From 7c46cd8fa67be1366e683f6b006d1fa1a2bef4ca Mon Sep 17 00:00:00 2001 From: Erich Gubler Date: Wed, 19 Jul 2023 12:25:50 -0400 Subject: [PATCH 1/2] feat!: update `max_bindings_per_bind_group` from 640 to 1000 Both default `Limits` and the Vulkan backend use 640 as a hard-coded limit value, but the spec. was [updated](https://github.com/gpuweb/gpuweb/issues/3864) to use 1000 instead. --- wgpu-hal/src/vulkan/adapter.rs | 2 +- wgpu-types/src/lib.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wgpu-hal/src/vulkan/adapter.rs b/wgpu-hal/src/vulkan/adapter.rs index ed0bbbda8a..5e465b79e5 100644 --- a/wgpu-hal/src/vulkan/adapter.rs +++ b/wgpu-hal/src/vulkan/adapter.rs @@ -720,7 +720,7 @@ impl PhysicalDeviceCapabilities { max_bind_groups: limits .max_bound_descriptor_sets .min(crate::MAX_BIND_GROUPS as u32), - max_bindings_per_bind_group: 640, + max_bindings_per_bind_group: 1000, max_dynamic_uniform_buffers_per_pipeline_layout: limits .max_descriptor_set_uniform_buffers_dynamic, max_dynamic_storage_buffers_per_pipeline_layout: limits diff --git a/wgpu-types/src/lib.rs b/wgpu-types/src/lib.rs index a5e838653b..4d8ff0a8b8 100644 --- a/wgpu-types/src/lib.rs +++ b/wgpu-types/src/lib.rs @@ -845,7 +845,7 @@ pub struct Limits { pub max_texture_array_layers: u32, /// Amount of bind groups that can be attached to a pipeline at the same time. Defaults to 4. Higher is "better". pub max_bind_groups: u32, - /// Maximum binding index allowed in `create_bind_group_layout`. Defaults to 640. + /// Maximum binding index allowed in `create_bind_group_layout`. Defaults to 1000. pub max_bindings_per_bind_group: u32, /// Amount of uniform buffer bindings that can be dynamic in a single pipeline. Defaults to 8. Higher is "better". pub max_dynamic_uniform_buffers_per_pipeline_layout: u32, @@ -929,7 +929,7 @@ impl Default for Limits { max_texture_dimension_3d: 2048, max_texture_array_layers: 256, max_bind_groups: 4, - max_bindings_per_bind_group: 640, + max_bindings_per_bind_group: 1000, max_dynamic_uniform_buffers_per_pipeline_layout: 8, max_dynamic_storage_buffers_per_pipeline_layout: 4, max_sampled_textures_per_shader_stage: 16, From a5b6ba3cffa163673778670cc87fe126fc4babd7 Mon Sep 17 00:00:00 2001 From: Erich Gubler Date: Wed, 19 Jul 2023 12:28:07 -0400 Subject: [PATCH 2/2] refactor(vulkan): use `Limits::default` instead of hardcoded value --- wgpu-hal/src/vulkan/adapter.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wgpu-hal/src/vulkan/adapter.rs b/wgpu-hal/src/vulkan/adapter.rs index 5e465b79e5..d23aca76a3 100644 --- a/wgpu-hal/src/vulkan/adapter.rs +++ b/wgpu-hal/src/vulkan/adapter.rs @@ -720,7 +720,7 @@ impl PhysicalDeviceCapabilities { max_bind_groups: limits .max_bound_descriptor_sets .min(crate::MAX_BIND_GROUPS as u32), - max_bindings_per_bind_group: 1000, + max_bindings_per_bind_group: wgt::Limits::default().max_bindings_per_bind_group, max_dynamic_uniform_buffers_per_pipeline_layout: limits .max_descriptor_set_uniform_buffers_dynamic, max_dynamic_storage_buffers_per_pipeline_layout: limits