From a08b246879b3508636f79033751d5d744a8bd98f Mon Sep 17 00:00:00 2001 From: praydog Date: Sun, 26 May 2024 18:04:14 -0700 Subject: [PATCH] VR (D3D12): Fix texture RTV not getting cleared --- src/mods/vr/D3D12Component.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mods/vr/D3D12Component.cpp b/src/mods/vr/D3D12Component.cpp index 7f0b2f70c..7db39556a 100644 --- a/src/mods/vr/D3D12Component.cpp +++ b/src/mods/vr/D3D12Component.cpp @@ -56,7 +56,7 @@ vr::EVRCompositorError D3D12Component::on_frame(VR* vr) { 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); + commands.clear_rtv(m_converted_eye_tex, clear_color, D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE); // 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);