About Social Code
aboutsummaryrefslogtreecommitdiff
path: root/src/intel/vulkan/anv_nir_push_descriptor_analysis.c
diff options
context:
space:
mode:
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>2023-01-07 02:58:09 +0200
committerMarge Bot <emma+marge@anholt.net>2023-01-09 23:00:24 +0000
commite2b0086b786fc46193c2c4c0313922d64bbe2653 (patch)
treed8bf274e225992e9fe4f5b97aa9643a5d6f5c666 /src/intel/vulkan/anv_nir_push_descriptor_analysis.c
parent48bb3df95158ca14e7c291d03be45becb097263f (diff)
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 <lionel.g.landwerlin@intel.com> Fixes: ff91c5ca42 ("anv: add analysis for push descriptor uses and store it in shader cache") Reviewed-by: Emma Anholt <emma@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20555>
Diffstat (limited to 'src/intel/vulkan/anv_nir_push_descriptor_analysis.c')
-rw-r--r--src/intel/vulkan/anv_nir_push_descriptor_analysis.c4
1 files changed, 3 insertions, 1 deletions
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)) {