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

reject binding type multisampled when on a float filterable sample type #3686

Merged

Conversation

mockersf
Copy link
Contributor

@mockersf mockersf commented Apr 13, 2023

Checklist

  • Run cargo clippy.
  • Run RUSTFLAGS=--cfg=web_sys_unstable_apis cargo clippy --target wasm32-unknown-unknown if applicable.
  • Add change to CHANGELOG.md. See simple instructions inside file.

Connections
Link to the issues addressed by this PR, or dependent PRs in other repositories

Description

This binding is failing in webgpu (in Chrome):

BindingType::Texture {
  multisampled: true,
  sample_type: TextureSampleType::Float { filterable: true },
  view_dimension: TextureViewDimension::D2,
}

with the following error:

Sample type TextureSampleType::Float for multisampled texture bindings was TextureSampleType::Float.
 - While validating entries[17]
 - While validating [BindGroupLayoutDescriptor "mesh_view_layout_multisampled"]
 - While calling [Device].CreateBindGroupLayout([BindGroupLayoutDescriptor "mesh_view_layout_multisampled"]).

But working in native (metal)

This PR makes it error out in native too with the following error:

wgpu error: Validation Error

Caused by:
    In Device::create_bind_group_layout
      note: label = `mesh_view_layout_multisampled`
    Binding 17 entry is invalid
    Binding of TextureSampleType::Float can't be filterable when multisampled

Testing

Tested with bindings erroring and not erroring in webgpu and in native (metal)

wgpu-core/src/device/mod.rs Outdated Show resolved Hide resolved
wgpu-core/src/binding_model.rs Outdated Show resolved Hide resolved
wgpu-core/src/device/mod.rs Outdated Show resolved Hide resolved
Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@cwfitzgerald cwfitzgerald merged commit 7c25c00 into gfx-rs:trunk Apr 13, 2023
gents83 added a commit to gents83/wgpu that referenced this pull request Apr 15, 2023
github-merge-queue bot referenced this pull request in bevyengine/bevy Apr 26, 2023
# Objective

- Updated to wgpu 0.16.0 and wgpu-hal 0.16.0

---

## Changelog

1. Upgrade wgpu to 0.16.0 and  wgpu-hal to 0.16.0
2. Fix the error in native when using a filterable
`TextureSampleType::Float` on a multisample `BindingType::Texture`.
([https://github.com/gfx-rs/wgpu/pull/3686](https://github.com/gfx-rs/wgpu/pull/3686))

---------

Co-authored-by: François <[email protected]>
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