From baba0ca1f672bf71cc69c1dc5ec696c5c5e5a4ef Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 9 May 2023 19:28:18 -0400 Subject: [PATCH] zink: adjust bindless texel buffer handle before indexing buffer handle ids are offset by ZINK_MAX_BINDLESS_HANDLES, but the actual index is zero-based Fixes: 99ba529feed ("zink: implement descriptor buffer handling of bindless texture") Part-of: (cherry picked from commit 2df7ee528c6f499a5d29210a335fb91c3bef4741) --- .pick_status.json | 2 +- src/gallium/drivers/zink/zink_descriptors.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 96d63060818..ab540ea7699 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -139,7 +139,7 @@ "description": "zink: adjust bindless texel buffer handle before indexing", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "99ba529feed6f9917a44458a38acaf0b3d6d261d" }, diff --git a/src/gallium/drivers/zink/zink_descriptors.c b/src/gallium/drivers/zink/zink_descriptors.c index 359bf6ccd8e..af1aa5d07eb 100644 --- a/src/gallium/drivers/zink/zink_descriptors.c +++ b/src/gallium/drivers/zink/zink_descriptors.c @@ -1775,7 +1775,7 @@ zink_descriptors_update_bindless(struct zink_context *ctx) if (is_buffer) { size_t size = i ? screen->info.db_props.robustStorageTexelBufferDescriptorSize : screen->info.db_props.robustUniformTexelBufferDescriptorSize; info.type = i ? VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER : VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER; - info.data.pSampler = (void*)&ctx->di.bindless[i].db.buffer_infos[handle]; + info.data.pSampler = (void*)&ctx->di.bindless[i].db.buffer_infos[handle - ZINK_MAX_BINDLESS_HANDLES]; VKSCR(GetDescriptorEXT)(screen->dev, &info, size, ctx->dd.db.bindless_db_map + ctx->dd.db.bindless_db_offsets[binding] + handle * size); } else { info.type = i ? VK_DESCRIPTOR_TYPE_STORAGE_IMAGE : VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER;