From a0131b53ade7d12a43980e1b9230439c4314ddfe Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Tue, 2 Sep 2025 12:53:46 +0200 Subject: [PATCH] nvk: use hardware limits for maxComputeSharedMemorySize It doesn't change the reported values, but it will allow us to easily advertise real hardware limits in the future. Reviewed-by: Mel Henning Reviewed-by: Faith Ekstrand Part-of: --- src/nouveau/vulkan/nvk_physical_device.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/nouveau/vulkan/nvk_physical_device.c b/src/nouveau/vulkan/nvk_physical_device.c index 15bf22498f0..a47d8bdaef1 100644 --- a/src/nouveau/vulkan/nvk_physical_device.c +++ b/src/nouveau/vulkan/nvk_physical_device.c @@ -811,7 +811,13 @@ nvk_get_device_properties(const struct nvk_instance *instance, .maxFragmentOutputAttachments = NVK_MAX_RTS, .maxFragmentDualSrcAttachments = 1, .maxFragmentCombinedOutputResources = 16, - .maxComputeSharedMemorySize = NVK_MAX_SHARED_SIZE, + /* Nvidia limits this to 48kB for consistency reasons, we could lift the + * limit if we wanted to. + */ + .maxComputeSharedMemorySize = MIN2( + NVK_MAX_SHARED_SIZE, + info->sm_smem_sizes_kB[info->sm_smem_size_count - 1] * 1024 + ), .maxComputeWorkGroupCount = {0x7fffffff, 65535, 65535}, .maxComputeWorkGroupInvocations = 1024, .maxComputeWorkGroupSize = {1024, 1024, 64},