From 2ec4d0988d8ea453712e81e3cef6856d73a347cb Mon Sep 17 00:00:00 2001 From: Dsprtn Date: Sun, 30 Oct 2022 13:27:20 +0100 Subject: [PATCH 1/2] Fix darkened output in GTFO VR --- src/openvr/openvr_manager.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/openvr/openvr_manager.cpp b/src/openvr/openvr_manager.cpp index d5c09d9..0225f94 100644 --- a/src/openvr/openvr_manager.cpp +++ b/src/openvr/openvr_manager.cpp @@ -23,6 +23,7 @@ namespace vrperfkit { switch (inputFormat) { case DXGI_FORMAT_R10G10B10A2_UNORM: case DXGI_FORMAT_R10G10B10A2_TYPELESS: + case DXGI_FORMAT_R16G16B16A16_TYPELESS: // SteamVR applies a different color conversion for these formats that we can't match // with R8G8B8 textures, so we have to use a matching texture format for our own resources. // Otherwise we'll get darkened pictures (applies to Revive mostly) From dbce85d0be99e39d6b2bb46b57cc3cb081ebb75c Mon Sep 17 00:00:00 2001 From: Roughy Date: Sun, 23 Jul 2023 19:30:41 +0500 Subject: [PATCH 2/2] fix upscaling crashing oculus HMDs onSubmit would return VRCompositorError_TextureUsesUnsupportedFormat when DXGI_FORMAT_R10G10B10A2_UNORM used with oculus HMDs --- src/openvr/openvr_manager.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/openvr/openvr_manager.cpp b/src/openvr/openvr_manager.cpp index 0225f94..087707c 100644 --- a/src/openvr/openvr_manager.cpp +++ b/src/openvr/openvr_manager.cpp @@ -23,11 +23,14 @@ namespace vrperfkit { switch (inputFormat) { case DXGI_FORMAT_R10G10B10A2_UNORM: case DXGI_FORMAT_R10G10B10A2_TYPELESS: - case DXGI_FORMAT_R16G16B16A16_TYPELESS: // SteamVR applies a different color conversion for these formats that we can't match // with R8G8B8 textures, so we have to use a matching texture format for our own resources. // Otherwise we'll get darkened pictures (applies to Revive mostly) return DXGI_FORMAT_R10G10B10A2_UNORM; + case DXGI_FORMAT_R16G16B16A16_TYPELESS: + // Same as above, for GTFO VR mod. + // Oculus HMDs will return TextureUsesUnsupportedFormat if DXGI_FORMAT_R10G10B10A2_UNORM is used for this case. + return DXGI_FORMAT_R16G16B16A16_FLOAT; default: return DXGI_FORMAT_R8G8B8A8_UNORM; }