Skip to content

Commit

Permalink
Fixed buffer sizes encoding on Metal. (gfx-rs#3047)
Browse files Browse the repository at this point in the history
  • Loading branch information
dragostis committed Oct 5, 2022
1 parent 2372895 commit 5c33e23
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ SurfaceConfiguration {
- Add the missing `msg_send![view, retain]` call within `from_view` by @jinleili in [#2976](https://github.com/gfx-rs/wgpu/pull/2976)
- Fix `max_buffer` `max_texture` and `max_vertex_buffers` limits by @jinleili in [#2978](https://github.com/gfx-rs/wgpu/pull/2978)
- Remove PrivateCapabilities's `format_rgb10a2_unorm_surface` field by @jinleili in [#2981](https://github.com/gfx-rs/wgpu/pull/2981)
- Fix `_buffer_sizes` encoding by @dtiselice in [#3047](https://github.com/gfx-rs/wgpu/pull/3047)

#### Vulkan
- Fix `astc_hdr` formats support by @jinleili in [#2971]](https://github.com/gfx-rs/wgpu/pull/2971)
Expand Down
13 changes: 6 additions & 7 deletions wgpu-hal/src/metal/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,12 @@ impl super::CommandState {
let slot = stage_info.sizes_slot?;

result_sizes.clear();
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),
);
result_sizes.extend(stage_info.sized_bindings.iter().map(|br| {
self.storage_buffer_length_map
.get(br)
.map(|size| u32::try_from(size.get()).unwrap_or(u32::MAX))
.unwrap_or_default()
}));

if !result_sizes.is_empty() {
Some((slot as _, result_sizes))
Expand Down

0 comments on commit 5c33e23

Please sign in to comment.