Mesa (main): radv: fix reported sample counts for VRS 1x1

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Aug 10 07:41:27 UTC 2021


Module: Mesa
Branch: main
Commit: deecc7d10942a71c47b6f3afa51c4e5507fac884
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=deecc7d10942a71c47b6f3afa51c4e5507fac884

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Fri Aug  6 17:08:09 2021 +0200

radv: fix reported sample counts for VRS 1x1

The Vulkan spec requires ~0 for 1x1.

Fixes dEQP-VK.fragment_shading_rate.misc.shading_rates.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12245>

---

 src/amd/vulkan/radv_device.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 0af0bab0f92..656c0ba5c13 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -7962,9 +7962,16 @@ radv_GetPhysicalDeviceFragmentShadingRatesKHR(
 
    for (uint32_t x = 2; x >= 1; x--) {
       for (uint32_t y = 2; y >= 1; y--) {
-         append_rate(x, y,
-                     VK_SAMPLE_COUNT_1_BIT | VK_SAMPLE_COUNT_2_BIT | VK_SAMPLE_COUNT_4_BIT |
-                        VK_SAMPLE_COUNT_8_BIT);
+         VkSampleCountFlagBits samples;
+
+         if (x == 1 && y == 1) {
+            samples = ~0;
+         } else {
+            samples = VK_SAMPLE_COUNT_1_BIT | VK_SAMPLE_COUNT_2_BIT |
+                      VK_SAMPLE_COUNT_4_BIT | VK_SAMPLE_COUNT_8_BIT;
+         }
+
+         append_rate(x, y, samples);
       }
    }
 #undef append_rate



More information about the mesa-commit mailing list