Browse Source

Slightly better error reporting from BSLFX importer
Fixed DX11 shader parsing so it handles system value semantics

BearishSun 10 years ago
parent
commit
f801e0445c

+ 0 - 2
BansheeD3D11RenderAPI/Source/BsD3D11Mappings.cpp

@@ -337,8 +337,6 @@ namespace BansheeEngine
 		if(strcmp(sem, "PSIZE") == 0) 
 			return VES_PSIZE;
 
-		BS_EXCEPT(RenderingAPIException, "Invalid shader semantic: " + String(sem));
-
 		// Unsupported type
 		return VES_POSITION;
 	}

+ 1 - 1
BansheeSL/Include/BsSLFXCompiler.h

@@ -18,7 +18,7 @@ namespace BansheeEngine
 	 */
 	struct BSLFXCompileResult
 	{
-		ShaderPtr shader; /**< Resulting shader if compilation was successful. Null if erroro occurred. */
+		ShaderPtr shader; /**< Resulting shader if compilation was successful. Null if error occurred. */
 		String errorMessage; /**< Error message if compilation failed. */
 		int errorLine = 0; /**< Line of the error if one occurred. */
 		int errorColumn = 0; /**< Column of the error if one occurred. */

+ 7 - 2
BansheeSL/Source/BsSLFXCompiler.cpp

@@ -76,7 +76,7 @@ namespace BansheeEngine
 		{
 			output.errorMessage = parseState->errorMessage;
 			output.errorLine = parseState->errorLine;
-			output.errorLine = parseState->errorColumn;
+			output.errorColumn = parseState->errorColumn;
 
 			parseStateDelete(parseState);
 		}
@@ -126,7 +126,12 @@ namespace BansheeEngine
 			}
 
 			if (hasError)
-				LOGERR("Failed compiling GPU program(s): " + gpuProgError.str());
+			{
+				output.shader = nullptr;
+				output.errorMessage = "Failed compiling GPU program(s): " + gpuProgError.str();
+				output.errorLine = 0;
+				output.errorColumn = 0;
+			}
 		}
 
 		return output;