@ -235,9 +235,12 @@ void ImGui_ImplDX12_RenderDrawData(ImDrawData* draw_data, ID3D12GraphicsCommandL
{
{
// Apply Scissor, Bind texture, Draw
// Apply Scissor, Bind texture, Draw
const D3D12_RECT r = { ( LONG ) ( pcmd - > ClipRect . x - clip_off . x ) , ( LONG ) ( pcmd - > ClipRect . y - clip_off . y ) , ( LONG ) ( pcmd - > ClipRect . z - clip_off . x ) , ( LONG ) ( pcmd - > ClipRect . w - clip_off . y ) } ;
const D3D12_RECT r = { ( LONG ) ( pcmd - > ClipRect . x - clip_off . x ) , ( LONG ) ( pcmd - > ClipRect . y - clip_off . y ) , ( LONG ) ( pcmd - > ClipRect . z - clip_off . x ) , ( LONG ) ( pcmd - > ClipRect . w - clip_off . y ) } ;
ctx - > SetGraphicsRootDescriptorTable ( 1 , * ( D3D12_GPU_DESCRIPTOR_HANDLE * ) & pcmd - > TextureId ) ;
if ( r . right > r . left & & r . bottom > r . top )
ctx - > RSSetScissorRects ( 1 , & r ) ;
{
ctx - > DrawIndexedInstanced ( pcmd - > ElemCount , 1 , pcmd - > IdxOffset + global_idx_offset , pcmd - > VtxOffset + global_vtx_offset , 0 ) ;
ctx - > SetGraphicsRootDescriptorTable ( 1 , * ( D3D12_GPU_DESCRIPTOR_HANDLE * ) & pcmd - > TextureId ) ;
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 ;
global_idx_offset + = cmd_list - > IdxBuffer . Size ;