Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot compile shaders #3

Open
Syphius opened this issue Jul 30, 2022 · 2 comments
Open

Cannot compile shaders #3

Syphius opened this issue Jul 30, 2022 · 2 comments

Comments

@Syphius
Copy link

Syphius commented Jul 30, 2022

Hello,

My configuration:

  • Windows 11
  • Visual studio 2022 or 2019
  • Latest Windows SDK 10.0.22621.0
  • I used the last DXC : [https://github.com/microsoft/DirectXShaderCompiler/releases/tag/v1.7.2207]

Everything compile fine, except shaders, I have the same messages for every shaders:

1>------ Build started: Project: basic_triangle_shaders, Configuration: Debug x64 ------ 1>[ 50.0%] DXIL FAIL shaders.hlsl:main_ps 1>ERRORS for shaders.hlsl:main_ps : 1> 1> 1>[100.0%] DXIL FAIL shaders.hlsl:main_vs 1>ERRORS for shaders.hlsl:main_vs : 1> 1> 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(147,5): error MSB3073: The command "setlocal 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(147,5): error MSB3073: ..\..\..\bin\nvrhi-scomp.exe --infile "C:/Dev/donut/donut_examples/examples/basic_triangle/shaders.cfg" --parallel --out "C:/Dev/donut/donut_examples/bin/shaders/basic_triangle/dxil" --platform dxil --cflags "-Zi -Qembed_debug -O3 -WX -Zpr" -I "C:/Dev/donut/donut_examples/donut/include" --compiler "C:/Users/myusername/Downloads/dxc_2022_07_18 (1)/bin/x64/dxc.exe" 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(147,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(147,5): error MSB3073: :cmEnd 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(147,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(147,5): error MSB3073: :cmErrorLevel 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(147,5): error MSB3073: exit /b %1 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(147,5): error MSB3073: :cmDone 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(147,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(147,5): error MSB3073: setlocal 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(147,5): error MSB3073: ..\..\..\bin\nvrhi-scomp.exe --infile "C:/Dev/donut/donut_examples/examples/basic_triangle/shaders.cfg" --parallel --out "C:/Dev/donut/donut_examples/bin/shaders/basic_triangle/dxbc" --platform dxbc --cflags "-Zi -O3 -WX -Zpr" -I "C:/Dev/donut/donut_examples/donut/include" --compiler "C:/Program Files (x86)/Windows Kits/10/bin/10.0.22621.0/x64/fxc.exe" 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(147,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(147,5): error MSB3073: :cmEnd 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(147,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(147,5): error MSB3073: :cmErrorLevel 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(147,5): error MSB3073: exit /b %1 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(147,5): error MSB3073: :cmDone 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(147,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(147,5): error MSB3073: setlocal 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(147,5): error MSB3073: ..\..\..\bin\nvrhi-scomp.exe --infile "C:/Dev/donut/donut_examples/examples/basic_triangle/shaders.cfg" --parallel --out "C:/Dev/donut/donut_examples/bin/shaders/basic_triangle/spirv" --platform spirv -I "C:/Dev/donut/donut_examples/donut/include" -D SPIRV --cflags "-Zi -fspv-target-env=vulkan1.2 -O3 -WX -Zpr" --compiler "C:/Users/myusername/Downloads/dxc_2022_07_18 (1)/bin/x64/dxc.exe" 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(147,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(147,5): error MSB3073: :cmEnd 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(147,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(147,5): error MSB3073: :cmErrorLevel 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(147,5): error MSB3073: exit /b %1 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(147,5): error MSB3073: :cmDone 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(147,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(147,5): error MSB3073: :VCEnd" exited with code 1. 1>Done building project "basic_triangle_shaders.vcxproj" -- FAILED. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

It show no error, but fail anyway.

I have the same errors for SPIR-V:

Build started... 1>------ Build started: Project: basic_triangle_shaders, Configuration: Debug x64 ------ 1>[ 50.0%] SPIR-V FAIL shaders.hlsl:main_ps 1>ERRORS for shaders.hlsl:main_ps : 1> 1> 1>[100.0%] SPIR-V FAIL shaders.hlsl:main_vs 1>ERRORS for shaders.hlsl:main_vs : 1> 1> 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(147,5): error MSB3073: The command " 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(147,5): error MSB3073: setlocal 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(147,5): error MSB3073: ..\..\..\bin\nvrhi-scomp.exe --infile "C:/Dev/donut/donut_examples/examples/basic_triangle/shaders.cfg" --parallel --out "C:/Dev/donut/donut_examples/bin/shaders/basic_triangle/spirv" --platform spirv -I "C:/Dev/donut/donut_examples/donut/include" -D SPIRV --cflags "-Zi -fspv-target-env=vulkan1.2 -O3 -WX -Zpr" --compiler "C:/Users/myusername/Downloads/dxc_2022_07_18 (1)/bin/x64/dxc.exe" 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(147,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(147,5): error MSB3073: :cmEnd 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(147,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(147,5): error MSB3073: :cmErrorLevel 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(147,5): error MSB3073: exit /b %1 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(147,5): error MSB3073: :cmDone 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(147,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(147,5): error MSB3073: :VCEnd" exited with code 1. 1>Done building project "basic_triangle_shaders.vcxproj" -- FAILED. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

What I already tried :

  • Use the DXC from windows SDK
  • Tried SPIR-V
  • Regenerate the solution with cmake

Could you help me please? I don't know what to do

@apanteleev
Copy link
Contributor

That's odd.
What happens if you run nvrhi-scomp.exe from console, as shown in the log?

..\..\..\bin\nvrhi-scomp.exe --infile "C:/Dev/donut/donut_examples/examples/basic_triangle/shaders.cfg" --parallel --out "C:/Dev/donut/donut_examples/bin/shaders/basic_triangle/dxil" --platform dxil --cflags "-Zi -Qembed_debug -O3 -WX -Zpr" -I "C:/Dev/donut/donut_examples/donut/include" --compiler "C:/Users/myusername/Downloads/dxc_2022_07_18 (1)/bin/x64/dxc.exe"

One guess is that there might be an issue with the DXC path that contains a space and (1), but I'm not sure.

@Syphius
Copy link
Author

Syphius commented Jul 31, 2022

Thank you very much,

It was a space in path problem, but not only for the dxc, the project was build in a directory (c:\Dev X\donut\donut_examples).

I re-did everything in path : C:\donut_example, and everything works now.

Regards,

Syphius.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants