summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsjtxietian <jsjtxietian@outlook.com>2023-09-09 23:43:49 +0800
committerjsjtxietian <jsjtxietian@outlook.com>2023-10-27 10:46:52 +0800
commit967e0e64851f4a8ff7bf63dbb16c308db40bf827 (patch)
treec3d728c324055a9ad03da73f984eabe3fa4f76fe
parentea0ab441c836091f3ede370d88b5fe1453b7a653 (diff)
downloadredot-engine-967e0e64851f4a8ff7bf63dbb16c308db40bf827.tar.gz
Fix int to uint implicit cast error when use uniform mat in gles3
-rw-r--r--servers/rendering/shader_compiler.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/servers/rendering/shader_compiler.cpp b/servers/rendering/shader_compiler.cpp
index 71f821205e..1e95cdde0c 100644
--- a/servers/rendering/shader_compiler.cpp
+++ b/servers/rendering/shader_compiler.cpp
@@ -432,13 +432,13 @@ static String _get_global_shader_uniform_from_type_and_index(const String &p_buf
return "(" + p_buffer + "[" + p_index + "].xyzw)";
}
case ShaderLanguage::TYPE_MAT2: {
- return "mat2(" + p_buffer + "[" + p_index + "].xy," + p_buffer + "[" + p_index + "+1].xy)";
+ return "mat2(" + p_buffer + "[" + p_index + "].xy," + p_buffer + "[" + p_index + "+1u].xy)";
}
case ShaderLanguage::TYPE_MAT3: {
- return "mat3(" + p_buffer + "[" + p_index + "].xyz," + p_buffer + "[" + p_index + "+1].xyz," + p_buffer + "[" + p_index + "+2].xyz)";
+ return "mat3(" + p_buffer + "[" + p_index + "].xyz," + p_buffer + "[" + p_index + "+1u].xyz," + p_buffer + "[" + p_index + "+2u].xyz)";
}
case ShaderLanguage::TYPE_MAT4: {
- return "mat4(" + p_buffer + "[" + p_index + "].xyzw," + p_buffer + "[" + p_index + "+1].xyzw," + p_buffer + "[" + p_index + "+2].xyzw," + p_buffer + "[" + p_index + "+3].xyzw)";
+ return "mat4(" + p_buffer + "[" + p_index + "].xyzw," + p_buffer + "[" + p_index + "+1u].xyzw," + p_buffer + "[" + p_index + "+2u].xyzw," + p_buffer + "[" + p_index + "+3u].xyzw)";
}
default: {
ERR_FAIL_V("void");