Skip to content

Commit b2deb22

Browse files
committed
Merge pull request #109749 from Repiteo/scons/mesa-rollback
SCons: Temporarily revert Mesa includes to `CPPPATH`
2 parents ef44ec1 + 65b8210 commit b2deb22

File tree

4 files changed

+67
-39
lines changed

4 files changed

+67
-39
lines changed

drivers/d3d12/SCsub

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,9 @@ else:
162162
env.Append(CCFLAGS=["-Wno-unknown-pragmas"])
163163

164164
# This is needed since rendering_device_d3d12.cpp needs to include some Mesa internals.
165-
env_d3d12_rdd.Prepend(CPPEXTPATH=mesa_private_inc_paths)
165+
# FIXME: Should be CPPEXTPATH, but doing so introduces an include-order bug when combined with
166+
# godot-nir-static; this necessitates warning macro wrappers. See #106376.
167+
env_d3d12_rdd.Prepend(CPPPATH=mesa_private_inc_paths)
166168
# For the same reason as above, the defines must be the same as in the 3rd-party code itself.
167169
env_d3d12_rdd.Append(CPPDEFINES=extra_defines)
168170

drivers/d3d12/rendering_context_driver_d3d12.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,23 @@
3939
#include "core/version.h"
4040
#include "servers/rendering/rendering_device.h"
4141

42+
GODOT_GCC_WARNING_PUSH
43+
GODOT_GCC_WARNING_IGNORE("-Wmissing-field-initializers")
44+
GODOT_GCC_WARNING_IGNORE("-Wnon-virtual-dtor")
45+
GODOT_GCC_WARNING_IGNORE("-Wshadow")
46+
GODOT_GCC_WARNING_IGNORE("-Wswitch")
47+
GODOT_CLANG_WARNING_PUSH
48+
GODOT_CLANG_WARNING_IGNORE("-Wmissing-field-initializers")
49+
GODOT_CLANG_WARNING_IGNORE("-Wnon-virtual-dtor")
50+
GODOT_CLANG_WARNING_IGNORE("-Wstring-plus-int")
51+
GODOT_CLANG_WARNING_IGNORE("-Wswitch")
52+
GODOT_MSVC_WARNING_PUSH
53+
4254
#include <dxcapi.h>
4355

56+
GODOT_GCC_WARNING_POP
57+
GODOT_CLANG_WARNING_POP
58+
4459
#if !defined(_MSC_VER)
4560
#include <guiddef.h>
4661

drivers/d3d12/rendering_device_driver_d3d12.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,35 @@
4040
#include "d3d12_godot_nir_bridge.h"
4141
#include "rendering_context_driver_d3d12.h"
4242

43+
GODOT_GCC_WARNING_PUSH
44+
GODOT_GCC_WARNING_IGNORE("-Wimplicit-fallthrough")
45+
GODOT_GCC_WARNING_IGNORE("-Wlogical-not-parentheses")
46+
GODOT_GCC_WARNING_IGNORE("-Wmissing-field-initializers")
47+
GODOT_GCC_WARNING_IGNORE("-Wnon-virtual-dtor")
48+
GODOT_GCC_WARNING_IGNORE("-Wshadow")
49+
GODOT_GCC_WARNING_IGNORE("-Wswitch")
50+
GODOT_CLANG_WARNING_PUSH
51+
GODOT_CLANG_WARNING_IGNORE("-Wimplicit-fallthrough")
52+
GODOT_CLANG_WARNING_IGNORE("-Wlogical-not-parentheses")
53+
GODOT_CLANG_WARNING_IGNORE("-Wmissing-field-initializers")
54+
GODOT_CLANG_WARNING_IGNORE("-Wnon-virtual-dtor")
55+
GODOT_CLANG_WARNING_IGNORE("-Wstring-plus-int")
56+
GODOT_CLANG_WARNING_IGNORE("-Wswitch")
57+
GODOT_MSVC_WARNING_PUSH
58+
GODOT_MSVC_WARNING_IGNORE(4200) // "nonstandard extension used: zero-sized array in struct/union".
59+
GODOT_MSVC_WARNING_IGNORE(4806) // "'&': unsafe operation: no value of type 'bool' promoted to type 'uint32_t' can equal the given constant".
60+
4361
#include <nir_spirv.h>
4462
#include <nir_to_dxil.h>
4563
#include <spirv_to_dxil.h>
4664
extern "C" {
4765
#include <dxil_spirv_nir.h>
4866
}
4967

68+
GODOT_GCC_WARNING_POP
69+
GODOT_CLANG_WARNING_POP
70+
GODOT_MSVC_WARNING_POP
71+
5072
#if !defined(_MSC_VER)
5173
#include <guiddef.h>
5274

