Skip to content

Commit

Permalink
Add missing types to indirection expression tests (#3384)
Browse files Browse the repository at this point in the history
Add bool, u32, and f16 to tests.
  • Loading branch information
amaiorano authored Feb 12, 2024
1 parent 8ca8543 commit b73e8cc
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions src/webgpu/shader/execution/expression/unary/indirection.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,15 @@ Pointer expression dereference.
u
.combine('inputSource', allButConstInputSource)
.combine('vectorize', [undefined, 2, 3, 4] as const)
.combine('scalarType', ['u32', 'i32', 'f32'] as ScalarKind[])
.combine('scalarType', ['bool', 'u32', 'i32', 'f32', 'f16'] as ScalarKind[])
.combine('derefType', keysOf(kDerefCases))
.filter(p => !kDerefCases[p.derefType].requires_pointer_composite_access)
)
.beforeAllSubcases(t => {
if (t.params.scalarType === 'f16') {
t.selectDeviceOrSkipTestCase({ requiredFeatures: ['shader-f16'] });
}
})
.fn(async t => {
const ty = scalarType(t.params.scalarType);
const cases = sparseScalarF32Range().map(e => {
Expand Down Expand Up @@ -83,9 +88,14 @@ Pointer expression dereference as lhs of index accessor expression
u
.combine('inputSource', allButConstInputSource)
.combine('vectorize', [undefined, 2, 3, 4] as const)
.combine('scalarType', ['i32', 'f32'] as ScalarKind[])
.combine('scalarType', ['bool', 'u32', 'i32', 'f32', 'f16'] as ScalarKind[])
.combine('derefType', keysOf(kDerefCases))
)
.beforeAllSubcases(t => {
if (t.params.scalarType === 'f16') {
t.selectDeviceOrSkipTestCase({ requiredFeatures: ['shader-f16'] });
}
})
.fn(async t => {
if (
kDerefCases[t.params.derefType].requires_pointer_composite_access &&
Expand Down Expand Up @@ -124,9 +134,14 @@ Pointer expression dereference as lhs of member accessor expression
u
.combine('inputSource', allButConstInputSource)
.combine('vectorize', [undefined, 2, 3, 4] as const)
.combine('scalarType', ['i32', 'f32'] as ScalarKind[])
.combine('scalarType', ['bool', 'u32', 'i32', 'f32', 'f16'] as ScalarKind[])
.combine('derefType', keysOf(kDerefCases))
)
.beforeAllSubcases(t => {
if (t.params.scalarType === 'f16') {
t.selectDeviceOrSkipTestCase({ requiredFeatures: ['shader-f16'] });
}
})
.fn(async t => {
if (
kDerefCases[t.params.derefType].requires_pointer_composite_access &&
Expand Down

0 comments on commit b73e8cc

Please sign in to comment.