Hello,
I just came across this project on GitHub (GitHub - KhronosGroup/SPIR), which seems to allow to compile OpenCL kernels to SPIR-V. I’ve already used GLSL compute shaders, compiled to SPIR-V, within Vulkan as compute shaders, so I was wondering, whether there is also a way to execute to-spirv-compiled OpenCL kernels with the Vulkan compute pipeline?
If it’s possible at all, are there any resources, that may contain further information about this ?
If you compile OpenCL kernels to SPIR-V, then your kernels presumably use OpenCL features. Which means that the SPIR-V it generates will be flavored for use in OpenCL by using features that aren’t allowed in Vulkan. The most notable of which is the use of a Phsycial32/64 addressing mode rather than Logical. Physical addressing modes means that you can use pointers. But the Vulkan execution environment doesn’t allow for Physical addressing; you have to use Logical.