ir3/nir: Set up image_dims consts for image_deref_size intrinsic too
authorEduardo Lima Mitev <elima@igalia.com>
Sun, 21 Oct 2018 18:48:41 +0000 (20:48 +0200)
committerEduardo Lima Mitev <elima@igalia.com>
Sun, 21 Oct 2018 19:29:18 +0000 (21:29 +0200)
`nir_intrinsic_image_deref_size` is not being considered during scan for
driver constants, so image constants are not emitted if a shader
only ever query the size of an image (no load, store, atomic op, etc).
This is unlikely, but possible.

Reviewed-by: Rob Clark <robdclark@gmail.com>
src/gallium/drivers/freedreno/ir3/ir3_nir.c

index d934acc74273d461be17b959b8ea52089267f315..63866ae4d0116af8ffcf871de7c21000f8f49983 100644 (file)
@@ -254,6 +254,7 @@ ir3_nir_scan_driver_consts(nir_shader *shader,
                                case nir_intrinsic_image_deref_atomic_exchange:
                                case nir_intrinsic_image_deref_atomic_comp_swap:
                                case nir_intrinsic_image_deref_store:
+                               case nir_intrinsic_image_deref_size:
                                        idx = nir_intrinsic_get_var(intr, 0)->data.driver_location;
                                        if (layout->image_dims.mask & (1 << idx))
                                                break;