From 725d185a31f860b74014aba167aa69003d12c01a Mon Sep 17 00:00:00 2001 From: PlayDay <18056374+playday3008@users.noreply.github.com> Date: Thu, 19 Jun 2025 05:54:54 +0200 Subject: [PATCH] Backends: DirectX12: fixed build on MinGW. (#8702, #4594) --- backends/imgui_impl_dx12.cpp | 6 +++++- docs/CHANGELOG.txt | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/backends/imgui_impl_dx12.cpp b/backends/imgui_impl_dx12.cpp index e3bcda195..5f7eec063 100644 --- a/backends/imgui_impl_dx12.cpp +++ b/backends/imgui_impl_dx12.cpp @@ -20,6 +20,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2025-06-19: Fixed build on MinGW. (#8702, #4594) // 2025-06-11: DirectX12: Added support for ImGuiBackendFlags_RendererHasTextures, for dynamic font atlas. // 2025-05-07: DirectX12: Honor draw_data->FramebufferScale to allow for custom backends and experiment using it (consistently with other renderer backends, even though in normal condition it is not set under Windows). // 2025-02-24: DirectX12: Fixed an issue where ImGui_ImplDX12_Init() signature change from 2024-11-15 combined with change from 2025-01-15 made legacy ImGui_ImplDX12_Init() crash. (#8429) @@ -61,6 +62,9 @@ #pragma comment(lib, "d3dcompiler") // Automatically link with d3dcompiler.lib as we are using D3DCompile() below. #endif +// MinGW workaround, see #4594 +typedef decltype(D3D12SerializeRootSignature) *_PFN_D3D12_SERIALIZE_ROOT_SIGNATURE; + // DirectX12 data struct ImGui_ImplDX12_RenderBuffers; @@ -618,7 +622,7 @@ bool ImGui_ImplDX12_CreateDeviceObjects() return false; } - PFN_D3D12_SERIALIZE_ROOT_SIGNATURE D3D12SerializeRootSignatureFn = (PFN_D3D12_SERIALIZE_ROOT_SIGNATURE)(void*)::GetProcAddress(d3d12_dll, "D3D12SerializeRootSignature"); + _PFN_D3D12_SERIALIZE_ROOT_SIGNATURE D3D12SerializeRootSignatureFn = (_PFN_D3D12_SERIALIZE_ROOT_SIGNATURE)(void*)::GetProcAddress(d3d12_dll, "D3D12SerializeRootSignature"); if (D3D12SerializeRootSignatureFn == nullptr) return false; diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index b6f5c9e6e..71549deb5 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -392,6 +392,7 @@ Other changes: - Backends: SDLGPU3: added support for ImDrawCallback_ResetRenderState. (#8599) - Backends: OpenGL3: made GLES 3.20 contexts not access GL_CONTEXT_PROFILE_MASK nor GL_PRIMITIVE_RESTART. (#8664) [@DyXel] + - Backends: DirectX12: Fixed build on MinGW. (#8702, #4594) [@playday3008] - Backends: DirectX10, DirectX11, DirectX12: Honor FramebufferScale to allow for custom platform backends and experiments using it (consistently with other renderer backends, even though in normal condition it is not set under Windows). (#8412) [@WSSDude]