From 077a238f66c2af16194a5cb40ed53b7c55fdeb3d Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Thu, 30 Aug 2018 12:05:06 -0500 Subject: [PATCH] anv/blorp: Emit depth flush and stall prior to HiZ clears We had the flush/stall after the clear but missed the one that needs to go before the clear. Cc: mesa-stable@lists.freedesktop.org Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107760 --- src/intel/vulkan/anv_blorp.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/intel/vulkan/anv_blorp.c b/src/intel/vulkan/anv_blorp.c index 3dfc8087630..532e8185c0e 100644 --- a/src/intel/vulkan/anv_blorp.c +++ b/src/intel/vulkan/anv_blorp.c @@ -1605,6 +1605,16 @@ anv_image_hiz_clear(struct anv_cmd_buffer *cmd_buffer, ISL_AUX_USAGE_NONE, &stencil); } + /* From the Sky Lake PRM Volume 7, "Depth Buffer Clear": + * + * "If other rendering operations have preceded this clear, a + * PIPE_CONTROL with depth cache flush enabled, Depth Stall bit enabled + * must be issued before the rectangle primitive used for the depth + * buffer clear operation." + */ + cmd_buffer->state.pending_pipe_bits |= + ANV_PIPE_DEPTH_CACHE_FLUSH_BIT | ANV_PIPE_DEPTH_STALL_BIT; + blorp_hiz_clear_depth_stencil(&batch, &depth, &stencil, level, base_layer, layer_count, area.offset.x, area.offset.y, -- 2.17.1