diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-10-22 09:53:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-22 09:53:49 +0200 |
commit | d05c7da1aa0fa0c58d54dfaeca1e474cdd31a20c (patch) | |
tree | 858835653bb10caf199ff4848706b83ce2216ba4 /servers/rendering/rasterizer_rd | |
parent | 3b85f22a6f92523e9e8fe60ce1dc0dad096e6ed4 (diff) | |
parent | 5d33cd94c86e3face79eec804fa0eb6f0b718da2 (diff) |
Merge pull request #42949 from DavidSichma/shaderglobals
Shader globals bugfixes
Diffstat (limited to 'servers/rendering/rasterizer_rd')
-rw-r--r-- | servers/rendering/rasterizer_rd/shader_compiler_rd.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/servers/rendering/rasterizer_rd/shader_compiler_rd.cpp b/servers/rendering/rasterizer_rd/shader_compiler_rd.cpp index 946a83dcf8..0a0c343e57 100644 --- a/servers/rendering/rasterizer_rd/shader_compiler_rd.cpp +++ b/servers/rendering/rasterizer_rd/shader_compiler_rd.cpp @@ -423,13 +423,13 @@ static String _get_global_variable_from_type_and_index(const String &p_buffer, c return "(" + p_buffer + "[" + p_index + "].x != 0.0)"; } case ShaderLanguage::TYPE_BVEC2: { - return "(" + p_buffer + "[" + p_index + "].xy != vec2(0.0))"; + return "(notEqual(" + p_buffer + "[" + p_index + "].xy, vec2(0.0)))"; } case ShaderLanguage::TYPE_BVEC3: { - return "(" + p_buffer + "[" + p_index + "].xyz != vec3(0.0))"; + return "(notEqual(" + p_buffer + "[" + p_index + "].xyz, vec3(0.0)))"; } case ShaderLanguage::TYPE_BVEC4: { - return "(" + p_buffer + "[" + p_index + "].xyzw != vec4(0.0))"; + return "(notEqual(" + p_buffer + "[" + p_index + "].xyzw, vec4(0.0)))"; } case ShaderLanguage::TYPE_INT: { return "floatBitsToInt(" + p_buffer + "[" + p_index + "].x)"; @@ -444,16 +444,16 @@ static String _get_global_variable_from_type_and_index(const String &p_buffer, c return "floatBitsToInt(" + p_buffer + "[" + p_index + "].xyzw)"; } case ShaderLanguage::TYPE_UINT: { - return "floatBitsToUInt(" + p_buffer + "[" + p_index + "].x)"; + return "floatBitsToUint(" + p_buffer + "[" + p_index + "].x)"; } case ShaderLanguage::TYPE_UVEC2: { - return "floatBitsToUInt(" + p_buffer + "[" + p_index + "].xy)"; + return "floatBitsToUint(" + p_buffer + "[" + p_index + "].xy)"; } case ShaderLanguage::TYPE_UVEC3: { - return "floatBitsToUInt(" + p_buffer + "[" + p_index + "].xyz)"; + return "floatBitsToUint(" + p_buffer + "[" + p_index + "].xyz)"; } case ShaderLanguage::TYPE_UVEC4: { - return "floatBitsToUInt(" + p_buffer + "[" + p_index + "].xyzw)"; + return "floatBitsToUint(" + p_buffer + "[" + p_index + "].xyzw)"; } case ShaderLanguage::TYPE_FLOAT: { return "(" + p_buffer + "[" + p_index + "].x)"; |