mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-27 04:00:10 +01:00
panfrost: Only emit images when they are present
nr_images is the trigger for allocating double the number of buffers
for attributes. When there are no images, there is not always enough
space for ALIGN_POT(k, 2) to not move k out of bounds, so don't
execute the line in that case.
Fixes: dc85f65e05 ("panfrost: emit shader image attribute descriptors")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17447>
This commit is contained in:
parent
240835cfb0
commit
fe613a8de9
1 changed files with 6 additions and 4 deletions
|
|
@ -2165,10 +2165,12 @@ panfrost_emit_vertex_data(struct panfrost_batch *batch,
|
|||
}
|
||||
#endif
|
||||
|
||||
k = ALIGN_POT(k, 2);
|
||||
emit_image_attribs(ctx, PIPE_SHADER_VERTEX, out + so->num_elements, k);
|
||||
emit_image_bufs(batch, PIPE_SHADER_VERTEX, bufs + k, k);
|
||||
k += (util_last_bit(ctx->image_mask[PIPE_SHADER_VERTEX]) * 2);
|
||||
if (nr_images) {
|
||||
k = ALIGN_POT(k, 2);
|
||||
emit_image_attribs(ctx, PIPE_SHADER_VERTEX, out + so->num_elements, k);
|
||||
emit_image_bufs(batch, PIPE_SHADER_VERTEX, bufs + k, k);
|
||||
k += (util_last_bit(ctx->image_mask[PIPE_SHADER_VERTEX]) * 2);
|
||||
}
|
||||
|
||||
#if PAN_ARCH >= 6
|
||||
/* We need an empty attrib buf to stop the prefetching on Bifrost */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue