mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-18 06:10:36 +01:00
util/draw: fix map size of indirect buffer in util_draw_indirect_read
this was incorrectly calculating too small of a map region if
the stride was less than the size of the struct
Fixes: 3eb9932317 ("aux/draw: add a util function for reading back indirect draw params")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15963>
This commit is contained in:
parent
31727f114a
commit
efca37d415
1 changed files with 2 additions and 3 deletions
|
|
@ -158,12 +158,11 @@ util_draw_indirect_read(struct pipe_context *pipe,
|
|||
if (!draws)
|
||||
return NULL;
|
||||
|
||||
if (indirect->stride)
|
||||
num_params = MIN2(indirect->stride / 4, num_params);
|
||||
unsigned map_size = (draw_count - 1) * indirect->stride + (num_params * sizeof(uint32_t));
|
||||
params = pipe_buffer_map_range(pipe,
|
||||
indirect->buffer,
|
||||
indirect->offset,
|
||||
(num_params * indirect->draw_count) * sizeof(uint32_t),
|
||||
map_size,
|
||||
PIPE_MAP_READ,
|
||||
&transfer);
|
||||
if (!transfer) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue