@@ -9,11 +9,10 @@ import { GPUConst } from '../../../../constants.js';
9
9
import {
10
10
kDepthStencilFormats ,
11
11
kDepthStencilFormatResolvedAspect ,
12
- kTextureFormatInfo ,
13
- isMultisampledTextureFormatDeprecated ,
12
+ isStencilTextureFormat ,
13
+ isDepthTextureFormat ,
14
14
} from '../../../../format_info.js' ;
15
- import { MaxLimitsTestMixin } from '../../../../gpu_test.js' ;
16
- import { ValidationTest } from '../../validation_test.js' ;
15
+ import { AllFeaturesMaxLimitsValidationTest } from '../../validation_test.js' ;
17
16
18
17
type TextureBindingType =
19
18
| 'sampled-texture'
@@ -30,7 +29,7 @@ const kTextureBindingTypes = [
30
29
] as const ;
31
30
32
31
const SIZE = 32 ;
33
- class TextureUsageTracking extends ValidationTest {
32
+ class TextureUsageTracking extends AllFeaturesMaxLimitsValidationTest {
34
33
createTestTexture (
35
34
options : {
36
35
width ?: number ;
@@ -268,7 +267,7 @@ class TextureUsageTracking extends ValidationTest {
268
267
}
269
268
}
270
269
271
- export const g = makeTestGroup ( MaxLimitsTestMixin ( TextureUsageTracking ) ) ;
270
+ export const g = makeTestGroup ( TextureUsageTracking ) ;
272
271
273
272
const BASE_LEVEL = 1 ;
274
273
const TOTAL_LEVELS = 6 ;
@@ -680,13 +679,13 @@ g.test('subresources_and_binding_types_combination_for_aspect')
680
679
. combine ( 'aspect1' , [ 'all' , 'depth-only' , 'stencil-only' ] as const )
681
680
. unless (
682
681
p =>
683
- ( p . aspect0 === 'stencil-only' && ! kTextureFormatInfo [ p . format ] . stencil ) ||
684
- ( p . aspect1 === 'stencil-only' && ! kTextureFormatInfo [ p . format ] . stencil )
682
+ ( p . aspect0 === 'stencil-only' && ! isStencilTextureFormat ( p . format ) ) ||
683
+ ( p . aspect1 === 'stencil-only' && ! isStencilTextureFormat ( p . format ) )
685
684
)
686
685
. unless (
687
686
p =>
688
- ( p . aspect0 === 'depth-only' && ! kTextureFormatInfo [ p . format ] . depth ) ||
689
- ( p . aspect1 === 'depth-only' && ! kTextureFormatInfo [ p . format ] . depth )
687
+ ( p . aspect0 === 'depth-only' && ! isDepthTextureFormat ( p . format ) ) ||
688
+ ( p . aspect1 === 'depth-only' && ! isDepthTextureFormat ( p . format ) )
690
689
)
691
690
. combineWithParams ( [
692
691
{
@@ -703,8 +702,8 @@ g.test('subresources_and_binding_types_combination_for_aspect')
703
702
. unless (
704
703
// Can't sample a multiplanar texture without selecting an aspect.
705
704
p =>
706
- ! ! kTextureFormatInfo [ p . format ] . depth &&
707
- ! ! kTextureFormatInfo [ p . format ] . stencil &&
705
+ isDepthTextureFormat ( p . format ) &&
706
+ isStencilTextureFormat ( p . format ) &&
708
707
( ( p . aspect0 === 'all' && p . type0 === 'sampled-texture' ) ||
709
708
( p . aspect1 === 'all' && p . type1 === 'sampled-texture' ) )
710
709
)
@@ -724,15 +723,11 @@ g.test('subresources_and_binding_types_combination_for_aspect')
724
723
// Depth-stencil attachment views must encompass all aspects of the texture. Invalid
725
724
// cases are for depth-stencil textures when the aspect is not 'all'.
726
725
p . type1 === 'render-target' &&
727
- ! ! kTextureFormatInfo [ p . format ] . depth &&
728
- ! ! kTextureFormatInfo [ p . format ] . stencil &&
726
+ isDepthTextureFormat ( p . format ) &&
727
+ isStencilTextureFormat ( p . format ) &&
729
728
p . aspect1 !== 'all'
730
729
)
731
730
)
732
- . beforeAllSubcases ( t => {
733
- const { format } = t . params ;
734
- t . selectDeviceOrSkipTestCase ( kTextureFormatInfo [ format ] . feature ) ;
735
- } )
736
731
. fn ( t => {
737
732
const {
738
733
compute,
@@ -749,6 +744,7 @@ g.test('subresources_and_binding_types_combination_for_aspect')
749
744
_usageSuccess,
750
745
} = t . params ;
751
746
747
+ t . skipIfTextureFormatNotSupported ( format ) ;
752
748
t . skipIf ( t . isCompatibility , 'sub ranges of layers are not supported in compat mode' ) ;
753
749
754
750
const texture = t . createTestTexture ( {
@@ -775,8 +771,8 @@ g.test('subresources_and_binding_types_combination_for_aspect')
775
771
aspect : aspect1 ,
776
772
} ) ;
777
773
const view1ResolvedFormat = kDepthStencilFormatResolvedAspect [ format ] [ aspect1 ] ! ;
778
- const view1HasDepth = kTextureFormatInfo [ view1ResolvedFormat ] . depth ;
779
- const view1HasStencil = kTextureFormatInfo [ view1ResolvedFormat ] . stencil ;
774
+ const view1HasDepth = isDepthTextureFormat ( view1ResolvedFormat ) ;
775
+ const view1HasStencil = isStencilTextureFormat ( view1ResolvedFormat ) ;
780
776
781
777
const encoder = t . device . createCommandEncoder ( ) ;
782
778
// Color attachment's size should match depth/stencil attachment's size. Note that if
@@ -813,8 +809,8 @@ g.test('subresources_and_binding_types_combination_for_aspect')
813
809
case 'stencil-only' :
814
810
return 'uint' ;
815
811
case 'all' :
816
- assert ( kTextureFormatInfo [ format ] . depth !== kTextureFormatInfo [ format ] . stencil ) ;
817
- if ( kTextureFormatInfo [ format ] . stencil ) {
812
+ assert ( isDepthTextureFormat ( format ) !== isStencilTextureFormat ( format ) ) ;
813
+ if ( isStencilTextureFormat ( format ) ) {
818
814
return 'uint' ;
819
815
}
820
816
return 'depth' ;
@@ -1157,9 +1153,9 @@ g.test('bindings_in_bundle')
1157
1153
1158
1154
t . skipIfNeedStorageTexturesByResourceTypeAndNoStorageTextures ( type0 , GPUShaderStage . FRAGMENT ) ;
1159
1155
t . skipIfNeedStorageTexturesByResourceTypeAndNoStorageTextures ( type1 , GPUShaderStage . FRAGMENT ) ;
1160
- t . skipIf (
1161
- _sampleCount ! > 1 && ! isMultisampledTextureFormatDeprecated ( 'r32float' , t . isCompatibility )
1162
- ) ;
1156
+ if ( _sampleCount ! > 1 ) {
1157
+ t . skipIfTextureFormatNotMultisampled ( 'r32float' ) ;
1158
+ }
1163
1159
1164
1160
// Two bindings are attached to the same texture view.
1165
1161
const usage =
0 commit comments