瀏覽代碼

shaderc_glsl: skip interp params when parsing glslopt output

Keywords like `flat` qualify type names. Without skipping them, the parser
will not find the type used and fail.
Sandy Carter 6 年之前
父節點
當前提交
9d09b965f5
共有 1 個文件被更改,包括 11 次插入0 次删除
  1. 11 0
      tools/shaderc/shaderc_glsl.cpp

+ 11 - 0
tools/shaderc/shaderc_glsl.cpp

@@ -125,6 +125,17 @@ namespace bgfx { namespace glsl
 						continue;
 					}
 
+					if (0 == bx::strCmp(qualifier, "flat", 4)
+					||  0 == bx::strCmp(qualifier, "smooth", 6)
+					||  0 == bx::strCmp(qualifier, "noperspective", 13)
+					||  0 == bx::strCmp(qualifier, "centroid", 8)
+					   )
+					{
+						// skip interpolation qualifiers
+						parse.set(eol.getPtr() + 1, parse.getTerm() );
+						continue;
+					}
+
 					if (0 == bx::strCmp(parse, "tmpvar", 6) )
 					{
 						// skip temporaries