nir/deref: fix struct wrapper casts. (v3)
authorDave Airlie <airlied@redhat.com>
Fri, 8 Mar 2019 03:09:05 +0000 (13:09 +1000)
committerDave Airlie <airlied@redhat.com>
Thu, 28 Mar 2019 22:10:50 +0000 (08:10 +1000)
commitb779baa9bf95ca259779fa028a7b822bf8a17f46
tree42c347816f9290dc272e52e9bcbd51b9612caae1
parent8e0469f62934e2228694948bf5cded8b5462ef3e
nir/deref: fix struct wrapper casts. (v3)

llvm/spir-v spits out some struct a { struct b {} }, but it
doesn't deref, it casts (struct a) to (struct b), reconstruct
struct derefs instead of casts for these.

v2: use ssa_def_rewrite uses, rework the type restrictions (Jason)
v3: squish more stuff into one function, drop unused temp (Jason)

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/nir/nir_deref.c