NIR: add a nir_deref_type_pixel
This is an idea I've had kicking around for a little while. Maybe instead of the current mechanism we use for storage image references where we have a bunch of parameters on each intrinsic, we could have a new nir_deref_instr
type for "pixel". This is rather HLSLish but could work really well. We would ensure that the deref source of the image intrinsic is always an SSA value to a nir_deref_instr
of type pixel so, while it would require a little bit of chasing in a back-end, it wouldn't be bad.
For image operations that work on variables, it's fairly straightforward: The parent would just be a nir_deref_instr
representing an image. For image operations on indices or bindless handles, I'm not quite sure what it would look like. We could possibly use some sort of cast or maybe something else.
Thoughts?