diff options
| author | assiduous <assiduous@diligentgraphics.com> | 2020-08-26 01:24:07 +0000 |
|---|---|---|
| committer | assiduous <assiduous@diligentgraphics.com> | 2020-08-26 01:24:07 +0000 |
| commit | e4442858ed28725b051770aaa060f2067f99c5ed (patch) | |
| tree | 0ba5ed23bf83a25341676083ea9ddedb3c73e293 /Imgui/src/ImGuiDiligentRenderer.cpp | |
| parent | Merge pull request #19 from dolphineye/user/dolphineye/imgui-multiple-textures (diff) | |
| download | DiligentTools-e4442858ed28725b051770aaa060f2067f99c5ed.tar.gz DiligentTools-e4442858ed28725b051770aaa060f2067f99c5ed.zip | |
ImGuiDiligentRenderer: a couple of minor updates
Diffstat (limited to 'Imgui/src/ImGuiDiligentRenderer.cpp')
| -rw-r--r-- | Imgui/src/ImGuiDiligentRenderer.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Imgui/src/ImGuiDiligentRenderer.cpp b/Imgui/src/ImGuiDiligentRenderer.cpp index 0ef4028..289bacd 100644 --- a/Imgui/src/ImGuiDiligentRenderer.cpp +++ b/Imgui/src/ImGuiDiligentRenderer.cpp @@ -393,6 +393,8 @@ void ImGuiDiligentRenderer::CreateFontsTexture() m_pSRB.Release(); m_pPSO->CreateShaderResourceBinding(&m_pSRB, true); + m_pTextureVar = m_pSRB->GetVariableByName(SHADER_TYPE_PIXEL, "Texture"); + VERIFY_EXPR(m_pTextureVar != nullptr); // Store our identifier io.Fonts->TexID = (ImTextureID)m_pFontSRV; @@ -654,10 +656,10 @@ void ImGuiDiligentRenderer::RenderDrawData(IDeviceContext* pCtx, ImDrawData* pDr // Render command lists // (Because we merged all buffers into a single one, we maintain our own offset into them) - int global_idx_offset = 0; - int global_vtx_offset = 0; - ITextureView* pLastTextureView = nullptr; + int global_idx_offset = 0; + int global_vtx_offset = 0; + ITextureView* pLastTextureView = nullptr; for (int n = 0; n < pDrawData->CmdListsCount; n++) { const ImDrawList* cmd_list = pDrawData->CmdLists[n]; @@ -699,12 +701,12 @@ void ImGuiDiligentRenderer::RenderDrawData(IDeviceContext* pCtx, ImDrawData* pDr static_cast<Uint32>(m_RenderSurfaceHeight * pDrawData->FramebufferScale.y)); // Bind texture - auto pTextureView = reinterpret_cast<ITextureView*>(pcmd->TextureId); + auto* pTextureView = reinterpret_cast<ITextureView*>(pcmd->TextureId); VERIFY_EXPR(pTextureView); if (pTextureView != pLastTextureView) { pLastTextureView = pTextureView; - m_pSRB->GetVariableByName(SHADER_TYPE_PIXEL, "Texture")->Set(pTextureView); + m_pTextureVar->Set(pTextureView); pCtx->CommitShaderResources(m_pSRB, RESOURCE_STATE_TRANSITION_MODE_TRANSITION); } |
