@adobe/data 0.5.11 → 0.5.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ecs/archetype/archetype.d.ts +2 -1
- package/dist/ecs/archetype/archetype.js +14 -0
- package/dist/ecs/archetype/archetype.js.map +1 -1
- package/dist/ecs/archetype/create-archetype.d.ts +2 -2
- package/dist/ecs/archetype/create-archetype.test.js +6 -6
- package/dist/ecs/archetype/create-archetype.test.js.map +1 -1
- package/dist/ecs/archetype/delete-row.test.js +4 -4
- package/dist/ecs/archetype/delete-row.test.js.map +1 -1
- package/dist/ecs/database/transactional-store/apply-operations.js.map +1 -1
- package/dist/ecs/database/transactional-store/create-transactional-store.js.map +1 -1
- package/dist/ecs/database/transactional-store/transactional-store.d.ts +1 -1
- package/dist/ecs/entity/entity.d.ts +8 -0
- package/dist/ecs/entity/entity.js +3 -0
- package/dist/ecs/entity/entity.js.map +1 -0
- package/dist/ecs/entity/u32.d.ts +8 -0
- package/dist/{lit/elements/service-context.js → ecs/entity/u32.js} +3 -3
- package/dist/ecs/entity/u32.js.map +1 -0
- package/dist/ecs/entity.d.ts +2 -2
- package/dist/ecs/entity.js +1 -1
- package/dist/ecs/entity.js.map +1 -1
- package/dist/ecs/index.d.ts +2 -1
- package/dist/ecs/index.js +2 -1
- package/dist/ecs/index.js.map +1 -1
- package/dist/ecs/store/core/create-core.js +2 -2
- package/dist/ecs/store/core/create-core.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/lit/hooks/use-element.d.ts +3 -0
- package/dist/lit/hooks/use-element.js +63 -5
- package/dist/lit/hooks/use-element.js.map +1 -1
- package/dist/math/f32/f32.d.ts +2 -3
- package/dist/math/f32/f32.js +2 -2
- package/dist/mutable-clone.d.ts +1 -4
- package/dist/mutable-clone.js +21 -0
- package/dist/mutable-clone.js.map +1 -1
- package/dist/mutable.d.ts +9 -0
- package/dist/mutable.js +26 -0
- package/dist/mutable.js.map +1 -0
- package/dist/samples/todo/services/state-service/create-todo-database.d.ts +2 -2
- package/dist/samples/todo/services/state-service/create-todo-store.d.ts +2 -2
- package/dist/schema/schema.d.ts +15 -0
- package/dist/schema/schema.js.map +1 -1
- package/dist/schema/to-vertex-buffer-layout.d.ts +56 -0
- package/dist/schema/to-vertex-buffer-layout.js +129 -0
- package/dist/schema/to-vertex-buffer-layout.js.map +1 -0
- package/dist/schema/to-vertex-buffer-layout.test.d.ts +1 -0
- package/dist/schema/to-vertex-buffer-layout.test.js +247 -0
- package/dist/schema/to-vertex-buffer-layout.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/typed-buffer/create-struct-buffer.js +3 -3
- package/dist/typed-buffer/create-struct-buffer.js.map +1 -1
- package/dist/typed-buffer/create-struct-buffer.test.d.ts +1 -0
- package/dist/typed-buffer/create-struct-buffer.test.js +227 -0
- package/dist/typed-buffer/create-struct-buffer.test.js.map +1 -0
- package/dist/typed-buffer/create-typed-buffer.js +3 -1
- package/dist/typed-buffer/create-typed-buffer.js.map +1 -1
- package/dist/typed-buffer/create-typed-buffer.test.d.ts +1 -0
- package/dist/typed-buffer/create-typed-buffer.test.js +148 -0
- package/dist/typed-buffer/create-typed-buffer.test.js.map +1 -0
- package/dist/typed-buffer/structs/get-struct-layout.d.ts +0 -1
- package/dist/typed-buffer/structs/get-struct-layout.js +72 -39
- package/dist/typed-buffer/structs/get-struct-layout.js.map +1 -1
- package/dist/typed-buffer/structs/get-struct-layout.test.js +137 -0
- package/dist/typed-buffer/structs/get-struct-layout.test.js.map +1 -1
- package/dist/typed-buffer/structs/struct-layout.d.ts +4 -0
- package/dist/types/types.d.ts +5 -0
- package/dist/types/types.js +3 -0
- package/dist/types/types.js.map +1 -1
- package/package.json +1 -1
- package/dist/lit/elements/service-application.d.ts +0 -9
- package/dist/lit/elements/service-application.js +0 -55
- package/dist/lit/elements/service-application.js.map +0 -1
- package/dist/lit/elements/service-context.d.ts +0 -1
- package/dist/lit/elements/service-context.js.map +0 -1
- package/dist/lit/elements/service-element.d.ts +0 -6
- package/dist/lit/elements/service-element.js +0 -43
- package/dist/lit/elements/service-element.js.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export declare const todoStoreSchemaVersion = 1;
|
|
2
2
|
export declare const createTodoStore: () => import("../../../../ecs/index.js").Store<{
|
|
3
|
-
todo: true;
|
|
4
3
|
name: string;
|
|
5
4
|
order: number;
|
|
5
|
+
todo: true;
|
|
6
6
|
complete: boolean;
|
|
7
7
|
dragPosition: number | null;
|
|
8
8
|
}, {
|
|
9
9
|
displayCompleted: boolean;
|
|
10
10
|
}, {
|
|
11
|
-
Todo: ("
|
|
11
|
+
Todo: ("name" | "order" | "todo" | "complete" | "dragPosition")[];
|
|
12
12
|
}>;
|
|
13
13
|
export type TodoStore = ReturnType<typeof createTodoStore>;
|
package/dist/schema/schema.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { TypedBuffer } from "../typed-buffer/typed-buffer.js";
|
|
|
2
2
|
import { DeepReadonly } from "../types/types.js";
|
|
3
3
|
type JSONPath = string;
|
|
4
4
|
type JSONMergePatch = unknown;
|
|
5
|
+
export type Layout = "std140" | "packed";
|
|
5
6
|
/**
|
|
6
7
|
* Conditional patch applied to the path when the enclosing schema branch is active
|
|
7
8
|
* and `match` is not present or validates against the root.
|
|
@@ -57,6 +58,20 @@ export interface Schema {
|
|
|
57
58
|
allOf?: readonly Schema[];
|
|
58
59
|
const?: any;
|
|
59
60
|
enum?: readonly any[];
|
|
61
|
+
layout?: Layout;
|
|
62
|
+
/**
|
|
63
|
+
* Classification of data according to privacy regulations and cookie consent frameworks.
|
|
64
|
+
* Used to categorize data collection and processing for privacy compliance.
|
|
65
|
+
* Useful resource:
|
|
66
|
+
* https://www.onetrust.com/products/cookie-consent/
|
|
67
|
+
*
|
|
68
|
+
* @remarks
|
|
69
|
+
* - `strictlyNecessary`: Essential data required for basic functionality and security
|
|
70
|
+
* - `performance`: Data used for analytics, performance monitoring, and site optimization
|
|
71
|
+
* - `functional`: Data used for enhanced features and user experience improvements
|
|
72
|
+
* - `advertising`: Data used for advertising, marketing, and personalized content
|
|
73
|
+
*/
|
|
74
|
+
privacy?: 'strictlyNecessary' | 'performance' | 'functional' | 'advertising';
|
|
60
75
|
}
|
|
61
76
|
export type FromSchemas<T> = {
|
|
62
77
|
[K in keyof T]: FromSchema<T[K]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/schema/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/schema/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AA4OX,MAAM,QAAQ,GAAG;IACf,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACrB,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACrB,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE;KACvB;IACD,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;IACpB,oBAAoB,EAAE,KAAK;CACF,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Layout, Schema } from "./schema.js";
|
|
2
|
+
export interface GPUVertexBufferLayout {
|
|
3
|
+
arrayStride: number;
|
|
4
|
+
stepMode?: 'vertex' | 'instance';
|
|
5
|
+
attributes: GPUVertexAttributeDescriptor[];
|
|
6
|
+
}
|
|
7
|
+
export interface GPUVertexAttributeDescriptor {
|
|
8
|
+
format: GPUVertexFormat;
|
|
9
|
+
offset: number;
|
|
10
|
+
shaderLocation: number;
|
|
11
|
+
}
|
|
12
|
+
export type GPUVertexFormat = 'uint8x2' | 'uint8x8' | 'sint8x2' | 'sint8x8' | 'unorm8x2' | 'unorm8x8' | 'snorm8x2' | 'snorm8x8' | 'uint16x2' | 'uint16x4' | 'sint16x2' | 'sint16x4' | 'unorm16x2' | 'unorm16x4' | 'snorm16x2' | 'snorm16x4' | 'float16x2' | 'float16x4' | 'float32' | 'float32x2' | 'float32x3' | 'float32x4' | 'uint32' | 'uint32x2' | 'uint32x3' | 'uint32x4' | 'sint32' | 'sint32x2' | 'sint32x3' | 'sint32x4';
|
|
13
|
+
/**
|
|
14
|
+
* Options for configuring vertex buffer layout generation
|
|
15
|
+
*/
|
|
16
|
+
export interface VertexBufferLayoutOptions {
|
|
17
|
+
/** Layout mode to use (defaults to schema.layout or "packed") */
|
|
18
|
+
layout?: Layout;
|
|
19
|
+
/** Custom shader location mapping for fields */
|
|
20
|
+
shaderLocations?: Partial<Record<string, number>>;
|
|
21
|
+
/** Step mode for vertex buffer (default: 'vertex') */
|
|
22
|
+
stepMode?: 'vertex' | 'instance';
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Converts a Schema to a WebGPU GPUVertexBufferLayout descriptor
|
|
26
|
+
*
|
|
27
|
+
* @param schema - Schema defining the vertex structure
|
|
28
|
+
* @param options - Configuration options for layout generation
|
|
29
|
+
* @returns GPUVertexBufferLayout descriptor ready for WebGPU pipeline creation
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```typescript
|
|
33
|
+
* const vertexLayout = schemaToVertexBufferLayout(positionColorNormalVertexSchema, {
|
|
34
|
+
* shaderLocations: { position: 0, color: 8, normal: 9 }
|
|
35
|
+
* });
|
|
36
|
+
*
|
|
37
|
+
* const pipeline = device.createRenderPipeline({
|
|
38
|
+
* vertex: {
|
|
39
|
+
* module: shaderModule,
|
|
40
|
+
* entryPoint: 'vs_main',
|
|
41
|
+
* buffers: [{ ...vertexLayout }]
|
|
42
|
+
* },
|
|
43
|
+
* // ...
|
|
44
|
+
* });
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export declare function schemaToVertexBufferLayout<S extends Schema>(schema: S, options?: VertexBufferLayoutOptions): GPUVertexBufferLayout;
|
|
48
|
+
/**
|
|
49
|
+
* Type-safe helper to generate vertex buffer layout for a specific schema type
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```typescript
|
|
53
|
+
* const positionColorLayout = positionColorNormalVertexSchema |> schemaToVertexBufferLayoutForType;
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export declare function schemaToVertexBufferLayoutForType<T extends Schema>(schema: T, options?: VertexBufferLayoutOptions): GPUVertexBufferLayout;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/*MIT License
|
|
2
|
+
|
|
3
|
+
© Copyright 2025 Adobe. All rights reserved.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.*/
|
|
22
|
+
import { getStructLayout } from "../typed-buffer/structs/get-struct-layout.js";
|
|
23
|
+
/**
|
|
24
|
+
* Converts a struct field layout to equivalent WebGPU vertex format
|
|
25
|
+
*/
|
|
26
|
+
function fieldLayoutToVertexFormat(fieldLayout) {
|
|
27
|
+
if (typeof fieldLayout === "string") {
|
|
28
|
+
// Handle primitive types
|
|
29
|
+
switch (fieldLayout) {
|
|
30
|
+
case "f32": return "float32";
|
|
31
|
+
case "i32": return "sint32";
|
|
32
|
+
case "u32": return "uint32";
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (typeof fieldLayout === "object" && fieldLayout.type === "array") {
|
|
36
|
+
// Handle array/vector types
|
|
37
|
+
const size = fieldLayout.size;
|
|
38
|
+
const elementCount = getVectorElementCount(fieldLayout);
|
|
39
|
+
switch (elementCount) {
|
|
40
|
+
case 1: return "float32"; // f32
|
|
41
|
+
case 2: return "float32x2"; // vec2
|
|
42
|
+
case 3: return "float32x3"; // vec3
|
|
43
|
+
case 4: return "float32x4"; // vec4
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
throw new Error(`Unsupported field layout for vertex buffer: ${JSON.stringify(fieldLayout)}`);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Determines the number of elements in a vector from field layout
|
|
50
|
+
*/
|
|
51
|
+
function getVectorElementCount(fieldLayout) {
|
|
52
|
+
// For fixed-size arrays like Vec3/Vec4, count the fields
|
|
53
|
+
const fieldCount = Object.keys(fieldLayout.fields).length;
|
|
54
|
+
if (fieldCount >= 1 && fieldCount <= 4) {
|
|
55
|
+
return fieldCount;
|
|
56
|
+
}
|
|
57
|
+
throw new Error(`Vector dimensions must be 1-4 elements, got ${fieldCount}`);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Converts a Schema to a WebGPU GPUVertexBufferLayout descriptor
|
|
61
|
+
*
|
|
62
|
+
* @param schema - Schema defining the vertex structure
|
|
63
|
+
* @param options - Configuration options for layout generation
|
|
64
|
+
* @returns GPUVertexBufferLayout descriptor ready for WebGPU pipeline creation
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```typescript
|
|
68
|
+
* const vertexLayout = schemaToVertexBufferLayout(positionColorNormalVertexSchema, {
|
|
69
|
+
* shaderLocations: { position: 0, color: 8, normal: 9 }
|
|
70
|
+
* });
|
|
71
|
+
*
|
|
72
|
+
* const pipeline = device.createRenderPipeline({
|
|
73
|
+
* vertex: {
|
|
74
|
+
* module: shaderModule,
|
|
75
|
+
* entryPoint: 'vs_main',
|
|
76
|
+
* buffers: [{ ...vertexLayout }]
|
|
77
|
+
* },
|
|
78
|
+
* // ...
|
|
79
|
+
* });
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
export function schemaToVertexBufferLayout(schema, options = {}) {
|
|
83
|
+
// Determine layout to use
|
|
84
|
+
const layoutMode = options.layout ?? schema.layout ?? "packed";
|
|
85
|
+
// Get struct layout information
|
|
86
|
+
const structLayout = getStructLayout({ ...schema, layout: layoutMode }, true);
|
|
87
|
+
if (!structLayout) {
|
|
88
|
+
throw new Error("Schema is not a valid vertex buffer layout - must be a struct schema");
|
|
89
|
+
}
|
|
90
|
+
const attributes = [];
|
|
91
|
+
let nextShaderLocation = 0;
|
|
92
|
+
// Generate attributes for each field
|
|
93
|
+
for (const [fieldName, fieldLayout] of Object.entries(structLayout.fields)) {
|
|
94
|
+
const shaderLocation = options.shaderLocations?.[fieldName] ?? nextShaderLocation;
|
|
95
|
+
try {
|
|
96
|
+
const format = fieldLayoutToVertexFormat(fieldLayout.type);
|
|
97
|
+
attributes.push({
|
|
98
|
+
format,
|
|
99
|
+
offset: fieldLayout.offset,
|
|
100
|
+
shaderLocation
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
catch (error) {
|
|
104
|
+
throw new Error(`Field "${fieldName}" cannot be converted to vertex format: ${error instanceof Error ? error.message : String(error)}`);
|
|
105
|
+
}
|
|
106
|
+
if (!options.shaderLocations?.[fieldName]) {
|
|
107
|
+
nextShaderLocation++;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
// Sort attributes by shader location for logical ordering
|
|
111
|
+
attributes.sort((a, b) => a.shaderLocation - b.shaderLocation);
|
|
112
|
+
return {
|
|
113
|
+
arrayStride: structLayout.size,
|
|
114
|
+
stepMode: options.stepMode ?? 'vertex',
|
|
115
|
+
attributes
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Type-safe helper to generate vertex buffer layout for a specific schema type
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```typescript
|
|
123
|
+
* const positionColorLayout = positionColorNormalVertexSchema |> schemaToVertexBufferLayoutForType;
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
export function schemaToVertexBufferLayoutForType(schema, options) {
|
|
127
|
+
return schemaToVertexBufferLayout(schema, options);
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=to-vertex-buffer-layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"to-vertex-buffer-layout.js","sourceRoot":"","sources":["../../src/schema/to-vertex-buffer-layout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAIX,OAAO,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AA+C/E;;GAEG;AACH,SAAS,yBAAyB,CAAC,WAAkC;IACjE,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE,CAAC;QAClC,yBAAyB;QACzB,QAAQ,WAAW,EAAE,CAAC;YAClB,KAAK,KAAK,CAAC,CAAC,OAAO,SAAS,CAAC;YAC7B,KAAK,KAAK,CAAC,CAAC,OAAO,QAAQ,CAAC;YAC5B,KAAK,KAAK,CAAC,CAAC,OAAO,QAAQ,CAAC;QAChC,CAAC;IACL,CAAC;IAED,IAAI,OAAO,WAAW,KAAK,QAAQ,IAAI,W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,MAAS,EACT,OAAmC;IAEnC,OAAO,0BAA0B,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACvD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
/*MIT License
|
|
2
|
+
|
|
3
|
+
© Copyright 2025 Adobe. All rights reserved.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.*/
|
|
22
|
+
import { describe, it, expect } from "vitest";
|
|
23
|
+
import { schemaToVertexBufferLayout, schemaToVertexBufferLayoutForType } from "./to-vertex-buffer-layout.js";
|
|
24
|
+
describe("schemaToVertexBufferLayout", () => {
|
|
25
|
+
describe("position-color-normal vertex schema", () => {
|
|
26
|
+
const positionColorNormalSchema = {
|
|
27
|
+
type: "object",
|
|
28
|
+
properties: {
|
|
29
|
+
position: {
|
|
30
|
+
type: "array",
|
|
31
|
+
items: { type: "number", precision: 1 },
|
|
32
|
+
minItems: 3,
|
|
33
|
+
maxItems: 3
|
|
34
|
+
},
|
|
35
|
+
color: {
|
|
36
|
+
type: "array",
|
|
37
|
+
items: { type: "number", precision: 1 },
|
|
38
|
+
minItems: 4,
|
|
39
|
+
maxItems: 4
|
|
40
|
+
},
|
|
41
|
+
normal: {
|
|
42
|
+
type: "array",
|
|
43
|
+
items: { type: "number", precision: 1 },
|
|
44
|
+
minItems: 3,
|
|
45
|
+
maxItems: 3
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
layout: "packed"
|
|
49
|
+
};
|
|
50
|
+
it("should generate correct packed layout for position-color-normal", () => {
|
|
51
|
+
const layout = schemaToVertexBufferLayout(positionColorNormalSchema);
|
|
52
|
+
expect(layout.arrayStride).toBe(40); // 3 + 4 + 3 = 10 floats × 4 bytes = 40 bytes
|
|
53
|
+
expect(layout.stepMode).toBe("vertex");
|
|
54
|
+
expect(layout.attributes).toHaveLength(3);
|
|
55
|
+
// Position: Vec3 at offset 0
|
|
56
|
+
expect(layout.attributes[0]).toEqual({
|
|
57
|
+
format: "float32x3",
|
|
58
|
+
offset: 0,
|
|
59
|
+
shaderLocation: 0
|
|
60
|
+
});
|
|
61
|
+
// Color: Vec4 at offset 12
|
|
62
|
+
expect(layout.attributes[1]).toEqual({
|
|
63
|
+
format: "float32x4",
|
|
64
|
+
offset: 12,
|
|
65
|
+
shaderLocation: 1
|
|
66
|
+
});
|
|
67
|
+
// Normal: Vec3 at offset 28
|
|
68
|
+
expect(layout.attributes[2]).toEqual({
|
|
69
|
+
format: "float32x3",
|
|
70
|
+
offset: 28,
|
|
71
|
+
shaderLocation: 2
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
it("should allow custom shader locations", () => {
|
|
75
|
+
const layout = schemaToVertexBufferLayout(positionColorNormalSchema, {
|
|
76
|
+
shaderLocations: {
|
|
77
|
+
position: 0,
|
|
78
|
+
color: 8,
|
|
79
|
+
normal: 9
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
expect(layout.attributes.find(a => a.shaderLocation === 0)?.offset).toBe(0);
|
|
83
|
+
expect(layout.attributes.find(a => a.shaderLocation === 8)?.offset).toBe(12);
|
|
84
|
+
expect(layout.attributes.find(a => a.shaderLocation === 9)?.offset).toBe(28);
|
|
85
|
+
});
|
|
86
|
+
it("should support instance step mode", () => {
|
|
87
|
+
const layout = schemaToVertexBufferLayout(positionColorNormalSchema, {
|
|
88
|
+
stepMode: "instance"
|
|
89
|
+
});
|
|
90
|
+
expect(layout.stepMode).toBe("instance");
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
describe("simple position schema", () => {
|
|
94
|
+
const positionSchema = {
|
|
95
|
+
type: "object",
|
|
96
|
+
properties: {
|
|
97
|
+
position: {
|
|
98
|
+
type: "array",
|
|
99
|
+
items: { type: "number", precision: 1 },
|
|
100
|
+
minItems: 3,
|
|
101
|
+
maxItems: 3
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
layout: "packed"
|
|
105
|
+
};
|
|
106
|
+
it("should generate minimal vertex layout", () => {
|
|
107
|
+
const layout = schemaToVertexBufferLayout(positionSchema);
|
|
108
|
+
expect(layout.arrayStride).toBe(12); // Vec3 = 12 bytes
|
|
109
|
+
expect(layout.attributes).toHaveLength(1);
|
|
110
|
+
expect(layout.attributes[0]).toEqual({
|
|
111
|
+
format: "float32x3",
|
|
112
|
+
offset: 0,
|
|
113
|
+
shaderLocation: 0
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
describe("primitive type schemas", () => {
|
|
118
|
+
it("should handle single float", () => {
|
|
119
|
+
const schema = {
|
|
120
|
+
type: "object",
|
|
121
|
+
properties: {
|
|
122
|
+
weight: { type: "number", precision: 1 }
|
|
123
|
+
},
|
|
124
|
+
layout: "packed"
|
|
125
|
+
};
|
|
126
|
+
const layout = schemaToVertexBufferLayout(schema);
|
|
127
|
+
expect(layout.arrayStride).toBe(4);
|
|
128
|
+
expect(layout.attributes[0]).toEqual({
|
|
129
|
+
format: "float32",
|
|
130
|
+
offset: 0,
|
|
131
|
+
shaderLocation: 0
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
it("should handle integer types", () => {
|
|
135
|
+
const schema = {
|
|
136
|
+
type: "object",
|
|
137
|
+
properties: {
|
|
138
|
+
id: { type: "integer", minimum: 0, maximum: 65535 }
|
|
139
|
+
},
|
|
140
|
+
layout: "packed"
|
|
141
|
+
};
|
|
142
|
+
const layout = schemaToVertexBufferLayout(schema);
|
|
143
|
+
expect(layout.arrayStride).toBe(4);
|
|
144
|
+
expect(layout.attributes[0]).toEqual({
|
|
145
|
+
format: "uint32",
|
|
146
|
+
offset: 0,
|
|
147
|
+
shaderLocation: 0
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
describe("error handling", () => {
|
|
152
|
+
it("should throw error for non-struct schemas", () => {
|
|
153
|
+
const arraySchema = {
|
|
154
|
+
type: "array",
|
|
155
|
+
items: { type: "number" }
|
|
156
|
+
};
|
|
157
|
+
expect(() => {
|
|
158
|
+
schemaToVertexBufferLayout(arraySchema);
|
|
159
|
+
}).toThrow(/Array must have fixed length/);
|
|
160
|
+
});
|
|
161
|
+
it("should throw error for unsupported field types", () => {
|
|
162
|
+
const schema = {
|
|
163
|
+
type: "object",
|
|
164
|
+
properties: {
|
|
165
|
+
name: { type: "string" }
|
|
166
|
+
},
|
|
167
|
+
layout: "packed"
|
|
168
|
+
};
|
|
169
|
+
expect(() => {
|
|
170
|
+
schemaToVertexBufferLayout(schema);
|
|
171
|
+
}).toThrow(/not a valid struct type/);
|
|
172
|
+
});
|
|
173
|
+
it("should throw error for oversized vectors", () => {
|
|
174
|
+
const schema = {
|
|
175
|
+
type: "object",
|
|
176
|
+
properties: {
|
|
177
|
+
values: {
|
|
178
|
+
type: "array",
|
|
179
|
+
items: { type: "number", precision: 1 },
|
|
180
|
+
minItems: 5,
|
|
181
|
+
maxItems: 5
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
layout: "packed"
|
|
185
|
+
};
|
|
186
|
+
expect(() => {
|
|
187
|
+
schemaToVertexBufferLayout(schema);
|
|
188
|
+
}).toThrow(/dimensions must be 1-4 elements/);
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
describe("layout mode handling", () => {
|
|
192
|
+
it("should use schema layout by default", () => {
|
|
193
|
+
const schema = {
|
|
194
|
+
type: "object",
|
|
195
|
+
properties: {
|
|
196
|
+
position: {
|
|
197
|
+
type: "array",
|
|
198
|
+
items: { type: "number", precision: 1 },
|
|
199
|
+
minItems: 3,
|
|
200
|
+
maxItems: 3
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
layout: "packed"
|
|
204
|
+
};
|
|
205
|
+
const layout = schemaToVertexBufferLayout(schema);
|
|
206
|
+
expect(layout.arrayStride).toBe(12); // Packed: tight packing
|
|
207
|
+
});
|
|
208
|
+
it("should override schema layout when specified", () => {
|
|
209
|
+
const schema = {
|
|
210
|
+
type: "object",
|
|
211
|
+
properties: {
|
|
212
|
+
position: {
|
|
213
|
+
type: "array",
|
|
214
|
+
items: { type: "number", precision: 1 },
|
|
215
|
+
minItems: 3,
|
|
216
|
+
maxItems: 3
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
layout: "packed"
|
|
220
|
+
};
|
|
221
|
+
const layout = schemaToVertexBufferLayout(schema, {
|
|
222
|
+
layout: "std140"
|
|
223
|
+
});
|
|
224
|
+
expect(layout.arrayStride).toBe(16); // std140: 16-byte alignment
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
describe("type-safe helper", () => {
|
|
228
|
+
it("should work with schemaToVertexBufferLayoutForType", () => {
|
|
229
|
+
const testSchema = {
|
|
230
|
+
type: "object",
|
|
231
|
+
properties: {
|
|
232
|
+
position: {
|
|
233
|
+
type: "array",
|
|
234
|
+
items: { type: "number", precision: 1 },
|
|
235
|
+
minItems: 2,
|
|
236
|
+
maxItems: 2
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
layout: "packed"
|
|
240
|
+
};
|
|
241
|
+
const layout = schemaToVertexBufferLayoutForType(testSchema);
|
|
242
|
+
expect(layout.arrayStride).toBe(8); // Vec2 = 8 bytes
|
|
243
|
+
expect(layout.attributes[0].format).toBe("float32x2");
|
|
244
|
+
});
|
|
245
|
+
});
|
|
246
|
+
});
|
|
247
|
+
//# sourceMappingURL=to-vertex-buffer-layout.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"to-vertex-buffer-layout.test.js","sourceRoot":"","sources":["../../src/schema/to-vertex-buffer-layout.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AACX,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,0BAA0B,EAAE,iCAAiC,EAAE,MAAM,8BAA8B,CAAC;AAG7G,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IACxC,QAAQ,CAAC,qCAAqC,EAAE,GAAG,EAAE;QACjD,MAAM,yBAAyB,GAAW;YACtC,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACR,QAAQ,EAAE;oBACN,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE;oBACvC,QAAQ,EAAE,CAAC;oBACX,QAAQ,EAAE,CAAC;iBACd;gBACD,KAAK,EAAE;oBACH,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE;oBACvC,QAAQ,EAAE,CAAC;oBACX,QAAQ,EAAE,CAAC;iBACd;gBACD,MAAM,E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