3bfb2f94d4
This allows shaders to declare and use pointer-type variables. Pointers may be loaded and stored, be the result of an `OpSelect`, be passed to and returned from functions, and even be passed as inputs to the `OpPhi` instruction. All types of pointers may be used as variable pointers. Variable pointers to storage buffers and workgroup memory may even be loaded from and stored to, as though they were ordinary variables. In addition, this enables using an interior pointer to an array as though it were an array pointer itself using the `OpPtrAccessChain` instruction. This is a rather large and involved change, mostly because this is somewhat complicated with a lot of moving parts. It's a wonder SPIRV-Cross's output is largely unchanged. Indeed, many of these changes are to accomplish exactly that! Perhaps the largest source of changes was the violation of the assumption that, when emitting types, the pointer type didn't matter. One of the test cases added by the change doesn't optimize very well; the output of `spirv-opt` here is invalid SPIR-V. I need to file a bug with SPIRV-Tools about this. I wanted to test that variable pointers to images worked too, but I couldn't figure out how to propagate the access qualifier properly--in MSL, it's part of the type, so getting this right is important. I've punted on that for now. |
||
---|---|---|
.. | ||
asm | ||
comp | ||
frag | ||
vert |