Selaa lähdekoodia

Skip white space between $input/$output.

Branimir Karadžić 11 vuotta sitten
vanhempi
sitoutus
748da31049

+ 2 - 2
3rdparty/glsl-optimizer/src/glsl/ir_print_metal_visitor.cpp

@@ -374,7 +374,7 @@ void ir_print_metal_visitor::newline_deindent()
 
 void ir_print_metal_visitor::print_var_name (ir_variable* v)
 {
-    long id = (long)hash_table_find (globals->var_hash, v);
+    uintptr_t id = (uintptr_t)hash_table_find (globals->var_hash, v);
 	if (!id && v->data.mode == ir_var_temporary)
 	{
         id = ++globals->var_counter;
@@ -543,7 +543,7 @@ void ir_print_metal_visitor::visit(ir_variable *ir)
 	// give an id to any variable defined in a function that is not an uniform
 	if ((this->mode == kPrintGlslNone && ir->data.mode != ir_var_uniform))
 	{
-		long id = (long)hash_table_find (globals->var_hash, ir);
+		uintptr_t id = (uintptr_t)hash_table_find (globals->var_hash, ir);
 		if (id == 0)
 		{
 			id = ++globals->var_counter;

+ 8 - 0
3rdparty/glsl-optimizer/src/mesa/main/compiler.h

@@ -247,6 +247,14 @@ static inline GLuint CPU_TO_LE32(GLuint x)
 #define M_PI (3.14159265358979323846)
 #endif
 
+#ifndef M_PI_2
+#define M_PI_2 1.57079632679489661923
+#endif
+
+#ifndef M_PI_4
+#define M_PI_4 0.78539816339744830962
+#endif
+
 #ifndef M_E
 #define M_E (2.7182818284590452354)
 #endif

+ 2 - 0
tools/shaderc/shaderc.cpp

@@ -2032,6 +2032,8 @@ int main(int _argc, const char* _argv[])
 					raw = true;
 					str += 3;
 				}
+
+				input = const_cast<char*>(bx::strws(input) );
 			}
 
 			if (!raw)