diff --git a/src/mods/VR.hpp b/src/mods/VR.hpp index 1ae8809..b17d2f8 100644 --- a/src/mods/VR.hpp +++ b/src/mods/VR.hpp @@ -136,10 +136,13 @@ class VR : public Mod { // int32_t get_game_frame_count() const; bool is_using_async_aer() const { - // openVR has issues with 2 different poses at the same time for non steam native VR hmds like oculus - // for these exceptions need to implement viewport cropping and viewport reprojection - //TODO it looks like runtime does not fully support dx11 reprojeciton, I need to do it manually - return m_use_async_aer->value() && g_framework->is_dx12(); + if (!m_use_async_aer->value()) { + return false; + } + if (g_framework->is_dx12()) { + return true; + } + return get_runtime()->is_openxr(); } bool is_gui_enabled() const { diff --git a/src/mods/vr/D3D11Component.cpp b/src/mods/vr/D3D11Component.cpp index ed39485..831b362 100644 --- a/src/mods/vr/D3D11Component.cpp +++ b/src/mods/vr/D3D11Component.cpp @@ -299,6 +299,12 @@ vr::EVRCompositorError D3D11Component::on_frame(VR* vr) { if (runtime->is_openxr() && runtime->ready()) { LOG_VERBOSE("Copying left eye"); m_openxr.copy(0, (ID3D11Texture2D*)copy_from_tex.Get()); + + if (vr->is_using_async_aer()) { + auto right_eye_source = backbufferIs8Bit ? m_right_eye_tex : m_right_eye_rt.tex; + LOG_VERBOSE("Copying right eye (async AER extra copy)"); + m_openxr.copy(1, (ID3D11Texture2D*)right_eye_source.Get()); + } } if (runtime->is_openvr()) { @@ -360,11 +366,19 @@ vr::EVRCompositorError D3D11Component::on_frame(VR* vr) { m_toneMap->SetExposure(settings.toneMapExposure); m_toneMap->SetHDRSourceTexture(m_backbuffer_copy_rt); m_toneMap->Process(context.Get()); + } else if (backbufferIs8Bit) { + context->CopyResource(m_right_eye_tex.Get(), backbuffer.Get()); } if (runtime->ready() && runtime->is_openxr()) { LOG_VERBOSE("Copying right eye"); m_openxr.copy(1, (ID3D11Texture2D*)copy_from_tex.Get()); + + if (vr->is_using_async_aer()) { + auto left_eye_source = backbufferIs8Bit ? m_left_eye_tex : m_left_eye_rt.tex; + LOG_VERBOSE("Copying left eye (async AER extra copy)"); + m_openxr.copy(0, (ID3D11Texture2D*)left_eye_source.Get()); + } } if (runtime->is_openvr()) {