diff --git a/wgpu-hal/src/dx12/adapter.rs b/wgpu-hal/src/dx12/adapter.rs index d1389612df..c4567ff94d 100644 --- a/wgpu-hal/src/dx12/adapter.rs +++ b/wgpu-hal/src/dx12/adapter.rs @@ -775,7 +775,11 @@ impl super::Adapter { // of the two, so we divide it by 4 to account for the worst case scenario // (2 shader stages, with both using 16 storage textures and 16 storage buffers) max_storage_buffers_per_shader_stage: uav_count / 4, + max_storage_buffers_in_vertex_stage: uav_count / 4, + max_storage_buffers_in_fragment_stage: uav_count / 4, max_storage_textures_per_shader_stage: uav_count / 4, + max_storage_textures_in_vertex_stage: uav_count / 4, + max_storage_textures_in_fragment_stage: uav_count / 4, max_uniform_buffers_per_shader_stage: full_heap_count, max_binding_array_elements_per_shader_stage: full_heap_count, max_binding_array_sampler_elements_per_shader_stage: full_heap_count, diff --git a/wgpu-hal/src/gles/adapter.rs b/wgpu-hal/src/gles/adapter.rs index c94365a7d0..6834145bbc 100644 --- a/wgpu-hal/src/gles/adapter.rs +++ b/wgpu-hal/src/gles/adapter.rs @@ -701,7 +701,11 @@ impl super::Adapter { max_sampled_textures_per_shader_stage: super::MAX_TEXTURE_SLOTS as u32, max_samplers_per_shader_stage: super::MAX_SAMPLERS as u32, max_storage_buffers_per_shader_stage, + max_storage_buffers_in_vertex_stage: max_storage_buffers_per_shader_stage, + max_storage_buffers_in_fragment_stage: max_storage_buffers_per_shader_stage, max_storage_textures_per_shader_stage, + max_storage_textures_in_vertex_stage: max_storage_textures_per_shader_stage, + max_storage_textures_in_fragment_stage: max_storage_textures_per_shader_stage, max_uniform_buffers_per_shader_stage, max_binding_array_elements_per_shader_stage: 0, max_binding_array_sampler_elements_per_shader_stage: 0, diff --git a/wgpu-hal/src/vulkan/adapter.rs b/wgpu-hal/src/vulkan/adapter.rs index 1519e9d896..3f26551651 100644 --- a/wgpu-hal/src/vulkan/adapter.rs +++ b/wgpu-hal/src/vulkan/adapter.rs @@ -1368,7 +1368,11 @@ impl PhysicalDeviceProperties { max_sampled_textures_per_shader_stage: limits.max_per_stage_descriptor_sampled_images, max_samplers_per_shader_stage: limits.max_per_stage_descriptor_samplers, max_storage_buffers_per_shader_stage: limits.max_per_stage_descriptor_storage_buffers, + max_storage_buffers_in_vertex_stage: limits.max_per_stage_descriptor_storage_buffers, + max_storage_buffers_in_fragment_stage: limits.max_per_stage_descriptor_storage_buffers, max_storage_textures_per_shader_stage: limits.max_per_stage_descriptor_storage_images, + max_storage_textures_in_vertex_stage: limits.max_per_stage_descriptor_storage_images, + max_storage_textures_in_fragment_stage: limits.max_per_stage_descriptor_storage_images, max_uniform_buffers_per_shader_stage: limits.max_per_stage_descriptor_uniform_buffers, max_binding_array_elements_per_shader_stage: max_binding_array_elements, max_binding_array_sampler_elements_per_shader_stage: max_sampler_binding_array_elements, diff --git a/wgpu-types/src/limits.rs b/wgpu-types/src/limits.rs index 31a24b2650..61851091de 100644 --- a/wgpu-types/src/limits.rs +++ b/wgpu-types/src/limits.rs @@ -35,7 +35,11 @@ macro_rules! with_limits { $macro_name!(max_sampled_textures_per_shader_stage, Ordering::Less); $macro_name!(max_samplers_per_shader_stage, Ordering::Less); $macro_name!(max_storage_buffers_per_shader_stage, Ordering::Less); + $macro_name!(max_storage_buffers_in_fragment_stage, Ordering::Less); + $macro_name!(max_storage_buffers_in_vertex_stage, Ordering::Less); $macro_name!(max_storage_textures_per_shader_stage, Ordering::Less); + $macro_name!(max_storage_textures_in_fragment_stage, Ordering::Less); + $macro_name!(max_storage_textures_in_vertex_stage, Ordering::Less); $macro_name!(max_uniform_buffers_per_shader_stage, Ordering::Less); $macro_name!(max_binding_array_elements_per_shader_stage, Ordering::Less); $macro_name!(max_uniform_buffer_binding_size, Ordering::Less); @@ -147,8 +151,16 @@ pub struct Limits { pub max_samplers_per_shader_stage: u32, /// Amount of storage buffers visible in a single shader stage. Defaults to 8. Higher is "better". pub max_storage_buffers_per_shader_stage: u32, + /// Amount of storage buffers visible in a single shader stage. Defaults to 8. Higher is "better". + pub max_storage_buffers_in_vertex_stage: u32, + /// Amount of storage buffers visible in a single shader stage. Defaults to 8. Higher is "better". + pub max_storage_buffers_in_fragment_stage: u32, /// Amount of storage textures visible in a single shader stage. Defaults to 4. Higher is "better". pub max_storage_textures_per_shader_stage: u32, + /// Amount of storage textures visible in a single shader stage. Defaults to 4. Higher is "better". + pub max_storage_textures_in_vertex_stage: u32, + /// Amount of storage textures visible in a single shader stage. Defaults to 4. Higher is "better". + pub max_storage_textures_in_fragment_stage: u32, /// Amount of uniform buffers visible in a single shader stage. Defaults to 12. Higher is "better". pub max_uniform_buffers_per_shader_stage: u32, /// Amount of individual resources within binding arrays that can be accessed in a single shader stage. Applies @@ -373,7 +385,11 @@ impl Limits { max_sampled_textures_per_shader_stage: 16, max_samplers_per_shader_stage: 16, max_storage_buffers_per_shader_stage: 8, + max_storage_buffers_in_vertex_stage: 8, + max_storage_buffers_in_fragment_stage: 8, max_storage_textures_per_shader_stage: 4, + max_storage_textures_in_vertex_stage: 8, + max_storage_textures_in_fragment_stage: 8, max_uniform_buffers_per_shader_stage: 12, max_binding_array_elements_per_shader_stage: 0, max_binding_array_sampler_elements_per_shader_stage: 0,