Commit: 2cad80cbc4775447152a631bbfcabbf8d642e833
Author: Peter Kim
Date:   Fri Feb 11 20:42:30 2022 +0900
Branches: blender-v3.1-release
https://developer.blender.org/rB2cad80cbc4775447152a631bbfcabbf8d642e833

Fix incompatible swapchain format for Quest 2

When using a RGBA16 (`GL_RGBA16`, `DXGI_FORMAT_R16G16B16A16_UNORM`)
swapchain format with Quest 2, no image is presented to the headset.
This can occur when using the SteamVR runtime with an AMD graphics card
(ex. T95374).

Workaround is to move this format after the Quest 2-compatible RGBA16F
formats in the candidates list so that the RGBA16F formats are chosen
instead.

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D14024

===================================================================

M       intern/ghost/intern/GHOST_XrGraphicsBinding.cpp

===================================================================

diff --git a/intern/ghost/intern/GHOST_XrGraphicsBinding.cpp 
b/intern/ghost/intern/GHOST_XrGraphicsBinding.cpp
index 6eaf55afacd..c6d513f0ac5 100644
--- a/intern/ghost/intern/GHOST_XrGraphicsBinding.cpp
+++ b/intern/ghost/intern/GHOST_XrGraphicsBinding.cpp
@@ -175,11 +175,18 @@ class GHOST_XrGraphicsBindingOpenGL : public 
GHOST_IXrGraphicsBinding {
                                                bool &r_is_srgb_format) const 
override
   {
     std::vector<int64_t> gpu_binding_formats = {
+#if 0 /* RGB10A2, RGBA16 don't seem to work with Oculus head-sets, \
+       * so move them after RGBA16F for the time being. */
         GL_RGB10_A2,
         GL_RGBA16,
-        GL_RGBA16F,
-        GL_RGBA8,
-        GL_SRGB8_ALPHA8,
+#endif
+      GL_RGBA16F,
+#if 1
+      GL_RGB10_A2,
+      GL_RGBA16,
+#endif
+      GL_RGBA8,
+      GL_SRGB8_ALPHA8,
     };
 
     std::optional result = 
choose_swapchain_format_from_candidates(gpu_binding_formats,
@@ -361,14 +368,15 @@ class GHOST_XrGraphicsBindingD3D : public 
GHOST_IXrGraphicsBinding {
                                                bool &r_is_srgb_format) const 
override
   {
     std::vector<int64_t> gpu_binding_formats = {
-#  if 0 /* RGB10A2 doesn't seem to work with Oculus head-sets, \
-         * so move it after RGB16AF for the time being. */
+#  if 0 /* RGB10A2, RGBA16 don't seem to work with Oculus head-sets, \
+         * so move them after RGBA16F for the time being. */
         DXGI_FORMAT_R10G10B10A2_UNORM,
+        DXGI_FORMAT_R16G16B16A16_UNORM,
 #  endif
-      DXGI_FORMAT_R16G16B16A16_UNORM,
       DXGI_FORMAT_R16G16B16A16_FLOAT,
 #  if 1
       DXGI_FORMAT_R10G10B10A2_UNORM,
+      DXGI_FORMAT_R16G16B16A16_UNORM,
 #  endif
       DXGI_FORMAT_R8G8B8A8_UNORM,
       DXGI_FORMAT_R8G8B8A8_UNORM_SRGB,

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to