@predy-js/render-interface 0.1.62-beta.5 → 0.1.62
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 +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/dist/statistic.js +1 -1
- package/dist/types/native/MaterialInternal.d.ts +0 -6
- package/dist/types/native/RendererInternal.d.ts +11 -4
- package/package.json +1 -1
- package/types/native/MaterialInternal.ts +0 -7
- package/types/native/RendererInternal.ts +16 -4
package/dist/statistic.js
CHANGED
@@ -13,11 +13,5 @@ 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;
|
22
16
|
abstract destroy(): void;
|
23
17
|
}
|
@@ -24,6 +24,11 @@ export interface InternalResInfo {
|
|
24
24
|
renderPass: number;
|
25
25
|
frame: number;
|
26
26
|
}
|
27
|
+
export interface RendererInternalCompleteInfo {
|
28
|
+
gpuTime?: number;
|
29
|
+
frame: number;
|
30
|
+
cpuTime?: number;
|
31
|
+
}
|
27
32
|
export declare abstract class RendererInternal implements ResourceInternal {
|
28
33
|
readonly isDestroyed: boolean;
|
29
34
|
readonly platform: ResourcePlatform;
|
@@ -31,9 +36,6 @@ export declare abstract class RendererInternal implements ResourceInternal {
|
|
31
36
|
readonly shaderLibrary: ShaderLibraryInternal;
|
32
37
|
readonly width: number;
|
33
38
|
readonly height: number;
|
34
|
-
/**
|
35
|
-
* 用于Android的GL上下文, 用于测试, 不会在RI中使用
|
36
|
-
*/
|
37
39
|
readonly gl?: AndGLContext;
|
38
40
|
abstract destroy(): void;
|
39
41
|
/**
|
@@ -49,8 +51,13 @@ export declare abstract class RendererInternal implements ResourceInternal {
|
|
49
51
|
abstract createRenderFrame(options: RenderFrameInternalOptions): RenderFrameInternal;
|
50
52
|
abstract createTexture(options: TextureInternalConstructOptions): TextureInternal;
|
51
53
|
abstract getResourceInfo(): InternalResInfo;
|
52
|
-
abstract requestAnimationFrame(callback:
|
54
|
+
abstract requestAnimationFrame(callback: FrameRequestCallback): number;
|
53
55
|
abstract cancelAnimationFrame(id: number): void;
|
56
|
+
/**
|
57
|
+
* 下一帧渲染完成后的回调,在调用removeRenderCompleteCallback前,不需要重复注册
|
58
|
+
*/
|
59
|
+
abstract addRenderCompleteCallback(callback: (info: RendererInternalCompleteInfo) => void): number;
|
60
|
+
abstract removeRenderCompleteCallback(id: number): void;
|
54
61
|
/**
|
55
62
|
* 获取错误信息,目前支持最大获取5条,
|
56
63
|
* 每次调用此函数后,清空错误队列
|
package/package.json
CHANGED
@@ -16,12 +16,5 @@ 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;
|
26
19
|
abstract destroy (): void;
|
27
20
|
}
|
@@ -26,6 +26,15 @@ export interface InternalResInfo {
|
|
26
26
|
frame: number,
|
27
27
|
}
|
28
28
|
|
29
|
+
export interface RendererInternalCompleteInfo {
|
30
|
+
//gpu耗时,单位ms
|
31
|
+
gpuTime?: number,
|
32
|
+
//渲染了多少个frame
|
33
|
+
frame: number,
|
34
|
+
//cpu耗时
|
35
|
+
cpuTime?: number,
|
36
|
+
}
|
37
|
+
|
29
38
|
export abstract class RendererInternal implements ResourceInternal {
|
30
39
|
readonly isDestroyed: boolean;
|
31
40
|
readonly platform: ResourcePlatform;
|
@@ -33,9 +42,6 @@ export abstract class RendererInternal implements ResourceInternal {
|
|
33
42
|
readonly shaderLibrary: ShaderLibraryInternal;
|
34
43
|
readonly width: number;
|
35
44
|
readonly height: number;
|
36
|
-
/**
|
37
|
-
* 用于Android的GL上下文, 用于测试, 不会在RI中使用
|
38
|
-
*/
|
39
45
|
readonly gl?: AndGLContext;
|
40
46
|
|
41
47
|
abstract destroy (): void;
|
@@ -63,10 +69,16 @@ export abstract class RendererInternal implements ResourceInternal {
|
|
63
69
|
|
64
70
|
abstract getResourceInfo (): InternalResInfo;
|
65
71
|
|
66
|
-
abstract requestAnimationFrame (callback:
|
72
|
+
abstract requestAnimationFrame (callback: FrameRequestCallback): number;
|
67
73
|
|
68
74
|
abstract cancelAnimationFrame (id: number): void;
|
69
75
|
|
76
|
+
/**
|
77
|
+
* 下一帧渲染完成后的回调,在调用removeRenderCompleteCallback前,不需要重复注册
|
78
|
+
*/
|
79
|
+
abstract addRenderCompleteCallback (callback: (info: RendererInternalCompleteInfo) => void): number;
|
80
|
+
|
81
|
+
abstract removeRenderCompleteCallback (id: number): void;
|
70
82
|
/**
|
71
83
|
* 获取错误信息,目前支持最大获取5条,
|
72
84
|
* 每次调用此函数后,清空错误队列
|