Skip to content

Clean up includes in drivers/d3d12#117359

Open
akien-mga wants to merge 1 commit intogodotengine:masterfrom
akien-mga:d3d12-cleanup-includes
Open

Clean up includes in drivers/d3d12#117359
akien-mga wants to merge 1 commit intogodotengine:masterfrom
akien-mga:d3d12-cleanup-includes

Conversation

@akien-mga
Copy link
Member

@akien-mga akien-mga commented Mar 12, 2026

While working on the above PR I took the chance to refactor the drivers/d3d12 code a bit to wrap some thirdparty headers that require specific pragmas or definitions, which adds godot_d3dx12.h, godot_d3d12ma.h, and godot_nir.h. These new wrapper headers should be included with angled brackets to be properly treated as "system"/thirdparty, which avoids some diagnostics to show up with clangd.

I also cleaned up the pragmas to reduce them to what seems to be the minimal changes to compile (possibly some of these warnings were solved in D3D12/Mesa). Needs testing, especially with MSVC as I only tested mingw-gcc and llvm-mingw from Linux.

I removed the AS typedef for AudioServer as we don't use it and it caused a -Wshadow warning in one of the thirdparty D3D12 headers.

@akien-mga akien-mga added this to the 4.x milestone Mar 12, 2026
@akien-mga akien-mga requested review from a team as code owners March 12, 2026 08:55
@akien-mga akien-mga requested review from blueskythlikesclouds and bruvzg and removed request for a team March 12, 2026 08:56
Comment on lines +36 to +38
//GODOT_MSVC_WARNING_PUSH
//GODOT_MSVC_WARNING_IGNORE(4200) // "nonstandard extension used: zero-sized array in struct/union".
//GODOT_MSVC_WARNING_IGNORE(4806) // "'&': unsafe operation: no value of type 'bool' promoted to type 'uint32_t' can equal the given constant".
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tested whether those can be safely removed for MSVC, we'll see what CI says.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like only C4200 was still relevant, and specifically for nir.h, so I moved it to godot_nir.h.

@akien-mga akien-mga force-pushed the d3d12-cleanup-includes branch from c356f33 to 7d40e98 Compare March 12, 2026 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant