@woosh/meep-engine 2.111.12 → 2.111.15
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.js +1 -1
- 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/{TextureDescriptor.d.ts → TextureResourceDescriptor.d.ts} +5 -5
- package/src/engine/graphics/render/frame_graph/resource/TextureResourceDescriptor.d.ts.map +1 -0
- package/src/engine/graphics/render/frame_graph/resource/{TextureDescriptor.js → TextureResourceDescriptor.js} +3 -3
- 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 +4 -4
- package/src/engine/graphics/render/frame_graph/sample/deferred/run.js +2 -2
- 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/resource/TextureDescriptor.d.ts.map +0 -1
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
|
|
@@ -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
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export class
|
|
1
|
+
export class TextureResourceDescriptor extends ResourceDescriptor {
|
|
2
2
|
static from({ height, width, format, channel_count, initial_state }: {
|
|
3
3
|
height?: number;
|
|
4
4
|
width?: number;
|
|
5
5
|
format?: BinaryDataType;
|
|
6
6
|
channel_count?: number;
|
|
7
7
|
initial_state?: number;
|
|
8
|
-
}):
|
|
8
|
+
}): TextureResourceDescriptor;
|
|
9
9
|
/**
|
|
10
10
|
*
|
|
11
11
|
* @type {number}
|
|
@@ -33,11 +33,11 @@ export class TextureDescriptor extends ResourceDescriptor {
|
|
|
33
33
|
initial_state: number;
|
|
34
34
|
/**
|
|
35
35
|
*
|
|
36
|
-
* @param {
|
|
36
|
+
* @param {TextureResourceDescriptor} other
|
|
37
37
|
* @returns {boolean}
|
|
38
38
|
*/
|
|
39
|
-
equals(other:
|
|
39
|
+
equals(other: TextureResourceDescriptor): boolean;
|
|
40
40
|
}
|
|
41
41
|
import { ResourceDescriptor } from "./ResourceDescriptor.js";
|
|
42
42
|
import { BinaryDataType } from "../../../../../core/binary/type/BinaryDataType.js";
|
|
43
|
-
//# sourceMappingURL=
|
|
43
|
+
//# sourceMappingURL=TextureResourceDescriptor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextureResourceDescriptor.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/render/frame_graph/resource/TextureResourceDescriptor.js"],"names":[],"mappings":"AAMA;IAoEI;;;;;;kCAiBC;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,yBAAyB,GACvB,OAAO,CAkBnB;CAqBJ;mCAzFkC,yBAAyB;+BAH7B,mDAAmD"}
|
|
@@ -4,7 +4,7 @@ import { computeStringHash } from "../../../../../core/primitives/strings/comput
|
|
|
4
4
|
import { ResourceDescriptor } from "./ResourceDescriptor.js";
|
|
5
5
|
import { TextureInitialState } from "./TextureInitialState.js";
|
|
6
6
|
|
|
7
|
-
export class
|
|
7
|
+
export class TextureResourceDescriptor extends ResourceDescriptor {
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
*
|
|
@@ -50,7 +50,7 @@ export class TextureDescriptor extends ResourceDescriptor {
|
|
|
50
50
|
|
|
51
51
|
/**
|
|
52
52
|
*
|
|
53
|
-
* @param {
|
|
53
|
+
* @param {TextureResourceDescriptor} other
|
|
54
54
|
* @returns {boolean}
|
|
55
55
|
*/
|
|
56
56
|
equals(other) {
|
|
@@ -80,7 +80,7 @@ export class TextureDescriptor extends ResourceDescriptor {
|
|
|
80
80
|
initial_state = TextureInitialState.Clear
|
|
81
81
|
}) {
|
|
82
82
|
|
|
83
|
-
const r = new
|
|
83
|
+
const r = new TextureResourceDescriptor();
|
|
84
84
|
|
|
85
85
|
r.height = height;
|
|
86
86
|
r.width = width;
|
|
@@ -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;IAOoD,yBAGhC;IAPhB;;;;MAqBC;IAED,8DAEC;CACJ;2BAhC0B,qBAAqB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RenderPass } from "../../RenderPass.js";
|
|
2
|
-
import {
|
|
2
|
+
import { TextureResourceDescriptor } from "../../resource/TextureResourceDescriptor.js";
|
|
3
3
|
|
|
4
4
|
export class GBufferDrawPass extends RenderPass {
|
|
5
5
|
name = "Draw G-buffer";
|
|
@@ -7,16 +7,16 @@ export class GBufferDrawPass extends RenderPass {
|
|
|
7
7
|
setup(builder, inputs) {
|
|
8
8
|
// ignore inputs
|
|
9
9
|
|
|
10
|
-
const out_albedo = new
|
|
10
|
+
const out_albedo = new TextureResourceDescriptor();
|
|
11
11
|
const res_albedo = builder.create("Albedo", out_albedo);
|
|
12
12
|
builder.write(res_albedo);
|
|
13
13
|
|
|
14
|
-
const out_normal = new
|
|
14
|
+
const out_normal = new TextureResourceDescriptor();
|
|
15
15
|
const res_normal = builder.create("Normal", out_normal);
|
|
16
16
|
builder.write(res_normal);
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
const out_depth = new
|
|
19
|
+
const out_depth = new TextureResourceDescriptor();
|
|
20
20
|
const res_position = builder.create("Position", out_depth);
|
|
21
21
|
builder.write(res_position);
|
|
22
22
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RenderGraph } from "../../RenderGraph.js";
|
|
2
|
-
import {
|
|
2
|
+
import { TextureResourceDescriptor } from "../../resource/TextureResourceDescriptor.js";
|
|
3
3
|
import { WebGLRenderContext } from "../../webgl/WebGLRenderContext.js";
|
|
4
4
|
import { GBufferDrawPass } from "./GBufferDrawPass.js";
|
|
5
5
|
import { LightingPass } from "./LightingPass.js";
|
|
@@ -7,7 +7,7 @@ import { LightingPass } from "./LightingPass.js";
|
|
|
7
7
|
|
|
8
8
|
const graph = new RenderGraph();
|
|
9
9
|
|
|
10
|
-
const back_buffer_id = graph.import_resource("Backbuffer", new
|
|
10
|
+
const back_buffer_id = graph.import_resource("Backbuffer", new TextureResourceDescriptor(), "");
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
const p_g = new GBufferDrawPass();
|
|
@@ -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;IAGQ,yBAC0C;IAH9C,oBAAoC;IAEpC;;;MAuBC;IAED,8DAGC;CACJ;2BAnC0B,qBAAqB;oBAD5B,wCAAwC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { BinaryDataType } from "../../../../../../core/binary/type/BinaryDataType.js";
|
|
2
2
|
import Vector2 from "../../../../../../core/geom/Vector2.js";
|
|
3
3
|
import { RenderPass } from "../../RenderPass.js";
|
|
4
|
-
import {
|
|
4
|
+
import { TextureResourceDescriptor } from "../../resource/TextureResourceDescriptor.js";
|
|
5
5
|
|
|
6
6
|
export class ColorDepthPass extends RenderPass {
|
|
7
7
|
resolution = new Vector2(1024, 724);
|
|
8
8
|
|
|
9
9
|
setup(builder, inputs) {
|
|
10
|
-
const color = builder.create("Color",
|
|
10
|
+
const color = builder.create("Color", TextureResourceDescriptor.from({
|
|
11
11
|
width: this.resolution.x,
|
|
12
12
|
height: this.resolution.y,
|
|
13
13
|
format: BinaryDataType.Uint8,
|
|
@@ -16,7 +16,7 @@ export class ColorDepthPass extends RenderPass {
|
|
|
16
16
|
|
|
17
17
|
builder.write(color);
|
|
18
18
|
|
|
19
|
-
const depth = builder.create("Depth",
|
|
19
|
+
const depth = builder.create("Depth", TextureResourceDescriptor.from({
|
|
20
20
|
width: this.resolution.x,
|
|
21
21
|
height: this.resolution.y,
|
|
22
22
|
format: BinaryDataType.Float32,
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|