The number of const shared registers was being used for the allocation size
rather than the number of bytes. In practice this doesn't make a difference as
the max allocation size is 24 bytes, which then gets rounded up to 64 bytes by
the buffer allocation function. However, we might as well make the allocation
size correct to avoid any future confusion. Noticed through code inspection.
Fixes:
7509e259f85 ("pvr: Implement color/depth/depth+stencil attachment clear.")
Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25489>
/* TODO: This doesn't need to be aligned to slc size. Alignment to 4 is fine.
* Change pvr_cmd_buffer_alloc_mem() to take in an alignment?
*/
- result = pvr_cmd_buffer_alloc_mem(cmd_buffer,
- device->heaps.general_heap,
- shader_info->const_shared_regs,
- &const_shareds_buffer);
+ result =
+ pvr_cmd_buffer_alloc_mem(cmd_buffer,
+ device->heaps.general_heap,
+ PVR_DW_TO_BYTES(shader_info->const_shared_regs),
+ &const_shareds_buffer);
if (result != VK_SUCCESS)
return result;