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

Author: Konstantin Seurer <[email protected]>
Date:   Mon Oct 31 18:07:45 2022 +0100

radv: Add a field for the max shared memory size

Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17663>

---

 src/amd/vulkan/radv_device.c  | 4 +++-
 src/amd/vulkan/radv_private.h | 3 +++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index d730b647f73..3df1473c86f 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -904,6 +904,8 @@ radv_physical_device_try_create(struct radv_instance 
*instance, drmDevicePtr drm
          device->rt_wave_size = 32;
    }
 
+   device->max_shared_size = device->rad_info.gfx_level >= GFX7 ? 65536 : 
32768;
+
    radv_physical_device_init_mem_types(device);
 
    radv_physical_device_get_supported_extensions(device, 
&device->vk.supported_extensions);
@@ -2016,7 +2018,7 @@ radv_GetPhysicalDeviceProperties(VkPhysicalDevice 
physicalDevice,
       .maxFragmentOutputAttachments = 8,
       .maxFragmentDualSrcAttachments = 1,
       .maxFragmentCombinedOutputResources = max_descriptor_set_size,
-      .maxComputeSharedMemorySize = pdevice->rad_info.gfx_level >= GFX7 ? 
65536 : 32768,
+      .maxComputeSharedMemorySize = pdevice->max_shared_size,
       .maxComputeWorkGroupCount = {65535, 65535, 65535},
       .maxComputeWorkGroupInvocations = 1024,
       .maxComputeWorkGroupSize = {1024, 1024, 1024},
diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h
index c9259f33245..1f9b639dbb2 100644
--- a/src/amd/vulkan/radv_private.h
+++ b/src/amd/vulkan/radv_private.h
@@ -299,6 +299,9 @@ struct radv_physical_device {
    uint8_t ge_wave_size;
    uint8_t rt_wave_size;
 
+   /* Maximum compute shared memory size. */
+   uint32_t max_shared_size;
+
    /* Whether to use the LLVM compiler backend */
    bool use_llvm;
 

Reply via email to