[Bf-blender-cvs] [8f327fb0700] soc-2019-openxr: Cleanup: Add comments on GPU data and Ghost context usage
Julian Eisel
noreply at git.blender.org
Wed Mar 11 20:28:25 CET 2020
Commit: 8f327fb070044984a140ce958cdcbdf934d3c3f6
Author: Julian Eisel
Date: Wed Mar 11 14:14:00 2020 +0100
Branches: soc-2019-openxr
https://developer.blender.org/rB8f327fb070044984a140ce958cdcbdf934d3c3f6
Cleanup: Add comments on GPU data and Ghost context usage
===================================================================
M intern/ghost/GHOST_C-api.h
M source/blender/windowmanager/intern/wm_xr.c
===================================================================
diff --git a/intern/ghost/GHOST_C-api.h b/intern/ghost/GHOST_C-api.h
index aefb4403d54..aba5b5f733b 100644
--- a/intern/ghost/GHOST_C-api.h
+++ b/intern/ghost/GHOST_C-api.h
@@ -762,7 +762,9 @@ extern GHOST_TSuccess GHOST_ReleaseOpenGLContext(GHOST_ContextHandle contexthand
extern unsigned int GHOST_GetContextDefaultOpenGLFramebuffer(GHOST_ContextHandle contexthandle);
/**
- * Returns whether a context is rendered upside down compared to OpenGL.
+ * Returns whether a context is rendered upside down compared to OpenGL. This only needs to be
+ * called if there's a non-OpenGL context, which is really the exception.
+ * So generally, this does not need to be called.
*/
extern int GHOST_isUpsideDownContext(GHOST_ContextHandle contexthandle);
diff --git a/source/blender/windowmanager/intern/wm_xr.c b/source/blender/windowmanager/intern/wm_xr.c
index bd80e668258..d90d513ff6c 100644
--- a/source/blender/windowmanager/intern/wm_xr.c
+++ b/source/blender/windowmanager/intern/wm_xr.c
@@ -471,8 +471,14 @@ void wm_xr_draw_view(const GHOST_XrDrawViewInfo *draw_view, void *customdata)
surface_data->offscreen,
surface_data->viewport);
- /* Re-use the offscreen framebuffer to render the composited viewport into. Keep it bound,
- * Ghost-XR will then blit from the currently bound framebuffer into the OpenXR swapchain. */
+ /* The draw-manager uses both GPUOffscreen and GPUViewport to manage frame and texture buffers. A
+ * call to GPU_viewport_draw_to_screen() is still needed to get the final result from the
+ * viewport buffers composited together and potentially color managed for display on screen.
+ * It needs a bound framebuffer to draw into, for which we simply reuse the GPUOffscreen one.
+ *
+ * In a next step, Ghost-XR will use the the currently bound framebuffer to retrieve the image to
+ * be submitted to the OpenXR swapchain. So do not un-bind the offscreen yet! */
+
GPU_offscreen_bind(surface_data->offscreen, false);
wm_xr_draw_viewport_buffers_to_active_framebuffer(surface_data, draw_view);
More information about the Bf-blender-cvs
mailing list