Skip to content

Commit

Permalink
use Type.type
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Mar 12, 2024
1 parent 353d053 commit 9d03161
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ Validation tests for the ${builtin}() builtin.
import { makeTestGroup } from '../../../../../../common/framework/test_group.js';
import { keysOf, objectsToRecord } from '../../../../../../common/util/data_tables.js';
import {
i32Type,
Type,
kConcreteIntegerScalarsAndVectors,
kConvertableToFloatScalarsAndVectors,
u32Type,
isConvertible,
} from '../../../../../util/conversion.js';
import { ShaderValidationTest } from '../../../shader_validation_test.js';
Expand Down Expand Up @@ -133,7 +132,7 @@ Validates that only incorrect array_index arguments are rejected by ${builtin}
`;

const expectSuccess =
isConvertible(arrayIndexArgType, i32Type) || isConvertible(arrayIndexArgType, u32Type);
isConvertible(arrayIndexArgType, Type.i32) || isConvertible(arrayIndexArgType, Type.u32);
t.expectCompileResult(expectSuccess, code);
});

Expand Down
4 changes: 2 additions & 2 deletions src/webgpu/util/conversion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -882,10 +882,10 @@ function valueFromBytes<A extends TypedArrayBufferView>(
const abstractIntType = new ScalarType('abstract-int', 8, (buf: Uint8Array, offset: number) =>
abstractInt(valueFromBytes(workingDataI64, buf, offset))
);
export const i32Type = new ScalarType('i32', 4, (buf: Uint8Array, offset: number) =>
const i32Type = new ScalarType('i32', 4, (buf: Uint8Array, offset: number) =>
i32(valueFromBytes(workingDataI32, buf, offset))
);
export const u32Type = new ScalarType('u32', 4, (buf: Uint8Array, offset: number) =>
const u32Type = new ScalarType('u32', 4, (buf: Uint8Array, offset: number) =>
u32(valueFromBytes(workingDataU32, buf, offset))
);
const i16Type = new ScalarType('i16', 2, (buf: Uint8Array, offset: number) =>
Expand Down

0 comments on commit 9d03161

Please sign in to comment.