radv: Enable sparse buffer and image support.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tue, 24 Nov 2020 22:02:54 +0000 (23:02 +0100)
committerMarge Bot <eric+marge@anholt.net>
Mon, 11 Jan 2021 12:01:34 +0000 (12:01 +0000)
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7953>

docs/relnotes/new_features.txt
src/amd/vulkan/radv_device.c

index 4cb3086..117dfa7 100644 (file)
@@ -10,3 +10,4 @@ VK_KHR_fragment_shading_rate on RADV (RDNA2 only)
 Freedreno a6xx exposes GL 3.3
 Classic swrast dri driver removed in favor of gallium swrast (llvmpipe or softpipe)
 Panfrost t760/t860 exposes GL 3.0
+Sparse memory support on RADV
index 6a7cb1c..6fe7eca 100644 (file)
@@ -1011,8 +1011,12 @@ void radv_GetPhysicalDeviceFeatures(
                .shaderInt64                              = true,
                .shaderInt16                              = true,
                .sparseBinding                            = true,
+               .sparseResidencyBuffer                    = pdevice->rad_info.chip_class >= GFX8,
+               .sparseResidencyImage2D                   = pdevice->rad_info.chip_class >= GFX8,
+               .sparseResidencyAliased                   = pdevice->rad_info.chip_class >= GFX8,
                .variableMultisampleRate                  = true,
                .shaderResourceMinLod                     = true,
+               .shaderResourceResidency                  = true,
                .inheritedQueries                         = true,
        };
 }
@@ -1655,7 +1659,10 @@ void radv_GetPhysicalDeviceProperties(
                .deviceID = pdevice->rad_info.pci_id,
                .deviceType = pdevice->rad_info.has_dedicated_vram ? VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU : VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU,
                .limits = limits,
-               .sparseProperties = {0},
+               .sparseProperties = {
+                       .residencyNonResidentStrict = pdevice->rad_info.chip_class >= GFX8,
+                       .residencyStandard2DBlockShape = pdevice->rad_info.chip_class >= GFX8,
+               },
        };
 
        strcpy(pProperties->deviceName, pdevice->name);