[Freedreno] [PATCH] ir3/nir: Set up image_dims consts for image_deref_size intrinsic too

Eduardo Lima Mitev elima at igalia.com
Sun Oct 21 18:48:41 UTC 2018


`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.
---
 src/gallium/drivers/freedreno/ir3/ir3_nir.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/gallium/drivers/freedreno/ir3/ir3_nir.c b/src/gallium/drivers/freedreno/ir3/ir3_nir.c
index d934acc7427..63866ae4d01 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_nir.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3_nir.c
@@ -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;
-- 
2.19.1



More information about the Freedreno mailing list