763ddd0fd3
If deref chain has nir_deref_type_cast nir_intrinsic_get_var will
return null, which is valid for e.g. shader inputs, since the pass
only care about outputs.
NIR excerpt that caused issues:
```
32x3 %6 = deref_cast (block *)%5 (ubo block) (ptr_stride=0, align_mul=0, align_offset=0)
32x3 %7 = deref_struct &%6->field0 (ubo vec4[4]) // &((block *)%5)->field0
32 %8 = load_const (0x00000001)
32x3 %9 = deref_array &(*%7)[1] (ubo vec4) // &((block *)%5)->field0[1]
32x4 %10 = @load_deref (%9) (access=none)
```
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33647>