@woosh/meep-engine 2.111.9 → 2.111.11
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 +1 -1
- package/src/core/collection/table/RowFirstTable.d.ts +2 -1
- package/src/core/collection/table/RowFirstTable.d.ts.map +1 -1
- package/src/core/collection/table/RowFirstTable.js +4 -1
- package/src/engine/graphics/render/frame_graph/IRenderContext.d.ts +15 -2
- package/src/engine/graphics/render/frame_graph/IRenderContext.d.ts.map +1 -1
- package/src/engine/graphics/render/frame_graph/IRenderContext.js +21 -2
- package/src/engine/graphics/render/frame_graph/RenderGraph.d.ts +1 -1
- package/src/engine/graphics/render/frame_graph/RenderGraph.d.ts.map +1 -1
- package/src/engine/graphics/render/frame_graph/RenderGraph.js +7 -1
- package/src/engine/graphics/render/frame_graph/RenderGraphBuilder.d.ts +6 -17
- package/src/engine/graphics/render/frame_graph/RenderGraphBuilder.d.ts.map +1 -1
- package/src/engine/graphics/render/frame_graph/RenderGraphBuilder.js +13 -13
- package/src/engine/graphics/render/frame_graph/ResourceEntry.d.ts +18 -10
- package/src/engine/graphics/render/frame_graph/ResourceEntry.d.ts.map +1 -1
- package/src/engine/graphics/render/frame_graph/ResourceEntry.js +20 -10
- package/src/engine/graphics/render/frame_graph/ResourceNode.d.ts +7 -3
- package/src/engine/graphics/render/frame_graph/ResourceNode.d.ts.map +1 -1
- package/src/engine/graphics/render/frame_graph/ResourceNode.js +4 -1
- package/src/engine/graphics/render/frame_graph/resource/RenderResourceManager.d.ts +16 -0
- package/src/engine/graphics/render/frame_graph/resource/RenderResourceManager.d.ts.map +1 -0
- package/src/engine/graphics/render/frame_graph/resource/RenderResourceManager.js +78 -0
- package/src/engine/graphics/render/frame_graph/resource/RenderTarget.d.ts.map +1 -0
- package/src/engine/graphics/render/frame_graph/resource/ResourceDescriptor.d.ts +17 -0
- package/src/engine/graphics/render/frame_graph/resource/ResourceDescriptor.d.ts.map +1 -0
- package/src/engine/graphics/render/frame_graph/resource/ResourceDescriptor.js +22 -0
- package/src/engine/graphics/render/frame_graph/{TextureDescriptor.d.ts → resource/TextureDescriptor.d.ts} +3 -2
- package/src/engine/graphics/render/frame_graph/resource/TextureDescriptor.d.ts.map +1 -0
- package/src/engine/graphics/render/frame_graph/{TextureDescriptor.js → resource/TextureDescriptor.js} +9 -4
- package/src/engine/graphics/render/frame_graph/resource/TextureInitialState.d.ts.map +1 -0
- package/src/engine/graphics/render/frame_graph/sample/deferred/GBufferDrawPass.d.ts.map +1 -1
- package/src/engine/graphics/render/frame_graph/sample/deferred/GBufferDrawPass.js +1 -1
- package/src/engine/graphics/render/frame_graph/sample/deferred/run.js +1 -1
- package/src/engine/graphics/render/frame_graph/sample/meep-v1/ColorDepthPass.d.ts.map +1 -1
- package/src/engine/graphics/render/frame_graph/sample/meep-v1/ColorDepthPass.js +3 -3
- package/src/engine/graphics/render/frame_graph/webgl/WebGLRenderContext.d.ts +1 -1
- package/src/engine/graphics/render/frame_graph/webgl/WebGLRenderContext.d.ts.map +1 -1
- package/src/engine/graphics/render/frame_graph/webgl/WebGLRenderContext.js +1 -1
- package/src/engine/graphics/render/frame_graph/RenderTarget.d.ts.map +0 -1
- package/src/engine/graphics/render/frame_graph/RenderTextureManager.d.ts +0 -16
- package/src/engine/graphics/render/frame_graph/RenderTextureManager.d.ts.map +0 -1
- package/src/engine/graphics/render/frame_graph/RenderTextureManager.js +0 -57
- package/src/engine/graphics/render/frame_graph/TextureDescriptor.d.ts.map +0 -1
- package/src/engine/graphics/render/frame_graph/TextureInitialState.d.ts.map +0 -1
- /package/src/engine/graphics/render/frame_graph/{RenderTarget.d.ts → resource/RenderTarget.d.ts} +0 -0
- /package/src/engine/graphics/render/frame_graph/{RenderTarget.js → resource/RenderTarget.js} +0 -0
- /package/src/engine/graphics/render/frame_graph/{TextureInitialState.d.ts → resource/TextureInitialState.d.ts} +0 -0
- /package/src/engine/graphics/render/frame_graph/{TextureInitialState.js → resource/TextureInitialState.js} +0 -0
package/package.json
CHANGED
|
@@ -116,8 +116,9 @@ export class RowFirstTable {
|
|
|
116
116
|
/**
|
|
117
117
|
*
|
|
118
118
|
* @param {Array.<number>} values
|
|
119
|
+
* @returns {number} index of newly added row
|
|
119
120
|
*/
|
|
120
|
-
addRow(values: Array<number>):
|
|
121
|
+
addRow(values: Array<number>): number;
|
|
121
122
|
/**
|
|
122
123
|
*
|
|
123
124
|
* @param {number} count number of rows to be added
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RowFirstTable.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/table/RowFirstTable.js"],"names":[],"mappings":"AAMA;;GAEG;AACH;IACI;;;;;OAKG;IACH,oDAHW,OAAO,EAuDjB;IA/CG;;;OAGG;IACH,wBAAgB;IAEhB;;;OAGG;IACH,gBAFU,qBAAsB,CAET;IAEvB;;;OAGG;IACH,MAFU,WAAW,CAEuB;IAE5C;;;OAGG;IACH,gBAFU,MAAM,CAEyB;IAEzC;;;OAGG;IACH,QAFU,MAAM,CAED;IAEf;;;OAGG;IACH,UAFU,MAAM,CAEC;IAEjB;;;OAGG;IACH,UAFU,QAAQ,CAEE;IAEpB;;MAEC;IAKL;;OAEG;IACH,mBAiBC;IAXG;;;OAGG;IACH,sBAFmB,QAAQ,QAAE,MAAM,QAAE,MAAM,EAAE,KAAG,IAAI,CAEb;IAEvC;;;OAGG;IACH,uBAFmB,QAAQ,QAAE,MAAM,QAAE,MAAM,EAAE,KAAG,IAAI,CAEX;IAG7C;;;;OAIG;IACH,uDAMC;IAED;;;OAGG;IACH,QAFa,MAAM,CA4BlB;IAED;;;OAGG;IACH,sBAFW,MAAM,QA+ChB;IAED;;OAEG;IACH,aAEC;IAED;;;OAGG;IACH,iBAFW,MAAM,QAchB;IAED;;;;;OAKG;IACH,yBAJW,MAAM,eACN,MAAM,SACN,MAAM,QAchB;IAED;;;;;OAKG;IACH,wBAJW,MAAM,eACN,MAAM,GACJ,MAAM,CAclB;IAED;;;;OAIG;IACH,kBAHW,MAAM,YACN,MAAM,QAyBhB;IAED;;;;;OAKG;IACH,kBAHW,MAAM,YACN,MAAM,QAqBhB;IAED
|
|
1
|
+
{"version":3,"file":"RowFirstTable.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/table/RowFirstTable.js"],"names":[],"mappings":"AAMA;;GAEG;AACH;IACI;;;;;OAKG;IACH,oDAHW,OAAO,EAuDjB;IA/CG;;;OAGG;IACH,wBAAgB;IAEhB;;;OAGG;IACH,gBAFU,qBAAsB,CAET;IAEvB;;;OAGG;IACH,MAFU,WAAW,CAEuB;IAE5C;;;OAGG;IACH,gBAFU,MAAM,CAEyB;IAEzC;;;OAGG;IACH,QAFU,MAAM,CAED;IAEf;;;OAGG;IACH,UAFU,MAAM,CAEC;IAEjB;;;OAGG;IACH,UAFU,QAAQ,CAEE;IAEpB;;MAEC;IAKL;;OAEG;IACH,mBAiBC;IAXG;;;OAGG;IACH,sBAFmB,QAAQ,QAAE,MAAM,QAAE,MAAM,EAAE,KAAG,IAAI,CAEb;IAEvC;;;OAGG;IACH,uBAFmB,QAAQ,QAAE,MAAM,QAAE,MAAM,EAAE,KAAG,IAAI,CAEX;IAG7C;;;;OAIG;IACH,uDAMC;IAED;;;OAGG;IACH,QAFa,MAAM,CA4BlB;IAED;;;OAGG;IACH,sBAFW,MAAM,QA+ChB;IAED;;OAEG;IACH,aAEC;IAED;;;OAGG;IACH,iBAFW,MAAM,QAchB;IAED;;;;;OAKG;IACH,yBAJW,MAAM,eACN,MAAM,SACN,MAAM,QAchB;IAED;;;;;OAKG;IACH,wBAJW,MAAM,eACN,MAAM,GACJ,MAAM,CAclB;IAED;;;;OAIG;IACH,kBAHW,MAAM,YACN,MAAM,QAyBhB;IAED;;;;;OAKG;IACH,kBAHW,MAAM,YACN,MAAM,QAqBhB;IAED;;;;OAIG;IACH,eAHW,MAAO,MAAM,CAAC,GACZ,MAAM,CAiBlB;IAED;;;;OAIG;IACH,eAHW,MAAM,4BAoChB;IAED;;;;OAIG;IACH,gBAHW,MAAM,UACN,MAAM,QAwBhB;IAED;;;;OAIG;IACH,YAFW,aAAa,QAsBvB;IAED;;;OAGG;IACH,cAHW,aAAa,GACX,OAAO,CAyBnB;IAED;;;;OAIG;IACH,wCAIC;IAED;;;;OAIG;IACH,cAHW,MAAM,UACN,MAAM,EAAE,QAMlB;IAED;;OAEG;IACH,qBA4BC;IAED;;OAEG;IACH,cAIC;IAED;;;OAGG;IACH,wBAEC;IAED;;;OAGG;IACH,cAFa,MAAM,EAAE,EAAE,CAgBtB;IAED;;OAEG;IACH,uBAIC;CACJ;mBA3iBkB,+BAA+B"}
|
|
@@ -311,6 +311,7 @@ export class RowFirstTable {
|
|
|
311
311
|
/**
|
|
312
312
|
*
|
|
313
313
|
* @param {Array.<number>} values
|
|
314
|
+
* @returns {number} index of newly added row
|
|
314
315
|
*/
|
|
315
316
|
addRow(values) {
|
|
316
317
|
|
|
@@ -325,6 +326,8 @@ export class RowFirstTable {
|
|
|
325
326
|
this.writeRowMethod(this.dataView, this.bytesPerRecord * rowIndex, values);
|
|
326
327
|
|
|
327
328
|
this.on.added.send2(rowIndex, values);
|
|
329
|
+
|
|
330
|
+
return rowIndex;
|
|
328
331
|
}
|
|
329
332
|
|
|
330
333
|
/**
|
|
@@ -385,7 +388,7 @@ export class RowFirstTable {
|
|
|
385
388
|
const bytes_per_record = this.bytesPerRecord;
|
|
386
389
|
|
|
387
390
|
const source_address = source * bytes_per_record;
|
|
388
|
-
const target_address =
|
|
391
|
+
const target_address = target * bytes_per_record;
|
|
389
392
|
|
|
390
393
|
const data_view = this.dataView;
|
|
391
394
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Abstracts rendering context, such as "WebGLRenderer" in THREE.js or WebGL/WebGPU
|
|
3
3
|
*/
|
|
4
4
|
export class IRenderContext {
|
|
5
|
-
resource_manager:
|
|
5
|
+
resource_manager: RenderResourceManager;
|
|
6
6
|
/**
|
|
7
7
|
*
|
|
8
8
|
* @param {TextureDescriptor} descriptor
|
|
@@ -15,7 +15,20 @@ export class IRenderContext {
|
|
|
15
15
|
* @returns {boolean}
|
|
16
16
|
*/
|
|
17
17
|
destroyRenderTarget(target: RenderTarget): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* @template T
|
|
20
|
+
* @param {ResourceDescriptor<T>} descriptor
|
|
21
|
+
* @returns {T}
|
|
22
|
+
*/
|
|
23
|
+
createResource<T>(descriptor: ResourceDescriptor<T>): T;
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @template T
|
|
27
|
+
* @param {T} resource
|
|
28
|
+
* @param {ResourceDescriptor<T>} descriptor
|
|
29
|
+
*/
|
|
30
|
+
destroyResource<T_1>(resource: T_1, descriptor: ResourceDescriptor<T_1>): void;
|
|
18
31
|
destroy(): void;
|
|
19
32
|
}
|
|
20
|
-
import {
|
|
33
|
+
import { RenderResourceManager } from "./resource/RenderResourceManager.js";
|
|
21
34
|
//# sourceMappingURL=IRenderContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IRenderContext.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/IRenderContext.js"],"names":[],"mappings":"AAIA;;GAEG;AACH;IAEI,
|
|
1
|
+
{"version":3,"file":"IRenderContext.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/IRenderContext.js"],"names":[],"mappings":"AAIA;;GAEG;AACH;IAEI,wCAA+C;IAO/C;;;;OAIG;IACH,gEAEC;IAED;;;;OAIG;IACH,2CAFa,OAAO,CAInB;IAED;;;;OAIG;IACH,wDAEC;IAED;;;;;OAKG;IACH,+EAEC;IAED,gBAEC;CACJ;sCAtDqC,qCAAqC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
//
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { RenderResourceManager } from "./resource/RenderResourceManager.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Abstracts rendering context, such as "WebGLRenderer" in THREE.js or WebGL/WebGPU
|
|
7
7
|
*/
|
|
8
8
|
export class IRenderContext {
|
|
9
9
|
|
|
10
|
-
resource_manager = new
|
|
10
|
+
resource_manager = new RenderResourceManager();
|
|
11
11
|
|
|
12
12
|
constructor() {
|
|
13
13
|
this.resource_manager.attach(this);
|
|
@@ -32,6 +32,25 @@ export class IRenderContext {
|
|
|
32
32
|
throw new Error('Not Implemented')
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
/**
|
|
36
|
+
* @template T
|
|
37
|
+
* @param {ResourceDescriptor<T>} descriptor
|
|
38
|
+
* @returns {T}
|
|
39
|
+
*/
|
|
40
|
+
createResource(descriptor) {
|
|
41
|
+
throw new Error('Not Implemented')
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
*
|
|
46
|
+
* @template T
|
|
47
|
+
* @param {T} resource
|
|
48
|
+
* @param {ResourceDescriptor<T>} descriptor
|
|
49
|
+
*/
|
|
50
|
+
destroyResource(resource, descriptor) {
|
|
51
|
+
throw new Error('Not Implemented')
|
|
52
|
+
}
|
|
53
|
+
|
|
35
54
|
destroy() {
|
|
36
55
|
// override as necessary
|
|
37
56
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderGraph.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/RenderGraph.js"],"names":[],"mappings":"AAQA;;;GAGG;AACH;IACI;;;;OAIG;IACH,iBAAc;IAEd;;;;OAIG;IACH,qBAAkB;IAElB;;;;OAIG;IACH,yBAAsB;IAEtB;;;;OAIG;IACH,4BAAyB;IAEzB;;;;OAIG;IACH,qBAHW,MAAM,
|
|
1
|
+
{"version":3,"file":"RenderGraph.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/RenderGraph.js"],"names":[],"mappings":"AAQA;;;GAGG;AACH;IACI;;;;OAIG;IACH,iBAAc;IAEd;;;;OAIG;IACH,qBAAkB;IAElB;;;;OAIG;IACH,yBAAsB;IAEtB;;;;OAIG;IACH,4BAAyB;IAEzB;;;;OAIG;IACH,qBAHW,MAAM,sBAahB;IAED;;;;OAIG;IACH,oBAHW,MAAM,qBAgBhB;IAED;;;;OAIG;IACH,qBAHW,MAAM,KAKhB;IAED;;;;OAIG;IACH,2BAHW,MAAM,2BAOhB;IAED;;;;;OAKG;IACH,6BAUC;IAED;;;;;;OAMG;IACH,4BAcC;IAED;;;;OAIG;IACH,oBAHW,MAAM,GACJ,MAAM,CAkBlB;IAED;;;;;;OAMG;IACH,2BALW,MAAM,kDAGJ,MAAM,CAUlB;IAED;;;OAGG;IACH,4BAHa,OAAO,CAQnB;IAED;;;;OAIG;IACH,gCAsBC;IAED,gBA0FC;IAED;;;OAGG;IACH,uCA6BC;IAED;;;OAGG;IACH,eAFY,MAAM,CAiEjB;CACJ;8BAzZ6B,oBAAoB;6BACrB,mBAAmB"}
|
|
@@ -47,7 +47,13 @@ export class RenderGraph {
|
|
|
47
47
|
getResourceEntry(id) {
|
|
48
48
|
const node = this.getResourceNode(id);
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
const registry = this.__resource_registry;
|
|
51
|
+
|
|
52
|
+
const entry = registry[node.resource_id];
|
|
53
|
+
|
|
54
|
+
assert.defined(entry, 'entry');
|
|
55
|
+
|
|
56
|
+
return entry;
|
|
51
57
|
}
|
|
52
58
|
|
|
53
59
|
/**
|
|
@@ -1,16 +1,4 @@
|
|
|
1
1
|
export class RenderGraphBuilder {
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
* @type {RenderGraph}
|
|
5
|
-
* @private
|
|
6
|
-
*/
|
|
7
|
-
private __graph;
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
10
|
-
* @type {RenderPassNode}
|
|
11
|
-
* @private
|
|
12
|
-
*/
|
|
13
|
-
private __node;
|
|
14
2
|
/**
|
|
15
3
|
*
|
|
16
4
|
* @param {RenderGraph} graph
|
|
@@ -18,23 +6,24 @@ export class RenderGraphBuilder {
|
|
|
18
6
|
*/
|
|
19
7
|
init(graph: RenderGraph, node: RenderPassNode): void;
|
|
20
8
|
/**
|
|
21
|
-
*
|
|
9
|
+
* Create a new resource
|
|
22
10
|
* @param {string} name
|
|
23
|
-
* @param {
|
|
11
|
+
* @param {ResourceDescriptor} descriptor
|
|
24
12
|
* @returns {number} resource ID
|
|
25
13
|
*/
|
|
26
|
-
create(name: string, descriptor:
|
|
14
|
+
create(name: string, descriptor: ResourceDescriptor): number;
|
|
27
15
|
/**
|
|
28
|
-
*
|
|
16
|
+
* Read an existing resource
|
|
29
17
|
* @param {number} resource
|
|
30
18
|
* @returns {number}
|
|
31
19
|
*/
|
|
32
20
|
read(resource: number): number;
|
|
33
21
|
/**
|
|
34
|
-
*
|
|
22
|
+
* Write a resource
|
|
35
23
|
* @param {number} resource
|
|
36
24
|
* @returns {number}
|
|
37
25
|
*/
|
|
38
26
|
write(resource: number): number;
|
|
27
|
+
#private;
|
|
39
28
|
}
|
|
40
29
|
//# sourceMappingURL=RenderGraphBuilder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderGraphBuilder.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/RenderGraphBuilder.js"],"names":[],"mappings":"AAEA;
|
|
1
|
+
{"version":3,"file":"RenderGraphBuilder.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/RenderGraphBuilder.js"],"names":[],"mappings":"AAEA;IAcI;;;;OAIG;IACH,qDAGC;IAED;;;;;OAKG;IACH,aAJW,MAAM,mCAEJ,MAAM,CASlB;IAED;;;;OAIG;IACH,eAHW,MAAM,GACJ,MAAM,CAMlB;IAED;;;;OAIG;IACH,gBAHW,MAAM,GACJ,MAAM,CAoBlB;;CACJ"}
|
|
@@ -6,13 +6,13 @@ export class RenderGraphBuilder {
|
|
|
6
6
|
* @type {RenderGraph}
|
|
7
7
|
* @private
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
#graph = null;
|
|
10
10
|
/**
|
|
11
11
|
*
|
|
12
12
|
* @type {RenderPassNode}
|
|
13
13
|
* @private
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
#node = null;
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
*
|
|
@@ -20,44 +20,44 @@ export class RenderGraphBuilder {
|
|
|
20
20
|
* @param {RenderPassNode} node
|
|
21
21
|
*/
|
|
22
22
|
init(graph, node) {
|
|
23
|
-
this
|
|
24
|
-
this
|
|
23
|
+
this.#graph = graph;
|
|
24
|
+
this.#node = node;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
28
|
+
* Create a new resource
|
|
29
29
|
* @param {string} name
|
|
30
|
-
* @param {
|
|
30
|
+
* @param {ResourceDescriptor} descriptor
|
|
31
31
|
* @returns {number} resource ID
|
|
32
32
|
*/
|
|
33
33
|
create(name, descriptor) {
|
|
34
|
-
const node = this.
|
|
34
|
+
const node = this.#graph.create_resource(name, descriptor);
|
|
35
35
|
|
|
36
36
|
// remember resource
|
|
37
|
-
this.
|
|
37
|
+
this.#node.resource_creates.push(node);
|
|
38
38
|
|
|
39
39
|
return node;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
|
-
*
|
|
43
|
+
* Read an existing resource
|
|
44
44
|
* @param {number} resource
|
|
45
45
|
* @returns {number}
|
|
46
46
|
*/
|
|
47
47
|
read(resource) {
|
|
48
48
|
assert.isNonNegativeInteger(resource, 'resource');
|
|
49
49
|
|
|
50
|
-
return this.
|
|
50
|
+
return this.#node.read(resource);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
|
-
*
|
|
54
|
+
* Write a resource
|
|
55
55
|
* @param {number} resource
|
|
56
56
|
* @returns {number}
|
|
57
57
|
*/
|
|
58
58
|
write(resource) {
|
|
59
|
-
const graph = this
|
|
60
|
-
const node = this
|
|
59
|
+
const graph = this.#graph;
|
|
60
|
+
const node = this.#node;
|
|
61
61
|
|
|
62
62
|
if (graph.getResourceEntry(resource).isImported()) {
|
|
63
63
|
// comes from outside the graph, and we write to it. That's a side effect
|
|
@@ -2,12 +2,20 @@
|
|
|
2
2
|
* @template T
|
|
3
3
|
*/
|
|
4
4
|
export class ResourceEntry<T> {
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @type {number}
|
|
8
|
+
*/
|
|
5
9
|
resource_id: number;
|
|
6
10
|
/**
|
|
7
11
|
*
|
|
8
|
-
* @type {
|
|
12
|
+
* @type {ResourceDescriptor<T>|null}
|
|
13
|
+
*/
|
|
14
|
+
resource_descriptor: ResourceDescriptor<T> | null;
|
|
15
|
+
/**
|
|
16
|
+
* Every time resource is modified - version increases
|
|
17
|
+
* @type {number}
|
|
9
18
|
*/
|
|
10
|
-
resource_descriptor: TextureDescriptor | null;
|
|
11
19
|
resource_version: number;
|
|
12
20
|
/**
|
|
13
21
|
* Actual resource handle
|
|
@@ -15,12 +23,13 @@ export class ResourceEntry<T> {
|
|
|
15
23
|
*/
|
|
16
24
|
resource: T | null;
|
|
17
25
|
/**
|
|
18
|
-
* Imported or transient resource
|
|
26
|
+
* Imported or transient resource.
|
|
27
|
+
* Transient resource only exists in the graph, it will be reclaimed once the execution is done
|
|
19
28
|
* @type {boolean}
|
|
20
29
|
*/
|
|
21
30
|
imported: boolean;
|
|
22
31
|
/**
|
|
23
|
-
*
|
|
32
|
+
* Node that created this resource
|
|
24
33
|
* @type {RenderPassNode|null}
|
|
25
34
|
*/
|
|
26
35
|
producer: RenderPassNode | null;
|
|
@@ -31,17 +40,16 @@ export class ResourceEntry<T> {
|
|
|
31
40
|
last: RenderPassNode | null;
|
|
32
41
|
/**
|
|
33
42
|
* Creates actual resource
|
|
34
|
-
* @param {
|
|
43
|
+
* @param {RenderResourceManager} resources
|
|
35
44
|
*/
|
|
36
|
-
create(resources:
|
|
45
|
+
create(resources: RenderResourceManager): void;
|
|
37
46
|
/**
|
|
38
47
|
* De-allocated memory for the resource
|
|
39
|
-
* @param {
|
|
48
|
+
* @param {RenderResourceManager} resources
|
|
40
49
|
*/
|
|
41
|
-
destroy(resources:
|
|
50
|
+
destroy(resources: RenderResourceManager): void;
|
|
42
51
|
isImported(): boolean;
|
|
43
52
|
isTransient(): boolean;
|
|
44
|
-
toString():
|
|
53
|
+
toString(): any;
|
|
45
54
|
}
|
|
46
|
-
import { TextureDescriptor } from "./TextureDescriptor.js";
|
|
47
55
|
//# sourceMappingURL=ResourceEntry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourceEntry.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/ResourceEntry.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ResourceEntry.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/ResourceEntry.js"],"names":[],"mappings":"AAIA;;GAEG;AACH;IACI;;;OAGG;IACH,aAFU,MAAM,CAEW;IAE3B;;;OAGG;IACH,qBAFU,wBAAsB,IAAI,CAET;IAE3B;;;OAGG;IACH,kBAFU,MAAM,CAEK;IAErB;;;OAGG;IACH,UAFU,CAAC,GAAC,IAAI,CAEA;IAEhB;;;;OAIG;IACH,UAFU,OAAO,CAEA;IAEjB;;;OAGG;IACH,UAFU,iBAAe,IAAI,CAEb;IAEhB;;;OAGG;IACH,MAFU,iBAAe,IAAI,CAEjB;IAEZ;;;OAGG;IACH,+CAIC;IAED;;;OAGG;IACH,gDAIC;IAED,sBAEC;IAED,uBAEC;IAED,gBAQC;CACJ"}
|
|
@@ -1,16 +1,27 @@
|
|
|
1
1
|
import { assert } from "../../../../core/assert.js";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
let id_counter = 0;
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* @template T
|
|
6
7
|
*/
|
|
7
8
|
export class ResourceEntry {
|
|
8
|
-
resource_id = 0;
|
|
9
9
|
/**
|
|
10
10
|
*
|
|
11
|
-
* @type {
|
|
11
|
+
* @type {number}
|
|
12
|
+
*/
|
|
13
|
+
resource_id = id_counter++;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @type {ResourceDescriptor<T>|null}
|
|
12
18
|
*/
|
|
13
19
|
resource_descriptor = null;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Every time resource is modified - version increases
|
|
23
|
+
* @type {number}
|
|
24
|
+
*/
|
|
14
25
|
resource_version = 0;
|
|
15
26
|
|
|
16
27
|
/**
|
|
@@ -20,13 +31,14 @@ export class ResourceEntry {
|
|
|
20
31
|
resource = null;
|
|
21
32
|
|
|
22
33
|
/**
|
|
23
|
-
* Imported or transient resource
|
|
34
|
+
* Imported or transient resource.
|
|
35
|
+
* Transient resource only exists in the graph, it will be reclaimed once the execution is done
|
|
24
36
|
* @type {boolean}
|
|
25
37
|
*/
|
|
26
38
|
imported = false;
|
|
27
39
|
|
|
28
40
|
/**
|
|
29
|
-
*
|
|
41
|
+
* Node that created this resource
|
|
30
42
|
* @type {RenderPassNode|null}
|
|
31
43
|
*/
|
|
32
44
|
producer = null;
|
|
@@ -39,7 +51,7 @@ export class ResourceEntry {
|
|
|
39
51
|
|
|
40
52
|
/**
|
|
41
53
|
* Creates actual resource
|
|
42
|
-
* @param {
|
|
54
|
+
* @param {RenderResourceManager} resources
|
|
43
55
|
*/
|
|
44
56
|
create(resources) {
|
|
45
57
|
assert.ok(this.isTransient(), 'Only transient resources can be allocated');
|
|
@@ -49,7 +61,7 @@ export class ResourceEntry {
|
|
|
49
61
|
|
|
50
62
|
/**
|
|
51
63
|
* De-allocated memory for the resource
|
|
52
|
-
* @param {
|
|
64
|
+
* @param {RenderResourceManager} resources
|
|
53
65
|
*/
|
|
54
66
|
destroy(resources) {
|
|
55
67
|
assert.ok(this.isTransient(), 'Only transient resources can be destroyed, that is resources that are created by the graph itself');
|
|
@@ -68,9 +80,7 @@ export class ResourceEntry {
|
|
|
68
80
|
toString() {
|
|
69
81
|
if (this.resource_descriptor !== null) {
|
|
70
82
|
|
|
71
|
-
|
|
72
|
-
return "texture";
|
|
73
|
-
}
|
|
83
|
+
return this.resource_descriptor.type;
|
|
74
84
|
|
|
75
85
|
}
|
|
76
86
|
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @template T
|
|
3
|
+
*/
|
|
4
|
+
export class ResourceNode<T> extends GraphNode {
|
|
5
|
+
constructor();
|
|
2
6
|
resource_id: number;
|
|
3
7
|
/**
|
|
4
8
|
*
|
|
5
|
-
* @type {
|
|
9
|
+
* @type {ResourceDescriptor<T>|null}
|
|
6
10
|
*/
|
|
7
|
-
descriptor:
|
|
11
|
+
descriptor: ResourceDescriptor<T> | null;
|
|
8
12
|
/**
|
|
9
13
|
*
|
|
10
14
|
* @type {RenderPassNode|null}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourceNode.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/ResourceNode.js"],"names":[],"mappings":"AAEA;IACI,oBAAgB;IAEhB;;;OAGG;IACH,YAFU,
|
|
1
|
+
{"version":3,"file":"ResourceNode.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/ResourceNode.js"],"names":[],"mappings":"AAEA;;GAEG;AACH;;IACI,oBAAgB;IAEhB;;;OAGG;IACH,YAFU,wBAAsB,IAAI,CAElB;IAElB;;;OAGG;IACH,UAFU,iBAAe,IAAI,CAEb;IAGpB;;;OAGG;IACH,yBAFU,OAAO,CAEoB;CANpC;0BAnByB,gBAAgB"}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { GraphNode } from "./GraphNode.js";
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @template T
|
|
5
|
+
*/
|
|
3
6
|
export class ResourceNode extends GraphNode {
|
|
4
7
|
resource_id = 0;
|
|
5
8
|
|
|
6
9
|
/**
|
|
7
10
|
*
|
|
8
|
-
* @type {
|
|
11
|
+
* @type {ResourceDescriptor<T>|null}
|
|
9
12
|
*/
|
|
10
13
|
descriptor = null;
|
|
11
14
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export class RenderResourceManager {
|
|
2
|
+
attach(ctx: any): void;
|
|
3
|
+
/**
|
|
4
|
+
* @template T
|
|
5
|
+
* @param {ResourceDescriptor<T>} descriptor
|
|
6
|
+
* @returns {T}
|
|
7
|
+
*/
|
|
8
|
+
get<T>(descriptor: ResourceDescriptor<T>): T;
|
|
9
|
+
/**
|
|
10
|
+
* @template T
|
|
11
|
+
* @param {T} resource
|
|
12
|
+
*/
|
|
13
|
+
release<T_1>(resource: T_1): void;
|
|
14
|
+
#private;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=RenderResourceManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RenderResourceManager.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/render/frame_graph/resource/RenderResourceManager.js"],"names":[],"mappings":"AAGA;IAqBI,uBAEC;IAUD;;;;OAIG;IACH,6CAiBC;IAED;;;OAGG;IACH,kCAYC;;CACJ"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { ImmutableObjectPool } from "../../../../../core/model/object/ImmutableObjectPool.js";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export class RenderResourceManager {
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* @type {IRenderContext|null}
|
|
10
|
+
*/
|
|
11
|
+
#ctx = null;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @type {Map<*, ResourceDescriptor>}
|
|
16
|
+
*/
|
|
17
|
+
#resource_descriptors = new Map();
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @type {ImmutableObjectPool<ResourceDescriptor, *>}
|
|
22
|
+
*/
|
|
23
|
+
#cache = new ImmutableObjectPool();
|
|
24
|
+
|
|
25
|
+
attach(ctx) {
|
|
26
|
+
this.#ctx = ctx;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
constructor() {
|
|
30
|
+
this.#cache.onRemoved.add((descriptor, resource) => {
|
|
31
|
+
|
|
32
|
+
this.#ctx.destroyResource(resource, descriptor);
|
|
33
|
+
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @template T
|
|
39
|
+
* @param {ResourceDescriptor<T>} descriptor
|
|
40
|
+
* @returns {T}
|
|
41
|
+
*/
|
|
42
|
+
get(descriptor) {
|
|
43
|
+
let resource = this.#cache.get(descriptor);
|
|
44
|
+
|
|
45
|
+
if (resource === undefined) {
|
|
46
|
+
// nothing in cache, create a new one
|
|
47
|
+
resource = this.#ctx.createResource(descriptor);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const existing_descriptor = this.#resource_descriptors.get(resource);
|
|
51
|
+
|
|
52
|
+
if (existing_descriptor !== undefined) {
|
|
53
|
+
throw new Error(`Resource is already associated with a live descriptor`);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
this.#resource_descriptors.set(resource, descriptor);
|
|
57
|
+
|
|
58
|
+
return resource;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* @template T
|
|
63
|
+
* @param {T} resource
|
|
64
|
+
*/
|
|
65
|
+
release(resource) {
|
|
66
|
+
|
|
67
|
+
const descriptor = this.#resource_descriptors.get(resource);
|
|
68
|
+
|
|
69
|
+
if (descriptor === undefined) {
|
|
70
|
+
throw new Error(`Resource is not managed`);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
this.#resource_descriptors.delete(resource);
|
|
74
|
+
|
|
75
|
+
this.#cache.add(descriptor, resource);
|
|
76
|
+
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RenderTarget.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/render/frame_graph/resource/RenderTarget.js"],"names":[],"mappings":"AAAA;IACI;;;OAGG;IACH,YAFU,oBAAkB,IAAI,CAEf;IAEjB,eAAW;CACd"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base abstract class for any managed resource such as a texture of a buffer
|
|
3
|
+
*/
|
|
4
|
+
export class ResourceDescriptor {
|
|
5
|
+
/**
|
|
6
|
+
* Resource type, useful for debugging and UI
|
|
7
|
+
* Not guaranteed to be unique
|
|
8
|
+
* @return {string}
|
|
9
|
+
*/
|
|
10
|
+
get type(): string;
|
|
11
|
+
/**
|
|
12
|
+
* For fast type checks
|
|
13
|
+
* @return {boolean}
|
|
14
|
+
*/
|
|
15
|
+
get isResourceDescriptor(): boolean;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=ResourceDescriptor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResourceDescriptor.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/render/frame_graph/resource/ResourceDescriptor.js"],"names":[],"mappings":"AAAA;;GAEG;AACH;IAEI;;;;OAIG;IACH,mBAEC;IAED;;;OAGG;IACH,oCAEC;CACJ"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base abstract class for any managed resource such as a texture of a buffer
|
|
3
|
+
*/
|
|
4
|
+
export class ResourceDescriptor {
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Resource type, useful for debugging and UI
|
|
8
|
+
* Not guaranteed to be unique
|
|
9
|
+
* @return {string}
|
|
10
|
+
*/
|
|
11
|
+
get type() {
|
|
12
|
+
return 'resource'
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* For fast type checks
|
|
17
|
+
* @return {boolean}
|
|
18
|
+
*/
|
|
19
|
+
get isResourceDescriptor() {
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export class TextureDescriptor {
|
|
1
|
+
export class TextureDescriptor extends ResourceDescriptor {
|
|
2
2
|
static from({ height, width, format, channel_count, initial_state }: {
|
|
3
3
|
height?: number;
|
|
4
4
|
width?: number;
|
|
@@ -39,5 +39,6 @@ export class TextureDescriptor {
|
|
|
39
39
|
*/
|
|
40
40
|
equals(other: TextureDescriptor): boolean;
|
|
41
41
|
}
|
|
42
|
-
import {
|
|
42
|
+
import { ResourceDescriptor } from "./ResourceDescriptor.js";
|
|
43
|
+
import { BinaryDataType } from "../../../../../core/binary/type/BinaryDataType.js";
|
|
43
44
|
//# sourceMappingURL=TextureDescriptor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextureDescriptor.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/render/frame_graph/resource/TextureDescriptor.js"],"names":[],"mappings":"AAMA;IA2DI;;;;;;0BAiBC;IA1ED;;;OAGG;IACH,QAFU,MAAM,CAEL;IACX;;;OAGG;IACH,OAFU,MAAM,CAEN;IAEV;;;OAGG;IACH,QAFU,cAAc,CAEM;IAE9B;;;OAGG;IACH,eAFU,MAAM,CAEE;IAElB;;;OAGG;IACH,eAFU,MAAM,CAE0B;IAM1C,eAOC;IAED;;;;OAIG;IACH,cAHW,iBAAiB,GACf,OAAO,CASnB;CAqBJ;mCAhFkC,yBAAyB;+BAH7B,mDAAmD"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { BinaryDataType } from "
|
|
2
|
-
import { computeHashIntegerArray } from "
|
|
3
|
-
import { computeStringHash } from "
|
|
1
|
+
import { BinaryDataType } from "../../../../../core/binary/type/BinaryDataType.js";
|
|
2
|
+
import { computeHashIntegerArray } from "../../../../../core/collection/array/computeHashIntegerArray.js";
|
|
3
|
+
import { computeStringHash } from "../../../../../core/primitives/strings/computeStringHash.js";
|
|
4
|
+
import { ResourceDescriptor } from "./ResourceDescriptor.js";
|
|
4
5
|
import { TextureInitialState } from "./TextureInitialState.js";
|
|
5
6
|
|
|
6
|
-
export class TextureDescriptor {
|
|
7
|
+
export class TextureDescriptor extends ResourceDescriptor {
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
*
|
|
@@ -34,6 +35,10 @@ export class TextureDescriptor {
|
|
|
34
35
|
*/
|
|
35
36
|
initial_state = TextureInitialState.Clear;
|
|
36
37
|
|
|
38
|
+
get type() {
|
|
39
|
+
return 'texture';
|
|
40
|
+
}
|
|
41
|
+
|
|
37
42
|
hash() {
|
|
38
43
|
return computeHashIntegerArray(
|
|
39
44
|
this.width,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextureInitialState.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/render/frame_graph/resource/TextureInitialState.js"],"names":[],"mappings":"kCAEU,MAAM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GBufferDrawPass.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/render/frame_graph/sample/deferred/GBufferDrawPass.js"],"names":[],"mappings":"AAGA;
|
|
1
|
+
{"version":3,"file":"GBufferDrawPass.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/render/frame_graph/sample/deferred/GBufferDrawPass.js"],"names":[],"mappings":"AAGA;IAQU,yBAEkC;IAPxC;;;;MAqBC;IAED,8DAEC;CACJ;2BAhC0B,qBAAqB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RenderPass } from "../../RenderPass.js";
|
|
2
|
-
import { TextureDescriptor } from "../../TextureDescriptor.js";
|
|
2
|
+
import { TextureDescriptor } from "../../resource/TextureDescriptor.js";
|
|
3
3
|
|
|
4
4
|
export class GBufferDrawPass extends RenderPass {
|
|
5
5
|
name = "Draw G-buffer";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RenderGraph } from "../../RenderGraph.js";
|
|
2
|
-
import { TextureDescriptor } from "../../TextureDescriptor.js";
|
|
2
|
+
import { TextureDescriptor } from "../../resource/TextureDescriptor.js";
|
|
3
3
|
import { WebGLRenderContext } from "../../webgl/WebGLRenderContext.js";
|
|
4
4
|
import { GBufferDrawPass } from "./GBufferDrawPass.js";
|
|
5
5
|
import { LightingPass } from "./LightingPass.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorDepthPass.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/render/frame_graph/sample/meep-v1/ColorDepthPass.js"],"names":[],"mappings":"AAKA;
|
|
1
|
+
{"version":3,"file":"ColorDepthPass.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/render/frame_graph/sample/meep-v1/ColorDepthPass.js"],"names":[],"mappings":"AAKA;IAGwB,yBAC0C;IAH9D,oBAAoC;IAEpC;;;MAuBC;IAED,8DAGC;CACJ;2BAnC0B,qBAAqB;oBAD5B,wCAAwC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { RenderPass } from "../../RenderPass.js";
|
|
2
|
-
import { TextureDescriptor } from "../../TextureDescriptor.js";
|
|
3
|
-
import Vector2 from "../../../../../../core/geom/Vector2.js";
|
|
4
1
|
import { BinaryDataType } from "../../../../../../core/binary/type/BinaryDataType.js";
|
|
2
|
+
import Vector2 from "../../../../../../core/geom/Vector2.js";
|
|
3
|
+
import { RenderPass } from "../../RenderPass.js";
|
|
4
|
+
import { TextureDescriptor } from "../../resource/TextureDescriptor.js";
|
|
5
5
|
|
|
6
6
|
export class ColorDepthPass extends RenderPass {
|
|
7
7
|
resolution = new Vector2(1024, 724);
|
|
@@ -13,5 +13,5 @@ export class WebGLRenderContext extends IRenderContext {
|
|
|
13
13
|
#private;
|
|
14
14
|
}
|
|
15
15
|
import { IRenderContext } from "../IRenderContext.js";
|
|
16
|
-
import { RenderTarget } from "../RenderTarget.js";
|
|
16
|
+
import { RenderTarget } from "../resource/RenderTarget.js";
|
|
17
17
|
//# sourceMappingURL=WebGLRenderContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebGLRenderContext.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/render/frame_graph/webgl/WebGLRenderContext.js"],"names":[],"mappings":"AAGA;IAOI;;;OAGG;IACH,iBAFW,sBAAsB,EAMhC;IAED;;;OAGG;IACH,gEASC;IAED,0CAEC;;CACJ;+BAtC8B,sBAAsB;6BACxB,
|
|
1
|
+
{"version":3,"file":"WebGLRenderContext.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/render/frame_graph/webgl/WebGLRenderContext.js"],"names":[],"mappings":"AAGA;IAOI;;;OAGG;IACH,iBAFW,sBAAsB,EAMhC;IAED;;;OAGG;IACH,gEASC;IAED,0CAEC;;CACJ;+BAtC8B,sBAAsB;6BACxB,6BAA6B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RenderTarget.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/RenderTarget.js"],"names":[],"mappings":"AAAA;IACI;;;OAGG;IACH,YAFU,oBAAkB,IAAI,CAEf;IAEjB,eAAW;CACd"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export class RenderTextureManager {
|
|
2
|
-
attach(ctx: any): void;
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
* @param {TextureDescriptor} descriptor
|
|
6
|
-
* @returns {RenderTarget}
|
|
7
|
-
*/
|
|
8
|
-
get(descriptor: TextureDescriptor): RenderTarget;
|
|
9
|
-
/**
|
|
10
|
-
*
|
|
11
|
-
* @param {RenderTarget} handle
|
|
12
|
-
*/
|
|
13
|
-
release(handle: RenderTarget): void;
|
|
14
|
-
#private;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=RenderTextureManager.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RenderTextureManager.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/RenderTextureManager.js"],"names":[],"mappings":"AAGA;IAeI,uBAEC;IAUD;;;;OAIG;IACH,iDAUC;IAED;;;OAGG;IACH,oCAIC;;CACJ"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { ImmutableObjectPool } from "../../../../core/model/object/ImmutableObjectPool.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export class RenderTextureManager {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
*
|
|
9
|
-
* @type {IRenderContext|null}
|
|
10
|
-
*/
|
|
11
|
-
#ctx = null;
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
*
|
|
15
|
-
* @type {ImmutableObjectPool<TextureDescriptor, RenderTarget>}
|
|
16
|
-
*/
|
|
17
|
-
#cache = new ImmutableObjectPool();
|
|
18
|
-
|
|
19
|
-
attach(ctx) {
|
|
20
|
-
this.#ctx = ctx;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
constructor() {
|
|
24
|
-
this.#cache.onRemoved.add((descriptor, texture) => {
|
|
25
|
-
|
|
26
|
-
this.#ctx.destroyRenderTarget(texture);
|
|
27
|
-
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
*
|
|
33
|
-
* @param {TextureDescriptor} descriptor
|
|
34
|
-
* @returns {RenderTarget}
|
|
35
|
-
*/
|
|
36
|
-
get(descriptor) {
|
|
37
|
-
const existing = this.#cache.get(descriptor);
|
|
38
|
-
|
|
39
|
-
if (existing !== undefined) {
|
|
40
|
-
return existing;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// nothing in cache, create a new one
|
|
44
|
-
return this.#ctx.createRenderTarget(descriptor);
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
*
|
|
50
|
-
* @param {RenderTarget} handle
|
|
51
|
-
*/
|
|
52
|
-
release(handle) {
|
|
53
|
-
|
|
54
|
-
this.#cache.add(handle.descriptor, handle);
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TextureDescriptor.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/TextureDescriptor.js"],"names":[],"mappings":"AAKA;IAuDI;;;;;;0BAiBC;IAtED;;;OAGG;IACH,QAFU,MAAM,CAEL;IACX;;;OAGG;IACH,OAFU,MAAM,CAEN;IAEV;;;OAGG;IACH,QAFU,cAAc,CAEM;IAE9B;;;OAGG;IACH,eAFU,MAAM,CAEE;IAElB;;;OAGG;IACH,eAFU,MAAM,CAE0B;IAE1C,eAOC;IAED;;;;OAIG;IACH,cAHW,iBAAiB,GACf,OAAO,CASnB;CAqBJ;+BA9E8B,gDAAgD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TextureInitialState.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/TextureInitialState.js"],"names":[],"mappings":"kCAEU,MAAM"}
|
/package/src/engine/graphics/render/frame_graph/{RenderTarget.d.ts → resource/RenderTarget.d.ts}
RENAMED
|
File without changes
|
/package/src/engine/graphics/render/frame_graph/{RenderTarget.js → resource/RenderTarget.js}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|