summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Linietsky <juan@godotengine.org>2017-12-26 15:13:00 -0300
committerJuan Linietsky <juan@godotengine.org>2017-12-26 15:13:00 -0300
commitc54927a127a69a0073d30e7caa795f4bdda9e780 (patch)
treec8ed7eaf9fbb4159b600053bd2f973c63f04c318
parentc2240a2a714526e226ead5a20e3a070bb3eaaef6 (diff)
Property apply shader parameters, even when materials are being reused, fixes #14012
-rw-r--r--drivers/gles3/rasterizer_canvas_gles3.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp
index a4daa77b50..8d22a0e072 100644
--- a/drivers/gles3/rasterizer_canvas_gles3.cpp
+++ b/drivers/gles3/rasterizer_canvas_gles3.cpp
@@ -1086,19 +1086,22 @@ void RasterizerCanvasGLES3::canvas_render_items(Item *p_item_list, int p_z, cons
}
}
- if (shader_ptr && shader_ptr != shader_cache) {
+ if (shader_ptr) {
if (shader_ptr->canvas_item.uses_screen_texture && !state.canvas_texscreen_used) {
//copy if not copied before
_copy_texscreen(Rect2());
}
- if (shader_ptr->canvas_item.uses_time) {
- VisualServerRaster::redraw_request();
- }
+ if (shader_ptr != shader_cache) {
- state.canvas_shader.set_custom_shader(shader_ptr->custom_code_id);
- state.canvas_shader.bind();
+ if (shader_ptr->canvas_item.uses_time) {
+ VisualServerRaster::redraw_request();
+ }
+
+ state.canvas_shader.set_custom_shader(shader_ptr->custom_code_id);
+ state.canvas_shader.bind();
+ }
if (material_ptr->ubo_id) {
glBindBufferBase(GL_UNIFORM_BUFFER, 2, material_ptr->ubo_id);