3 ms·
A similar argument applies to SPIR-V. While I believe Apple are still trying to use LLVM bitcode for some purposes, the reality is that for a spec like Vulkan,
by atq2119 7y ago
A similar argument applies to SPIR-V. While I believe Apple are still trying to use LLVM bitcode for some purposes, the reality is that for a spec like Vulkan, you really want a shader program representation that is properly designed with a view to compatibility and independent extensibility (in the sense of hardware or platform vendor extensions), which LLVM IR isn't, pretty much on purpose.
- enos_feedler 7y agoIt makes sense to me that SPIR-V be a complete instruction set for an abstract GPU shader core. You can then have a GPU compiler translate to raw shader instructions. Much like a WASM compiler can translate from wasm to raw CPU instructions. I think an important design consideration in either case is "no surprises" meaning the translation should be fairly tight and predictable and serve just to smooth out some small surface area differences. If they do any funky magic/startling behavior the combined stack will start to exhibit weird performance properties