v3dv/device: do not compute per-pipeline limits multiplying per-stage
authorAlejandro Piñeiro <apinheiro@igalia.com>
Tue, 13 Apr 2021 21:14:43 +0000 (23:14 +0200)
committerMarge Bot <eric+marge@anholt.net>
Wed, 14 Apr 2021 11:00:36 +0000 (11:00 +0000)
There were two problems here:

   * We were multiplying by 6, when for graphics pipelines, we only
     support 2.

   * Right now we are tracking descriptors through the descriptor
     maps, and we have one per pipeline. So in practice there is no
     difference between per-stage and per-pipeline limits. So far this
     was not a problem, we could revisit in the future.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10207>

src/broadcom/vulkan/v3dv_device.c

index 09980e4..f71bf38 100644 (file)
@@ -1051,14 +1051,13 @@ v3dv_GetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice,
       .maxPerStageDescriptorInputAttachments    = max_input_attachments,
       .maxPerStageResources                     = 128,
 
-      /* We multiply some limits by 6 to account for all shader stages */
-      .maxDescriptorSetSamplers                 = 6 * max_samplers,
-      .maxDescriptorSetUniformBuffers           = 6 * max_uniform_buffers,
+      .maxDescriptorSetSamplers                 = max_samplers,
+      .maxDescriptorSetUniformBuffers           = max_uniform_buffers,
       .maxDescriptorSetUniformBuffersDynamic    = 8,
-      .maxDescriptorSetStorageBuffers           = 6 * max_storage_buffers,
-      .maxDescriptorSetStorageBuffersDynamic    = 6 * max_dynamic_storage_buffers,
-      .maxDescriptorSetSampledImages            = 6 * max_sampled_images,
-      .maxDescriptorSetStorageImages            = 6 * max_storage_images,
+      .maxDescriptorSetStorageBuffers           = max_storage_buffers,
+      .maxDescriptorSetStorageBuffersDynamic    = max_dynamic_storage_buffers,
+      .maxDescriptorSetSampledImages            = max_sampled_images,
+      .maxDescriptorSetStorageImages            = max_storage_images,
       .maxDescriptorSetInputAttachments         = 4,
 
       /* Vertex limits */