vbuffer_index = rctx->vertex_elements->elements[i].vertex_buffer_index;
vertex_buffer = &rctx->vertex_buffer[vbuffer_index];
rbuffer = (struct r600_resource*)vertex_buffer->buffer;
- offset = rctx->vertex_elements->vbuffer_offset[i] +
- vertex_buffer->buffer_offset +
- r600_bo_offset(rbuffer->bo);
+ offset = rctx->vertex_elements->vbuffer_offset[i];
} else {
/* bind vertex buffer once */
vertex_buffer = &rctx->vertex_buffer[i];
rbuffer = (struct r600_resource*)vertex_buffer->buffer;
- offset = vertex_buffer->buffer_offset +
- r600_bo_offset(rbuffer->bo);
+ offset = 0;
}
+ if (vertex_buffer == NULL)
+ continue;
+ offset += vertex_buffer->buffer_offset + r600_bo_offset(rbuffer->bo);
r600_pipe_state_add_reg(rstate, R_030000_RESOURCE0_WORD0,
offset, 0xFFFFFFFF, rbuffer->bo);
vbuffer_index = rctx->vertex_elements->elements[i].vertex_buffer_index;
vertex_buffer = &rctx->vertex_buffer[vbuffer_index];
rbuffer = (struct r600_resource*)vertex_buffer->buffer;
- offset = rctx->vertex_elements->vbuffer_offset[i] +
- vertex_buffer->buffer_offset +
- r600_bo_offset(rbuffer->bo);
+ offset = rctx->vertex_elements->vbuffer_offset[i];
} else {
/* bind vertex buffer once */
vertex_buffer = &rctx->vertex_buffer[i];
rbuffer = (struct r600_resource*)vertex_buffer->buffer;
- offset = vertex_buffer->buffer_offset +
- r600_bo_offset(rbuffer->bo);
+ offset = 0;
}
+ if (vertex_buffer == NULL)
+ continue;
+ offset += vertex_buffer->buffer_offset + r600_bo_offset(rbuffer->bo);
r600_pipe_state_add_reg(rstate, R_038000_RESOURCE0_WORD0,
offset, 0xFFFFFFFF, rbuffer->bo);
struct pipe_vertex_buffer *vbo;
unsigned max_index = (unsigned)-1;
- for (int i = 0; i < rctx->nvertex_buffer; i++) {
- pipe_resource_reference(&rctx->vertex_buffer[i].buffer, NULL);
+ if (rctx->family >= CHIP_CEDAR) {
+ for (int i = 0; i < rctx->nvertex_buffer; i++) {
+ pipe_resource_reference(&rctx->vertex_buffer[i].buffer, NULL);
+ evergreen_fs_resource_set(&rctx->ctx, NULL, i);
+ }
+ } else {
+ for (int i = 0; i < rctx->nvertex_buffer; i++) {
+ pipe_resource_reference(&rctx->vertex_buffer[i].buffer, NULL);
+ r600_context_pipe_state_set_fs_resource(&rctx->ctx, NULL, i);
+ }
}
memcpy(rctx->vertex_buffer, buffers, sizeof(struct pipe_vertex_buffer) * count);
vbo = (struct pipe_vertex_buffer*)&buffers[i];
rctx->vertex_buffer[i].buffer = NULL;
+ if (buffers[i].buffer == NULL)
+ continue;
if (r600_buffer_is_user_buffer(buffers[i].buffer))
rctx->any_user_vbs = TRUE;
pipe_resource_reference(&rctx->vertex_buffer[i].buffer, buffers[i].buffer);