mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
panvk: Avoid division by zero for vkCmdCopyQueryPoolResults
Stride can be zero if there are less than two queries to copy.
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Fixes: 7755c41b3e ("panvk/csf: Rework the occlusion query logic to avoid draw flushes")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34020>
This commit is contained in:
parent
43c99d3928
commit
8a47ae456c
1 changed files with 5 additions and 3 deletions
|
|
@ -258,9 +258,11 @@ panvk_copy_occlusion_query_results(struct panvk_cmd_buffer *cmd,
|
||||||
struct cs_index scratch_regs = cs_scratch_reg_tuple(b, 0, 11);
|
struct cs_index scratch_regs = cs_scratch_reg_tuple(b, 0, 11);
|
||||||
uint32_t queries_per_batch = scratch_regs.size / regs_per_copy;
|
uint32_t queries_per_batch = scratch_regs.size / regs_per_copy;
|
||||||
|
|
||||||
/* Store offset is a 16-bit signed integer, so we might be limited by the
|
if (stride > 0) {
|
||||||
* stride here. */
|
/* Store offset is a 16-bit signed integer, so we might be limited by the
|
||||||
queries_per_batch = MIN2(((1u << 15) / stride) + 1, queries_per_batch);
|
* stride here. */
|
||||||
|
queries_per_batch = MIN2(((1u << 15) / stride) + 1, queries_per_batch);
|
||||||
|
}
|
||||||
|
|
||||||
/* Stop unrolling the loop when it takes more than 2 steps to copy the
|
/* Stop unrolling the loop when it takes more than 2 steps to copy the
|
||||||
* queries. */
|
* queries. */
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue