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. |
||
---|---|---|
.. | ||
atomic-decrement.asm.comp | ||
atomic-increment.asm.comp | ||
bitcast_iadd.asm.comp | ||
bitcast_sar.asm.comp | ||
bitcast_sdiv.asm.comp | ||
bitcast_slr.asm.comp | ||
block-name-alias-global.asm.comp | ||
buffer-write-relative-addr.asm.comp | ||
buffer-write.asm.comp | ||
global-parameter-name-alias.asm.comp | ||
multiple-entry.asm.comp | ||
quantize.asm.comp | ||
relaxed-block-layout.asm.comp | ||
specialization-constant-workgroup.asm.comp | ||
storage-buffer-basic.invalid.asm.comp | ||
variable-pointers-2.asm.comp | ||
vector-builtin-type-cast-func.asm.comp | ||
vector-builtin-type-cast.asm.comp |