Merge pull request #31751 from clayjohn/GLES3-Viewport-crash-canvas

Throw error when canvas background is used without sample buffer
This commit is contained in:
Rémi Verschelde 2019-09-23 15:35:31 +02:00 committed by GitHub
commit f1146c261d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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