drivers/d3d12/rendering_shader_container_d3d12.cpp

Lines changed: 27 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -41,26 +41,10 @@
4141
#define __REQUIRED_RPCNDR_H_VERSION__ 475
4242
#endif
4343

44-
#if defined(__GNUC__) && !defined(__clang__)
45-
#pragma GCC diagnostic push
46-
#pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
47-
#pragma GCC diagnostic ignored "-Wshadow"
48-
#pragma GCC diagnostic ignored "-Wswitch"
49-
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
50-
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
51-
#elif defined(__clang__)
52-
#pragma clang diagnostic push
53-
#pragma clang diagnostic ignored "-Wnon-virtual-dtor"
54-
#pragma clang diagnostic ignored "-Wstring-plus-int"
55-
#pragma clang diagnostic ignored "-Wswitch"
56-
#pragma clang diagnostic ignored "-Wmissing-field-initializers"
57-
#pragma clang diagnostic ignored "-Wimplicit-fallthrough"
58-
#endif
59-
60-
#include "d3dx12.h"
44+
#include <d3dx12.h>
6145
#include <dxgi1_6.h>
6246
#define D3D12MA_D3D12_HEADERS_ALREADY_INCLUDED
63-
#include "D3D12MemAlloc.h"
47+
#include <D3D12MemAlloc.h>
6448

6549
#include <wrl/client.h>
6650

@@ -69,29 +53,34 @@
6953
#undef MemoryBarrier
7054
#endif
7155

72-
// No point in fighting warnings in Mesa.
73-
#if defined(_MSC_VER)
74-
#pragma warning(push)
75-
#pragma warning(disable : 4200) // "nonstandard extension used: zero-sized array in struct/union".
76-
#pragma warning(disable : 4806) // "'&': unsafe operation: no value of type 'bool' promoted to type 'uint32_t' can equal the given constant".
77-
#endif
78-
79-
#include "nir_spirv.h"
80-
#include "nir_to_dxil.h"
81-
#include "spirv_to_dxil.h"
56+
GODOT_GCC_WARNING_PUSH
57+
GODOT_GCC_WARNING_IGNORE("-Wimplicit-fallthrough")
58+
GODOT_GCC_WARNING_IGNORE("-Wlogical-not-parentheses")
59+
GODOT_GCC_WARNING_IGNORE("-Wmissing-field-initializers")
60+
GODOT_GCC_WARNING_IGNORE("-Wnon-virtual-dtor")
61+
GODOT_GCC_WARNING_IGNORE("-Wshadow")
62+
GODOT_GCC_WARNING_IGNORE("-Wswitch")
63+
GODOT_CLANG_WARNING_PUSH
64+
GODOT_CLANG_WARNING_IGNORE("-Wimplicit-fallthrough")
65+
GODOT_CLANG_WARNING_IGNORE("-Wlogical-not-parentheses")
66+
GODOT_CLANG_WARNING_IGNORE("-Wmissing-field-initializers")
67+
GODOT_CLANG_WARNING_IGNORE("-Wnon-virtual-dtor")
68+
GODOT_CLANG_WARNING_IGNORE("-Wstring-plus-int")
69+
GODOT_CLANG_WARNING_IGNORE("-Wswitch")
70+
GODOT_MSVC_WARNING_PUSH
71+
GODOT_MSVC_WARNING_IGNORE(4200) // "nonstandard extension used: zero-sized array in struct/union".
72+
GODOT_MSVC_WARNING_IGNORE(4806) // "'&': unsafe operation: no value of type 'bool' promoted to type 'uint32_t' can equal the given constant".
73+
74+
#include <nir_spirv.h>
75+
#include <nir_to_dxil.h>
76+
#include <spirv_to_dxil.h>
8277
extern "C" {
83-
#include "dxil_spirv_nir.h"
78+
#include <dxil_spirv_nir.h>
8479
}
8580

86-
#if defined(__GNUC__) && !defined(__clang__)
87-
#pragma GCC diagnostic pop
88-
#elif defined(__clang__)
89-
#pragma clang diagnostic pop
90-
#endif
91-
92-
#if defined(_MSC_VER)
93-
#pragma warning(pop)
94-
#endif
81+
GODOT_GCC_WARNING_POP
82+
GODOT_CLANG_WARNING_POP
83+
GODOT_MSVC_WARNING_POP
9584

9685
static D3D12_SHADER_VISIBILITY stages_to_d3d12_visibility(uint32_t p_stages_mask) {
9786
switch (p_stages_mask) {

0 commit comments

Comments
 (0)