anv/cmd_buffer: Look at both sides for stencil enable
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 1 Mar 2016 18:59:21 +0000 (10:59 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 1 Mar 2016 19:03:29 +0000 (11:03 -0800)
Now it's all consistent with gen9

src/intel/vulkan/gen7_cmd_buffer.c
src/intel/vulkan/gen8_cmd_buffer.c

index 09025ef232368a7e5eb8b9e0c3ece476861c780e..3ed93137f6a66ce41385e035392ef4658b263ef9 100644 (file)
@@ -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,
index 8a0fe60db33f2b4a60508d8af6dee429e4154718..884152da20766f0132dc8b225d31b28fd6782dbc 100644 (file)
@@ -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,