mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-04 12:40:36 +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);
|
||||
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
|
||||
* stride here. */
|
||||
queries_per_batch = MIN2(((1u << 15) / stride) + 1, queries_per_batch);
|
||||
if (stride > 0) {
|
||||
/* Store offset is a 16-bit signed integer, so we might be limited by the
|
||||
* 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
|
||||
* queries. */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue