throw error when user tries to use Canvas background without sample buffer

(cherry picked from commit e65d2184b9)
This commit is contained in:
clayjohn 2019-09-15 21:07:07 -07:00 committed by Rémi Verschelde
parent 99adaef47c
commit e821477102
1 changed files with 4 additions and 0 deletions

View File

@ -4310,6 +4310,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;
}