Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intern/ghost/intern/GHOST_XrSession.cpp')
-rw-r--r--intern/ghost/intern/GHOST_XrSession.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/intern/ghost/intern/GHOST_XrSession.cpp b/intern/ghost/intern/GHOST_XrSession.cpp
index a5eb7a891d7..f2f94d8f47d 100644
--- a/intern/ghost/intern/GHOST_XrSession.cpp
+++ b/intern/ghost/intern/GHOST_XrSession.cpp
@@ -420,6 +420,13 @@ static void ghost_xr_draw_view_info_from_view(const XrView &view, GHOST_XrDrawVi
r_info.fov.angle_down = view.fov.angleDown;
}
+bool ghost_xr_draw_view_expects_srgb_buffer(const GHOST_XrContext *context)
+{
+ /* WMR seems to be faulty and doesn't do OETF transform correctly. So expect a SRGB buffer to
+ * compensate. */
+ return context->getOpenXRRuntimeID() == OPENXR_RUNTIME_WMR;
+}
+
void GHOST_XrSession::drawView(XrSwapchain swapchain,
XrCompositionLayerProjectionView &proj_layer_view,
XrView &view,
@@ -449,6 +456,7 @@ void GHOST_XrSession::drawView(XrSwapchain swapchain,
swapchain_image = m_oxr->swapchain_images[swapchain][swapchain_idx];
+ draw_view_info.expects_srgb_buffer = ghost_xr_draw_view_expects_srgb_buffer(m_context);
draw_view_info.ofsx = proj_layer_view.subImage.imageRect.offset.x;
draw_view_info.ofsy = proj_layer_view.subImage.imageRect.offset.y;
draw_view_info.width = proj_layer_view.subImage.imageRect.extent.width;