From: Bas Nieuwenhuizen Date: Sun, 5 Jul 2020 16:57:35 +0000 (+0200) Subject: radv: Always enable PERFECT_ZPASS_COUNTS. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ad913a18b14f25b4f6995cb8a8b0c55c747029d8;p=mesa.git radv: Always enable PERFECT_ZPASS_COUNTS. We have an issue with early depth testing and discard, where non-perfect counts count the tile if the early depth test succeeds. We could spend a lot of effort to set this conditionally based on the presence of the two conditions, but in the presence of inherited queries let's try this first. Changing PERFECT_ZPASS_COUNTS since I'm pretty sure this has a lower performance impact than always using late depth testing. CC: Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3218 Reviewed-by: Samuel Pitoiset Part-of: --- diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index 695aa257c31..5ff1f3121c2 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -2171,8 +2171,11 @@ void radv_set_db_count_control(struct radv_cmd_buffer *cmd_buffer) bool gfx10_perfect = cmd_buffer->device->physical_device->rad_info.chip_class >= GFX10 && has_perfect_queries; if (cmd_buffer->device->physical_device->rad_info.chip_class >= GFX7) { + /* Always enable PERFECT_ZPASS_COUNTS due to issues with partially + * covered tiles, discards, and early depth testing. For more details, + * see https://gitlab.freedesktop.org/mesa/mesa/-/issues/3218 */ db_count_control = - S_028004_PERFECT_ZPASS_COUNTS(has_perfect_queries) | + S_028004_PERFECT_ZPASS_COUNTS(1) | S_028004_DISABLE_CONSERVATIVE_ZPASS_COUNTS(gfx10_perfect) | S_028004_SAMPLE_RATE(sample_rate) | S_028004_ZPASS_ENABLE(1) |