3 ms·
Inline assembly in shaders exists for basically the same reasons it exists in C++. Hardware gains new features much faster than Khronos standardizes an API for
by Conscat 2y ago
Inline assembly in shaders exists for basically the same reasons it exists in C++. Hardware gains new features much faster than Khronos standardizes an API for them in SPIR-V, so inline assembly lets you use of them ASAP. You might also want to make optimizations with the assembly if AMD/Intel's SPIR-V compilers aren't doing what you want.
Vulkan does make it easy to check which the feature availability of your device, and dispatch different shaders accordingly.
That said I've actually never had a reason to use inline assembly in shaders, personally.