From: Jason Ekstrand Date: Tue, 1 Mar 2016 18:59:21 +0000 (-0800) Subject: anv/cmd_buffer: Look at both sides for stencil enable X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6e20c1e058d7449c800506d05cd1c6431fa77a4b;p=mesa.git anv/cmd_buffer: Look at both sides for stencil enable Now it's all consistent with gen9 --- diff --git a/src/intel/vulkan/gen7_cmd_buffer.c b/src/intel/vulkan/gen7_cmd_buffer.c index 09025ef2323..3ed93137f6a 100644 --- a/src/intel/vulkan/gen7_cmd_buffer.c +++ b/src/intel/vulkan/gen7_cmd_buffer.c @@ -586,11 +586,9 @@ genX(cmd_buffer_flush_state)(struct anv_cmd_buffer *cmd_buffer) uint32_t depth_stencil_dw[GENX(DEPTH_STENCIL_STATE_length)]; struct anv_dynamic_state *d = &cmd_buffer->state.dynamic; - const struct anv_image_view *iview = - anv_cmd_buffer_get_depth_stencil_view(cmd_buffer); - struct GENX(DEPTH_STENCIL_STATE) depth_stencil = { - .StencilBufferWriteEnable = iview && (iview->aspect_mask & VK_IMAGE_ASPECT_STENCIL_BIT), + .StencilBufferWriteEnable = d->stencil_write_mask.front != 0 || + d->stencil_write_mask.back != 0, .StencilTestMask = d->stencil_compare_mask.front & 0xff, .StencilWriteMask = d->stencil_write_mask.front & 0xff, diff --git a/src/intel/vulkan/gen8_cmd_buffer.c b/src/intel/vulkan/gen8_cmd_buffer.c index 8a0fe60db33..884152da207 100644 --- a/src/intel/vulkan/gen8_cmd_buffer.c +++ b/src/intel/vulkan/gen8_cmd_buffer.c @@ -388,8 +388,8 @@ genX(cmd_buffer_flush_state)(struct anv_cmd_buffer *cmd_buffer) struct GENX(3DSTATE_WM_DEPTH_STENCIL wm_depth_stencil) = { GENX(3DSTATE_WM_DEPTH_STENCIL_header), - /* Is this what we need to do? */ - .StencilBufferWriteEnable = d->stencil_write_mask.front != 0, + .StencilBufferWriteEnable = d->stencil_write_mask.front != 0 || + d->stencil_write_mask.back != 0, .StencilTestMask = d->stencil_compare_mask.front & 0xff, .StencilWriteMask = d->stencil_write_mask.front & 0xff,