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:
authorPeter Kim <pk15950@gmail.com>2022-02-11 14:44:26 +0300
committerPeter Kim <pk15950@gmail.com>2022-02-11 14:46:55 +0300
commit675f38aca7073234a2ce0b36597d95f8a153ef7c (patch)
treec6fb86abe6e78c57b23edfe7122f69848aea48e9 /source/blender/gpu/GPU_viewport.h
parent2cad80cbc4775447152a631bbfcabbf8d642e833 (diff)
Fix excessive re-creation of VR viewport textures
Due to the freeing and re-creation of textures performed when binding offscreen viewports, VR viewport textures would be needlessly re-created every drawing iteration, leading to a negative impact on VR frame rate. This was brought to light by 6738ecb64e8b, which introduced an additional texture clear operation on initialization and was prohibitively costly on some systems when performed every frame. Now, the textures for VR viewports will not be always re-created during offscreen binding, but only when necessary using a pre-drawing step (`wm_xr_session_surface_offscreen_ensure()`). Reviewed By: jbakker, fclem Differential Revision: https://developer.blender.org/D14059
Diffstat (limited to 'source/blender/gpu/GPU_viewport.h')
-rw-r--r--source/blender/gpu/GPU_viewport.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/gpu/GPU_viewport.h b/source/blender/gpu/GPU_viewport.h
index 917b87efeaa..263d1d7c90f 100644
--- a/source/blender/gpu/GPU_viewport.h
+++ b/source/blender/gpu/GPU_viewport.h
@@ -79,7 +79,9 @@ void GPU_viewport_colorspace_set(GPUViewport *viewport,
/**
* Should be called from DRW after DRW_opengl_context_enable.
*/
-void GPU_viewport_bind_from_offscreen(GPUViewport *viewport, struct GPUOffScreen *ofs);
+void GPU_viewport_bind_from_offscreen(GPUViewport *viewport,
+ struct GPUOffScreen *ofs,
+ bool is_xr_surface);
/**
* Clear vars assigned from offscreen, so we don't free data owned by `GPUOffScreen`.
*/