@@ -2712,7 +2712,7 @@ impl TextureFormat {
2712
2712
/// Returns the format features guaranteed by the WebGPU spec.
2713
2713
///
2714
2714
/// Additional features are available if `Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES` is enabled.
2715
- pub fn guaranteed_format_features ( & self ) -> TextureFormatFeatures {
2715
+ pub fn guaranteed_format_features ( & self , device_features : Features ) -> TextureFormatFeatures {
2716
2716
// Multisampling
2717
2717
let noaa = TextureFormatFeatureFlags :: empty ( ) ;
2718
2718
let msaa = TextureFormatFeatureFlags :: MULTISAMPLE_X4 ;
@@ -2724,6 +2724,11 @@ impl TextureFormat {
2724
2724
let attachment = basic | TextureUsages :: RENDER_ATTACHMENT ;
2725
2725
let storage = basic | TextureUsages :: STORAGE_BINDING ;
2726
2726
let all_flags = TextureUsages :: all ( ) ;
2727
+ let rg11b10f = if device_features. contains ( Features :: RG11B10UFLOAT_RENDERABLE ) {
2728
+ attachment
2729
+ } else {
2730
+ basic
2731
+ } ;
2727
2732
2728
2733
#[ rustfmt:: skip] // lets make a nice table
2729
2734
let (
@@ -2755,7 +2760,7 @@ impl TextureFormat {
2755
2760
Self :: Bgra8Unorm => ( msaa_resolve, attachment) ,
2756
2761
Self :: Bgra8UnormSrgb => ( msaa_resolve, attachment) ,
2757
2762
Self :: Rgb10a2Unorm => ( msaa_resolve, attachment) ,
2758
- Self :: Rg11b10Float => ( msaa, basic ) ,
2763
+ Self :: Rg11b10Float => ( msaa, rg11b10f ) ,
2759
2764
Self :: Rg32Uint => ( noaa, all_flags) ,
2760
2765
Self :: Rg32Sint => ( noaa, all_flags) ,
2761
2766
Self :: Rg32Float => ( noaa, all_flags) ,
0 commit comments