فهرست منبع

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

PlayDay 1 ماه پیش
والد
کامیت
725d185a31
2فایلهای تغییر یافته به همراه6 افزوده شده و 1 حذف شده
  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
 // CHANGELOG
 // (minor and older changes stripped away, please see git history for details)
 // (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-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-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)
 //  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.
 #pragma comment(lib, "d3dcompiler") // Automatically link with d3dcompiler.lib as we are using D3DCompile() below.
 #endif
 #endif
 
 
+// MinGW workaround, see #4594
+typedef decltype(D3D12SerializeRootSignature) *_PFN_D3D12_SERIALIZE_ROOT_SIGNATURE;
+
 // DirectX12 data
 // DirectX12 data
 struct ImGui_ImplDX12_RenderBuffers;
 struct ImGui_ImplDX12_RenderBuffers;
 
 
@@ -618,7 +622,7 @@ bool    ImGui_ImplDX12_CreateDeviceObjects()
                 return false;
                 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)
         if (D3D12SerializeRootSignatureFn == nullptr)
             return false;
             return false;
 
 

+ 1 - 0
docs/CHANGELOG.txt

@@ -392,6 +392,7 @@ Other changes:
   - Backends: SDLGPU3: added support for ImDrawCallback_ResetRenderState. (#8599)
   - Backends: SDLGPU3: added support for ImDrawCallback_ResetRenderState. (#8599)
   - Backends: OpenGL3: made GLES 3.20 contexts not access GL_CONTEXT_PROFILE_MASK nor
   - Backends: OpenGL3: made GLES 3.20 contexts not access GL_CONTEXT_PROFILE_MASK nor
     GL_PRIMITIVE_RESTART. (#8664) [@DyXel]
     GL_PRIMITIVE_RESTART. (#8664) [@DyXel]
+  - Backends: DirectX12: Fixed build on MinGW. (#8702, #4594) [@playday3008]
   - Backends: DirectX10, DirectX11, DirectX12: Honor FramebufferScale to allow for custom
   - Backends: DirectX10, DirectX11, DirectX12: Honor FramebufferScale to allow for custom
     platform backends and experiments using it (consistently with other renderer backends,
     platform backends and experiments using it (consistently with other renderer backends,
     even though in normal condition it is not set under Windows). (#8412) [@WSSDude]
     even though in normal condition it is not set under Windows). (#8412) [@WSSDude]