summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2024-04-27 02:42:48 -0400
committerMarge Bot <emma+marge@anholt.net>2024-05-15 06:42:33 +0000
commit1d3dbb2bef3fef0d873c08fcca8dbf1c11ac8a5e (patch)
tree129edb679e561d9ad0c69249c07756717154cac6
parent96cf96f611f26b80f815c4ef5ebcc24cbd00c937 (diff)
radeonsi: fix the size of the query result SSBO
This was harmless because the shader writes only 4 bytes if the type has 32 bits. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29053>
-rw-r--r--src/gallium/drivers/radeonsi/gfx11_query.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gallium/drivers/radeonsi/gfx11_query.c b/src/gallium/drivers/radeonsi/gfx11_query.c
index 722f91d36a6..b6e5e34100a 100644
--- a/src/gallium/drivers/radeonsi/gfx11_query.c
+++ b/src/gallium/drivers/radeonsi/gfx11_query.c
@@ -322,7 +322,8 @@ static void gfx11_sh_query_get_result_resource(struct si_context *sctx, struct s
consts.config = 1;
}
- if (result_type == PIPE_QUERY_TYPE_I64 || result_type == PIPE_QUERY_TYPE_U64)
+ bool is_result_64bit = result_type == PIPE_QUERY_TYPE_I64 || result_type == PIPE_QUERY_TYPE_U64;
+ if (is_result_64bit)
consts.config |= 8;
constant_buffer.buffer_size = sizeof(consts);
@@ -370,7 +371,7 @@ static void gfx11_sh_query_get_result_resource(struct si_context *sctx, struct s
if (qbuf == query->last) {
ssbo[2].buffer = resource;
ssbo[2].buffer_offset = offset;
- ssbo[2].buffer_size = 8;
+ ssbo[2].buffer_size = is_result_64bit ? 8 : 4;
}
sctx->b.set_constant_buffer(&sctx->b, PIPE_SHADER_COMPUTE, 0, false, &constant_buffer);