Skip to content

Commit

Permalink
D3D12: Fix error occurring under debug layer
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Jan 26, 2025
1 parent 173b6b6 commit ce1d453
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/uevr-imgui/imgui_impl_dx12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,12 @@ void ImGui_ImplDX12_RenderDrawData(ImDrawData* draw_data, ID3D12GraphicsCommandL
const D3D12_RECT r = { (LONG)clip_min.x, (LONG)clip_min.y, (LONG)clip_max.x, (LONG)clip_max.y };
D3D12_GPU_DESCRIPTOR_HANDLE texture_handle = {};
texture_handle.ptr = (UINT64)pcmd->GetTexID();
ctx->SetGraphicsRootDescriptorTable(1, texture_handle);
ctx->RSSetScissorRects(1, &r);
ctx->DrawIndexedInstanced(pcmd->ElemCount, 1, pcmd->IdxOffset + global_idx_offset, pcmd->VtxOffset + global_vtx_offset, 0);

if (texture_handle.ptr != 0) {
ctx->SetGraphicsRootDescriptorTable(1, texture_handle);
ctx->RSSetScissorRects(1, &r);
ctx->DrawIndexedInstanced(pcmd->ElemCount, 1, pcmd->IdxOffset + global_idx_offset, pcmd->VtxOffset + global_vtx_offset, 0);
}
}
}
global_idx_offset += cmd_list->IdxBuffer.Size;
Expand Down

0 comments on commit ce1d453

Please sign in to comment.