Fix AsBindGroup sampler validation. (#15071)

Kind of confused why this wasn't breaking for me pre-`0.15-dev` since
nothing obvious seems to have changed in `wgpu` upstream, but this fixes
it and ensures that we return the correct sample type re: the actual
device.
This commit is contained in:
charlotte 2024-09-09 08:48:33 -07:00 committed by GitHub
parent bca228fdaa
commit 8460cfa6ab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -366,7 +366,7 @@ pub fn derive_as_bind_group(ast: syn::DeriveInput) -> Result<TokenStream> {
if let Some(handle) = handle {
let image = images.get(handle).ok_or_else(|| #render_path::render_resource::AsBindGroupError::RetryNextUpdate)?;
let Some(sample_type) = image.texture_format.sample_type(None, None) else {
let Some(sample_type) = image.texture_format.sample_type(None, Some(render_device.features())) else {
return Err(#render_path::render_resource::AsBindGroupError::InvalidSamplerType(
#binding_index,
"None".to_string(),