lavapipe: fix accel struct device query copy

This change:
1. use vulkan flags instead of pipe query flags
2. set the avail bit when requested

Fixes: a26f96ed3d ("lavapipe: Handle accel struct queries in handle_copy_query_pool_results")
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33951>
This commit is contained in:
Yiwei Zhang 2025-03-07 13:46:37 -08:00 committed by Marge Bot
parent bc190cab2d
commit e538a38017

View file

@ -2965,14 +2965,18 @@ static void handle_copy_query_pool_results(struct vk_cmd_queue_entry *cmd,
uint8_t *map = pipe_buffer_map(state->pctx, lvp_buffer_from_handle(copycmd->dst_buffer)->bo, PIPE_MAP_WRITE, &transfer);
map += offset;
if (flags & VK_QUERY_RESULT_64_BIT) {
if (copycmd->flags & VK_QUERY_RESULT_64_BIT) {
uint64_t *dst = (uint64_t *)map;
uint64_t *src = (uint64_t *)pool->data;
*dst = src[i];
if (copycmd->flags & VK_QUERY_RESULT_WITH_AVAILABILITY_BIT)
*(dst + 1) = 1;
} else {
uint32_t *dst = (uint32_t *)map;
uint64_t *src = (uint64_t *)pool->data;
*dst = (uint32_t) (src[i] & UINT32_MAX);
if (copycmd->flags & VK_QUERY_RESULT_WITH_AVAILABILITY_BIT)
*(dst + 1) = 1;
}
state->pctx->buffer_unmap(state->pctx, transfer);