From b95e5a8cc2d3363ff68207bc41c855f531001ca3 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Sat, 7 Jan 2023 02:58:09 +0200 Subject: [PATCH] anv: check that push range actually match binding considered We can't just check the load_ubo range is contained in the push entry, we also need to check that the push entry set/binding matches the load_ubo set/binding. Signed-off-by: Lionel Landwerlin Fixes: ff91c5ca42 ("anv: add analysis for push descriptor uses and store it in shader cache") Reviewed-by: Emma Anholt Part-of: (cherry picked from commit e2b0086b786fc46193c2c4c0313922d64bbe2653) --- .pick_status.json | 2 +- src/intel/vulkan/anv_nir_push_descriptor_analysis.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 213701a1220..18813e9a8c2 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1147,7 +1147,7 @@ "description": "anv: check that push range actually match binding considered", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "ff91c5ca42bc80aa411cb3fd8f550aa6fdd16bdc" }, diff --git a/src/intel/vulkan/anv_nir_push_descriptor_analysis.c b/src/intel/vulkan/anv_nir_push_descriptor_analysis.c index 6a0dd905372..63d951f0535 100644 --- a/src/intel/vulkan/anv_nir_push_descriptor_analysis.c +++ b/src/intel/vulkan/anv_nir_push_descriptor_analysis.c @@ -222,7 +222,9 @@ anv_nir_push_desc_ubo_fully_promoted(nir_shader *nir, (nir_dest_bit_size(intrin->dest) / 8); for (unsigned i = 0; i < ARRAY_SIZE(bind_map->push_ranges); i++) { - if (bind_map->push_ranges[i].start * 32 <= load_offset && + if (bind_map->push_ranges[i].set == binding->set && + bind_map->push_ranges[i].index == desc_idx && + bind_map->push_ranges[i].start * 32 <= load_offset && (bind_map->push_ranges[i].start + bind_map->push_ranges[i].length) * 32 >= (load_offset + load_bytes)) {