@@ -6,9 +6,10 @@ Tests that textureBindingViewDimension must compatible with texture dimension
6
6
import { makeTestGroup } from '../../../../../common/framework/test_group.js' ;
7
7
import { kTextureDimensions , kTextureViewDimensions } from '../../../../capability_info.js' ;
8
8
import {
9
- kColorTextureFormats ,
10
9
kCompatModeUnsupportedStorageTextureFormats ,
11
- kTextureFormatInfo ,
10
+ kDifferentBaseFormatTextureFormats ,
11
+ getBlockInfoForTextureFormat ,
12
+ getBaseFormatForTextureFormat ,
12
13
} from '../../../../format_info.js' ;
13
14
import { getTextureDimensionFromView } from '../../../../util/texture/base.js' ;
14
15
import { CompatibilityTest } from '../../../compatibility_test.js' ;
@@ -121,27 +122,19 @@ g.test('format_reinterpretation')
121
122
)
122
123
. params ( u =>
123
124
u //
124
- . combine ( 'format' , kColorTextureFormats as GPUTextureFormat [ ] )
125
- . filter (
126
- ( { format } ) =>
127
- ! ! kTextureFormatInfo [ format ] . baseFormat &&
128
- kTextureFormatInfo [ format ] . baseFormat !== format
129
- )
125
+ . combine ( 'format' , kDifferentBaseFormatTextureFormats )
130
126
)
131
- . beforeAllSubcases ( t => {
132
- const info = kTextureFormatInfo [ t . params . format ] ;
133
- t . skipIfTextureFormatNotSupportedDeprecated ( t . params . format ) ;
134
- t . selectDeviceOrSkipTestCase ( info . feature ) ;
135
- } )
136
127
. fn ( t => {
137
128
const { format } = t . params ;
138
- const info = kTextureFormatInfo [ format ] ;
129
+ t . skipIfTextureFormatNotSupported ( format ) ;
130
+ const info = getBlockInfoForTextureFormat ( format ) ;
131
+ const baseFormat = getBaseFormatForTextureFormat ( format ) ;
139
132
140
133
const formatPairs = [
141
- { format, viewFormats : [ info . baseFormat ! ] } ,
142
- { format : info . baseFormat ! , viewFormats : [ format ] } ,
143
- { format, viewFormats : [ format , info . baseFormat ! ] } ,
144
- { format : info . baseFormat ! , viewFormats : [ format , info . baseFormat ! ] } ,
134
+ { format, viewFormats : [ baseFormat ] } ,
135
+ { format : baseFormat , viewFormats : [ format ] } ,
136
+ { format, viewFormats : [ format , baseFormat ] } ,
137
+ { format : baseFormat , viewFormats : [ format , baseFormat ] } ,
145
138
] ;
146
139
for ( const { format, viewFormats } of formatPairs ) {
147
140
t . expectGPUErrorInCompatibilityMode (
0 commit comments