struct iris_vertex_buffer_state {
uint32_t vertex_buffers[1 + 33 * GENX(VERTEX_BUFFER_STATE_length)];
- struct iris_bo *bos[33];
+ struct pipe_resource *resources[33];
unsigned num_buffers;
};
{
if (cso) {
for (unsigned i = 0; i < cso->num_buffers; i++)
- iris_bo_unreference(cso->bos[i]);
+ pipe_resource_reference(&cso->resources[i], NULL);
free(cso);
}
}
return;
struct iris_vertex_buffer_state *cso =
- malloc(sizeof(struct iris_vertex_buffer_state));
+ calloc(1, sizeof(struct iris_vertex_buffer_state));
iris_free_vertex_buffers(ice->state.cso_vertex_buffers);
for (unsigned i = 0; i < count; i++) {
assert(!buffers[i].is_user_buffer);
- struct iris_resource *res = (void *) buffers[i].buffer.resource;
- iris_bo_reference(res->bo);
- cso->bos[i] = res->bo;
+ pipe_resource_reference(&cso->resources[i], buffers[i].buffer.resource);
+ struct iris_resource *res = (void *) cso->resources[i];
iris_pack_state(GENX(VERTEX_BUFFER_STATE), vb_pack_dest, vb) {
vb.VertexBufferIndex = start_slot + i;
if (clean & IRIS_DIRTY_VERTEX_BUFFERS) {
struct iris_vertex_buffer_state *cso = ice->state.cso_vertex_buffers;
for (unsigned i = 0; i < cso->num_buffers; i++) {
- iris_use_pinned_bo(batch, cso->bos[i], false);
+ struct iris_resource *res = (void *) cso->resources[i];
+ iris_use_pinned_bo(batch, res->bo, false);
}
}
}
sizeof(uint32_t) * (1 + vb_dwords * cso->num_buffers));
for (unsigned i = 0; i < cso->num_buffers; i++) {
- iris_use_pinned_bo(batch, cso->bos[i], false);
+ struct iris_resource *res = (void *) cso->resources[i];
+ iris_use_pinned_bo(batch, res->bo, false);
}
}