Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

metal: Don't skip incomplete binding resources. #2622

Merged
merged 2 commits into from
Apr 21, 2022
Merged
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
18 changes: 13 additions & 5 deletions wgpu-hal/src/metal/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,21 @@ impl super::CommandState {
) -> Option<(u32, &'a [u32])> {
let stage_info = &self.stage_infos[stage];
let slot = stage_info.sizes_slot?;

result_sizes.clear();
for br in stage_info.sized_bindings.iter() {
// If it's None, this isn't the right time to update the sizes
let size = self.storage_buffer_length_map.get(br)?;
result_sizes.push(size.get().min(!0u32 as u64) as u32);
result_sizes.extend(
stage_info
.sized_bindings
.iter()
.filter_map(|br| self.storage_buffer_length_map.get(br))
.map(|size| size.get().min(!0u32 as u64) as u32),
);

if !result_sizes.is_empty() {
Some((slot as _, result_sizes))
} else {
None
}
Some((slot as _, result_sizes))
}
}

Expand Down