summaryrefslogtreecommitdiff
path: root/drivers/gles2/shader_compiler_gles2.cpp
diff options
context:
space:
mode:
authorclayjohn <claynjohn@gmail.com>2019-07-28 11:06:05 -0700
committerclayjohn <claynjohn@gmail.com>2019-07-29 11:17:08 -0700
commit3f25dde6b4c46bec1fd25a3dd8f65c774b0fef94 (patch)
treeb9ccae49176d3ef73ea3167f46f1f1ee4c6d583b /drivers/gles2/shader_compiler_gles2.cpp
parent5dae2ea777da5395cf1b1e9a8bc6abc93f6ae6bb (diff)
added round function to gles2
Diffstat (limited to 'drivers/gles2/shader_compiler_gles2.cpp')
-rw-r--r--drivers/gles2/shader_compiler_gles2.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gles2/shader_compiler_gles2.cpp b/drivers/gles2/shader_compiler_gles2.cpp
index df7eee2301..630a5ed6c6 100644
--- a/drivers/gles2/shader_compiler_gles2.cpp
+++ b/drivers/gles2/shader_compiler_gles2.cpp
@@ -733,6 +733,17 @@ String ShaderCompilerGLES2::_dump_node_code(SL::Node *p_node, int p_level, Gener
code += ")";
+ if (p_default_actions.usage_defines.has(var_node->name) && !used_name_defines.has(var_node->name)) {
+ String define = p_default_actions.usage_defines[var_node->name];
+
+ if (define.begins_with("@")) {
+ define = p_default_actions.usage_defines[define.substr(1, define.length())];
+ }
+
+ r_gen_code.custom_defines.push_back(define.utf8());
+ used_name_defines.insert(var_node->name);
+ }
+
} break;
case SL::OP_INDEX: {
@@ -917,6 +928,7 @@ ShaderCompilerGLES2::ShaderCompilerGLES2() {
actions[VS::SHADER_CANVAS_ITEM].usage_defines["NORMAL"] = "#define NORMAL_USED\n";
actions[VS::SHADER_CANVAS_ITEM].usage_defines["NORMALMAP"] = "#define NORMALMAP_USED\n";
actions[VS::SHADER_CANVAS_ITEM].usage_defines["LIGHT"] = "#define USE_LIGHT_SHADER_CODE\n";
+ actions[VS::SHADER_CANVAS_ITEM].usage_defines["round"] = "#define ROUND_USED\n";
actions[VS::SHADER_CANVAS_ITEM].render_mode_defines["skip_vertex_transform"] = "#define SKIP_TRANSFORM_USED\n";
/** SPATIAL SHADER **/