From: Kristian Høgsberg Kristensen Date: Thu, 7 Jan 2016 00:41:22 +0000 (-0800) Subject: vk: Issue PIPELINE_SELECT before setting up render pass X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=067dbd7a17e04cacf74fd08f5bc8a692fb68e202;p=mesa.git vk: Issue PIPELINE_SELECT before setting up render pass We need to make sure we're selected the 3D pipeline before we start setting up depth and stencil buffers. --- diff --git a/src/vulkan/gen8_cmd_buffer.c b/src/vulkan/gen8_cmd_buffer.c index 9b03b0a5c56..74f7e32952d 100644 --- a/src/vulkan/gen8_cmd_buffer.c +++ b/src/vulkan/gen8_cmd_buffer.c @@ -145,15 +145,8 @@ gen8_cmd_buffer_emit_viewport(struct anv_cmd_buffer *cmd_buffer) #endif static void -cmd_buffer_flush_state(struct anv_cmd_buffer *cmd_buffer) +flush_pipeline_select_3d(struct anv_cmd_buffer *cmd_buffer) { - struct anv_pipeline *pipeline = cmd_buffer->state.pipeline; - uint32_t *p; - - uint32_t vb_emit = cmd_buffer->state.vb_dirty & pipeline->vb_used; - - assert((pipeline->active_stages & VK_SHADER_STAGE_COMPUTE_BIT) == 0); - if (cmd_buffer->state.current_pipeline != _3D) { anv_batch_emit(&cmd_buffer->batch, GENX(PIPELINE_SELECT), #if ANV_GEN >= 9 @@ -162,6 +155,19 @@ cmd_buffer_flush_state(struct anv_cmd_buffer *cmd_buffer) .PipelineSelection = _3D); cmd_buffer->state.current_pipeline = _3D; } +} + +static void +cmd_buffer_flush_state(struct anv_cmd_buffer *cmd_buffer) +{ + struct anv_pipeline *pipeline = cmd_buffer->state.pipeline; + uint32_t *p; + + uint32_t vb_emit = cmd_buffer->state.vb_dirty & pipeline->vb_used; + + assert((pipeline->active_stages & VK_SHADER_STAGE_COMPUTE_BIT) == 0); + + flush_pipeline_select_3d(cmd_buffer); if (vb_emit) { const uint32_t num_buffers = __builtin_popcount(vb_emit); @@ -807,6 +813,8 @@ void genX(CmdBeginRenderPass)( cmd_buffer->state.framebuffer = framebuffer; cmd_buffer->state.pass = pass; + flush_pipeline_select_3d(cmd_buffer); + const VkRect2D *render_area = &pRenderPassBegin->renderArea; anv_batch_emit(&cmd_buffer->batch, GENX(3DSTATE_DRAWING_RECTANGLE),