Mesa (master): radv: Always enable PERFECT_ZPASS_COUNTS.
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Jul 6 14:05:44 UTC 2020
Module: Mesa
Branch: master
Commit: ad913a18b14f25b4f6995cb8a8b0c55c747029d8
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ad913a18b14f25b4f6995cb8a8b0c55c747029d8
Author: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Date: Sun Jul 5 18:57:35 2020 +0200
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: <mesa-stable at lists.freedesktop.org>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3218
Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5757>
---
src/amd/vulkan/radv_cmd_buffer.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
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) |
More information about the mesa-commit
mailing list