User forums > Using Code::Blocks

How to configure Vulkan SPIR-V compiler in Code::Blocks

(1/1)

cdavalillo:
I want to compile GLSL shader files with the Vulkan SPIR-V compiler as we do with the c/c++ source files. I read some time ago in the Nvidia support pages how to set the CUDA compiler in Code::Blocks (https://forums.developer.nvidia.com/t/how-to-setup-cuda-compiler-on-code-blocks-author-not-me/11760), so I have some idea how to do it. But after putting in the path to the linker and compiler it don't work, so I want to know what I'm missing. I'm on Debian 12 64 bits, after list the files installed for the package spirv-tools I have the following output


--- Code: ---/.
/usr
/usr/bin
/usr/bin/spirv-as
/usr/bin/spirv-cfg
/usr/bin/spirv-dis
/usr/bin/spirv-lesspipe.sh
/usr/bin/spirv-link
/usr/bin/spirv-lint
/usr/bin/spirv-opt
/usr/bin/spirv-reduce
/usr/bin/spirv-val
/usr/include
/usr/include/spirv-tools
/usr/include/spirv-tools/instrument.hpp
/usr/include/spirv-tools/libspirv.h
/usr/include/spirv-tools/libspirv.hpp
/usr/include/spirv-tools/linker.hpp
/usr/include/spirv-tools/optimizer.hpp
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/cmake
/usr/lib/x86_64-linux-gnu/cmake/SPIRV-Tools
/usr/lib/x86_64-linux-gnu/cmake/SPIRV-Tools/SPIRV-ToolsConfig.cmake
/usr/lib/x86_64-linux-gnu/cmake/SPIRV-Tools/SPIRV-ToolsTarget-release.cmake
/usr/lib/x86_64-linux-gnu/cmake/SPIRV-Tools/SPIRV-ToolsTarget.cmake
/usr/lib/x86_64-linux-gnu/cmake/SPIRV-Tools-diff
/usr/lib/x86_64-linux-gnu/cmake/SPIRV-Tools-diff/SPIRV-Tools-diffConfig.cmake
/usr/lib/x86_64-linux-gnu/cmake/SPIRV-Tools-diff/SPIRV-Tools-diffTargets-release.cmake
/usr/lib/x86_64-linux-gnu/cmake/SPIRV-Tools-diff/SPIRV-Tools-diffTargets.cmake
/usr/lib/x86_64-linux-gnu/cmake/SPIRV-Tools-link
/usr/lib/x86_64-linux-gnu/cmake/SPIRV-Tools-link/SPIRV-Tools-linkConfig.cmake
/usr/lib/x86_64-linux-gnu/cmake/SPIRV-Tools-link/SPIRV-Tools-linkTargets-release.cmake
/usr/lib/x86_64-linux-gnu/cmake/SPIRV-Tools-link/SPIRV-Tools-linkTargets.cmake
/usr/lib/x86_64-linux-gnu/cmake/SPIRV-Tools-lint
/usr/lib/x86_64-linux-gnu/cmake/SPIRV-Tools-lint/SPIRV-Tools-lintConfig.cmake
/usr/lib/x86_64-linux-gnu/cmake/SPIRV-Tools-lint/SPIRV-Tools-lintTargets-release.cmake
/usr/lib/x86_64-linux-gnu/cmake/SPIRV-Tools-lint/SPIRV-Tools-lintTargets.cmake
/usr/lib/x86_64-linux-gnu/cmake/SPIRV-Tools-opt
/usr/lib/x86_64-linux-gnu/cmake/SPIRV-Tools-opt/SPIRV-Tools-optConfig.cmake
/usr/lib/x86_64-linux-gnu/cmake/SPIRV-Tools-opt/SPIRV-Tools-optTargets-release.cmake
/usr/lib/x86_64-linux-gnu/cmake/SPIRV-Tools-opt/SPIRV-Tools-optTargets.cmake
/usr/lib/x86_64-linux-gnu/cmake/SPIRV-Tools-reduce
/usr/lib/x86_64-linux-gnu/cmake/SPIRV-Tools-reduce/SPIRV-Tools-reduceConfig.cmake
/usr/lib/x86_64-linux-gnu/cmake/SPIRV-Tools-reduce/SPIRV-Tools-reduceTarget-release.cmake
/usr/lib/x86_64-linux-gnu/cmake/SPIRV-Tools-reduce/SPIRV-Tools-reduceTarget.cmake
/usr/lib/x86_64-linux-gnu/cmake/SPIRV-Tools-tools
/usr/lib/x86_64-linux-gnu/cmake/SPIRV-Tools-tools/SPIRV-Tools-toolsConfig.cmake
/usr/lib/x86_64-linux-gnu/cmake/SPIRV-Tools-tools/SPIRV-Tools-toolsTargets-release.cmake
/usr/lib/x86_64-linux-gnu/cmake/SPIRV-Tools-tools/SPIRV-Tools-toolsTargets.cmake
/usr/lib/x86_64-linux-gnu/libSPIRV-Tools-diff.a
/usr/lib/x86_64-linux-gnu/libSPIRV-Tools-link.a
/usr/lib/x86_64-linux-gnu/libSPIRV-Tools-lint.a
/usr/lib/x86_64-linux-gnu/libSPIRV-Tools-opt.a
/usr/lib/x86_64-linux-gnu/libSPIRV-Tools-reduce.a
/usr/lib/x86_64-linux-gnu/libSPIRV-Tools.a
/usr/lib/x86_64-linux-gnu/pkgconfig
/usr/lib/x86_64-linux-gnu/pkgconfig/SPIRV-Tools.pc
/usr/share
/usr/share/doc
/usr/share/doc/spirv-tools
/usr/share/doc/spirv-tools/changelog.Debian.gz
/usr/share/doc/spirv-tools/changelog.gz
/usr/share/doc/spirv-tools/copyright
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/spirv-tools

--- End code ---

So I know that the linker is /usr/bin/spirv-link but not know what to put in the other tool chain executable textboxes. This is what I have so far

cdavalillo:
Ok now I know that the compiler is glslc located at /usr/bin so the tool chain should looks like this image. But how to configure Code::Blocks to run a compilation as it was done by the following command line


--- Code: ---glslc /home/User/CodeBlocks_Projects/GLSL/vs_background.vert  -o vert.spv

--- End code ---

In which the .vert file is a GLSL shader file and the .spv is the compiled byte code SPIR-V program.

stahta01:
I would read this link it might or might not help.
https://wiki.codeblocks.org/index.php/Adding_support_for_non_C/C%2B%2B_files_to_the_build_system

Tim S.

cdavalillo:
Thank you for the help, that is exactly what I was asking for. Now I have the following compilation command


--- Code: ---$compiler $options $includes -c $file -o $file_dir/$file_name.$exe_ext
--- End code ---

And in the Others tag in the field of object file extension I have the spv extension. This settings yield a .spv compiled file and after checking the compiled file with the SPIR-V visualizer (https://www.khronos.org/spir/visualizer/) I get what is in the following image

Navigation

[0] Message Index

Go to full version