Skip to content

Commit

Permalink
Use extended limits when partially bound descriptor sets are enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
LPGhatguy committed Nov 27, 2024
1 parent 5c5c8b1 commit ee65b33
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion wgpu-hal/src/vulkan/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1024,6 +1024,11 @@ impl PhysicalDeviceProperties {
// We could increase the limit when we aren't on a tiled GPU.
let max_color_attachment_bytes_per_sample = 32;

let max_sampled_textures_per_shader_stage = match &self.descriptor_indexing {
Some(indexing) => indexing.max_descriptor_set_update_after_bind_sampled_images,
None => limits.max_descriptor_set_sampled_images,
};

wgt::Limits {
max_texture_dimension_1d: limits.max_image_dimension1_d,
max_texture_dimension_2d: limits.max_image_dimension2_d,
Expand All @@ -1037,7 +1042,7 @@ impl PhysicalDeviceProperties {
.max_descriptor_set_uniform_buffers_dynamic,
max_dynamic_storage_buffers_per_pipeline_layout: limits
.max_descriptor_set_storage_buffers_dynamic,
max_sampled_textures_per_shader_stage: limits.max_per_stage_descriptor_sampled_images,
max_sampled_textures_per_shader_stage,
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_textures_per_shader_stage: limits.max_per_stage_descriptor_storage_images,
Expand Down
1 change: 1 addition & 0 deletions wgpu-hal/src/vulkan/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1341,6 +1341,7 @@ impl crate::Device for super::Device {

if partially_bound && entry.count.is_some() {
flags |= vk::DescriptorBindingFlags::PARTIALLY_BOUND;
flags |= vk::DescriptorBindingFlags::UPDATE_AFTER_BIND;
}

flags
Expand Down

0 comments on commit ee65b33

Please sign in to comment.