This PR addresses two issues related to compiling ShaderBytecode:
When ShaderBytecode.Compile failed, it never returned an error result code or threw an exception, even when Configuration.ThrowOnShaderCompileError was true. This is because it assumed that D3D.Compile2 throws an exception on failure, which is not the case. This PR adds explicit error handling by checking the result code. This fixes #695.
When using ShaderBytecode.CompileFromFile, the error messages always refer to the source file as unknown. Passing along the fileName fixes this.
This PR addresses two issues related to compiling ShaderBytecode:
ShaderBytecode.Compile
failed, it never returned an error result code or threw an exception, even whenConfiguration.ThrowOnShaderCompileError
wastrue
. This is because it assumed thatD3D.Compile2
throws an exception on failure, which is not the case. This PR adds explicit error handling by checking the result code. This fixes #695.ShaderBytecode.CompileFromFile
, the error messages always refer to the source file asunknown
. Passing along thefileName
fixes this.