SPIRV-Cross/reference
Chip Davis 3bfb2f94d4 MSL: Support SPV_KHR_variable_pointers.
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.
2019-01-07 11:19:10 -06:00
..
opt MSL: Support SPV_KHR_variable_pointers. 2019-01-07 11:19:10 -06:00
shaders Deal with phi copies which happen inside continue blocks. 2019-01-07 14:24:07 +01:00
shaders-hlsl Merge pull request #799 from KhronosGroup/fix-780 2019-01-04 16:08:10 +01:00
shaders-hlsl-no-opt Update tests. 2018-11-01 11:23:48 +01:00
shaders-msl MSL: Support SPV_KHR_variable_pointers. 2019-01-07 11:19:10 -06:00
shaders-msl-no-opt MSL: Support SPV_KHR_variable_pointers. 2019-01-07 11:19:10 -06:00
shaders-no-opt Update tests. 2018-11-01 11:23:48 +01:00
shaders-reflection Prefix integer types with underscore 2018-06-21 09:24:22 -07:00