@predy-js/render-interface 0.1.62-beta.4 → 0.1.62-beta.5

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/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.62-beta.4
5
+ * Version: v0.1.62-beta.5
6
6
  */
7
7
 
8
8
  // https://github.com/greggman/webgl-memory/blob/main/src/texture-utils.js
@@ -0,0 +1,18 @@
1
+ export declare abstract class AndGLContext {
2
+ abstract isEnabled(param: GLenum): boolean;
3
+ /**
4
+ * 获取gl的参数, 返回值为4个int 数组
5
+ * @param param
6
+ */
7
+ abstract getParameter_i4(param: GLenum): [number, number, number, number];
8
+ /**
9
+ * 获取gl的参数, 返回值为4个bool 数组
10
+ * @param param
11
+ */
12
+ abstract getParameter_b4(param: GLenum): [boolean, boolean, boolean, boolean];
13
+ /**
14
+ * 获取gl的参数, 返回值为1个int
15
+ * @param param
16
+ */
17
+ abstract getParameter_i1(param: GLenum): number;
18
+ }
@@ -13,5 +13,11 @@ export declare abstract class MaterialInternal implements ResourceInternal {
13
13
  readonly shaderCacheId: string;
14
14
  dataBlocks: DataBlockInternal[];
15
15
  protected constructor(options: MaterialInternalOptions);
16
+ /**
17
+ * 将Material的状态设置到GPU
18
+ * 这个方法会在Native端调用, 在RI中不会调用
19
+ * 为了Android 测试,会主动调用设置状态到GPU, IOS 暂不调用
20
+ */
21
+ abstract setupStates(): void;
16
22
  abstract destroy(): void;
17
23
  }
@@ -10,6 +10,7 @@ import type { RenderFrameInternal, RenderFrameInternalOptions } from './RenderFr
10
10
  import type { GPUCapability } from '../GPUCapability';
11
11
  import type { TextureInternal, TextureInternalConstructOptions } from './TextureInternal';
12
12
  import type { ImageBitmapCallback, ImageBitmapConstructor } from './ImageBitmapInternal';
13
+ import type { AndGLContext } from './AndGLContext';
13
14
  /**
14
15
  * renderer 内部创建的对象,用来统计信息,排查资源泄漏的问题
15
16
  */
@@ -30,6 +31,10 @@ export declare abstract class RendererInternal implements ResourceInternal {
30
31
  readonly shaderLibrary: ShaderLibraryInternal;
31
32
  readonly width: number;
32
33
  readonly height: number;
34
+ /**
35
+ * 用于Android的GL上下文, 用于测试, 不会在RI中使用
36
+ */
37
+ readonly gl?: AndGLContext;
33
38
  abstract destroy(): void;
34
39
  /**
35
40
  * 需要进行重新渲染
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@predy-js/render-interface",
3
- "version": "0.1.62-beta.4",
3
+ "version": "0.1.62-beta.5",
4
4
  "license": "MIT",
5
5
  "module": "./dist/index.mjs",
6
6
  "main": "./dist/index.js",
@@ -0,0 +1,22 @@
1
+
2
+ export abstract class AndGLContext {
3
+ abstract isEnabled (param: GLenum): boolean;
4
+
5
+ /**
6
+ * 获取gl的参数, 返回值为4个int 数组
7
+ * @param param
8
+ */
9
+ abstract getParameter_i4 (param: GLenum): [number, number, number, number];
10
+
11
+ /**
12
+ * 获取gl的参数, 返回值为4个bool 数组
13
+ * @param param
14
+ */
15
+ abstract getParameter_b4 (param: GLenum): [boolean, boolean, boolean, boolean];
16
+
17
+ /**
18
+ * 获取gl的参数, 返回值为1个int
19
+ * @param param
20
+ */
21
+ abstract getParameter_i1 (param: GLenum): number;
22
+ }
@@ -16,5 +16,12 @@ export abstract class MaterialInternal implements ResourceInternal {
16
16
 
17
17
  protected constructor (options: MaterialInternalOptions) {
18
18
  }
19
+
20
+ /**
21
+ * 将Material的状态设置到GPU
22
+ * 这个方法会在Native端调用, 在RI中不会调用
23
+ * 为了Android 测试,会主动调用设置状态到GPU, IOS 暂不调用
24
+ */
25
+ abstract setupStates (): void;
19
26
  abstract destroy (): void;
20
27
  }
@@ -10,6 +10,7 @@ import type { RenderFrameInternal, RenderFrameInternalOptions } from './RenderFr
10
10
  import type { GPUCapability } from '../GPUCapability';
11
11
  import type { TextureInternal, TextureInternalConstructOptions } from './TextureInternal';
12
12
  import type { ImageBitmapCallback, ImageBitmapConstructor } from './ImageBitmapInternal';
13
+ import type { AndGLContext } from './AndGLContext';
13
14
 
14
15
  /**
15
16
  * renderer 内部创建的对象,用来统计信息,排查资源泄漏的问题
@@ -32,6 +33,10 @@ export abstract class RendererInternal implements ResourceInternal {
32
33
  readonly shaderLibrary: ShaderLibraryInternal;
33
34
  readonly width: number;
34
35
  readonly height: number;
36
+ /**
37
+ * 用于Android的GL上下文, 用于测试, 不会在RI中使用
38
+ */
39
+ readonly gl?: AndGLContext;
35
40
 
36
41
  abstract destroy (): void;
37
42