if (sctx->vertex_buffer_pointer_dirty) {
cik_prefetch_TC_L2_async(sctx, &sctx->vertex_buffers.buffer->b.b,
sctx->vertex_buffers.buffer_offset,
- sctx->vertex_elements->count * 16);
+ sctx->vertex_elements->desc_list_byte_size);
}
if (si_pm4_state_changed(sctx, ps))
cik_prefetch_shader_async(sctx, sctx->queued.named.ps);
* directly through a staging buffer and don't go through
* the fine-grained upload path.
*/
- u_upload_alloc(sctx->b.uploader, 0, count * 16, 256, &desc->buffer_offset,
+ u_upload_alloc(sctx->b.uploader, 0, velems->desc_list_byte_size, 256,
+ &desc->buffer_offset,
(struct pipe_resource**)&desc->buffer, (void**)&ptr);
if (!desc->buffer)
return false;
return NULL;
v->count = count;
+ v->desc_list_byte_size = align(count * 16, SI_CPDMA_ALIGNMENT);
+
for (i = 0; i < count; ++i) {
const struct util_format_description *desc;
const struct util_format_channel_description *channel;
{
unsigned count;
unsigned first_vb_use_mask;
+ /* Vertex buffer descriptor list size aligned for optimal prefetch. */
+ unsigned desc_list_byte_size;
/* Two bits per attribute indicating the size of each vector component
* in bytes if the size 3-workaround must be applied.