From: Chad Versace Date: Fri, 28 Aug 2015 14:46:16 +0000 (-0700) Subject: vk/gen7: Add func gen7_cmd_buffer_emit_depth_stencil() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=35b0262a2d80b8b21dfccaf9a099278d3f3f6a6c;p=mesa.git vk/gen7: Add func gen7_cmd_buffer_emit_depth_stencil() 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(). --- diff --git a/src/vulkan/gen7_cmd_buffer.c b/src/vulkan/gen7_cmd_buffer.c index 1028b6dae22..c157155cd99 100644 --- a/src/vulkan/gen7_cmd_buffer.c +++ b/src/vulkan/gen7_cmd_buffer.c @@ -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)