From e65d2184b95ce22553dd6df729e79db3f75c30aa Mon Sep 17 00:00:00 2001 From: clayjohn Date: Sun, 15 Sep 2019 21:07:07 -0700 Subject: [PATCH] throw error when user tries to use Canvas background without sample buffer --- drivers/gles3/rasterizer_scene_gles3.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp index 1472954ebc5..b582ac6369f 100644 --- a/drivers/gles3/rasterizer_scene_gles3.cpp +++ b/drivers/gles3/rasterizer_scene_gles3.cpp @@ -4335,6 +4335,10 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const if (storage->frame.current_rt->buffers.active) { current_fbo = storage->frame.current_rt->buffers.fbo; } else { + if (storage->frame.current_rt->effects.mip_maps[0].sizes.size() == 0) { + ERR_PRINT_ONCE("Can't use canvas background mode in a render target configured without sampling"); + return; + } current_fbo = storage->frame.current_rt->effects.mip_maps[0].sizes[0].fbo; }