@woosh/meep-engine 2.111.11 → 2.111.14
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/build/meep.cjs +11 -1
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +11 -1
- package/package.json +1 -1
- package/src/core/model/object/ImmutableObjectPool.d.ts +7 -2
- package/src/core/model/object/ImmutableObjectPool.d.ts.map +1 -1
- package/src/core/model/object/ImmutableObjectPool.js +11 -1
- package/src/core/model/object/objectDeepEquals.d.ts +1 -1
- package/src/engine/graphics/render/frame_graph/IRenderContext.d.ts +0 -12
- package/src/engine/graphics/render/frame_graph/IRenderContext.d.ts.map +1 -1
- package/src/engine/graphics/render/frame_graph/IRenderContext.js +1 -20
- package/src/engine/graphics/render/frame_graph/RenderGraph.d.ts +10 -2
- package/src/engine/graphics/render/frame_graph/RenderGraph.d.ts.map +1 -1
- package/src/engine/graphics/render/frame_graph/RenderGraph.js +28 -2
- package/src/engine/graphics/render/frame_graph/RenderPass.d.ts +10 -1
- package/src/engine/graphics/render/frame_graph/RenderPass.d.ts.map +1 -1
- package/src/engine/graphics/render/frame_graph/RenderPass.js +13 -1
- package/src/engine/graphics/render/frame_graph/RenderPassNode.d.ts +2 -2
- package/src/engine/graphics/render/frame_graph/RenderPassNode.d.ts.map +1 -1
- package/src/engine/graphics/render/frame_graph/RenderPassNode.js +2 -2
- package/src/engine/graphics/render/frame_graph/backend/void/VoidRenderContext.d.ts +11 -0
- package/src/engine/graphics/render/frame_graph/backend/void/VoidRenderContext.d.ts.map +1 -0
- package/src/engine/graphics/render/frame_graph/backend/void/VoidRenderContext.js +16 -0
- package/src/engine/graphics/render/frame_graph/resource/RenderResourceManager.d.ts +5 -0
- package/src/engine/graphics/render/frame_graph/resource/RenderResourceManager.d.ts.map +1 -1
- package/src/engine/graphics/render/frame_graph/resource/RenderResourceManager.js +19 -0
- package/src/engine/graphics/render/frame_graph/resource/ResourceDescriptor.d.ts +7 -0
- package/src/engine/graphics/render/frame_graph/resource/ResourceDescriptor.d.ts.map +1 -1
- package/src/engine/graphics/render/frame_graph/resource/ResourceDescriptor.js +15 -0
- package/src/engine/graphics/render/frame_graph/resource/TextureDescriptor.d.ts +0 -1
- package/src/engine/graphics/render/frame_graph/resource/TextureDescriptor.d.ts.map +1 -1
- package/src/engine/graphics/render/frame_graph/resource/TextureDescriptor.js +9 -0
- package/src/engine/graphics/render/frame_graph/webgl/WebGLRenderContext.d.ts +2 -0
- package/src/engine/graphics/render/frame_graph/webgl/WebGLRenderContext.d.ts.map +1 -1
- package/src/engine/graphics/render/frame_graph/webgl/WebGLRenderContext.js +23 -0
package/build/meep.module.js
CHANGED
|
@@ -97886,7 +97886,7 @@ class LabelView extends View {
|
|
|
97886
97886
|
*/
|
|
97887
97887
|
class ImmutableObjectPool {
|
|
97888
97888
|
/**
|
|
97889
|
-
*
|
|
97889
|
+
* @readonly
|
|
97890
97890
|
* @type {Signal<Key,Value>}
|
|
97891
97891
|
*/
|
|
97892
97892
|
onRemoved = new Signal()
|
|
@@ -97955,6 +97955,16 @@ class ImmutableObjectPool {
|
|
|
97955
97955
|
return element.value;
|
|
97956
97956
|
}
|
|
97957
97957
|
|
|
97958
|
+
/**
|
|
97959
|
+
* Removed all elements from cache
|
|
97960
|
+
* NOTE: {@link onRemoved} signal *does* get triggered for each element
|
|
97961
|
+
*/
|
|
97962
|
+
clear() {
|
|
97963
|
+
while (this.__first !== null) {
|
|
97964
|
+
this.__removeElement(this.__first);
|
|
97965
|
+
}
|
|
97966
|
+
}
|
|
97967
|
+
|
|
97958
97968
|
/**
|
|
97959
97969
|
*
|
|
97960
97970
|
* @param {CacheElement<Key,Value>} el
|
package/package.json
CHANGED
|
@@ -7,10 +7,10 @@ export class ImmutableObjectPool<Key, Value> {
|
|
|
7
7
|
perKeyCapacity?: number;
|
|
8
8
|
});
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* @readonly
|
|
11
11
|
* @type {Signal<Key,Value>}
|
|
12
12
|
*/
|
|
13
|
-
onRemoved: Signal<Key, Value>;
|
|
13
|
+
readonly onRemoved: Signal<Key, Value>;
|
|
14
14
|
/**
|
|
15
15
|
*
|
|
16
16
|
* @type {HashMap<Key, CacheElement<Key,Value>[]>}
|
|
@@ -44,6 +44,11 @@ export class ImmutableObjectPool<Key, Value> {
|
|
|
44
44
|
*/
|
|
45
45
|
size: number;
|
|
46
46
|
get(key: any): Value_1;
|
|
47
|
+
/**
|
|
48
|
+
* Removed all elements from cache
|
|
49
|
+
* NOTE: {@link onRemoved} signal *does* get triggered for each element
|
|
50
|
+
*/
|
|
51
|
+
clear(): void;
|
|
47
52
|
/**
|
|
48
53
|
*
|
|
49
54
|
* @param {CacheElement<Key,Value>} el
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImmutableObjectPool.d.ts","sourceRoot":"","sources":["../../../../../src/core/model/object/ImmutableObjectPool.js"],"names":[],"mappings":"AAIA;;GAEG;AACH;IAOI;;;OAqCC;IA3CD;;;OAGG;IACH,
|
|
1
|
+
{"version":3,"file":"ImmutableObjectPool.d.ts","sourceRoot":"","sources":["../../../../../src/core/model/object/ImmutableObjectPool.js"],"names":[],"mappings":"AAIA;;GAEG;AACH;IAOI;;;OAqCC;IA3CD;;;OAGG;IACH,oBAFU,OAAO,GAAG,EAAC,KAAK,CAAC,CAEH;IAGpB;;;OAGG;IACH,MAFU,QAAQ,GAAG,EAAE,aAAa,GAAG,EAAC,KAAK,CAAC,EAAE,CAAC,CAExB;IAEzB;;;;OAIG;IACH,gBAAmB;IACnB;;;;OAIG;IACH,eAAkB;IAElB;;;OAGG;IACH,UAFU,MAAM,CAEQ;IAExB;;;OAGG;IACH,gBAFU,MAAM,CAEoB;IAEpC;;;OAGG;IACH,MAFU,MAAM,CAEH;IAGjB,uBAuBC;IAED;;;OAGG;IACH,cAIC;IAED;;;;OAIG;IACH,wBA0BC;IAED,mCA2CC;CACJ;mBAnKkB,+BAA+B;wBAD1B,iCAAiC;6BAD5B,6BAA6B"}
|
|
@@ -7,7 +7,7 @@ import Signal from "../../events/signal/Signal.js";
|
|
|
7
7
|
*/
|
|
8
8
|
export class ImmutableObjectPool {
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* @readonly
|
|
11
11
|
* @type {Signal<Key,Value>}
|
|
12
12
|
*/
|
|
13
13
|
onRemoved = new Signal()
|
|
@@ -76,6 +76,16 @@ export class ImmutableObjectPool {
|
|
|
76
76
|
return element.value;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
+
/**
|
|
80
|
+
* Removed all elements from cache
|
|
81
|
+
* NOTE: {@link onRemoved} signal *does* get triggered for each element
|
|
82
|
+
*/
|
|
83
|
+
clear() {
|
|
84
|
+
while (this.__first !== null) {
|
|
85
|
+
this.__removeElement(this.__first);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
79
89
|
/**
|
|
80
90
|
*
|
|
81
91
|
* @param {CacheElement<Key,Value>} el
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export function objectDeepEquals<A extends object, B extends object>(a: A, b: B, value_equals
|
|
1
|
+
export function objectDeepEquals<A extends object, B extends object>(a: A, b: B, value_equals?: (a: A, b: B) => boolean, value_equals_context?: any): boolean
|
|
@@ -3,18 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export class IRenderContext {
|
|
5
5
|
resource_manager: RenderResourceManager;
|
|
6
|
-
/**
|
|
7
|
-
*
|
|
8
|
-
* @param {TextureDescriptor} descriptor
|
|
9
|
-
* @returns {RenderTarget}
|
|
10
|
-
*/
|
|
11
|
-
createRenderTarget(descriptor: TextureDescriptor): RenderTarget;
|
|
12
|
-
/**
|
|
13
|
-
*
|
|
14
|
-
* @param {RenderTarget} target
|
|
15
|
-
* @returns {boolean}
|
|
16
|
-
*/
|
|
17
|
-
destroyRenderTarget(target: RenderTarget): boolean;
|
|
18
6
|
/**
|
|
19
7
|
* @template T
|
|
20
8
|
* @param {ResourceDescriptor<T>} descriptor
|
|
@@ -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,wCAA+C;
|
|
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;IAM/C;;;;OAIG;IACH,wDAEC;IAED;;;;;OAKG;IACH,+EAEC;IAED,gBAEC;CACJ;sCAnCqC,qCAAqC"}
|
|
@@ -13,25 +13,6 @@ export class IRenderContext {
|
|
|
13
13
|
this.resource_manager.attach(this);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
*
|
|
19
|
-
* @param {TextureDescriptor} descriptor
|
|
20
|
-
* @returns {RenderTarget}
|
|
21
|
-
*/
|
|
22
|
-
createRenderTarget(descriptor) {
|
|
23
|
-
throw new Error('Not Implemented')
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
*
|
|
28
|
-
* @param {RenderTarget} target
|
|
29
|
-
* @returns {boolean}
|
|
30
|
-
*/
|
|
31
|
-
destroyRenderTarget(target) {
|
|
32
|
-
throw new Error('Not Implemented')
|
|
33
|
-
}
|
|
34
|
-
|
|
35
16
|
/**
|
|
36
17
|
* @template T
|
|
37
18
|
* @param {ResourceDescriptor<T>} descriptor
|
|
@@ -52,6 +33,6 @@ export class IRenderContext {
|
|
|
52
33
|
}
|
|
53
34
|
|
|
54
35
|
destroy() {
|
|
55
|
-
|
|
36
|
+
this.resource_manager.destroy();
|
|
56
37
|
}
|
|
57
38
|
}
|
|
@@ -75,11 +75,11 @@ export class RenderGraph {
|
|
|
75
75
|
/**
|
|
76
76
|
* @template T
|
|
77
77
|
* @param {string} name
|
|
78
|
-
* @param {
|
|
78
|
+
* @param {ResourceDescriptor<T>} description
|
|
79
79
|
* @param {T} resource
|
|
80
80
|
* @returns {number}
|
|
81
81
|
*/
|
|
82
|
-
import_resource<T_2>(name: string, description:
|
|
82
|
+
import_resource<T_2>(name: string, description: ResourceDescriptor<T_2>, resource: T_2): number;
|
|
83
83
|
/**
|
|
84
84
|
* @returns {boolean}
|
|
85
85
|
* @param id
|
|
@@ -91,6 +91,14 @@ export class RenderGraph {
|
|
|
91
91
|
* @returns {T} resources/handles returned by {@link RenderPass#setup}
|
|
92
92
|
*/
|
|
93
93
|
add<T_3>(pass: RenderPass): T_3;
|
|
94
|
+
/**
|
|
95
|
+
* Perform validation, useful for debugging
|
|
96
|
+
* Typically done before compilation
|
|
97
|
+
* @param {function(problem:string):*} problem_consumer
|
|
98
|
+
* @param {*} [problem_consumer_context] thisArg for `problem_consumer`
|
|
99
|
+
* @returns {boolean}
|
|
100
|
+
*/
|
|
101
|
+
validate(problem_consumer: any, problem_consumer_context?: any): boolean;
|
|
94
102
|
compile(): void;
|
|
95
103
|
/**
|
|
96
104
|
*
|
|
@@ -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,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,
|
|
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,wDAGJ,MAAM,CAUlB;IAED;;;OAGG;IACH,4BAHa,OAAO,CAQnB;IAED;;;;OAIG;IACH,gCA0BC;IAED;;;;;;OAMG;IACH,iEAFa,OAAO,CAOnB;IAED,gBA0FC;IAED;;;OAGG;IACH,uCAqCC;IAED;;;OAGG;IACH,eAFY,MAAM,CAiEjB;CACJ;8BAnb6B,oBAAoB;6BACrB,mBAAmB"}
|
|
@@ -163,7 +163,7 @@ export class RenderGraph {
|
|
|
163
163
|
/**
|
|
164
164
|
* @template T
|
|
165
165
|
* @param {string} name
|
|
166
|
-
* @param {
|
|
166
|
+
* @param {ResourceDescriptor<T>} description
|
|
167
167
|
* @param {T} resource
|
|
168
168
|
* @returns {number}
|
|
169
169
|
*/
|
|
@@ -210,6 +210,10 @@ export class RenderGraph {
|
|
|
210
210
|
|
|
211
211
|
const result = pass.setup(builder, pass.inputs);
|
|
212
212
|
|
|
213
|
+
assert.defined(result, 'result');
|
|
214
|
+
assert.notNull(result, 'result');
|
|
215
|
+
assert.isObject(result, 'result');
|
|
216
|
+
|
|
213
217
|
this.__passes.push(pass);
|
|
214
218
|
|
|
215
219
|
node.data = result;
|
|
@@ -217,6 +221,20 @@ export class RenderGraph {
|
|
|
217
221
|
return result;
|
|
218
222
|
}
|
|
219
223
|
|
|
224
|
+
/**
|
|
225
|
+
* Perform validation, useful for debugging
|
|
226
|
+
* Typically done before compilation
|
|
227
|
+
* @param {function(problem:string):*} problem_consumer
|
|
228
|
+
* @param {*} [problem_consumer_context] thisArg for `problem_consumer`
|
|
229
|
+
* @returns {boolean}
|
|
230
|
+
*/
|
|
231
|
+
validate(problem_consumer, problem_consumer_context) {
|
|
232
|
+
|
|
233
|
+
// TODO implement
|
|
234
|
+
|
|
235
|
+
return true;
|
|
236
|
+
}
|
|
237
|
+
|
|
220
238
|
compile() {
|
|
221
239
|
const pass_nodes = this.__pass_nodes;
|
|
222
240
|
|
|
@@ -314,8 +332,13 @@ export class RenderGraph {
|
|
|
314
332
|
* @param {IRenderContext} context
|
|
315
333
|
*/
|
|
316
334
|
execute(context) {
|
|
335
|
+
assert.defined(context, 'context');
|
|
336
|
+
assert.notNull(context, 'context');
|
|
337
|
+
assert.isObject(context, 'context');
|
|
338
|
+
|
|
317
339
|
const pass_nodes = this.__pass_nodes;
|
|
318
340
|
const pass_node_count = pass_nodes.length;
|
|
341
|
+
|
|
319
342
|
for (let i = 0; i < pass_node_count; i++) {
|
|
320
343
|
const node = pass_nodes[i];
|
|
321
344
|
|
|
@@ -323,7 +346,10 @@ export class RenderGraph {
|
|
|
323
346
|
continue;
|
|
324
347
|
}
|
|
325
348
|
|
|
326
|
-
|
|
349
|
+
const node_created_resources = node.resource_creates;
|
|
350
|
+
|
|
351
|
+
for (const id of node_created_resources) {
|
|
352
|
+
|
|
327
353
|
// allocate resource
|
|
328
354
|
this.getResourceEntry(id).create(context.resource_manager);
|
|
329
355
|
}
|
|
@@ -22,14 +22,23 @@ export class RenderPass<DATA> {
|
|
|
22
22
|
*
|
|
23
23
|
* @param {RenderGraphBuilder} builder
|
|
24
24
|
* @param {Object<number>} inputs
|
|
25
|
-
* @returns {Object<number>}
|
|
25
|
+
* @returns {Object<number>} resources/handles that are used by the pass, includes both inputs and outputs
|
|
26
26
|
*/
|
|
27
27
|
setup(builder: RenderGraphBuilder, inputs: any): any;
|
|
28
28
|
/**
|
|
29
29
|
* @param {DATA} data
|
|
30
30
|
* @param {RenderPassResources} resources
|
|
31
31
|
* @param {IRenderContext} render_context
|
|
32
|
+
* @returns {void}
|
|
32
33
|
*/
|
|
33
34
|
execute(data: DATA, resources: RenderPassResources, render_context: IRenderContext): void;
|
|
35
|
+
/**
|
|
36
|
+
* Validate render pass internal structure
|
|
37
|
+
* This is an optional method, mainly useful for debugging purposes
|
|
38
|
+
* Default behaviour is to report pass as "valid" (true)
|
|
39
|
+
* @param {function(problem:string)} problem_consumer when returning false, reasons are supplied here
|
|
40
|
+
* @return {boolean} true for valid, false for invalid
|
|
41
|
+
*/
|
|
42
|
+
validate(problem_consumer: any): boolean;
|
|
34
43
|
}
|
|
35
44
|
//# sourceMappingURL=RenderPass.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderPass.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/RenderPass.js"],"names":[],"mappings":"AAEA;;GAEG;AACH;IAqBI,yBAEC;IArBD;;;OAGG;IACH,MAFU,MAAM,CAEK;IAErB;;;OAGG;IACH,OAFU,MAAM,kBAAgB,CAEV;IAGtB;;;OAGG;IACH,YAAY;IAOZ;;;;;OAKG;IACH,qDAEC;IAED
|
|
1
|
+
{"version":3,"file":"RenderPass.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/RenderPass.js"],"names":[],"mappings":"AAEA;;GAEG;AACH;IAqBI,yBAEC;IArBD;;;OAGG;IACH,MAFU,MAAM,CAEK;IAErB;;;OAGG;IACH,OAFU,MAAM,kBAAgB,CAEV;IAGtB;;;OAGG;IACH,YAAY;IAOZ;;;;;OAKG;IACH,qDAEC;IAED;;;;;OAKG;IACH,cALW,IAAI,mEAGF,IAAI,CAIhB;IAED;;;;;;OAMG;IACH,iCAFY,OAAO,CAIlB;CACJ"}
|
|
@@ -33,7 +33,7 @@ export class RenderPass {
|
|
|
33
33
|
*
|
|
34
34
|
* @param {RenderGraphBuilder} builder
|
|
35
35
|
* @param {Object<number>} inputs
|
|
36
|
-
* @returns {Object<number>}
|
|
36
|
+
* @returns {Object<number>} resources/handles that are used by the pass, includes both inputs and outputs
|
|
37
37
|
*/
|
|
38
38
|
setup(builder, inputs) {
|
|
39
39
|
throw new Error('Not Implemented');
|
|
@@ -43,8 +43,20 @@ export class RenderPass {
|
|
|
43
43
|
* @param {DATA} data
|
|
44
44
|
* @param {RenderPassResources} resources
|
|
45
45
|
* @param {IRenderContext} render_context
|
|
46
|
+
* @returns {void}
|
|
46
47
|
*/
|
|
47
48
|
execute(data, resources, render_context) {
|
|
48
49
|
throw new Error('Not Implemented');
|
|
49
50
|
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Validate render pass internal structure
|
|
54
|
+
* This is an optional method, mainly useful for debugging purposes
|
|
55
|
+
* Default behaviour is to report pass as "valid" (true)
|
|
56
|
+
* @param {function(problem:string)} problem_consumer when returning false, reasons are supplied here
|
|
57
|
+
* @return {boolean} true for valid, false for invalid
|
|
58
|
+
*/
|
|
59
|
+
validate(problem_consumer) {
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
50
62
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderPassNode.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/RenderPassNode.js"],"names":[],"mappings":"AAGA;IACI;;;OAGG;IACH,MAFU,aAAW,IAAI,CAEb;IAGZ;;;OAGG;IACH,kBAFU,OAAO,CAEQ;IAEzB;;;OAGG;IACH,
|
|
1
|
+
{"version":3,"file":"RenderPassNode.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/RenderPassNode.js"],"names":[],"mappings":"AAGA;IACI;;;OAGG;IACH,MAFU,aAAW,IAAI,CAEb;IAGZ;;;OAGG;IACH,kBAFU,OAAO,CAEQ;IAEzB;;;OAGG;IACH,UAAU;IAEV;;;OAGG;IACH,kBAFU,MAAM,EAAE,CAEI;IACtB;;;OAGG;IACH,gBAFU,MAAM,EAAE,CAEE;IACpB;;;OAGG;IACH,iBAFU,MAAM,EAAE,CAEG;IAErB;;;;OAIG;IACH,YAHW,MAAM,GACL,OAAO,CAMlB;IAED;;;;OAIG;IACH,UAHW,MAAM,GACL,OAAO,CAMlB;IAED;;;;OAIG;IACH,WAHW,MAAM,GACL,OAAO,CAMlB;IAED,0BAOC;IAED;;;OAGG;IACH,eAFW,MAAM,UAUhB;IAED;;;OAGG;IACH,eAFY,OAAO,CAIlB;CACJ;0BArGyB,gBAAgB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Doesn't actually do anything, but works as a valid rendering context
|
|
3
|
+
* Mainly used for testing
|
|
4
|
+
*/
|
|
5
|
+
export class VoidRenderContext extends IRenderContext {
|
|
6
|
+
static INSTANCE: VoidRenderContext;
|
|
7
|
+
createResource(descriptor: any): any;
|
|
8
|
+
destroyResource(resource: any, descriptor: any): void;
|
|
9
|
+
}
|
|
10
|
+
import { IRenderContext } from "../../IRenderContext.js";
|
|
11
|
+
//# sourceMappingURL=VoidRenderContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoidRenderContext.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/render/frame_graph/backend/void/VoidRenderContext.js"],"names":[],"mappings":"AAEA;;;GAGG;AACH;IAQI,mCAA0C;IAP1C,qCAEC;IAED,sDACC;CAGJ;+BAf8B,yBAAyB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IRenderContext } from "../../IRenderContext.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Doesn't actually do anything, but works as a valid rendering context
|
|
5
|
+
* Mainly used for testing
|
|
6
|
+
*/
|
|
7
|
+
export class VoidRenderContext extends IRenderContext {
|
|
8
|
+
createResource(descriptor) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
destroyResource(resource, descriptor) {
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
static INSTANCE = new VoidRenderContext();
|
|
16
|
+
}
|
|
@@ -11,6 +11,11 @@ export class RenderResourceManager {
|
|
|
11
11
|
* @param {T} resource
|
|
12
12
|
*/
|
|
13
13
|
release<T_1>(resource: T_1): void;
|
|
14
|
+
/**
|
|
15
|
+
* Release all held resources including ones issues in cache and held externally
|
|
16
|
+
* All resources issues by the manager are affected
|
|
17
|
+
*/
|
|
18
|
+
destroy(): void;
|
|
14
19
|
#private;
|
|
15
20
|
}
|
|
16
21
|
//# sourceMappingURL=RenderResourceManager.d.ts.map
|
|
@@ -1 +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"}
|
|
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;IAED;;;OAGG;IACH,gBAaC;;CACJ"}
|
|
@@ -75,4 +75,23 @@ export class RenderResourceManager {
|
|
|
75
75
|
this.#cache.add(descriptor, resource);
|
|
76
76
|
|
|
77
77
|
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Release all held resources including ones issues in cache and held externally
|
|
81
|
+
* All resources issues by the manager are affected
|
|
82
|
+
*/
|
|
83
|
+
destroy() {
|
|
84
|
+
this.#cache.clear()
|
|
85
|
+
|
|
86
|
+
// release all held resources
|
|
87
|
+
for (const resource of this.#resource_descriptors.keys()) {
|
|
88
|
+
|
|
89
|
+
const descriptor = this.#resource_descriptors.get(resource);
|
|
90
|
+
|
|
91
|
+
this.#ctx.destroyResource(resource, descriptor);
|
|
92
|
+
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
this.#resource_descriptors.clear();
|
|
96
|
+
}
|
|
78
97
|
}
|
|
@@ -13,5 +13,12 @@ export class ResourceDescriptor {
|
|
|
13
13
|
* @return {boolean}
|
|
14
14
|
*/
|
|
15
15
|
get isResourceDescriptor(): boolean;
|
|
16
|
+
hash(): number;
|
|
17
|
+
/**
|
|
18
|
+
* @template T {ResourceDescriptor}
|
|
19
|
+
* @param {T} other
|
|
20
|
+
* @returns {boolean}
|
|
21
|
+
*/
|
|
22
|
+
equals<T>(other: T): boolean;
|
|
16
23
|
}
|
|
17
24
|
//# sourceMappingURL=ResourceDescriptor.d.ts.map
|
|
@@ -1 +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;
|
|
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;IAGD,eAEC;IAED;;;;OAIG;IACH,qBAFa,OAAO,CAInB;CAEJ"}
|
|
@@ -19,4 +19,19 @@ export class ResourceDescriptor {
|
|
|
19
19
|
get isResourceDescriptor() {
|
|
20
20
|
return true;
|
|
21
21
|
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
hash() {
|
|
25
|
+
return 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @template T {ResourceDescriptor}
|
|
30
|
+
* @param {T} other
|
|
31
|
+
* @returns {boolean}
|
|
32
|
+
*/
|
|
33
|
+
equals(other) {
|
|
34
|
+
return this.type === other.type;
|
|
35
|
+
}
|
|
36
|
+
|
|
22
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextureDescriptor.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/render/frame_graph/resource/TextureDescriptor.js"],"names":[],"mappings":"AAMA;
|
|
1
|
+
{"version":3,"file":"TextureDescriptor.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/render/frame_graph/resource/TextureDescriptor.js"],"names":[],"mappings":"AAMA;IAoEI;;;;;;0BAiBC;IAnFD;;;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;;;;OAIG;IACH,cAHW,iBAAiB,GACf,OAAO,CAkBnB;CAqBJ;mCAzFkC,yBAAyB;+BAH7B,mDAAmD"}
|
|
@@ -54,6 +54,15 @@ export class TextureDescriptor extends ResourceDescriptor {
|
|
|
54
54
|
* @returns {boolean}
|
|
55
55
|
*/
|
|
56
56
|
equals(other) {
|
|
57
|
+
if (this === other) {
|
|
58
|
+
// shortcut
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (!super.equals(other)) {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
|
|
57
66
|
return this.width === other.width
|
|
58
67
|
&& this.height === other.height
|
|
59
68
|
&& this.format === other.format
|
|
@@ -4,6 +4,8 @@ export class WebGLRenderContext extends IRenderContext {
|
|
|
4
4
|
* @param {WebGL2RenderingContext} ctx
|
|
5
5
|
*/
|
|
6
6
|
constructor(ctx: WebGL2RenderingContext);
|
|
7
|
+
createResource(descriptor: any): RenderTarget;
|
|
8
|
+
destroyResource(resource: any, descriptor: any): boolean;
|
|
7
9
|
/**
|
|
8
10
|
*
|
|
9
11
|
* @param {TextureDescriptor} descriptor
|
|
@@ -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;+
|
|
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,8CAQC;IAED,yDAWC;IAED;;;OAGG;IACH,gEASC;IAED,0CAEC;;CACJ;+BA7D8B,sBAAsB;6BACxB,6BAA6B"}
|
|
@@ -18,6 +18,29 @@ export class WebGLRenderContext extends IRenderContext {
|
|
|
18
18
|
this.#gl = ctx;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
createResource(descriptor) {
|
|
22
|
+
const resource_type = descriptor.type;
|
|
23
|
+
|
|
24
|
+
if(resource_type === "texture"){
|
|
25
|
+
return this.createRenderTarget(descriptor);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
throw new Error(`Unsupported resource type ${resource_type}`);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
destroyResource(resource, descriptor) {
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
const resource_type = descriptor.type;
|
|
35
|
+
|
|
36
|
+
if(resource_type === "texture"){
|
|
37
|
+
return this.destroyRenderTarget(resource);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
throw new Error(`Unsupported resource type ${resource_type}`);
|
|
41
|
+
|
|
42
|
+
}
|
|
43
|
+
|
|
21
44
|
/**
|
|
22
45
|
*
|
|
23
46
|
* @param {TextureDescriptor} descriptor
|