@bloopjs/toodle 0.1.5 → 0.1.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bloopjs/toodle",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -28,6 +28,9 @@ export interface IBackendShader {
28
28
  /** Debug label for the shader */
29
29
  readonly label: string;
30
30
 
31
+ /** The final compiled shader code (for debugging) */
32
+ readonly code: string;
33
+
31
34
  /**
32
35
  * Prepare for a new frame.
33
36
  * Called once per frame before any processBatch calls.
@@ -16,6 +16,7 @@ const INSTANCE_BYTES = INSTANCE_FLOATS * Float32Array.BYTES_PER_ELEMENT;
16
16
  */
17
17
  export class WebGLQuadShader implements IBackendShader {
18
18
  readonly label: string;
19
+ readonly code: string;
19
20
 
20
21
  #backend: WebGLBackend;
21
22
  #atlas: ITextureAtlas;
@@ -45,6 +46,7 @@ export class WebGLQuadShader implements IBackendShader {
45
46
 
46
47
  this.#atlas = atlas;
47
48
  this.label = label;
49
+ this.code = userFragmentShader ?? fragmentShader;
48
50
  this.#backend = backend;
49
51
  this.#instanceCount = instanceCount;
50
52
 
@@ -21,6 +21,7 @@ import type { WebGLFontPipeline } from "./WebGLFontPipeline";
21
21
  */
22
22
  export class WebGLTextShader implements ITextShader {
23
23
  readonly label = "text";
24
+ readonly code: string = fragmentShader;
24
25
  readonly font: MsdfFont;
25
26
  readonly maxCharCount: number;
26
27
 
@@ -22,6 +22,7 @@ const textDescriptorInstanceSize = struct.size;
22
22
 
23
23
  export class WebGPUTextShader implements ITextShader {
24
24
  readonly label = "text";
25
+ readonly code: string = msdfShader;
25
26
 
26
27
  #backend: WebGPUBackend;
27
28
  #pipeline: GPURenderPipeline;