DirectXShaderCompiler
DirectXShaderCompiler copied to clipboard
hctbuild problems with building with -spirv
Hello. I am trying to build program with command utils\hct\hctbuild -x64 -vs2022 -rel -official -spirv, but I have issues with it. I am building on Windows 11. There is a building error like this:
CMake Error at external/CMakeLists.txt:20 (add_subdirectory): The source directory
C:/DirectXShaderCompiler/external/SPIRV-Headersdoes not contain a CMakeLists.txt file.
CMake Error at external/CMakeLists.txt:26 (message): SPIRV-Headers was not found - required for SPIR-V codegen
I builded spirv-headers and added them to the path environment variable, but, that seems cmake could not find spirv-headers anyway. And, also, everything building correctly without any of spirv arguments. How could I solve problem? Thanks.
SPIR-V headers should go in the SPIR-V tools directory under the “externals” folder. That’s odd though, I don’t believe I had to do this sort of manual configuration with my setup. I’m also on Win 11
Well, I've tried different things, like: copying spirv-headers directly to the build directory, build spirv-tools, install spirv-tools and spirv-headers with vcpkg. Not a single thing worked for me and I don't understand, what I should do here. I with there was more comprehensive guide how to correctly do the things here or vulkan sdk was already have dxc.exe builded with -DENABLE_SPIRV_CODEGEN=ON, really close to giving up.
Really thought we used to have proper documentation for this in the readme. Nevertheless, I've always had to add the submodules manually. You can go to the external/ dir and execute
git clone https://github.com/KhronosGroup/SPIRV-Headers
git clone https://github.com/KhronosGroup/SPIRV-Tools
git clone https://github.com/google/effcee
git clone https://github.com/google/re2
and you should be good to go!
@natevm, we should add this information to the Readme. We might also consider making this more automatic. I was looking into another way of adding submodules that would make a lot of this easier. We can discuss it later.
Tagging this bug with SPIRV.
I got it. Now that worked pretty fine. Sorry for being rude, but that was just my stupidity fault, who somehow totally forgot about submodules. Thanks, now everything builded correctly
@TheArheus, Happy to hear it! It's a good note that we need better docs in this area.
Ah, yeah, agreed. This should be documented. By habit I tend to add --recursive to my clone commands, and forgot that I did that here...
The SPIR-V CodeGen docs do include the instructions to run git submodule update --init which should clone all submodules. I know this is a very late reply, but if you remember any other instructions you were using where this detail might have been missing feel free to add a link to it below and I'd be happy to update it.