From 8a8382a78a51fe598822be91fc0f9f21e943879c Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Mon, 20 Feb 2023 19:02:47 +0200 Subject: [PATCH] nir: teach nir_chase_binding about resource_intel It's needed to have opt_gcm work properly. Signed-off-by: Lionel Landwerlin Reviewed-by: Kenneth Graunke Part-of: --- src/compiler/nir/nir.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c index 56e66a47a44..30174ff965b 100644 --- a/src/compiler/nir/nir.c +++ b/src/compiler/nir/nir.c @@ -2942,6 +2942,22 @@ nir_binding nir_chase_binding(nir_src rsrc) if (!intrin) return (nir_binding){0}; + /* Intel resource, similar to load_vulkan_descriptor after it has been + * lowered. + */ + if (intrin->intrinsic == nir_intrinsic_resource_intel) { + res.success = true; + res.desc_set = nir_intrinsic_desc_set(intrin); + res.binding = nir_intrinsic_binding(intrin); + /* nir_intrinsic_resource_intel has 3 sources, but src[2] is included in + * src[1], it is kept around for other purposes. + */ + res.num_indices = 2; + res.indices[0] = intrin->src[0]; + res.indices[1] = intrin->src[1]; + return res; + } + /* skip load_vulkan_descriptor */ if (intrin->intrinsic == nir_intrinsic_load_vulkan_descriptor) { intrin = nir_src_as_intrinsic(intrin->src[0]);