From 8460cfa6ab1fb88d037b3999f6660d0723baa9f6 Mon Sep 17 00:00:00 2001 From: charlotte Date: Mon, 9 Sep 2024 08:48:33 -0700 Subject: [PATCH] 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. --- crates/bevy_render/macros/src/as_bind_group.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_render/macros/src/as_bind_group.rs b/crates/bevy_render/macros/src/as_bind_group.rs index 9e4a4ab9fd..6de62672a6 100644 --- a/crates/bevy_render/macros/src/as_bind_group.rs +++ b/crates/bevy_render/macros/src/as_bind_group.rs @@ -366,7 +366,7 @@ pub fn derive_as_bind_group(ast: syn::DeriveInput) -> Result { 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(),