From b79aa8b0252be60441931653e22454759d641d7c Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sun, 29 Sep 2019 13:01:31 -0700 Subject: Imgui implementation: fixed few Vulkan issues --- Imgui/src/ImGuiImplDiligent.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Imgui/src/ImGuiImplDiligent.cpp') diff --git a/Imgui/src/ImGuiImplDiligent.cpp b/Imgui/src/ImGuiImplDiligent.cpp index ededaf9..1653823 100644 --- a/Imgui/src/ImGuiImplDiligent.cpp +++ b/Imgui/src/ImGuiImplDiligent.cpp @@ -38,10 +38,12 @@ class ImGuiImplDiligent_Internal public: ImGuiImplDiligent_Internal(IRenderDevice* pDevice, TEXTURE_FORMAT BackBufferFmt, + TEXTURE_FORMAT DepthBufferFmt, Uint32 InitialVertexBufferSize, Uint32 InitialIndexBufferSize) : m_pDevice (pDevice), m_BackBufferFmt (BackBufferFmt), + m_DepthBufferFmt (DepthBufferFmt), m_VertexBufferSize(InitialVertexBufferSize), m_IndexBufferSize (InitialIndexBufferSize) { @@ -79,6 +81,7 @@ private: RefCntAutoPtr m_pFontSRV; RefCntAutoPtr m_pSRB; const TEXTURE_FORMAT m_BackBufferFmt; + const TEXTURE_FORMAT m_DepthBufferFmt; Uint32 m_VertexBufferSize = 0; Uint32 m_IndexBufferSize = 0; }; @@ -177,6 +180,7 @@ void ImGuiImplDiligent_Internal::CreateDeviceObjects() GraphicsPipeline.NumRenderTargets = 1; GraphicsPipeline.RTVFormats[0] = m_BackBufferFmt; + GraphicsPipeline.DSVFormat = m_DepthBufferFmt; GraphicsPipeline.PrimitiveTopology = PRIMITIVE_TOPOLOGY_TRIANGLE_LIST; GraphicsPipeline.pVS = pVS; @@ -419,9 +423,10 @@ void ImGuiImplDiligent_Internal::RenderDrawData(IDeviceContext* pCtx, ImDrawData ImGuiImplDiligent::ImGuiImplDiligent(IRenderDevice* pDevice, TEXTURE_FORMAT BackBufferFmt, + TEXTURE_FORMAT DepthBufferFmt, Uint32 InitialVertexBufferSize, Uint32 InitialIndexBufferSize) : - m_pImpl(new ImGuiImplDiligent_Internal(pDevice, BackBufferFmt, InitialVertexBufferSize, InitialIndexBufferSize)) + m_pImpl(new ImGuiImplDiligent_Internal(pDevice, BackBufferFmt, DepthBufferFmt, InitialVertexBufferSize, InitialIndexBufferSize)) { } -- cgit v1.2.3