Branimir Karadžić 7 سال پیش
والد
کامیت
d4fef78240
2فایلهای تغییر یافته به همراه19 افزوده شده و 14 حذف شده
  1. 1 1
      scripts/shaderc.lua
  2. 18 13
      tools/shaderc/shaderc.cpp

+ 1 - 1
scripts/shaderc.lua

@@ -310,7 +310,6 @@ project "glsl-optimizer"
 			"-Wno-sign-compare",
 			"-Wno-unused-function",
 			"-Wno-unused-parameter",
-			"-Wno-misleading-indentation",
 		}
 
 		removebuildoptions {
@@ -363,6 +362,7 @@ project "fcpp"
 	configuration { "not vs*" }
 		buildoptions {
 			"-Wno-implicit-fallthrough",
+			"-Wno-parentheses-equality",
 		}
 
 	configuration {}

+ 18 - 13
tools/shaderc/shaderc.cpp

@@ -414,7 +414,7 @@ namespace bgfx
 	class File
 	{
 	public:
-		File(const char* _filePath)
+		File(const bx::FilePath& _filePath)
 			: m_data(NULL)
 		{
 			bx::FileReader reader;
@@ -2402,18 +2402,23 @@ namespace bgfx
 		}
 		else
 		{
-			std::string defaultVarying = dir + "varying.def.sc";
-			const char* varyingdef = cmdLine.findOption("varyingdef", defaultVarying.c_str() );
-			File attribdef(varyingdef);
-			const char* parse = attribdef.getData();
-			if (NULL != parse
-			&&  *parse != '\0')
-			{
-				options.dependencies.push_back(varyingdef);
-			}
-			else
+			const char* varying = NULL;
+
+			if ('c' != options.shaderType)
 			{
-				fprintf(stderr, "ERROR: Failed to parse varying def file: \"%s\" No input/output semantics will be generated in the code!\n", varyingdef);
+				std::string defaultVarying = dir + "varying.def.sc";
+				const char* varyingdef = cmdLine.findOption("varyingdef", defaultVarying.c_str() );
+				File attribdef(varyingdef);
+				varying = attribdef.getData();
+				if (NULL     != varying
+				&&  *varying != '\0')
+				{
+					options.dependencies.push_back(varyingdef);
+				}
+				else
+				{
+					fprintf(stderr, "ERROR: Failed to parse varying def file: \"%s\" No input/output semantics will be generated in the code!\n", varyingdef);
+				}
 			}
 
 			const size_t padding    = 16384;
@@ -2452,7 +2457,7 @@ namespace bgfx
 				return bx::kExitFailure;
 			}
 
-			compiled = compileShader(attribdef.getData(), commandLineComment.c_str(), data, size, options, writer);
+			compiled = compileShader(varying, commandLineComment.c_str(), data, size, options, writer);
 
 			bx::close(writer);
 			delete writer;