@@ -24,18 +24,18 @@ g.test('concrete_scalar')
2424 . desc ( `Test indexing of an array of concrete scalars` )
2525 . params ( u =>
2626 u
27- . combine (
28- 'inputSource' ,
29- // 'uniform' address space requires array stride to be multiple of 16 bytes
30- allInputSources . filter ( s => s !== 'uniform' )
31- )
27+ . combine ( 'inputSource' , allInputSources )
3228 . combine ( 'elementType' , [ 'i32' , 'u32' , 'f32' , 'f16' ] as const )
3329 . combine ( 'indexType' , [ 'i32' , 'u32' ] as const )
3430 )
3531 . fn ( async t => {
3632 if ( t . params . elementType === 'f16' ) {
3733 t . skipIfDeviceDoesNotHaveFeature ( 'shader-f16' ) ;
3834 }
35+ if ( t . params . inputSource === 'uniform' ) {
36+ // 'uniform' address space requires array stride to be multiple of 16 bytes without this language feature.
37+ t . skipIfLanguageFeatureNotSupported ( 'uniform_buffer_standard_layout' ) ;
38+ }
3939 const elementType = Type [ t . params . elementType ] ;
4040 const indexType = Type [ t . params . indexType ] ;
4141 const cases : Case [ ] = [
@@ -87,15 +87,14 @@ g.test('bool')
8787 . specURL ( 'https://www.w3.org/TR/WGSL/#array-access-expr' )
8888 . desc ( `Test indexing of an array of booleans` )
8989 . params ( u =>
90- u
91- . combine (
92- 'inputSource' ,
93- // 'uniform' address space requires array stride to be multiple of 16 bytes
94- allInputSources . filter ( s => s !== 'uniform' )
95- )
96- . combine ( 'indexType' , [ 'i32' , 'u32' ] as const )
90+ u . combine ( 'inputSource' , allInputSources ) . combine ( 'indexType' , [ 'i32' , 'u32' ] as const )
9791 )
9892 . fn ( async t => {
93+ if ( t . params . inputSource === 'uniform' ) {
94+ // 'uniform' address space requires array stride to be multiple of 16 bytes without this language feature.
95+ t . skipIfLanguageFeatureNotSupported ( 'uniform_buffer_standard_layout' ) ;
96+ }
97+
9998 const indexType = Type [ t . params . indexType ] ;
10099 const cases : Case [ ] = [
101100 {
@@ -290,16 +289,16 @@ g.test('vector')
290289 . params ( u =>
291290 u
292291 . combine ( 'inputSource' , allInputSources )
293- . expand ( 'elementType' , t =>
294- t . inputSource === 'uniform'
295- ? ( [ 'vec4i' , 'vec4u' , 'vec4f' ] as const )
296- : ( [ 'vec4i' , 'vec4u' , 'vec4f' , 'vec4h' ] as const )
297- )
292+ . expand ( 'elementType' , _ => [ 'vec4i' , 'vec4u' , 'vec4f' , 'vec4h' ] as const )
298293 . combine ( 'indexType' , [ 'i32' , 'u32' ] as const )
299294 )
300295 . fn ( async t => {
301296 if ( t . params . elementType === 'vec4h' ) {
302297 t . skipIfDeviceDoesNotHaveFeature ( 'shader-f16' ) ;
298+ if ( t . params . inputSource === 'uniform' ) {
299+ // 'uniform' address space requires array stride to be multiple of 16 bytes without this language feature.
300+ t . skipIfLanguageFeatureNotSupported ( 'uniform_buffer_standard_layout' ) ;
301+ }
303302 }
304303 const elementType = Type [ t . params . elementType ] ;
305304 const indexType = Type [ t . params . indexType ] ;
@@ -372,6 +371,14 @@ g.test('matrix')
372371 if ( t . params . elementType === 'f16' ) {
373372 t . skipIfDeviceDoesNotHaveFeature ( 'shader-f16' ) ;
374373 }
374+ if (
375+ t . params . inputSource === 'uniform' &&
376+ ! t . hasLanguageFeature ( 'uniform_buffer_standard_layout' )
377+ ) {
378+ // 'uniform' address space requires array stride to be multiple of 16 bytes without this language feature.
379+ const mat = Type . mat ( t . params . columns , t . params . rows , Type [ t . params . elementType ] ) ;
380+ t . skipIf ( ( align ( mat . size , mat . alignment ) & 15 ) !== 0 ) ;
381+ }
375382 const elementType = Type [ t . params . elementType ] ;
376383 const indexType = Type [ t . params . indexType ] ;
377384 const matrixType = Type . mat ( t . params . columns , t . params . rows , elementType ) ;
0 commit comments