Merge pull request #47994 from lawnjelly/ewok_cope_broken_shader

Batching - Don't join items with invalid shaders
This commit is contained in:
Rémi Verschelde 2021-04-19 10:36:03 +02:00 committed by GitHub
commit 41a3b98f2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

@ -1356,6 +1356,12 @@ bool RasterizerCanvasGLES2::try_join_item(Item *p_ci, RenderItemState &r_ris, bo
if (material_ptr) {
shader_ptr = material_ptr->shader;
// special case, if the user has made an error in the shader code
if (shader_ptr && !shader_ptr->valid) {
join = false;
r_batch_break = true;
}
if (shader_ptr && shader_ptr->mode != VS::SHADER_CANVAS_ITEM) {
shader_ptr = NULL; // not a canvas item shader, don't use.
}

View File

@ -1754,6 +1754,12 @@ bool RasterizerCanvasGLES3::try_join_item(Item *p_ci, RenderItemState &r_ris, bo
if (material_ptr) {
shader_ptr = material_ptr->shader;
// special case, if the user has made an error in the shader code
if (shader_ptr && !shader_ptr->valid) {
join = false;
r_batch_break = true;
}
if (shader_ptr && shader_ptr->mode != VS::SHADER_CANVAS_ITEM) {
shader_ptr = NULL; // not a canvas item shader, don't use.
}