diff options
author | Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> | 2020-07-05 18:57:35 +0200 |
---|---|---|
committer | Eric Engestrom <eric@engestrom.ch> | 2020-07-08 19:31:19 +0200 |
commit | 822e03feebcb7592e7d7d2cf17b340c9ae673ab0 (patch) | |
tree | d4585056f78f38c2ae5ea60b4fea63ffd2253205 | |
parent | 447ba093577dcd7306f68af4ade2e3fce7b7e726 (diff) |
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@lists.freedesktop.org>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3218
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5757>
(cherry picked from commit ad913a18b14f25b4f6995cb8a8b0c55c747029d8)
-rw-r--r-- | .pick_status.json | 2 | ||||
-rw-r--r-- | src/amd/vulkan/radv_cmd_buffer.c | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/.pick_status.json b/.pick_status.json index 47c24a703fd..bca478c72da 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1381,7 +1381,7 @@ "description": "radv: Always enable PERFECT_ZPASS_COUNTS.", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": null }, diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index b0ef1e9a08e..1b8aef3eadb 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -2176,8 +2176,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) | |