@predy-js/render-interface 0.1.49 → 0.1.50

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.
@@ -10,9 +10,7 @@ declare enum ShaderType {
10
10
  }
11
11
  export declare class GLShaderLibrary implements ShaderLibrary {
12
12
  readonly renderer: GLGPURenderer;
13
- readonly shaderResults: {
14
- [p: string]: ShaderCompileResult;
15
- };
13
+ private readonly shaderResults;
16
14
  private _shaderMap;
17
15
  private _programMap;
18
16
  private _glVertShaderMap;
@@ -20,6 +18,8 @@ export declare class GLShaderLibrary implements ShaderLibrary {
20
18
  private readonly _glAsyncCompileExt?;
21
19
  private _shaderAllDone;
22
20
  constructor(renderer: GLGPURenderer);
21
+ get cacheIds(): string[];
22
+ getShaderResult(cacheId: string): ShaderCompileResult | undefined;
23
23
  compileAllShaders(asyncCallback?: (results: ShaderCompileResult[]) => void): void;
24
24
  getProgram(shaderCacheId: string): GLProgram | null;
25
25
  addMarcosHeader(header: string, shader: string, type: ShaderType, downgrade?: boolean): string;
package/dist/statistic.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * Name: @predy-js/render-interface
3
3
  * Description: undefined
4
4
  * Author: undefined
5
- * Version: v0.1.49
5
+ * Version: v0.1.50
6
6
  */
7
7
 
8
8
  // https://github.com/greggman/webgl-memory/blob/main/src/texture-utils.js
@@ -1,10 +1,10 @@
1
1
  export type Shader = ShaderWithSource | ShaderUseCacheId;
2
2
  export type ShaderWithSource = InstancedShaderWithSource | SharedShaderWithSource;
3
3
  export interface MetaShaderSpec {
4
+ mtlBinary?: ArrayBuffer;
4
5
  mtlSource?: string;
5
6
  mtlVertex?: string;
6
7
  mtlFragment?: string;
7
- mtlBinary?: ArrayBuffer;
8
8
  }
9
9
  export interface ShaderSourceBase extends MetaShaderSpec {
10
10
  fragment: string;
@@ -48,9 +48,8 @@ export interface ShaderCompileResult {
48
48
  * })
49
49
  */
50
50
  export interface ShaderLibrary {
51
- readonly shaderResults: {
52
- [cacheId: string]: ShaderCompileResult;
53
- };
51
+ readonly cacheIds: string[];
52
+ getShaderResult(cacheId: string): ShaderCompileResult | undefined;
54
53
  addShader(shader: Shader): string;
55
54
  /**
56
55
  * @param cacheId
@@ -70,9 +69,8 @@ export interface ShaderLibrary {
70
69
  destroy(): void;
71
70
  }
72
71
  export declare class ShaderLibraryEmpty implements ShaderLibrary {
73
- readonly shaderResults: {
74
- [cacheId: string]: ShaderCompileResult;
75
- };
72
+ get cacheIds(): never[];
73
+ getShaderResult(cacheId: string): ShaderCompileResult | undefined;
76
74
  addShader(shader: Shader, marcos?: ShaderMarcos): string;
77
75
  compileAllShaders(asyncCallback?: (results: ShaderCompileResult[]) => void): never[];
78
76
  deleteShader(cacheId: string): void;
@@ -1,8 +1,7 @@
1
1
  import type { ShaderLibrary, Shader, ShaderCompileResult } from '../ShaderLibrary';
2
2
  export declare abstract class ShaderLibraryInternal implements ShaderLibrary {
3
- readonly shaderResults: {
4
- [p: string]: ShaderCompileResult;
5
- };
3
+ abstract readonly cacheIds: string[];
4
+ abstract getShaderResult(cacheId: string): ShaderCompileResult;
6
5
  abstract addShader(shader: Shader): string;
7
6
  abstract compileAllShaders(asyncCallback?: (results: ShaderCompileResult[]) => void): void;
8
7
  abstract compileShader(shaderCacheId: string, asyncCallback?: (result: ShaderCompileResult) => void): ShaderCompileResult;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@predy-js/render-interface",
3
- "version": "0.1.49",
3
+ "version": "0.1.50",
4
4
  "license": "MIT",
5
5
  "module": "./dist/index.mjs",
6
6
  "main": "./dist/index.js",