vk: Emit PIPELINE_SELECT on demand

This commit is contained in:
Kristian Høgsberg Kristensen
2015-06-11 15:21:49 -07:00
parent 405697eb3d
commit 7637b02aaa
2 changed files with 10 additions and 3 deletions

View File

@@ -2424,10 +2424,8 @@ VkResult anv_BeginCommandBuffer(
{
struct anv_cmd_buffer *cmd_buffer = (struct anv_cmd_buffer *) cmdBuffer;
anv_batch_emit(&cmd_buffer->batch, GEN8_PIPELINE_SELECT,
.PipelineSelection = _3D);
anv_cmd_buffer_emit_state_base_address(cmd_buffer);
cmd_buffer->current_pipeline = UINT32_MAX;
return VK_SUCCESS;
}
@@ -3071,6 +3069,14 @@ anv_cmd_buffer_flush_state(struct anv_cmd_buffer *cmd_buffer)
uint32_t vb_emit = cmd_buffer->vb_dirty & pipeline->vb_used;
assert((pipeline->active_stages & VK_SHADER_STAGE_COMPUTE_BIT) == 0);
if (cmd_buffer->current_pipeline != _3D) {
anv_batch_emit(&cmd_buffer->batch, GEN8_PIPELINE_SELECT,
.PipelineSelection = _3D);
cmd_buffer->current_pipeline = _3D;
}
if (vb_emit) {
const uint32_t num_buffers = __builtin_popcount(vb_emit);
const uint32_t num_dwords = 1 + num_buffers * 4;