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>
This commit is contained in:
Marek Olšák 2024-04-27 02:42:48 -04:00 committed by Marge Bot
parent 96cf96f611
commit 1d3dbb2bef

View file

@ -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);