radv: fix a performance regression with graphics depth/stencil clears
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 22 Oct 2019 14:43:56 +0000 (16:43 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 23 Oct 2019 08:23:47 +0000 (10:23 +0200)
commitf11ea2266644a016a898744d1283d83ab63f4fb2
tree392d45608b9e0c0697db33b59eda885f8879adc2
parent7562a2cbe3e963247f32d6bd9d434036ad1a93dc
radv: fix a performance regression with graphics depth/stencil clears

I recently changed the slow depth/stencil clear path to make sure
depth values are explicitly exported by the fragment shader. This
is actually only useful when VK_EXT_depth_range_unrestricted is
enabled.

While this path is correct, it introduced a performance regression
with Heroes of the Storm, Shadow of Mordor (Vulkan beta) and
probably more titles. This is because it prevents the hardware
to do some optimizations like discarding fragments.

This commit re-introduces the previous (a bit faster) slow
depth/stencil clear path and it selects the unrestricted path
only if VK_EXT_depth_range_unrestricted is enabled.

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/863
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_meta_clear.c
src/amd/vulkan/radv_private.h