Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions wgpu-hal/src/dx12/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions wgpu-hal/src/gles/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions wgpu-hal/src/vulkan/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
16 changes: 16 additions & 0 deletions wgpu-types/src/limits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
Loading