* stride from the pipeline. */
for (uint32_t i = 0; i < bindingCount; i++) {
- cmd_buffer->vb[startBinding + i].buffer = (struct anv_buffer *) pBuffers[i];
- cmd_buffer->vb[startBinding + i].offset = pOffsets[i];
+ cmd_buffer->bindings.vb[startBinding + i].buffer = (struct anv_buffer *) pBuffers[i];
+ cmd_buffer->bindings.vb[startBinding + i].offset = pOffsets[i];
cmd_buffer->vb_dirty |= 1 << (startBinding + i);
}
}
GEN8_3DSTATE_VERTEX_BUFFERS);
uint32_t vb, i = 0;
for_each_bit(vb, cmd_buffer->vb_dirty) {
- struct anv_buffer *buffer = cmd_buffer->vb[vb].buffer;
- uint32_t offset = cmd_buffer->vb[vb].offset;
+ struct anv_buffer *buffer = cmd_buffer->bindings.vb[vb].buffer;
+ uint32_t offset = cmd_buffer->bindings.vb[vb].offset;
struct GEN8_VERTEX_BUFFER_STATE state = {
.VertexBufferIndex = vb,
&device->clear_state.rs_state);
}
+#define NUM_VB_USED 2
struct anv_saved_state {
- struct {
- struct anv_buffer *buffer;
- VkDeviceSize offset;
- } vb[2];
struct anv_bindings bindings;
struct anv_pipeline *pipeline;
};
anv_cmd_buffer_save(struct anv_cmd_buffer *cmd_buffer,
struct anv_saved_state *state)
{
- memcpy(state->vb, cmd_buffer->vb, sizeof(state->vb));
memcpy(&state->bindings, &cmd_buffer->bindings, sizeof(state->bindings));
state->pipeline = cmd_buffer->pipeline;
}
anv_cmd_buffer_restore(struct anv_cmd_buffer *cmd_buffer,
const struct anv_saved_state *state)
{
- memcpy(cmd_buffer->vb, state->vb, sizeof(state->vb));
memcpy(&cmd_buffer->bindings, &state->bindings, sizeof(state->bindings));
cmd_buffer->pipeline = state->pipeline;
- cmd_buffer->vb_dirty |= (1 << ARRAY_SIZE(state->vb)) - 1;
+ cmd_buffer->vb_dirty |= (1 << NUM_VB_USED) - 1;
cmd_buffer->dirty |= ANV_CMD_BUFFER_PIPELINE_DIRTY |
ANV_CMD_BUFFER_DESCRIPTOR_SET_DIRTY;
}
#define ANV_CMD_BUFFER_RS_DIRTY (1 << 2)
struct anv_bindings {
+ struct {
+ struct anv_buffer *buffer;
+ VkDeviceSize offset;
+ } vb[MAX_VBS];
+
struct {
uint32_t surfaces[256];
struct {
struct anv_state_stream dynamic_state_stream;
/* State required while building cmd buffer */
- struct {
- struct anv_buffer *buffer;
- VkDeviceSize offset;
- } vb[MAX_VBS];
uint32_t vb_dirty;
uint32_t dirty;
struct anv_pipeline * pipeline;