summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthew Nicholls <[email protected]>2018-01-19 14:11:48 +0000
committerAlex Smith <[email protected]>2018-01-22 08:57:42 +0000
commit005375717b18b2eb04bdc54a260b096cabab15d2 (patch)
treec38ed1d2ffb94f1ac7be9d0bd9971f791eb864ae /src
parent50485723523d2948a44570ba110f02f726f86a54 (diff)
radv: restore previous stencil reference after depth-stencil clear
Cc: [email protected] Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Alex Smith <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/amd/vulkan/radv_meta_clear.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_meta_clear.c b/src/amd/vulkan/radv_meta_clear.c
index b42ecedfc98..98fb8fa6a7c 100644
--- a/src/amd/vulkan/radv_meta_clear.c
+++ b/src/amd/vulkan/radv_meta_clear.c
@@ -624,6 +624,7 @@ emit_depthstencil_clear(struct radv_cmd_buffer *cmd_buffer,
VK_SHADER_STAGE_VERTEX_BIT, 0, 4,
&clear_value.depth);
+ uint32_t prev_reference = cmd_buffer->state.dynamic.stencil_reference.front;
if (aspects & VK_IMAGE_ASPECT_STENCIL_BIT) {
radv_CmdSetStencilReference(cmd_buffer_h, VK_STENCIL_FACE_FRONT_BIT,
clear_value.stencil);
@@ -658,6 +659,11 @@ emit_depthstencil_clear(struct radv_cmd_buffer *cmd_buffer,
radv_CmdSetScissor(radv_cmd_buffer_to_handle(cmd_buffer), 0, 1, &clear_rect->rect);
radv_CmdDraw(cmd_buffer_h, 3, clear_rect->layerCount, 0, clear_rect->baseArrayLayer);
+
+ if (aspects & VK_IMAGE_ASPECT_STENCIL_BIT) {
+ radv_CmdSetStencilReference(cmd_buffer_h, VK_STENCIL_FACE_FRONT_BIT,
+ prev_reference);
+ }
}
static bool