summaryrefslogtreecommitdiff
path: root/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-01-26 01:11:02 +0100
committerRémi Verschelde <rverschelde@gmail.com>2023-01-26 01:11:02 +0100
commit4b0363312e9d13349cc7e1cfeff03168206a4da5 (patch)
tree85361177e993f9070bddc6d66e74adca6041f30f /servers/rendering/renderer_rd/renderer_scene_render_rd.cpp
parent9b66b07c317cf685901693e6d7fcc33ae74cdd27 (diff)
parent85c478e170a40bc471fa2e0dec377b237e0a69b3 (diff)
Merge pull request #71455 from BastiaanOlij/fix_stereo_screen_depth
Make screen texture and depth texture work in Multiview
Diffstat (limited to 'servers/rendering/renderer_rd/renderer_scene_render_rd.cpp')
-rw-r--r--servers/rendering/renderer_rd/renderer_scene_render_rd.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp b/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp
index 2a87c4fa8d..33f6ac0276 100644
--- a/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp
+++ b/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp
@@ -253,6 +253,11 @@ void RendererSceneRenderRD::_render_buffers_copy_screen_texture(const RenderData
Ref<RenderSceneBuffersRD> rb = p_render_data->render_buffers;
ERR_FAIL_COND(rb.is_null());
+ if (!rb->has_internal_texture()) {
+ // We're likely rendering reflection probes where we can't use our backbuffers.
+ return;
+ }
+
RD::get_singleton()->draw_command_begin_label("Copy screen texture");
rb->allocate_blur_textures();
@@ -292,6 +297,11 @@ void RendererSceneRenderRD::_render_buffers_copy_depth_texture(const RenderDataR
Ref<RenderSceneBuffersRD> rb = p_render_data->render_buffers;
ERR_FAIL_COND(rb.is_null());
+ if (!rb->has_depth_texture()) {
+ // We're likely rendering reflection probes where we can't use our backbuffers.
+ return;
+ }
+
RD::get_singleton()->draw_command_begin_label("Copy depth texture");
// note, this only creates our back depth texture if we haven't already created it.