From aed66adbd2d2a8f84fcfd936f503df0634fb0bef Mon Sep 17 00:00:00 2001 From: Caterina Shablia Date: Tue, 8 Apr 2025 18:15:00 +0000 Subject: [PATCH] panfrost: don't overwrite push uniforms and sysvals UBO with user's UBO ss->info.ubo_mask includes the push+sysval UBO so if there's a user UBO bound at the same index as the push+sysval UBO, without this change we end up writing a descriptor for the user UBO at that index. Fixes: 3b3cd59f ("panfrost: Launch transform feedback shaders") Cc: mesa-stable Reviewed-by: Boris Brezillon Part-of: (cherry picked from commit 6948ab727f4ad3ca50e8052998a2d0e498bea95d) --- .pick_status.json | 2 +- src/gallium/drivers/panfrost/pan_cmdstream.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 6dc1b2da74c..271f6cf308e 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2414,7 +2414,7 @@ "description": "panfrost: don't overwrite push uniforms and sysvals UBO with user's UBO", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "3b3cd59fb85b5b200acce45f950869eb9d7b69a6", "notes": null diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 83746f20170..9077304f039 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -1459,8 +1459,8 @@ panfrost_emit_const_buf(struct panfrost_batch *batch, panfrost_emit_ubo(ubos.cpu, ubo_count, transfer.gpu, sys_size); /* The rest are honest-to-goodness UBOs */ - - u_foreach_bit(ubo, ss->info.ubo_mask & buf->enabled_mask) { + unsigned user_ubo_mask = ss->info.ubo_mask & BITFIELD_MASK(ubo_count); + u_foreach_bit(ubo, user_ubo_mask & buf->enabled_mask) { size_t usz = buf->cb[ubo].buffer_size; uint64_t address = 0;