switch (secondary->exec_mode) {
case ANV_CMD_BUFFER_EXEC_MODE_EMIT:
anv_batch_emit_batch(&primary->batch, &secondary->batch);
- anv_cmd_buffer_emit_state_base_address(primary);
break;
case ANV_CMD_BUFFER_EXEC_MODE_GROW_AND_EMIT: {
struct anv_batch_bo *bbo = anv_cmd_buffer_current_batch_bo(primary);
anv_batch_bo_grow(primary, bbo, &primary->batch, length,
GEN8_MI_BATCH_BUFFER_START_length * 4);
anv_batch_emit_batch(&primary->batch, &secondary->batch);
- anv_cmd_buffer_emit_state_base_address(primary);
break;
}
case ANV_CMD_BUFFER_EXEC_MODE_CHAIN: {
p += CACHELINE_SIZE;
}
}
-
- anv_cmd_buffer_emit_state_base_address(primary);
break;
}
case ANV_CMD_BUFFER_EXEC_MODE_COPY_AND_CHAIN: {
anv_batch_bo_continue(last_bbo, &primary->batch,
GEN8_MI_BATCH_BUFFER_START_length * 4);
-
- anv_cmd_buffer_emit_state_base_address(primary);
break;
}
default:
anv_cmd_buffer_add_secondary(primary, secondary);
}
+
+ /* Each of the secondary command buffers will use its own state base
+ * address. We need to re-emit state base address for the primary after
+ * all of the secondaries are done.
+ *
+ * TODO: Maybe we want to make this a dirty bit to avoid extra state base
+ * address calls?
+ */
+ anv_cmd_buffer_emit_state_base_address(primary);
}
VkResult anv_CreateCommandPool(