[Bf-blender-cvs] [7462fca7373] soc-2019-openxr: Avoid redundant framebuffer resize and offscreen texture drawing

Julian Eisel noreply at git.blender.org
Fri Aug 23 17:47:48 CEST 2019


Commit: 7462fca7373945e50acf8f6d6f534c6c831c53bd
Author: Julian Eisel
Date:   Fri Aug 23 17:43:47 2019 +0200
Branches: soc-2019-openxr
https://developer.blender.org/rB7462fca7373945e50acf8f6d6f534c6c831c53bd

Avoid redundant framebuffer resize and offscreen texture drawing

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

M	intern/ghost/intern/GHOST_XrGraphicsBinding.cpp
M	source/blender/windowmanager/intern/wm_xr.c

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

diff --git a/intern/ghost/intern/GHOST_XrGraphicsBinding.cpp b/intern/ghost/intern/GHOST_XrGraphicsBinding.cpp
index 2732af49c12..0b3c07b8984 100644
--- a/intern/ghost/intern/GHOST_XrGraphicsBinding.cpp
+++ b/intern/ghost/intern/GHOST_XrGraphicsBinding.cpp
@@ -282,7 +282,6 @@ class GHOST_XrGraphicsBindingD3D : public GHOST_IXrGraphicsBinding {
       m_shared_resource = m_ghost_ctx->createSharedOpenGLResource(draw_info->width,
                                                                   draw_info->height);
     }
-    ogl_ctx->setDefaultFramebufferSize(draw_info->width, draw_info->height);
     m_ghost_ctx->blitFromOpenGLContext(m_shared_resource, draw_info->width, draw_info->height);
 
     m_ghost_ctx->m_device_ctx->OMSetRenderTargets(0, nullptr, nullptr);
diff --git a/source/blender/windowmanager/intern/wm_xr.c b/source/blender/windowmanager/intern/wm_xr.c
index a514eb31c5b..f25b6c2e85c 100644
--- a/source/blender/windowmanager/intern/wm_xr.c
+++ b/source/blender/windowmanager/intern/wm_xr.c
@@ -465,13 +465,15 @@ GHOST_ContextHandle wm_xr_draw_view(const GHOST_XrDrawViewInfo *draw_view, void
   GPU_depth_test(false);
 
   wmViewport(&rect);
-  GPU_viewport_draw_to_screen_ex(viewport, &rect, draw_view->expects_srgb_buffer);
   if (surface_data->secondary_ghost_ctx &&
       GHOST_isUpsideDownContext(surface_data->secondary_ghost_ctx)) {
     GPU_texture_bind(texture, 0);
     wm_draw_upside_down(draw_view->width, draw_view->height, draw_view->expects_srgb_buffer);
     GPU_texture_unbind(texture);
   }
+  else {
+    GPU_viewport_draw_to_screen_ex(viewport, &rect, draw_view->expects_srgb_buffer);
+  }
   GPU_viewport_unbind(viewport);
 
   return g_xr_surface->ghost_ctx;



More information about the Bf-blender-cvs mailing list