anv: Account for dynamic stencil write disables in the PMA fix
authorJason Ekstrand <jason@jlekstrand.net>
Mon, 15 Jul 2019 22:14:26 +0000 (17:14 -0500)
committerJason Ekstrand <jason@jlekstrand.net>
Tue, 16 Jul 2019 15:12:45 +0000 (15:12 +0000)
In 6ce8592836b8 we started looking at the dynamic stencil state and
disabling stencil writes when the stencil mask is zero.  Unfortunately,
we never updated the PMA fix code accordingly so 3DSTATE_WM_DEPTH_STENCIL
and the PMA fix were getting out-of-sync causing hangs.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109203
Fixes: 6ce8592836 "anv: Disable stencil writes when both write..."
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/intel/vulkan/gen8_cmd_buffer.c

index 91d47ccf5bdbc405a646f8e57975a7961d67d1bb..3a89b3b5e308db02b873dd5d0cd48c77c48c9054 100644 (file)
@@ -372,6 +372,8 @@ want_stencil_pma_fix(struct anv_cmd_buffer *cmd_buffer)
     */
    const bool stc_write_en =
       (ds_iview->image->aspects & VK_IMAGE_ASPECT_STENCIL_BIT) &&
+      (cmd_buffer->state.gfx.dynamic.stencil_write_mask.front ||
+       cmd_buffer->state.gfx.dynamic.stencil_write_mask.back) &&
       pipeline->writes_stencil;
 
    /* STC_TEST_EN && 3DSTATE_PS_EXTRA::PixelShaderComputesStencil */