From da863546249bb99e14c67682d1ccf84bb29fcfab Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 2 Mar 2022 15:49:29 -0500 Subject: [PATCH] zink: fix descriptor cache pointer array allocation this got mixed up during some refactor and started indexing based on the number of bindings instead of the number of descriptors, which means that array descriptor bindings would have overlapping array memory cc: mesa-stable Acked-by: Emma Anholt Reviewed-by: Dave Airlie Part-of: (cherry picked from commit ab3725f533ecb0d4ecf7cefc6511fbcf15214b62) --- .pick_status.json | 2 +- src/gallium/drivers/zink/zink_descriptors.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index cb4078c10c6..1463448c92a 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -472,7 +472,7 @@ "description": "zink: fix descriptor cache pointer array allocation", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/gallium/drivers/zink/zink_descriptors.c b/src/gallium/drivers/zink/zink_descriptors.c index 91274442a77..b1621deb88e 100644 --- a/src/gallium/drivers/zink/zink_descriptors.c +++ b/src/gallium/drivers/zink/zink_descriptors.c @@ -710,13 +710,13 @@ allocate_desc_set(struct zink_context *ctx, struct zink_program *pg, enum zink_d #endif switch (type) { case ZINK_DESCRIPTOR_TYPE_SAMPLER_VIEW: - zds->sampler_states = (struct zink_sampler_state**)&samplers[i * pool->key->layout->num_bindings]; + zds->sampler_states = (struct zink_sampler_state**)&samplers[i * num_resources]; FALLTHROUGH; case ZINK_DESCRIPTOR_TYPE_IMAGE: - zds->surfaces = &surfaces[i * pool->key->layout->num_bindings]; + zds->surfaces = &surfaces[i * num_resources]; break; default: - zds->res_objs = (struct zink_resource_object**)&res_objs[i * pool->key->layout->num_bindings]; + zds->res_objs = (struct zink_resource_object**)&res_objs[i * num_resources]; break; } zds->desc_set = desc_set[i];