Skip to content

Commit

Permalink
VR (D3D12): Clear backbuffer RTV before rendering to it to fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Mar 12, 2024
1 parent 44693ae commit 0dc8219
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/mods/vr/D3D12Component.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ vr::EVRCompositorError D3D12Component::on_frame(VR* vr) {
// Copy current backbuffer into our copy so we can use it as an SRV.
m_backbuffer_copy.commands.copy(backbuffer.Get(), m_backbuffer_copy.texture.Get(), D3D12_RESOURCE_STATE_PRESENT, D3D12_RESOURCE_STATE_PRESENT);

float clear_color[4]{0.0f, 0.0f, 0.0f, 0.0f};
m_backbuffer_copy.commands.clear_rtv(m_converted_eye_tex, clear_color, D3D12_RESOURCE_STATE_PRESENT);

// Convert the backbuffer to 8-bit.
render_srv_to_rtv(command_list, m_backbuffer_copy, m_converted_eye_tex, D3D12_RESOURCE_STATE_PRESENT, D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE);

Expand Down

0 comments on commit 0dc8219

Please sign in to comment.