@plasius/gpu-renderer 0.1.0

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/index.js ADDED
@@ -0,0 +1,334 @@
1
+ // src/index.js
2
+ var DEFAULT_CLEAR_COLOR = Object.freeze([0.07, 0.11, 0.18, 1]);
3
+ var DEFAULT_CANVAS_SELECTOR = "canvas[data-plasius-gpu-renderer]";
4
+ function clamp01(value) {
5
+ return Math.min(1, Math.max(0, value));
6
+ }
7
+ function parseHexChannel(channel) {
8
+ return parseInt(channel, 16) / 255;
9
+ }
10
+ function normalizeColor(value) {
11
+ if (Array.isArray(value)) {
12
+ const [r = 0, g = 0, b = 0, a = 1] = value;
13
+ return [clamp01(Number(r) || 0), clamp01(Number(g) || 0), clamp01(Number(b) || 0), clamp01(Number(a) || 0)];
14
+ }
15
+ if (typeof value === "string") {
16
+ const trimmed = value.trim();
17
+ if (/^#[0-9a-f]{3}$/i.test(trimmed)) {
18
+ const r = trimmed[1];
19
+ const g = trimmed[2];
20
+ const b = trimmed[3];
21
+ return [
22
+ parseHexChannel(r + r),
23
+ parseHexChannel(g + g),
24
+ parseHexChannel(b + b),
25
+ 1
26
+ ];
27
+ }
28
+ if (/^#[0-9a-f]{6}$/i.test(trimmed)) {
29
+ return [
30
+ parseHexChannel(trimmed.slice(1, 3)),
31
+ parseHexChannel(trimmed.slice(3, 5)),
32
+ parseHexChannel(trimmed.slice(5, 7)),
33
+ 1
34
+ ];
35
+ }
36
+ }
37
+ return [...DEFAULT_CLEAR_COLOR];
38
+ }
39
+ function now() {
40
+ if (typeof performance !== "undefined" && typeof performance.now === "function") {
41
+ return performance.now();
42
+ }
43
+ return Date.now();
44
+ }
45
+ function readNavigator(navigatorOverride) {
46
+ const currentNavigator = navigatorOverride ?? globalThis.navigator;
47
+ if (!currentNavigator || typeof currentNavigator !== "object") {
48
+ throw new Error("Navigator unavailable. Provide a browser-like navigator object.");
49
+ }
50
+ return currentNavigator;
51
+ }
52
+ function readDocument(documentOverride) {
53
+ const doc = documentOverride ?? globalThis.document;
54
+ if (!doc || typeof doc !== "object") {
55
+ throw new Error("Document unavailable. Provide a browser-like document object.");
56
+ }
57
+ return doc;
58
+ }
59
+ function resolveCanvas(canvasOrSelector, documentOverride) {
60
+ if (canvasOrSelector && typeof canvasOrSelector === "object") {
61
+ return canvasOrSelector;
62
+ }
63
+ const doc = readDocument(documentOverride);
64
+ const selector = typeof canvasOrSelector === "string" && canvasOrSelector.trim().length > 0 ? canvasOrSelector : DEFAULT_CANVAS_SELECTOR;
65
+ const resolved = doc.querySelector(selector);
66
+ if (!resolved) {
67
+ throw new Error(`Unable to find canvas for selector "${selector}".`);
68
+ }
69
+ return resolved;
70
+ }
71
+ function readGpu(navigatorOverride) {
72
+ const currentNavigator = readNavigator(navigatorOverride);
73
+ const gpu = currentNavigator.gpu;
74
+ if (!gpu || typeof gpu.requestAdapter !== "function") {
75
+ throw new Error("WebGPU runtime unavailable. navigator.gpu is missing.");
76
+ }
77
+ return gpu;
78
+ }
79
+ function configureContext(context, device, format, alphaMode) {
80
+ if (typeof context.configure !== "function") {
81
+ throw new Error("Canvas WebGPU context does not support configure().");
82
+ }
83
+ context.configure({
84
+ device,
85
+ format,
86
+ alphaMode
87
+ });
88
+ }
89
+ function createRenderPassDescriptor(view, clearColor) {
90
+ return {
91
+ colorAttachments: [
92
+ {
93
+ view,
94
+ loadOp: "clear",
95
+ clearValue: {
96
+ r: clearColor[0],
97
+ g: clearColor[1],
98
+ b: clearColor[2],
99
+ a: clearColor[3]
100
+ },
101
+ storeOp: "store"
102
+ }
103
+ ]
104
+ };
105
+ }
106
+ function supportsWebGpu(options = {}) {
107
+ try {
108
+ const gpu = readGpu(options.navigator);
109
+ return Boolean(gpu);
110
+ } catch {
111
+ return false;
112
+ }
113
+ }
114
+ async function createGpuRenderer(options = {}) {
115
+ const {
116
+ canvas,
117
+ navigator: navigatorOverride,
118
+ document: documentOverride,
119
+ powerPreference = "high-performance",
120
+ alpha = true,
121
+ format,
122
+ clearColor = DEFAULT_CLEAR_COLOR,
123
+ requestAnimationFrame = globalThis.requestAnimationFrame?.bind(globalThis),
124
+ cancelAnimationFrame = globalThis.cancelAnimationFrame?.bind(globalThis),
125
+ onBeforeEncode,
126
+ onAfterSubmit
127
+ } = options;
128
+ const gpu = readGpu(navigatorOverride);
129
+ const adapter = await gpu.requestAdapter({ powerPreference });
130
+ if (!adapter) {
131
+ throw new Error("Unable to obtain GPU adapter.");
132
+ }
133
+ const device = await adapter.requestDevice();
134
+ const targetCanvas = resolveCanvas(canvas, documentOverride);
135
+ const context = targetCanvas.getContext?.("webgpu");
136
+ if (!context) {
137
+ throw new Error("Unable to obtain WebGPU canvas context.");
138
+ }
139
+ const resolvedFormat = format || (typeof gpu.getPreferredCanvasFormat === "function" ? gpu.getPreferredCanvasFormat() : "bgra8unorm");
140
+ configureContext(context, device, resolvedFormat, alpha ? "premultiplied" : "opaque");
141
+ let running = false;
142
+ let destroyed = false;
143
+ let frame = 0;
144
+ let lastTimestamp = 0;
145
+ let rafId = null;
146
+ let clear = normalizeColor(clearColor);
147
+ let xrActive = false;
148
+ let detachXrBinding = null;
149
+ const renderOnce = (timestamp = now()) => {
150
+ if (destroyed) {
151
+ throw new Error("Renderer was destroyed.");
152
+ }
153
+ const texture = context.getCurrentTexture?.();
154
+ if (!texture || typeof texture.createView !== "function") {
155
+ throw new Error("WebGPU context returned an invalid current texture.");
156
+ }
157
+ const encoder = device.createCommandEncoder({
158
+ label: `plasius.gpu-renderer.frame.${frame}`
159
+ });
160
+ const view = texture.createView();
161
+ const pass = encoder.beginRenderPass(createRenderPassDescriptor(view, clear));
162
+ if (typeof onBeforeEncode === "function") {
163
+ onBeforeEncode({
164
+ frame,
165
+ timestamp,
166
+ device,
167
+ context,
168
+ encoder,
169
+ pass,
170
+ canvas: targetCanvas
171
+ });
172
+ }
173
+ if (typeof pass.end === "function") {
174
+ pass.end();
175
+ }
176
+ const commandBuffer = encoder.finish();
177
+ device.queue.submit([commandBuffer]);
178
+ frame += 1;
179
+ lastTimestamp = timestamp;
180
+ if (typeof onAfterSubmit === "function") {
181
+ onAfterSubmit({
182
+ frame,
183
+ timestamp,
184
+ device,
185
+ context,
186
+ canvas: targetCanvas
187
+ });
188
+ }
189
+ return {
190
+ frame,
191
+ timestamp
192
+ };
193
+ };
194
+ const tick = (timestamp) => {
195
+ if (!running || destroyed) {
196
+ return;
197
+ }
198
+ renderOnce(timestamp);
199
+ if (typeof requestAnimationFrame === "function") {
200
+ rafId = requestAnimationFrame(tick);
201
+ }
202
+ };
203
+ const start = () => {
204
+ if (destroyed) {
205
+ throw new Error("Renderer was destroyed.");
206
+ }
207
+ if (running) {
208
+ return false;
209
+ }
210
+ running = true;
211
+ if (typeof requestAnimationFrame === "function") {
212
+ rafId = requestAnimationFrame(tick);
213
+ } else {
214
+ renderOnce();
215
+ }
216
+ return true;
217
+ };
218
+ const stop = () => {
219
+ if (!running) {
220
+ return false;
221
+ }
222
+ running = false;
223
+ if (rafId !== null && typeof cancelAnimationFrame === "function") {
224
+ cancelAnimationFrame(rafId);
225
+ }
226
+ rafId = null;
227
+ return true;
228
+ };
229
+ const resize = (cssWidth, cssHeight, devicePixelRatio = globalThis.devicePixelRatio ?? 1) => {
230
+ const width = Math.max(1, Math.floor(cssWidth * devicePixelRatio));
231
+ const height = Math.max(1, Math.floor(cssHeight * devicePixelRatio));
232
+ targetCanvas.width = width;
233
+ targetCanvas.height = height;
234
+ if (targetCanvas.style) {
235
+ targetCanvas.style.width = `${Math.max(1, Math.floor(cssWidth))}px`;
236
+ targetCanvas.style.height = `${Math.max(1, Math.floor(cssHeight))}px`;
237
+ }
238
+ return { width, height };
239
+ };
240
+ const setClearColor = (value) => {
241
+ clear = normalizeColor(value);
242
+ return [...clear];
243
+ };
244
+ const setXrActive = (active) => {
245
+ xrActive = Boolean(active);
246
+ };
247
+ const getSnapshot = () => {
248
+ const width = Number(targetCanvas.width) || 0;
249
+ const height = Number(targetCanvas.height) || 0;
250
+ return {
251
+ running,
252
+ frame,
253
+ lastTimestamp,
254
+ format: resolvedFormat,
255
+ width,
256
+ height,
257
+ xrActive
258
+ };
259
+ };
260
+ const renderer = {
261
+ canvas: targetCanvas,
262
+ context,
263
+ device,
264
+ format: resolvedFormat,
265
+ renderOnce,
266
+ start,
267
+ stop,
268
+ resize,
269
+ setClearColor,
270
+ setXrActive,
271
+ getSnapshot,
272
+ bindXrManager(xrManager, bindOptions = {}) {
273
+ if (detachXrBinding) {
274
+ detachXrBinding();
275
+ }
276
+ detachXrBinding = bindRendererToXrManager(renderer, xrManager, bindOptions);
277
+ return detachXrBinding;
278
+ },
279
+ destroy() {
280
+ stop();
281
+ destroyed = true;
282
+ if (detachXrBinding) {
283
+ detachXrBinding();
284
+ detachXrBinding = null;
285
+ }
286
+ if (typeof context.unconfigure === "function") {
287
+ context.unconfigure();
288
+ }
289
+ }
290
+ };
291
+ return renderer;
292
+ }
293
+ function snapshotFromXrManager(xrManager) {
294
+ if (xrManager && typeof xrManager.getState === "function") {
295
+ return xrManager.getState();
296
+ }
297
+ if (xrManager?.store && typeof xrManager.store.getSnapshot === "function") {
298
+ return xrManager.store.getSnapshot();
299
+ }
300
+ return null;
301
+ }
302
+ function bindRendererToXrManager(renderer, xrManager, options = {}) {
303
+ if (!xrManager || typeof xrManager.subscribe !== "function") {
304
+ throw new Error("XR manager must expose subscribe(listener). Use @plasius/gpu-xr createXrManager().");
305
+ }
306
+ const { onSessionStart, onSessionEnd } = options;
307
+ let previousSession = null;
308
+ const applyState = (state) => {
309
+ const session = state?.activeSession ?? null;
310
+ if (session === previousSession) {
311
+ return;
312
+ }
313
+ previousSession = session;
314
+ if (typeof renderer.setXrActive === "function") {
315
+ renderer.setXrActive(Boolean(session));
316
+ }
317
+ if (session && typeof onSessionStart === "function") {
318
+ onSessionStart(session, renderer);
319
+ }
320
+ if (!session && typeof onSessionEnd === "function") {
321
+ onSessionEnd(renderer);
322
+ }
323
+ };
324
+ applyState(snapshotFromXrManager(xrManager));
325
+ return xrManager.subscribe(applyState);
326
+ }
327
+ var defaultRendererClearColor = DEFAULT_CLEAR_COLOR;
328
+ export {
329
+ bindRendererToXrManager,
330
+ createGpuRenderer,
331
+ defaultRendererClearColor,
332
+ supportsWebGpu
333
+ };
334
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.js"],"sourcesContent":["const DEFAULT_CLEAR_COLOR = Object.freeze([0.07, 0.11, 0.18, 1.0]);\nconst DEFAULT_CANVAS_SELECTOR = \"canvas[data-plasius-gpu-renderer]\";\n\nfunction clamp01(value) {\n return Math.min(1, Math.max(0, value));\n}\n\nfunction parseHexChannel(channel) {\n return parseInt(channel, 16) / 255;\n}\n\nfunction normalizeColor(value) {\n if (Array.isArray(value)) {\n const [r = 0, g = 0, b = 0, a = 1] = value;\n return [clamp01(Number(r) || 0), clamp01(Number(g) || 0), clamp01(Number(b) || 0), clamp01(Number(a) || 0)];\n }\n\n if (typeof value === \"string\") {\n const trimmed = value.trim();\n if (/^#[0-9a-f]{3}$/i.test(trimmed)) {\n const r = trimmed[1];\n const g = trimmed[2];\n const b = trimmed[3];\n return [\n parseHexChannel(r + r),\n parseHexChannel(g + g),\n parseHexChannel(b + b),\n 1,\n ];\n }\n if (/^#[0-9a-f]{6}$/i.test(trimmed)) {\n return [\n parseHexChannel(trimmed.slice(1, 3)),\n parseHexChannel(trimmed.slice(3, 5)),\n parseHexChannel(trimmed.slice(5, 7)),\n 1,\n ];\n }\n }\n\n return [...DEFAULT_CLEAR_COLOR];\n}\n\nfunction now() {\n if (typeof performance !== \"undefined\" && typeof performance.now === \"function\") {\n return performance.now();\n }\n return Date.now();\n}\n\nfunction readNavigator(navigatorOverride) {\n const currentNavigator = navigatorOverride ?? globalThis.navigator;\n if (!currentNavigator || typeof currentNavigator !== \"object\") {\n throw new Error(\"Navigator unavailable. Provide a browser-like navigator object.\");\n }\n return currentNavigator;\n}\n\nfunction readDocument(documentOverride) {\n const doc = documentOverride ?? globalThis.document;\n if (!doc || typeof doc !== \"object\") {\n throw new Error(\"Document unavailable. Provide a browser-like document object.\");\n }\n return doc;\n}\n\nfunction resolveCanvas(canvasOrSelector, documentOverride) {\n if (canvasOrSelector && typeof canvasOrSelector === \"object\") {\n return canvasOrSelector;\n }\n\n const doc = readDocument(documentOverride);\n const selector =\n typeof canvasOrSelector === \"string\" && canvasOrSelector.trim().length > 0\n ? canvasOrSelector\n : DEFAULT_CANVAS_SELECTOR;\n const resolved = doc.querySelector(selector);\n if (!resolved) {\n throw new Error(`Unable to find canvas for selector \\\"${selector}\\\".`);\n }\n return resolved;\n}\n\nfunction readGpu(navigatorOverride) {\n const currentNavigator = readNavigator(navigatorOverride);\n const gpu = currentNavigator.gpu;\n if (!gpu || typeof gpu.requestAdapter !== \"function\") {\n throw new Error(\"WebGPU runtime unavailable. navigator.gpu is missing.\");\n }\n return gpu;\n}\n\nfunction configureContext(context, device, format, alphaMode) {\n if (typeof context.configure !== \"function\") {\n throw new Error(\"Canvas WebGPU context does not support configure().\");\n }\n context.configure({\n device,\n format,\n alphaMode,\n });\n}\n\nfunction createRenderPassDescriptor(view, clearColor) {\n return {\n colorAttachments: [\n {\n view,\n loadOp: \"clear\",\n clearValue: {\n r: clearColor[0],\n g: clearColor[1],\n b: clearColor[2],\n a: clearColor[3],\n },\n storeOp: \"store\",\n },\n ],\n };\n}\n\nexport function supportsWebGpu(options = {}) {\n try {\n const gpu = readGpu(options.navigator);\n return Boolean(gpu);\n } catch {\n return false;\n }\n}\n\nexport async function createGpuRenderer(options = {}) {\n const {\n canvas,\n navigator: navigatorOverride,\n document: documentOverride,\n powerPreference = \"high-performance\",\n alpha = true,\n format,\n clearColor = DEFAULT_CLEAR_COLOR,\n requestAnimationFrame = globalThis.requestAnimationFrame?.bind(globalThis),\n cancelAnimationFrame = globalThis.cancelAnimationFrame?.bind(globalThis),\n onBeforeEncode,\n onAfterSubmit,\n } = options;\n\n const gpu = readGpu(navigatorOverride);\n const adapter = await gpu.requestAdapter({ powerPreference });\n if (!adapter) {\n throw new Error(\"Unable to obtain GPU adapter.\");\n }\n\n const device = await adapter.requestDevice();\n const targetCanvas = resolveCanvas(canvas, documentOverride);\n const context = targetCanvas.getContext?.(\"webgpu\");\n if (!context) {\n throw new Error(\"Unable to obtain WebGPU canvas context.\");\n }\n\n const resolvedFormat =\n format ||\n (typeof gpu.getPreferredCanvasFormat === \"function\"\n ? gpu.getPreferredCanvasFormat()\n : \"bgra8unorm\");\n\n configureContext(context, device, resolvedFormat, alpha ? \"premultiplied\" : \"opaque\");\n\n let running = false;\n let destroyed = false;\n let frame = 0;\n let lastTimestamp = 0;\n let rafId = null;\n let clear = normalizeColor(clearColor);\n let xrActive = false;\n let detachXrBinding = null;\n\n const renderOnce = (timestamp = now()) => {\n if (destroyed) {\n throw new Error(\"Renderer was destroyed.\");\n }\n\n const texture = context.getCurrentTexture?.();\n if (!texture || typeof texture.createView !== \"function\") {\n throw new Error(\"WebGPU context returned an invalid current texture.\");\n }\n\n const encoder = device.createCommandEncoder({\n label: `plasius.gpu-renderer.frame.${frame}`,\n });\n const view = texture.createView();\n\n const pass = encoder.beginRenderPass(createRenderPassDescriptor(view, clear));\n\n if (typeof onBeforeEncode === \"function\") {\n onBeforeEncode({\n frame,\n timestamp,\n device,\n context,\n encoder,\n pass,\n canvas: targetCanvas,\n });\n }\n\n if (typeof pass.end === \"function\") {\n pass.end();\n }\n\n const commandBuffer = encoder.finish();\n device.queue.submit([commandBuffer]);\n\n frame += 1;\n lastTimestamp = timestamp;\n\n if (typeof onAfterSubmit === \"function\") {\n onAfterSubmit({\n frame,\n timestamp,\n device,\n context,\n canvas: targetCanvas,\n });\n }\n\n return {\n frame,\n timestamp,\n };\n };\n\n const tick = (timestamp) => {\n if (!running || destroyed) {\n return;\n }\n renderOnce(timestamp);\n if (typeof requestAnimationFrame === \"function\") {\n rafId = requestAnimationFrame(tick);\n }\n };\n\n const start = () => {\n if (destroyed) {\n throw new Error(\"Renderer was destroyed.\");\n }\n if (running) {\n return false;\n }\n running = true;\n if (typeof requestAnimationFrame === \"function\") {\n rafId = requestAnimationFrame(tick);\n } else {\n renderOnce();\n }\n return true;\n };\n\n const stop = () => {\n if (!running) {\n return false;\n }\n running = false;\n if (rafId !== null && typeof cancelAnimationFrame === \"function\") {\n cancelAnimationFrame(rafId);\n }\n rafId = null;\n return true;\n };\n\n const resize = (cssWidth, cssHeight, devicePixelRatio = globalThis.devicePixelRatio ?? 1) => {\n const width = Math.max(1, Math.floor(cssWidth * devicePixelRatio));\n const height = Math.max(1, Math.floor(cssHeight * devicePixelRatio));\n targetCanvas.width = width;\n targetCanvas.height = height;\n if (targetCanvas.style) {\n targetCanvas.style.width = `${Math.max(1, Math.floor(cssWidth))}px`;\n targetCanvas.style.height = `${Math.max(1, Math.floor(cssHeight))}px`;\n }\n return { width, height };\n };\n\n const setClearColor = (value) => {\n clear = normalizeColor(value);\n return [...clear];\n };\n\n const setXrActive = (active) => {\n xrActive = Boolean(active);\n };\n\n const getSnapshot = () => {\n const width = Number(targetCanvas.width) || 0;\n const height = Number(targetCanvas.height) || 0;\n return {\n running,\n frame,\n lastTimestamp,\n format: resolvedFormat,\n width,\n height,\n xrActive,\n };\n };\n\n const renderer = {\n canvas: targetCanvas,\n context,\n device,\n format: resolvedFormat,\n renderOnce,\n start,\n stop,\n resize,\n setClearColor,\n setXrActive,\n getSnapshot,\n bindXrManager(xrManager, bindOptions = {}) {\n if (detachXrBinding) {\n detachXrBinding();\n }\n detachXrBinding = bindRendererToXrManager(renderer, xrManager, bindOptions);\n return detachXrBinding;\n },\n destroy() {\n stop();\n destroyed = true;\n if (detachXrBinding) {\n detachXrBinding();\n detachXrBinding = null;\n }\n if (typeof context.unconfigure === \"function\") {\n context.unconfigure();\n }\n },\n };\n\n return renderer;\n}\n\nfunction snapshotFromXrManager(xrManager) {\n if (xrManager && typeof xrManager.getState === \"function\") {\n return xrManager.getState();\n }\n if (xrManager?.store && typeof xrManager.store.getSnapshot === \"function\") {\n return xrManager.store.getSnapshot();\n }\n return null;\n}\n\nexport function bindRendererToXrManager(renderer, xrManager, options = {}) {\n if (!xrManager || typeof xrManager.subscribe !== \"function\") {\n throw new Error(\"XR manager must expose subscribe(listener). Use @plasius/gpu-xr createXrManager().\");\n }\n\n const { onSessionStart, onSessionEnd } = options;\n let previousSession = null;\n\n const applyState = (state) => {\n const session = state?.activeSession ?? null;\n if (session === previousSession) {\n return;\n }\n\n previousSession = session;\n\n if (typeof renderer.setXrActive === \"function\") {\n renderer.setXrActive(Boolean(session));\n }\n\n if (session && typeof onSessionStart === \"function\") {\n onSessionStart(session, renderer);\n }\n\n if (!session && typeof onSessionEnd === \"function\") {\n onSessionEnd(renderer);\n }\n };\n\n applyState(snapshotFromXrManager(xrManager));\n return xrManager.subscribe(applyState);\n}\n\nexport const defaultRendererClearColor = DEFAULT_CLEAR_COLOR;\n"],"mappings":";AAAA,IAAM,sBAAsB,OAAO,OAAO,CAAC,MAAM,MAAM,MAAM,CAAG,CAAC;AACjE,IAAM,0BAA0B;AAEhC,SAAS,QAAQ,OAAO;AACtB,SAAO,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,KAAK,CAAC;AACvC;AAEA,SAAS,gBAAgB,SAAS;AAChC,SAAO,SAAS,SAAS,EAAE,IAAI;AACjC;AAEA,SAAS,eAAe,OAAO;AAC7B,MAAI,MAAM,QAAQ,KAAK,GAAG;AACxB,UAAM,CAAC,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,IAAI;AACrC,WAAO,CAAC,QAAQ,OAAO,CAAC,KAAK,CAAC,GAAG,QAAQ,OAAO,CAAC,KAAK,CAAC,GAAG,QAAQ,OAAO,CAAC,KAAK,CAAC,GAAG,QAAQ,OAAO,CAAC,KAAK,CAAC,CAAC;AAAA,EAC5G;AAEA,MAAI,OAAO,UAAU,UAAU;AAC7B,UAAM,UAAU,MAAM,KAAK;AAC3B,QAAI,kBAAkB,KAA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AAa,OAAO,UAAU,aAAa,YAAY;AACzD,WAAO,UAAU,SAAS;AAAA,EAC5B;AACA,MAAI,WAAW,SAAS,OAAO,UAAU,MAAM,gBAAgB,YAAY;AACzE,WAAO,UAAU,MAAM,YAAY;AAAA,EACrC;AACA,SAAO;AACT;AAEO,SAAS,wBAAwB,UAAU,WAAW,UAAU,CAAC,GAAG;AACzE,MAAI,CAAC,aAAa,OAAO,UAAU,cAAc,YAAY;AAC3D,UAAM,IAAI,MAAM,oFAAoF;AAAA,EACtG;AAEA,QAAM,EAAE,gBAAgB,aAAa,IAAI;AACzC,MAAI,kBAAkB;AAEtB,QAAM,aAAa,CAAC,UAAU;AAC5B,UAAM,UAAU,OAAO,iBAAiB;AACxC,QAAI,YAAY,iBAAiB;AAC/B;AAAA,IACF;AAEA,sBAAkB;AAElB,QAAI,OAAO,SAAS,gBAAgB,YAAY;AAC9C,eAAS,YAAY,QAAQ,OAAO,CAAC;AAAA,IACvC;AAEA,QAAI,WAAW,OAAO,mBAAmB,YAAY;AACnD,qBAAe,SAAS,QAAQ;AAAA,IAClC;AAEA,QAAI,CAAC,WAAW,OAAO,iBAAiB,YAAY;AAClD,mBAAa,QAAQ;AAAA,IACvB;AAAA,EACF;AAEA,aAAW,sBAAsB,SAAS,CAAC;AAC3C,SAAO,UAAU,UAAU,UAAU;AACvC;AAEO,IAAM,4BAA4B;","names":[]}
@@ -0,0 +1,2 @@
1
+ type,github_handle,full_name,company,email,date,approver
2
+ corporate,Zephod111r,Phillip Hounslow,Plasius LTD,zephod@plasius.co.uk,2025-09-12,Phillip Hounslow (Maintainer)
package/legal/CLA.md ADDED
@@ -0,0 +1,22 @@
1
+ # Contributor License Agreements (CLA)
2
+
3
+ To protect the intellectual property of this project and ensure clarity of rights, all contributors must sign a Contributor License Agreement (CLA) before their first contribution.
4
+
5
+ ## Which CLA should I sign?
6
+
7
+ - **Individual CLA**: If you are contributing personally and not on behalf of an employer, sign the [Individual CLA](INDIVIDUAL_CLA.md).
8
+ - **Corporate CLA**: If you are contributing as part of your work for a company, the company should sign the [Corporate CLA](CORPORATE_CLA.md).
9
+
10
+ ## How to sign
11
+
12
+ 1. Download the appropriate CLA file (Individual or Corporate).
13
+ 2. Fill in the required details, sign, and date it.
14
+ 3. Email a PDF copy of the signed document to **[contributors@plasius.co.uk](mailto:contributors@plasius.co.uk)** with subject: `CLA – Individual` or `CLA – Corporate`.
15
+
16
+ ## Registry
17
+
18
+ All signed CLAs are logged internally in the CLA registry (`CLA-REGISTRY.csv`).
19
+
20
+ ## Questions?
21
+
22
+ If you have any questions about which CLA to sign or how the process works, please email **[contributors@plasius.co.uk](mailtocontributors@plasius.co.uk)**.
@@ -0,0 +1,57 @@
1
+ # Corporate Contributor License Agreement (CLA)
2
+
3
+ ## Purpose
4
+
5
+ This Corporate Contributor License Agreement ("Agreement") is intended to protect the intellectual property rights of the contributors and the project, ensure clear licensing terms for contributions, and maintain trust within the community. By signing this Agreement, the corporation agrees to the terms that facilitate the use, distribution, and modification of contributions under the project's licensing framework.
6
+
7
+ ## Agreement
8
+
9
+ 1. **Representation of Authority**
10
+ The undersigned individual represents and warrants that they have the full legal authority to enter into this Agreement on behalf of the corporation named below ("Corporation") and to grant the rights contained herein.
11
+
12
+ 2. **Grant of Copyright License**
13
+ The Corporation hereby grants to the project maintainers and users a perpetual, worldwide, non-exclusive, royalty-free, irrevocable copyright license to use, reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute the contributions submitted to the project.
14
+
15
+ 3. **Grant of Patent License**
16
+ The Corporation hereby grants to the project maintainers and users a perpetual, worldwide, non-exclusive, royalty-free, irrevocable license under any patent claims that are necessarily infringed by the contributions to make, use, sell, offer for sale, import, and otherwise dispose of the contributions or derivative works thereof.
17
+
18
+ 4. **Warranties and Representations**
19
+ The Corporation represents and warrants that:
20
+
21
+ - The contributions are the original work of the Corporation or that the Corporation has sufficient rights to grant the licenses herein.
22
+ - The submission of the contributions does not violate any agreements or rights of third parties.
23
+
24
+ 5. **No Revocation**
25
+ This license is granted on a perpetual basis and cannot be revoked, provided that the terms of this Agreement are met.
26
+
27
+ 6. **Governing Law**
28
+ This Agreement shall be governed by and construed in accordance with the laws of the United Kingdom, without regard to its conflict of laws principles.
29
+
30
+ 7. **Execution**
31
+
32
+ This Agreement is effective upon signature by the authorized representative of the Corporation. Please sign and date this document, then email a scanned PDF copy to [contributors@plasius.co.uk](mailto:contributors@plasius.co.uk).
33
+
34
+ ---
35
+
36
+ ### **@plasius/gpu-renderer**
37
+
38
+ **Corporation Legal Name:** \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
39
+
40
+ **Authorized Representative:** \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
41
+
42
+ **Title:** \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
43
+
44
+ **Email:** \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
45
+
46
+ **Date:** \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
47
+
48
+ **Signature:** \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
49
+
50
+ ---
51
+
52
+ ## How to Sign
53
+
54
+ - Download this file as a template.
55
+ - Fill in the Corporation’s legal name, authorized representative, title, email, date, and provide a signature.
56
+ - Sign and date the document.
57
+ - Send a scanned copy of the signed Agreement to [contributors@plasius.co.uk](mailto:contributors@plasius.co.uk).
@@ -0,0 +1,91 @@
1
+ # Individual Contributor License Agreement (CLA)
2
+
3
+ **Project:** @plasius/gpu-renderer (Plasius LTD)
4
+ **Version:** 1.0 — 2025‑09‑12
5
+ **Contact:** [contributors@plasius.co.uk](mailto:contributors@plasius.co.uk)
6
+
7
+ ---
8
+
9
+ ## 1. Definitions
10
+
11
+ - **"You"** (or **"Contributor"**) means the individual signing this CLA and submitting Contributions to the Project.
12
+ - **"Contribution"** means any original work of authorship, including code, documentation, data, designs, or feedback that You submit to the Project in any form (e.g., pull request, issue comment, email, file upload).
13
+ - **"Project"** means the @plasius/gpu-renderer repositories and related materials owned or managed by **Plasius LTD**.
14
+
15
+ ## 2. Copyright License Grant
16
+
17
+ You hereby grant to Plasius LTD a **perpetual, worldwide, non‑exclusive, transferable, sublicensable, royalty‑free, irrevocable** copyright license to:
18
+
19
+ - use, reproduce, publicly display, publicly perform, modify, create derivative works of, and
20
+ - distribute Contributions in source and object form,
21
+ - and to **sublicense** these rights under any terms Plasius LTD chooses, including proprietary or open‑source licenses.
22
+
23
+ ## 3. Patent License Grant
24
+
25
+ You hereby grant to Plasius LTD and its sublicensees a **perpetual, worldwide, non‑exclusive, transferable, royalty‑free, irrevocable** patent license to **make, have made, use, offer to sell, sell, import, and otherwise transfer** the Contribution and derivative works thereof, where such license applies only to patent claims that You **own or control** and that would be infringed by Your Contribution or its combination with the Project.
26
+
27
+ ## 4. Moral Rights & Attribution
28
+
29
+ To the maximum extent permitted by applicable law, You **waive** and agree not to assert any moral rights (e.g., rights of attribution or integrity) in or to the Contribution against Plasius LTD. Plasius LTD may, but is not required to, credit You.
30
+
31
+ ## 5. Representations & Warranties
32
+
33
+ You represent that:
34
+
35
+ 1. **Originality / Rights:** Each Contribution is Your original creation, or You have sufficient rights to submit it and grant the licenses above.
36
+ 2. **No Confidential Info:** Contributions **do not** include confidential information or trade secrets of any third party.
37
+ 3. **No Infringement:** To the best of Your knowledge, Contributions do not infringe any third‑party IP rights.
38
+ 4. **Employment / Contractor Status:** If Your employer or a third party might claim rights in Your Contribution, You have obtained **written permission** to make the Contribution and grant these licenses (attach or reference below), or Your Contribution is made **outside the scope** of your employment and without using your employer’s confidential information or resources.
39
+ 5. **Compliance:** You will follow the Project’s policies (e.g., Code of Conduct, Security Policy) and applicable laws.
40
+
41
+ ## 6. Third‑Party Code
42
+
43
+ If Your Contribution includes code, data, or other material from a third party, You will **identify the material and its license** in the pull request or submission, and ensure it is **compatible** with the Project’s licensing model. You will not submit material subject to terms that require the Project to disclose proprietary source code (e.g., certain copyleft obligations) unless the Project has **pre‑approved** such inclusion in writing.
44
+
45
+ ## 7. Scope & Duration
46
+
47
+ - This CLA covers **all past and future** Contributions You submit to the Project, unless and until You provide written notice to **revoke** it.
48
+ - Revocation is **not retroactive**: rights granted for prior Contributions remain in effect.
49
+
50
+ ## 8. Disclaimer
51
+
52
+ THE CONTRIBUTION IS PROVIDED “AS IS” WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON‑INFRINGEMENT.
53
+
54
+ ## 9. Governing Law & Jurisdiction
55
+
56
+ This CLA is governed by the **laws of England and Wales**, and the courts of England and Wales shall have **exclusive jurisdiction** over any dispute arising out of or relating to it.
57
+
58
+ ## 10. Entire Agreement
59
+
60
+ This CLA is the entire agreement between You and Plasius LTD regarding Contributions. It supersedes any prior discussions relating to Contributions. If any provision is held unenforceable, the remaining provisions remain in full force.
61
+
62
+ ---
63
+
64
+ ## 11. Contributor Information & Signature
65
+
66
+ By signing below, You agree to the terms of this CLA for Your Contributions to the Project.
67
+
68
+ **Full Name:** \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
69
+
70
+ **Email:** \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
71
+
72
+ **GitHub Handle:** \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
73
+
74
+ **Address (optional):** \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
75
+
76
+ **Employer (if applicable):** \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
77
+
78
+ **If employed:** ☐ I confirm Contributions are made outside the scope of employment **or** ☐ I have attached my employer’s written permission.
79
+
80
+ **Signature:** \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
81
+
82
+ **Date (YYYY‑MM‑DD):** \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
83
+
84
+ _Electronic signatures are accepted. You may type your name in the Signature field and email a PDF copy._
85
+
86
+ **Submission:** Please email the signed CLA to **[contributors@plasius.co.uk](mailto:contributors@plasius.co.uk)** with subject line: `CLA – Individual – <GitHubHandle>`.
87
+
88
+ **(Optional) Attachments / Notes:**
89
+
90
+ - Employer permission letter (if required)
91
+ - Third‑party license disclosures (if any)
package/package.json ADDED
@@ -0,0 +1,72 @@
1
+ {
2
+ "name": "@plasius/gpu-renderer",
3
+ "version": "0.1.0",
4
+ "description": "Framework-agnostic WebGPU renderer runtime for Plasius projects.",
5
+ "type": "module",
6
+ "sideEffects": false,
7
+ "private": false,
8
+ "main": "./dist/index.cjs",
9
+ "module": "./dist/index.js",
10
+ "types": "./src/index.d.ts",
11
+ "files": [
12
+ "dist",
13
+ "src",
14
+ "README.md",
15
+ "CHANGELOG.md",
16
+ "LICENSE",
17
+ "legal"
18
+ ],
19
+ "exports": {
20
+ ".": {
21
+ "types": "./src/index.d.ts",
22
+ "import": "./dist/index.js",
23
+ "require": "./dist/index.cjs"
24
+ },
25
+ "./package.json": "./package.json"
26
+ },
27
+ "scripts": {
28
+ "build": "tsup",
29
+ "demo": "python3 -m http.server --directory ..",
30
+ "test": "npm run test:unit",
31
+ "test:unit": "node --test",
32
+ "test:coverage": "c8 --reporter=lcov --reporter=text node --test"
33
+ },
34
+ "keywords": [
35
+ "webgpu",
36
+ "renderer",
37
+ "xr",
38
+ "gpu",
39
+ "plasius"
40
+ ],
41
+ "author": "Plasius LTD <development@plasius.co.uk>",
42
+ "license": "Apache-2.0",
43
+ "dependencies": {
44
+ "@plasius/gpu-xr": "^0.1.0"
45
+ },
46
+ "devDependencies": {
47
+ "c8": "^10.1.3",
48
+ "tsup": "^8.5.0",
49
+ "typescript": "^5.9.3"
50
+ },
51
+ "repository": {
52
+ "type": "git",
53
+ "url": "git+https://github.com/Plasius-LTD/gpu-renderer.git"
54
+ },
55
+ "bugs": {
56
+ "url": "https://github.com/Plasius-LTD/gpu-renderer/issues"
57
+ },
58
+ "homepage": "https://github.com/Plasius-LTD/gpu-renderer#readme",
59
+ "publishConfig": {
60
+ "access": "public"
61
+ },
62
+ "funding": [
63
+ {
64
+ "type": "patreon",
65
+ "url": "https://www.patreon.com/c/plasiusltd/membership"
66
+ },
67
+ {
68
+ "type": "github",
69
+ "url": "https://github.com/sponsors/Plasius-LTD"
70
+ }
71
+ ]
72
+ }