Skip to content

Commit

Permalink
Set a render-target and some random scissor and viewport to make D3D1…
Browse files Browse the repository at this point in the history
…2 happy
  • Loading branch information
RobDangerous committed Sep 2, 2024
1 parent 6085134 commit 6b9858f
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ void kope_d3d12_command_list_begin_render_pass(kope_g5_command_list *list, const
D3D12_CPU_DESCRIPTOR_HANDLE rtv = list->d3d12.device->all_rtvs->GetCPUDescriptorHandleForHeapStart();
rtv.ptr += render_target->d3d12.rtv_index * list->d3d12.device->rtv_increment;

D3D12_RECT scissor = {0, 0, 1024, 768};

D3D12_VIEWPORT viewport = {0.0f, 0.0f, 1024.0f, 768.0f, 0.0f, 1.0f};

list->d3d12.list->OMSetRenderTargets(1, &rtv, true, nullptr);
list->d3d12.list->RSSetViewports(1, &viewport);
list->d3d12.list->RSSetScissorRects(1, &scissor);

FLOAT color[4];
memcpy(color, &parameters->color_attachments[0].clear_value, sizeof(color));
list->d3d12.list->ClearRenderTargetView(rtv, color, 0, NULL);
Expand Down

0 comments on commit 6b9858f

Please sign in to comment.