Skip to content

Sign up to be notified when the ShaderHunt platform is available, along with interactive examples teaching TypeGPU from the ground up.

deepEqual

deepEqual(a, b): boolean

Performs a deep comparison of two TypeGPU data schemas.

AnyData

The first data schema to compare.

AnyData

The second data schema to compare.

boolean

true if the schemas are deeply equal, false otherwise.

import { vec3f, struct, deepEqual } from 'typegpu/data';
const schema1 = struct({ a: vec3f });
const schema2 = struct({ a: vec3f });
const schema3 = struct({ b: vec3f });
console.log(deepEqual(schema1, schema2)); // true
console.log(deepEqual(schema1, schema3)); // false

packages/typegpu/src/data/deepEqual.ts:31