summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-01-23 17:52:51 +0100
committerGitHub <noreply@github.com>2020-01-23 17:52:51 +0100
commit1c0995d4509acd0a750f32517b14c01842220cca (patch)
treeac7d4e00e2e467d553101498fbfe77574b6a6874
parentb75fff5a56eb6f44aa7b315db5ef94919d7184e7 (diff)
parent3631a3cc9ecb18ba33ac044f24c876e33861c9c3 (diff)
Merge pull request #35476 from clayjohn/GLES3-scene-crash
Fix recently introduced crash in viewport size
-rw-r--r--drivers/gles3/rasterizer_scene_gles3.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp
index 1d4e478223..27173d317b 100644
--- a/drivers/gles3/rasterizer_scene_gles3.cpp
+++ b/drivers/gles3/rasterizer_scene_gles3.cpp
@@ -4130,13 +4130,13 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const
state.ubo_data.shadow_dual_paraboloid_render_zfar = 0;
state.ubo_data.opaque_prepass_threshold = 0.99;
- int viewport_width_pixels = storage->frame.current_rt->width;
- int viewport_height_pixels = storage->frame.current_rt->height;
+ if (storage->frame.current_rt) {
+ int viewport_width_pixels = storage->frame.current_rt->width;
+ int viewport_height_pixels = storage->frame.current_rt->height;
- state.ubo_data.viewport_size[0] = viewport_width_pixels;
- state.ubo_data.viewport_size[1] = viewport_height_pixels;
+ state.ubo_data.viewport_size[0] = viewport_width_pixels;
+ state.ubo_data.viewport_size[1] = viewport_height_pixels;
- if (storage->frame.current_rt) {
state.ubo_data.screen_pixel_size[0] = 1.0 / viewport_width_pixels;
state.ubo_data.screen_pixel_size[1] = 1.0 / viewport_height_pixels;
}