File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ pub enum BindGroupLayoutEntryError {
38
38
ArrayUnsupported ,
39
39
#[ error( "Multisampled binding with sample type `TextureSampleType::Float` must have filterable set to false." ) ]
40
40
SampleTypeFloatFilterableBindingMultisampled ,
41
+ #[ error( "Multisampled texture binding view dimension must be 2d, got {0:?}" ) ]
42
+ Non2DMultisampled ( wgt:: TextureViewDimension ) ,
41
43
#[ error( transparent) ]
42
44
MissingFeatures ( #[ from] MissingFeatures ) ,
43
45
#[ error( transparent) ]
Original file line number Diff line number Diff line change @@ -1714,10 +1714,23 @@ impl<A: HalApi> Device<A> {
1714
1714
BindGroupLayoutEntryError :: SampleTypeFloatFilterableBindingMultisampled ,
1715
1715
} ) ;
1716
1716
}
1717
- Bt :: Texture { .. } => (
1718
- Some ( wgt:: Features :: TEXTURE_BINDING_ARRAY ) ,
1719
- WritableStorage :: No ,
1720
- ) ,
1717
+ Bt :: Texture {
1718
+ multisampled,
1719
+ view_dimension,
1720
+ ..
1721
+ } => {
1722
+ if multisampled && view_dimension != TextureViewDimension :: D2 {
1723
+ return Err ( binding_model:: CreateBindGroupLayoutError :: Entry {
1724
+ binding : entry. binding ,
1725
+ error : BindGroupLayoutEntryError :: Non2DMultisampled ( view_dimension) ,
1726
+ } ) ;
1727
+ }
1728
+
1729
+ (
1730
+ Some ( wgt:: Features :: TEXTURE_BINDING_ARRAY ) ,
1731
+ WritableStorage :: No ,
1732
+ )
1733
+ }
1721
1734
Bt :: StorageTexture {
1722
1735
access,
1723
1736
view_dimension,
You can’t perform that action at this time.
0 commit comments