Browse Source

Merge pull request #35773 from Chaosus/vk_shader_fix_crash

[Vulkan] Fix shader crash if using multiple underscores in identifiers
Rémi Verschelde 5 years ago
parent
commit
eb2b1a6022
1 changed files with 1 additions and 1 deletions
  1. 1 1
      servers/visual/rasterizer_rd/shader_compiler_rd.cpp

+ 1 - 1
servers/visual/rasterizer_rd/shader_compiler_rd.cpp

@@ -170,7 +170,7 @@ static String _opstr(SL::Operator p_op) {
 
 
 static String _mkid(const String &p_id) {
 static String _mkid(const String &p_id) {
 
 
-	String id = "m_" + p_id;
+	String id = "m_" + p_id.replace("__", "_dus_");
 	return id.replace("__", "_dus_"); //doubleunderscore is reserved in glsl
 	return id.replace("__", "_dus_"); //doubleunderscore is reserved in glsl
 }
 }