@@ -542,6 +542,7 @@ g.test('check_capability_guarantees')
542
542
`check any adapter returned by requestAdapter() must provide the following guarantees:
543
543
- "texture-compression-bc" is supported or both "texture-compression-etc2" and "texture-compression-astc" are supported
544
544
- either "texture-compression-bc" or "texture-compression-bc-sliced-3d" is supported, both must be supported.
545
+ - if "texture-compression-astc-sliced-3d" is supported, then "texture-compression-astc" must be supported.
545
546
`
546
547
)
547
548
. fn ( async t => {
@@ -551,16 +552,24 @@ g.test('check_capability_guarantees')
551
552
const features = adapter . features ;
552
553
553
554
const supportsBC = features . has ( 'texture-compression-bc' ) ;
554
- const supportsETC2ASTC =
555
- features . has ( 'texture-compression-etc2' ) && features . has ( 'texture-compression-astc' ) ;
556
555
const supportsBCSliced3D = features . has ( 'texture-compression-bc-sliced-3d' ) ;
556
+ const supportsASTC = features . has ( 'texture-compression-astc' ) ;
557
+ const supportsASTCSliced3D = features . has ( 'texture-compression-astc-sliced-3d' ) ;
558
+ const supportsETC2 = features . has ( 'texture-compression-etc2' ) ;
557
559
558
- t . expect ( supportsBC || supportsETC2ASTC , 'Adapter must support BC or both ETC2 and ASTC' ) ;
560
+ t . expect (
561
+ supportsBC || ( supportsETC2 && supportsASTC ) ,
562
+ 'Adapter must support BC or both ETC2 and ASTC'
563
+ ) ;
559
564
560
565
if ( supportsBC || supportsBCSliced3D ) {
561
566
t . expect (
562
567
supportsBC && supportsBCSliced3D ,
563
568
'If BC or BC Sliced 3D is supported, both must be'
564
569
) ;
565
570
}
571
+
572
+ if ( supportsASTCSliced3D ) {
573
+ t . expect ( supportsASTC , 'If ASTC Sliced 3D is supported, ASTC must be supported' ) ;
574
+ }
566
575
} ) ;
0 commit comments