Does the SPIR-V specification guarantee that precompiled SPIR-V objects will run on all Vulkan targets regardless of the hardware vendor?

That is the goal of the SPIR-V and Vulkan relationship. Khronos has written the most rigorous specification possible for SPIR-V, and any issues should be reported to the SPIR-V project.

The one caveat is that Vulkan does not specify error behavior. If you write a SPIR-V shader that does not follow the SPIR-V specification, different implementations may have different behaviors.

If your SPIR-V passes the SPIR-V validator but behaves differently on different implementations, let Khronos know.

There are feature capability support bits in SPIR-V, so if you have a shader that works on one implementation that supports some capabilities and you run it on an implementation that does not support those capabilities, that’s not going to work. But otherwise the intent is that things are portable and that there are less implementation variations in SPIR-V consumers than there has been in GLSL compilers.

Return to FAQs