Ver Fonte

Backends: DirectX12: fixed build on MinGW. (#8702, #4594)

PlayDay há 1 mês atrás
pai
commit
725d185a31
2 ficheiros alterados com 6 adições e 1 exclusões
  1. 5 1
      backends/imgui_impl_dx12.cpp
  2. 1 0
      docs/CHANGELOG.txt

+ 5 - 1
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;
 

+ 1 - 0
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]