Skip to content

schemasEqualNominally

const schemasEqualNominally: TgpuComptime<(a, b) => boolean>

Defined in: packages/typegpu/src/data/schemasEqual.ts:46

Performs a nominal comparison of two TypeGPU data schemas. This means two struct definitions are only considered equal when they have the same object identity. Use schemasEqualStructurally for a structural comparison.

The first data schema to compare.

The second data schema to compare.

true if the schemas are nominally equal, false otherwise.

import { vec3f, struct, schemasEqualNominally } from 'typegpu/data';
const struct1 = struct({ a: vec3f });
const struct2 = struct({ a: vec3f });
console.log(schemasEqualNominally(d.arrayOf(struct1, 2), d.arrayOf(struct1, 2))); // true
console.log(schemasEqualNominally(struct1, struct2)); // false

© Software Mansion 2026. All trademarks and copyrights belong to their respective owners. Read about our Privacy Policy.