mellinoe / ShaderGen

Proof-of-concept library for generating HLSL, GLSL, and Metal shader code from C#,
MIT License
497 stars 56 forks source link

ShaderGen doesn't escape paths when passing to HLSL Compiler #60

Closed thargy closed 6 years ago

thargy commented 6 years ago

When a shader path has a space in it then HLSL compilation fails:

Failed to compile HLSL: StdOut: , StdErr: Too many files specified ('Control\Veldrid-Samples\bin\obj\TexturedCube\Cube-vertex.hlsl' was the last one), use /? to get usage information.

(Full path was "D:\Source Control\..." so is splitting on space

The issue is due to line 308 of ShaderGen.App.Program's CompileHlsl method which sets the args: string args = $"/T {profile} /E {entryPoint} {shaderPath} /Fo {outputPath}";

Quoting the parameters fixes, so I will submit a pull-request.

feliwir commented 6 years ago

I can confirm this error. We got it aswell