Previously, we were creating nir_deref's immediately. Now, instead, we
have an intermediate vtn_access_chain structure. While a little more
awkward initially, this will allow us to more easily do structure splitting
on-the-fly.
This currently sets the base and size of all push constants to the
entire push constant block. The idea is that we'll use the base and size
to eventually optimize the amount we actually push, but for now we don't
do that.
Phi handling is somewhat intrinsically tied to the CFG. Moving it here
makes it a bit easier to handle that. In particular, we can now do SSA
repair after we've done the phi node second-pass. This fixes 6 CTS tests.
SPIR-V only has one ImageQuerySize opcode that has to work for both
textures and storage images. Therefore, we have to special-case that one a
bit and look at the type of the incoming image handle.
Image intrinsics always take a vec4 coordinate and always return a vec4.
This simplifies the intrinsics a but but also means that they don't
actually match the incomming SPIR-V. In order to compensate for this, we
add swizzling movs for both source and destination to get the right number
of components.
We were just hard-coding everything to a vec4. This meant we weren't
handling shadow samplers at all and integer things were getting the wrong
return type.
The original objective was to disallow UBO and SSBO variables from the
variable lists. This was accidentally broken in b208620fd when fixing some
other interface issues.
Connor's original shallow-copy plan works great except that a couple of the
decorations apply to a matrix which may be some levels down in an array.
We weren't properly unpacking that. This fixes most of the remaining SSBO
and UBO layout tests.
Instead of trying to crawl through predecessor chains and build phi nodes,
we just do a poor-man's out-of-ssa on the spot. The into-SSA pass will
deal with putting the actual phi nodes in for us.
They were completely bogus before. For one thing, OpDecorationGroup
created a value of type undef rather than decoration_group. Also
OpGroupMemberDecorate didn't properly apply the decoration to the different
members of the different groups. It *should* be correct now but there's no
good way to test it yet.
Thanks to the addition of nir_clone, we now have a num_elements field in
nir_constant which we weren't setting. Also, constants have to be parented
to the variable they initialize, so we have to make a copy.