Skip to content

fix: update code for wgpu 29.0.0 API changes#351

Merged
telecos merged 2 commits intodependabot/cargo/wgpu-29.0.0from
claude/sub-pr-347
Mar 23, 2026
Merged

fix: update code for wgpu 29.0.0 API changes#351
telecos merged 2 commits intodependabot/cargo/wgpu-29.0.0from
claude/sub-pr-347

Conversation

@Claude
Copy link
Contributor

@Claude Claude AI commented Mar 23, 2026

Fixes compilation failures after wgpu 28.0.0 → 29.0.0 upgrade due to breaking API changes.

Changes

  • Pipeline layouts: bind_group_layouts now requires &[Option<&BindGroupLayout>] instead of &[&BindGroupLayout]

    • Updated lighting_shadows.rs to wrap bind group layout references with Some()
  • Buffer mapping: BufferViewMut no longer provides direct iteration - use copy_from_slice() instead

    • Updated buffer_integration_test.rs to use the new API
// Before (wgpu 28.0.0)
bind_group_layouts: &[
    &camera_bind_group_layout,
    &light_bind_group_layout,
]

// After (wgpu 29.0.0)
bind_group_layouts: &[
    Some(&camera_bind_group_layout),
    Some(&light_bind_group_layout),
]
// Before (wgpu 28.0.0)
let mut view = buffer.get_mapped_range_mut();
for (i, byte) in view.iter_mut().enumerate() {
    *byte = i as u8;
}

// After (wgpu 29.0.0)
let mut view = buffer.get_mapped_range_mut();
let data: Vec<u8> = (0..256).map(|i| i as u8).collect();
view.copy_from_slice(&data);

- Wrap bind_group_layouts with Some() in lighting_shadows example
- Update BufferViewMut usage to use copy_from_slice() method

Co-authored-by: telecos <8853689+telecos@users.noreply.github.com>
Agent-Logs-Url: https://github.com/telecos/wgpu_playground/sessions/b6484fcb-2696-4b95-b23a-9504ad32c026
@Claude Claude AI changed the title [WIP] Bump wgpu from 28.0.0 to 29.0.0 fix: update code for wgpu 29.0.0 API changes Mar 23, 2026
@Claude Claude AI requested a review from telecos March 23, 2026 23:08
@telecos telecos marked this pull request as ready for review March 23, 2026 23:17
@telecos telecos merged commit b4268db into dependabot/cargo/wgpu-29.0.0 Mar 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants