summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gles3/rasterizer_canvas_gles3.cpp10
-rw-r--r--drivers/gles3/shader_compiler_gles3.cpp15
-rw-r--r--drivers/gles3/shader_compiler_gles3.h1
3 files changed, 13 insertions, 13 deletions
diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp
index 37a2450377..96fa800206 100644
--- a/drivers/gles3/rasterizer_canvas_gles3.cpp
+++ b/drivers/gles3/rasterizer_canvas_gles3.cpp
@@ -993,13 +993,11 @@ void RasterizerCanvasGLES3::_copy_texscreen(const Rect2 &p_rect) {
glBindFramebuffer(GL_FRAMEBUFFER, storage->frame.current_rt->fbo); //back to front
glViewport(0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height);
- state.canvas_shader.bind(); //back to canvas
- _bind_canvas_texture(state.current_tex, state.current_normal);
+ // back to canvas, force rebind
+ state.using_texture_rect = true;
+ _set_texture_rect_mode(false);
- if (state.using_texture_rect) {
- state.using_texture_rect = false;
- _set_texture_rect_mode(state.using_texture_rect, state.using_ninepatch);
- }
+ _bind_canvas_texture(state.current_tex, state.current_normal);
glEnable(GL_BLEND);
}
diff --git a/drivers/gles3/shader_compiler_gles3.cpp b/drivers/gles3/shader_compiler_gles3.cpp
index f1d7085d54..070c661c8a 100644
--- a/drivers/gles3/shader_compiler_gles3.cpp
+++ b/drivers/gles3/shader_compiler_gles3.cpp
@@ -477,22 +477,22 @@ String ShaderCompilerGLES3::_dump_node_code(SL::Node *p_node, int p_level, Gener
current_func_name = fnode->name;
- if (fnode->name == "vertex") {
+ if (fnode->name == vertex_name) {
_dump_function_deps(pnode, fnode->name, function_code, r_gen_code.vertex_global, added_vtx);
- r_gen_code.vertex = function_code["vertex"];
+ r_gen_code.vertex = function_code[vertex_name];
}
- if (fnode->name == "fragment") {
+ if (fnode->name == fragment_name) {
_dump_function_deps(pnode, fnode->name, function_code, r_gen_code.fragment_global, added_fragment);
- r_gen_code.fragment = function_code["fragment"];
+ r_gen_code.fragment = function_code[fragment_name];
}
- if (fnode->name == "light") {
+ if (fnode->name == light_name) {
_dump_function_deps(pnode, fnode->name, function_code, r_gen_code.fragment_global, added_fragment);
- r_gen_code.light = function_code["light"];
+ r_gen_code.light = function_code[light_name];
}
}
@@ -573,7 +573,7 @@ String ShaderCompilerGLES3::_dump_node_code(SL::Node *p_node, int p_level, Gener
if (current_func_name == vertex_name) {
r_gen_code.uses_vertex_time = true;
}
- if (current_func_name == fragment_name) {
+ if (current_func_name == fragment_name || current_func_name == light_name) {
r_gen_code.uses_fragment_time = true;
}
}
@@ -939,6 +939,7 @@ ShaderCompilerGLES3::ShaderCompilerGLES3() {
vertex_name = "vertex";
fragment_name = "fragment";
+ light_name = "light";
time_name = "TIME";
List<String> func_list;
diff --git a/drivers/gles3/shader_compiler_gles3.h b/drivers/gles3/shader_compiler_gles3.h
index 85e8e02b8e..bf776ee062 100644
--- a/drivers/gles3/shader_compiler_gles3.h
+++ b/drivers/gles3/shader_compiler_gles3.h
@@ -83,6 +83,7 @@ private:
StringName current_func_name;
StringName vertex_name;
StringName fragment_name;
+ StringName light_name;
StringName time_name;
Set<StringName> used_name_defines;