panvk: widen type before multiplying

This function returns an uint64_t, but returns the result of two
uint32_t values. If we don't widen at least one of them before
returning, the multiplication wraps large results.

So let's widen the type first, so we can preserve large offsets.

Fixes: d1934e44fc ("panvk: Implement occlusion queries for JM")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
CID: 1634943
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32380>
This commit is contained in:
Erik Faye-Lund 2024-11-27 17:16:56 +01:00 committed by Marge Bot
parent 2c6bc9615d
commit 14bca200be

View file

@ -65,7 +65,7 @@ static uint64_t
panvk_query_offset(struct panvk_query_pool *pool, uint32_t query)
{
assert(query < pool->vk.query_count);
return query * pool->query_stride;
return query * (uint64_t)pool->query_stride;
}
static uint64_t