File tree Expand file tree Collapse file tree
crates/lambda-rs-platform/src/wgpu Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -697,15 +697,20 @@ linear; anisotropy disabled.",
697697
698698 /// Create the sampler on the provided device.
699699 pub fn build ( self , gpu : & Gpu ) -> Sampler {
700+ let requested_anisotropy = self . anisotropy_clamp . clamp ( 1 , 16 ) ;
700701 let downlevel = gpu. adapter ( ) . get_downlevel_capabilities ( ) ;
701- let max_supported_anisotropy = if downlevel
702+ let supports_anisotropy = downlevel
702703 . flags
703- . contains ( wgpu:: DownlevelFlags :: ANISOTROPIC_FILTERING )
704- {
705- 16
706- } else {
707- 1
708- } ;
704+ . contains ( wgpu:: DownlevelFlags :: ANISOTROPIC_FILTERING ) ;
705+ if requested_anisotropy > 1 && !supports_anisotropy {
706+ logging:: warn!(
707+ "Sampler anisotropy requested ({}), but adapter does not report \
708+ anisotropic filtering support; anisotropy disabled.",
709+ requested_anisotropy
710+ ) ;
711+ }
712+
713+ let max_supported_anisotropy = if supports_anisotropy { 16 } else { 1 } ;
709714 let desc = self . to_descriptor ( max_supported_anisotropy) ;
710715 let raw = gpu. device ( ) . create_sampler ( & desc) ;
711716 return Sampler {
You can’t perform that action at this time.
0 commit comments