/* The vertex buffer slot index where translated vertices have been
* stored in. */
unsigned fallback_vbs[VB_NUM];
+ unsigned fallback_vbs_mask;
/* Which buffer is a user buffer. */
uint32_t user_vb_mask; /* each bit describes a corresp. buffer */
return FALSE;
memset(fallback_vbs, ~0, sizeof(fallback_vbs));
+ mgr->fallback_vbs_mask = 0;
/* Find free slots for each type if needed. */
unused_vb_mask_orig = unused_vb_mask;
index = ffs(unused_vb_mask) - 1;
fallback_vbs[type] = index;
+ mgr->fallback_vbs_mask |= 1 << index;
unused_vb_mask &= ~(1 << index);
/*printf("found slot=%i for type=%i\n", index, type);*/
}
uint32_t index = ffs(unused_vb_mask_orig) - 1;
/* When sharing one vertex buffer use per-vertex frequency for everything. */
fallback_vbs[VB_VERTEX] = index;
+ mgr->fallback_vbs_mask = 1 << index;
mask[VB_VERTEX] = mask[VB_VERTEX] | mask[VB_CONST] | mask[VB_INSTANCE];
mask[VB_CONST] = 0;
mask[VB_INSTANCE] = 0;
if (vb != ~0u) {
pipe_resource_reference(&mgr->real_vertex_buffer[vb].buffer.resource, NULL);
mgr->fallback_vbs[i] = ~0;
-
- /* This will cause the buffer to be unbound in the driver later. */
- mgr->dirty_real_vb_mask |= 1 << vb;
}
}
+ /* This will cause the buffer to be unbound in the driver later. */
+ mgr->dirty_real_vb_mask |= mgr->fallback_vbs_mask;
+ mgr->fallback_vbs_mask = 0;
}
static void *
unsigned instance_div, first, size, index_bit;
/* Skip the buffers generated by translate. */
- if (index == mgr->fallback_vbs[VB_VERTEX] ||
- index == mgr->fallback_vbs[VB_INSTANCE] ||
- index == mgr->fallback_vbs[VB_CONST]) {
+ if ((1 << index) & mgr->fallback_vbs_mask) {
continue;
}