vk/gen7: Add func gen7_cmd_buffer_emit_depth_stencil()
authorChad Versace <chad.versace@intel.com>
Fri, 28 Aug 2015 14:46:16 +0000 (07:46 -0700)
committerChad Versace <chad.versace@intel.com>
Fri, 28 Aug 2015 14:46:16 +0000 (07:46 -0700)
This patch moves all the GEN7_3DSTATE_DEPTH_BUFFER code from
gen7_cmd_buffer_begin_subpass() into a new function
gen7_cmd_buffer_emit_depth_stencil().

src/vulkan/gen7_cmd_buffer.c

index 1028b6dae22fb04f57d314c0510454a8899e6615..c157155cd99281fe2bb16b564ca1a1193bbc4f1e 100644 (file)
@@ -525,17 +525,13 @@ void gen7_CmdPipelineBarrier(
    stub();
 }
 
-void
-gen7_cmd_buffer_begin_subpass(struct anv_cmd_buffer *cmd_buffer,
-                             struct anv_subpass *subpass)
+static void
+gen7_cmd_buffer_emit_depth_stencil(struct anv_cmd_buffer *cmd_buffer)
 {
+   struct anv_subpass *subpass = cmd_buffer->state.subpass;
    struct anv_framebuffer *fb = cmd_buffer->state.framebuffer;
    const struct anv_depth_stencil_view *view = NULL;
 
-   cmd_buffer->state.subpass = subpass;
-
-   cmd_buffer->state.descriptors_dirty |= VK_SHADER_STAGE_FRAGMENT_BIT;
-
    if (subpass->depth_stencil_attachment != VK_ATTACHMENT_UNUSED) {
       const struct anv_attachment_view *aview =
          fb->attachments[subpass->depth_stencil_attachment];
@@ -606,6 +602,16 @@ gen7_cmd_buffer_begin_subpass(struct anv_cmd_buffer *cmd_buffer,
    anv_batch_emit(&cmd_buffer->batch, GEN7_3DSTATE_CLEAR_PARAMS);
 }
 
+void
+gen7_cmd_buffer_begin_subpass(struct anv_cmd_buffer *cmd_buffer,
+                             struct anv_subpass *subpass)
+{
+   cmd_buffer->state.subpass = subpass;
+   cmd_buffer->state.descriptors_dirty |= VK_SHADER_STAGE_FRAGMENT_BIT;
+
+   gen7_cmd_buffer_emit_depth_stencil(cmd_buffer);
+}
+
 static void
 begin_render_pass(struct anv_cmd_buffer *cmd_buffer,
                   const VkRenderPassBeginInfo* pRenderPassBegin)