summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/gen7_cmd_buffer.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-12-07 20:31:12 -0800
committerJason Ekstrand <[email protected]>2017-02-14 14:18:55 -0800
commit6ce8592836b84f12bfe60de9f7913bfab11b8ef5 (patch)
treecc9155ff76eadf2be61b05731363762bff3ea952 /src/intel/vulkan/gen7_cmd_buffer.c
parent114c281e707919a1420d3a20219ce4392d8b360d (diff)
anv: Disable stencil writes when both write masks are zero
Vulkan doesn't have a stencilWriteEnable bit like it does for depth. Instead, you have a stencil mask. Since the stencil mask is handled as dynamic state, we have to handle it later during command buffer construction. This, combined with a later commit, seems to help Dota2 on my Broadwell GT3e desktop by a couple percent because it allows the hardware to move the depth and stencil writes to early in more cases. Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Nanley Chery <[email protected]>
Diffstat (limited to 'src/intel/vulkan/gen7_cmd_buffer.c')
-rw-r--r--src/intel/vulkan/gen7_cmd_buffer.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/intel/vulkan/gen7_cmd_buffer.c b/src/intel/vulkan/gen7_cmd_buffer.c
index 8d68aba9c9a..013ed8718a4 100644
--- a/src/intel/vulkan/gen7_cmd_buffer.c
+++ b/src/intel/vulkan/gen7_cmd_buffer.c
@@ -212,6 +212,10 @@ genX(cmd_buffer_flush_dynamic_state)(struct anv_cmd_buffer *cmd_buffer)
.BackfaceStencilTestMask = d->stencil_compare_mask.back & 0xff,
.BackfaceStencilWriteMask = d->stencil_write_mask.back & 0xff,
+
+ .StencilBufferWriteEnable =
+ (d->stencil_write_mask.front || d->stencil_write_mask.back) &&
+ pipeline->writes_stencil,
};
GENX(DEPTH_STENCIL_STATE_pack)(NULL, depth_stencil_dw, &depth_stencil);