@woosh/meep-engine 2.126.75 → 2.127.1
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/bundle-worker-image-decoder.js +1 -1
- package/package.json +1 -1
- package/src/core/binary/platform_compute_endianness.d.ts.map +1 -1
- package/src/core/binary/platform_compute_endianness.js +5 -1
- package/src/core/color/hunt/xyz_to_hpe.d.ts +7 -0
- package/src/core/color/hunt/xyz_to_hpe.d.ts.map +1 -0
- package/src/core/color/hunt/xyz_to_hpe.js +15 -0
- package/src/core/color/xyz/rgb_to_xyz.d.ts +2 -0
- package/src/core/color/xyz/rgb_to_xyz.d.ts.map +1 -1
- package/src/core/color/xyz/rgb_to_xyz.js +2 -0
- package/src/core/color/xyz/xyz_to_rgb.d.ts +2 -0
- package/src/core/color/xyz/xyz_to_rgb.d.ts.map +1 -1
- package/src/core/color/xyz/xyz_to_rgb.js +2 -0
- package/src/core/math/idct_1d.d.ts +14 -0
- package/src/core/math/idct_1d.d.ts.map +1 -0
- package/src/core/math/idct_1d.js +69 -0
- package/src/core/math/idct_2d.d.ts +11 -0
- package/src/core/math/idct_2d.d.ts.map +1 -0
- package/src/core/math/idct_2d.js +22 -0
- package/src/core/model/DebouncedObservedBoolean.d.ts +1 -1
- package/src/core/model/DebouncedObservedBoolean.d.ts.map +1 -1
- package/src/core/model/object/objectKeyByValue.d.ts.map +1 -1
- package/src/core/model/object/objectKeyByValue.js +4 -0
- package/src/engine/asset/Asset.d.ts.map +1 -1
- package/src/engine/asset/Asset.js +2 -5
- package/src/engine/asset/AssetTransformer.js +1 -1
- package/src/engine/asset/loaders/image/codec/NativeImageDecoder.d.ts +20 -1
- package/src/engine/asset/loaders/image/codec/NativeImageDecoder.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/codec/NativeImageDecoder.js +56 -13
- package/src/engine/asset/loaders/image/jpeg/JpegFrame.d.ts +42 -0
- package/src/engine/asset/loaders/image/jpeg/JpegFrame.d.ts.map +1 -0
- package/src/engine/asset/loaders/image/jpeg/JpegFrame.js +45 -0
- package/src/engine/asset/loaders/image/jpeg/JpegFrameComponent.d.ts +42 -0
- package/src/engine/asset/loaders/image/jpeg/JpegFrameComponent.d.ts.map +1 -0
- package/src/engine/asset/loaders/image/jpeg/JpegFrameComponent.js +48 -0
- package/src/engine/asset/loaders/image/jpeg/JpegImage.d.ts +60 -0
- package/src/engine/asset/loaders/image/jpeg/JpegImage.d.ts.map +1 -0
- package/src/engine/asset/loaders/image/jpeg/JpegImage.js +624 -0
- package/src/engine/asset/loaders/image/jpeg/NOTES.md +3 -0
- package/src/engine/asset/loaders/image/jpeg/buildComponentData.d.ts +7 -0
- package/src/engine/asset/loaders/image/jpeg/buildComponentData.d.ts.map +1 -0
- package/src/engine/asset/loaders/image/jpeg/buildComponentData.js +59 -0
- package/src/engine/asset/loaders/image/jpeg/buildHuffmanTable.d.ts +8 -0
- package/src/engine/asset/loaders/image/jpeg/buildHuffmanTable.d.ts.map +1 -0
- package/src/engine/asset/loaders/image/jpeg/buildHuffmanTable.js +46 -0
- package/src/engine/asset/loaders/image/jpeg/decodeScan.d.ts +17 -0
- package/src/engine/asset/loaders/image/jpeg/decodeScan.d.ts.map +1 -0
- package/src/engine/asset/loaders/image/jpeg/decodeScan.js +351 -0
- package/src/engine/asset/loaders/image/jpeg/idct8x8_fixed.d.ts +23 -0
- package/src/engine/asset/loaders/image/jpeg/idct8x8_fixed.d.ts.map +1 -0
- package/src/engine/asset/loaders/image/jpeg/idct8x8_fixed.js +214 -0
- package/src/engine/asset/loaders/image/jpeg/idct8x8_float.d.ts +9 -0
- package/src/engine/asset/loaders/image/jpeg/idct8x8_float.d.ts.map +1 -0
- package/src/engine/asset/loaders/image/jpeg/idct8x8_float.js +32 -0
- package/src/engine/asset/loaders/image/jpeg/jpeg_decode.d.ts +13 -0
- package/src/engine/asset/loaders/image/jpeg/jpeg_decode.d.ts.map +1 -0
- package/src/engine/asset/loaders/image/jpeg/jpeg_decode.js +41 -0
- package/src/engine/asset/loaders/image/png/PNG.d.ts +18 -11
- package/src/engine/asset/loaders/image/png/PNG.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/png/PNG.js +17 -22
- package/src/engine/asset/loaders/image/png/PNGReader.d.ts +71 -10
- package/src/engine/asset/loaders/image/png/PNGReader.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/png/PNGReader.js +422 -101
- package/src/engine/ecs/EntityComponentDataset.d.ts.map +1 -1
- package/src/engine/ecs/EntityComponentDataset.js +2 -1
- package/src/engine/graphics/geometry/AttributeSpec.d.ts.map +1 -1
- package/src/engine/graphics/geometry/AttributeSpec.js +2 -1
- package/src/engine/graphics/render/frame_graph/RenderGraph.d.ts +50 -7
- package/src/engine/graphics/render/frame_graph/RenderGraph.d.ts.map +1 -1
- package/src/engine/graphics/render/frame_graph/RenderGraph.js +108 -8
- package/src/engine/graphics/render/frame_graph/RenderPassBuilder.d.ts +44 -0
- package/src/engine/graphics/render/frame_graph/RenderPassBuilder.d.ts.map +1 -0
- package/src/engine/graphics/render/frame_graph/{RenderGraphBuilder.js → RenderPassBuilder.js} +25 -6
- package/src/engine/graphics/render/frame_graph/RenderPassNode.d.ts +1 -0
- package/src/engine/graphics/render/frame_graph/RenderPassNode.d.ts.map +1 -1
- package/src/engine/graphics/render/frame_graph/RenderPassNode.js +1 -0
- package/src/engine/graphics/render/frame_graph/ResourceEntry.d.ts +8 -0
- package/src/engine/graphics/render/frame_graph/ResourceEntry.d.ts.map +1 -1
- package/src/engine/graphics/render/frame_graph/ResourceEntry.js +8 -0
- package/src/engine/graphics/texture/sampler/downloadSamplerAsPNG.d.ts.map +1 -1
- package/src/engine/graphics/texture/sampler/downloadSamplerAsPNG.js +6 -1
- package/src/engine/graphics/texture/sampler/sampler2d_compute_texel_value_conversion_scale_to_uint8.d.ts.map +1 -1
- package/src/engine/graphics/texture/sampler/sampler2d_compute_texel_value_conversion_scale_to_uint8.js +7 -2
- package/src/engine/graphics/texture/sampler/sampler2d_to_html_canvas.d.ts.map +1 -1
- package/src/engine/graphics/texture/sampler/sampler2d_to_html_canvas.js +12 -1
- package/src/engine/logging/elastic/ElasticSearchLogger.d.ts +1 -1
- package/src/engine/logging/elastic/ElasticSearchLogger.d.ts.map +1 -1
- package/src/engine/graphics/render/frame_graph/RenderGraphBuilder.d.ts +0 -33
- package/src/engine/graphics/render/frame_graph/RenderGraphBuilder.d.ts.map +0 -1
- package/src/engine/graphics/render/frame_graph/RenderPass.d.ts +0 -50
- package/src/engine/graphics/render/frame_graph/RenderPass.d.ts.map +0 -1
- package/src/engine/graphics/render/frame_graph/RenderPass.js +0 -74
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityComponentDataset.d.ts","sourceRoot":"","sources":["../../../../src/engine/ecs/EntityComponentDataset.js"],"names":[],"mappings":"AAyHA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wDAfyB,MAAM;IAiB3B;;;;OAIG;IACH,wBAA+B;IAE/B;;;;;OAKG;IACH,yBAAsC;IAEtC;;;;;;;;;OASG;IACH,2BAAkC;IAElC;;;;;OAKG;IACH,yBAAsB;IAEtB;;;;OAIG;IACH,4BAAgC;IAEhC;;;;OAIG;IACH,2BAAuB;IAEvB;;;;OAIG;IACH,mBAAgB;IAEhB;;;;OAIG;IACH,oBAAgB;IAEhB;;;;;;;OAOG;IACH,mBAAe;IAEf;;;OAGG;IACH,0BAFU,OAAO,MAAM,CAAC,CAEO;IAE/B;;;OAGG;IACH,0BAFU,OAAO,MAAM,CAAC,CAEO;IAG/B;;;;OAIG;IACH,+BAA4B;IAE5B;;;;OAIG;IACH,kCAA+B;IAE/B;;;OAGG;IACH,kBAAe;IAGf;;;;;;OAMG;IACH,mEAkCC;IAED;;;;;OAKG;IACH,kDAHW,OAAO,GACL,OAAO,CAqDnB;IAED;;;;;OAKG;IACH,qDAHW,OAAO,GACL,OAAO,CA6DnB;IAED;;;OAGG;IACH,kBAFa,MAAM,CAIlB;IAED;;;OAGG;IACH,yBAFa,MAAM,CAIlB;IAED;;;;;OAKG;IACH,sBAJW,MAAM,qBACN,EAAE,SAmCZ;IAED
|
|
1
|
+
{"version":3,"file":"EntityComponentDataset.d.ts","sourceRoot":"","sources":["../../../../src/engine/ecs/EntityComponentDataset.js"],"names":[],"mappings":"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"}
|
|
@@ -477,7 +477,8 @@ export class EntityComponentDataset {
|
|
|
477
477
|
}
|
|
478
478
|
|
|
479
479
|
/**
|
|
480
|
-
* Get all components associated with a given entity
|
|
480
|
+
* Get all components associated with a given entity.
|
|
481
|
+
* Note that this method allocates. If performance is important - prefer alternatives.
|
|
481
482
|
* @param {number} entity_id
|
|
482
483
|
* @returns {[]} all components attached to the entity, array is not compacted
|
|
483
484
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttributeSpec.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/geometry/AttributeSpec.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AttributeSpec.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/geometry/AttributeSpec.js"],"names":[],"mappings":"AAMA;;;GAGG;AACH;IA8BI;;;;;;;OAOG;IACH,kBANW,cAAc,YACd,MAAM,eACN,OAAO,SACP,MAAM,GACJ,aAAa,CAazB;IAED,uCAMC;IA6FD;;;;;OAKG;IACH,iBAJW,aAAa,KACb,aAAa,GACZ,MAAM,CAIjB;IA5JD;;;OAGG;IACH,MAFU,MAAM,CAEN;IAEV;;;OAGG;IACH,MAFU,cAAc,CAEM;IAE9B;;;;;OAKG;IACH,UAFU,MAAM,CAEH;IAEb;;;;;OAKG;IACH,YAFU,OAAO,CAEE;IA+BnB;;;;;aAoBC;IAED;;;;;MAOC;IAED,mBAcC;IAED,eAEC;IAED;;;;OAIG;IACH,cAHW,aAAa,GACX,OAAO,CAQnB;IAED;;;OAGG;IACH,YAFW,aAAa,QAOvB;IAED,uBAMC;IAED;;;OAGG;IACH,eAFa,MAAM,CAIlB;IAaL;;;OAGG;IACH,0BAFU,OAAO,CAEsB;CANtC;+BAxK8B,6CAA6C"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { assert } from "../../../core/assert.js";
|
|
2
2
|
import { BinaryDataType } from "../../../core/binary/type/BinaryDataType.js";
|
|
3
3
|
import { DataTypeByteSizes } from "../../../core/binary/type/DataTypeByteSizes.js";
|
|
4
|
+
import { objectKeyByValue } from "../../../core/model/object/objectKeyByValue.js";
|
|
4
5
|
import { computeStringHash } from "../../../core/primitives/strings/computeStringHash.js";
|
|
5
6
|
|
|
6
7
|
/**
|
|
@@ -104,7 +105,7 @@ export class AttributeSpec {
|
|
|
104
105
|
r += `${this.name}:`
|
|
105
106
|
}
|
|
106
107
|
|
|
107
|
-
r += `${this.itemSize}x${this.type}`;
|
|
108
|
+
r += `${this.itemSize}x${( objectKeyByValue(BinaryDataType, this.type) ?? this.type)}`;
|
|
108
109
|
|
|
109
110
|
if (this.normalized) {
|
|
110
111
|
r += '-norm';
|
|
@@ -1,6 +1,35 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Based on the Frostbite's GDC paper "FrameGraph: Extensible Rendering Architecture in Frostbite" by Yuriy O'Donnell
|
|
3
|
-
* @
|
|
3
|
+
* @example
|
|
4
|
+
* const graph = new RenderGraph("My Graph");
|
|
5
|
+
*
|
|
6
|
+
* const pass_data = {};
|
|
7
|
+
* const pass = graph.add("GBuffer Pass", pass_data, (data, resources, context) => {
|
|
8
|
+
*
|
|
9
|
+
* context.beginRenderPass({
|
|
10
|
+
* depth_attachment: resources.get(data.depth),
|
|
11
|
+
* color_attachments:[
|
|
12
|
+
* resources.get(data.normal),
|
|
13
|
+
* resources.get(data.albedo),
|
|
14
|
+
* ]
|
|
15
|
+
* });
|
|
16
|
+
*
|
|
17
|
+
* for (const renderable in renderables){
|
|
18
|
+
* drawMesh(context, renderable.mesh, renderable.material);
|
|
19
|
+
* }
|
|
20
|
+
*
|
|
21
|
+
* context.endRenderPass();
|
|
22
|
+
*
|
|
23
|
+
* });
|
|
24
|
+
*
|
|
25
|
+
* pass_data.depth = pass.create("depth", {...});
|
|
26
|
+
* pass_data.albedo = pass.create("albedo", {...});
|
|
27
|
+
* pass_data.normal = pass.create("normal", {...});
|
|
28
|
+
*
|
|
29
|
+
*
|
|
30
|
+
* graph.compile();
|
|
31
|
+
* graph.execute(context);
|
|
32
|
+
*
|
|
4
33
|
*/
|
|
5
34
|
export class RenderGraph {
|
|
6
35
|
/**
|
|
@@ -54,6 +83,7 @@ export class RenderGraph {
|
|
|
54
83
|
* @template T
|
|
55
84
|
* @param {string} name
|
|
56
85
|
* @param {T} descriptor
|
|
86
|
+
* @returns {number}
|
|
57
87
|
*/
|
|
58
88
|
create_resource<T_1>(name: string, descriptor: T_1): number;
|
|
59
89
|
/**
|
|
@@ -73,10 +103,10 @@ export class RenderGraph {
|
|
|
73
103
|
private _createResourceNode;
|
|
74
104
|
/**
|
|
75
105
|
*
|
|
76
|
-
* @param {number}
|
|
77
|
-
* @returns {number}
|
|
106
|
+
* @param {number} node_id
|
|
107
|
+
* @returns {number} ID of the cloned resource node
|
|
78
108
|
*/
|
|
79
|
-
clone_resource(
|
|
109
|
+
clone_resource(node_id: number): number;
|
|
80
110
|
/**
|
|
81
111
|
* @template T
|
|
82
112
|
* @param {string} name
|
|
@@ -91,13 +121,14 @@ export class RenderGraph {
|
|
|
91
121
|
*/
|
|
92
122
|
is_valid_resource(id: any): boolean;
|
|
93
123
|
/**
|
|
124
|
+
* Add a new pass to the graph.
|
|
94
125
|
* @template T
|
|
95
126
|
* @param {string} name
|
|
96
127
|
* @param {T} data
|
|
97
128
|
* @param {function(data:T, resources: RenderPassResources, context:IRenderContext):void} execute
|
|
98
|
-
* @returns {
|
|
129
|
+
* @returns {RenderPassBuilder}
|
|
99
130
|
*/
|
|
100
|
-
add<T_3>(name: string, data: T_3, execute: any):
|
|
131
|
+
add<T_3>(name: string, data: T_3, execute: any): RenderPassBuilder;
|
|
101
132
|
/**
|
|
102
133
|
* Perform validation, useful for debugging
|
|
103
134
|
* Typically done before compilation
|
|
@@ -113,6 +144,18 @@ export class RenderGraph {
|
|
|
113
144
|
*/
|
|
114
145
|
execute(context: IRenderContext): void;
|
|
115
146
|
/**
|
|
147
|
+
* Should only call after {@link compile}
|
|
148
|
+
*
|
|
149
|
+
* @see https://github.com/skaarj1989/FrameGraph/blob/viewer/JsonWriter.hpp
|
|
150
|
+
* @return {{passes: [], resources: []}}
|
|
151
|
+
*/
|
|
152
|
+
exportToJson(): {
|
|
153
|
+
passes: [];
|
|
154
|
+
resources: [];
|
|
155
|
+
};
|
|
156
|
+
/**
|
|
157
|
+
* Export the graph diagram in GraphViz DOT format.
|
|
158
|
+
* Useful for debugging.
|
|
116
159
|
* @see https://en.wikipedia.org/wiki/DOT_(graph_description_language)
|
|
117
160
|
* @return {string}
|
|
118
161
|
*/
|
|
@@ -125,5 +168,5 @@ export class RenderGraph {
|
|
|
125
168
|
}
|
|
126
169
|
import { ResourceEntry } from "./ResourceEntry.js";
|
|
127
170
|
import { ResourceNode } from "./ResourceNode.js";
|
|
128
|
-
import {
|
|
171
|
+
import { RenderPassBuilder } from "./RenderPassBuilder.js";
|
|
129
172
|
//# sourceMappingURL=RenderGraph.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderGraph.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/RenderGraph.js"],"names":[],"mappings":"AAQA
|
|
1
|
+
{"version":3,"file":"RenderGraph.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/RenderGraph.js"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH;IA6BI;;;OAGG;IACH,mBAFW,MAAM,EAOhB;IArCD;;;;OAIG;IACH,MAFU,MAAM,CAEN;IAEV;;;;OAIG;IACH,qBAAkB;IAElB;;;;OAIG;IACH,yBAAsB;IAEtB;;;;OAIG;IACH,4BAAyB;IAazB;;;;OAIG;IACH,qBAHW,MAAM,sBAahB;IAED;;;;OAIG;IACH,oBAHW,MAAM,qBAmBhB;IAED;;;;OAIG;IACH,qBAHW,MAAM,KAKhB;IAED;;;;;OAKG;IACH,2BAJW,MAAM,oBAEJ,MAAM,CAWlB;IAED;;;;;OAKG;IACH,6BAYC;IAED;;;;;;OAMG;IACH,4BAeC;IAED;;;;OAIG;IACH,wBAHW,MAAM,GACJ,MAAM,CAkBlB;IAED;;;;;;OAMG;IACH,2BALW,MAAM,wDAGJ,MAAM,CAUlB;IAED;;;OAGG;IACH,4BAHa,OAAO,CAQnB;IAED;;;;;;;OAOG;IACH,eALW,MAAM,4BAGJ,iBAAiB,CA2B7B;IAED;;;;;;OAMG;IACH,iEAFa,OAAO,CAQnB;IAED,gBA6FC;IAED;;;OAGG;IACH,uCA2CC;IAED;;;;;OAKG;IACH;gBAFqB,EAAE;mBAAa,EAAE;MA2DrC;IAED;;;;;OAKG;IACH,eAFY,MAAM,CAiEjB;IAGL;;;OAGG;IACH,wBAFU,OAAO,CAEkB;CANlC;8BAtjB6B,oBAAoB;6BACrB,mBAAmB;kCAJd,wBAAwB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { assert } from "../../../../core/assert.js";
|
|
2
2
|
import LineBuilder from "../../../../core/codegen/LineBuilder.js";
|
|
3
|
-
import {
|
|
3
|
+
import { RenderPassBuilder } from "./RenderPassBuilder.js";
|
|
4
4
|
import { RenderPassNode } from "./RenderPassNode.js";
|
|
5
5
|
import { RenderPassResources } from "./RenderPassResources.js";
|
|
6
6
|
import { ResourceEntry } from "./ResourceEntry.js";
|
|
@@ -8,7 +8,36 @@ import { ResourceNode } from "./ResourceNode.js";
|
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Based on the Frostbite's GDC paper "FrameGraph: Extensible Rendering Architecture in Frostbite" by Yuriy O'Donnell
|
|
11
|
-
* @
|
|
11
|
+
* @example
|
|
12
|
+
* const graph = new RenderGraph("My Graph");
|
|
13
|
+
*
|
|
14
|
+
* const pass_data = {};
|
|
15
|
+
* const pass = graph.add("GBuffer Pass", pass_data, (data, resources, context) => {
|
|
16
|
+
*
|
|
17
|
+
* context.beginRenderPass({
|
|
18
|
+
* depth_attachment: resources.get(data.depth),
|
|
19
|
+
* color_attachments:[
|
|
20
|
+
* resources.get(data.normal),
|
|
21
|
+
* resources.get(data.albedo),
|
|
22
|
+
* ]
|
|
23
|
+
* });
|
|
24
|
+
*
|
|
25
|
+
* for (const renderable in renderables){
|
|
26
|
+
* drawMesh(context, renderable.mesh, renderable.material);
|
|
27
|
+
* }
|
|
28
|
+
*
|
|
29
|
+
* context.endRenderPass();
|
|
30
|
+
*
|
|
31
|
+
* });
|
|
32
|
+
*
|
|
33
|
+
* pass_data.depth = pass.create("depth", {...});
|
|
34
|
+
* pass_data.albedo = pass.create("albedo", {...});
|
|
35
|
+
* pass_data.normal = pass.create("normal", {...});
|
|
36
|
+
*
|
|
37
|
+
*
|
|
38
|
+
* graph.compile();
|
|
39
|
+
* graph.execute(context);
|
|
40
|
+
*
|
|
12
41
|
*/
|
|
13
42
|
export class RenderGraph {
|
|
14
43
|
/**
|
|
@@ -103,11 +132,13 @@ export class RenderGraph {
|
|
|
103
132
|
* @template T
|
|
104
133
|
* @param {string} name
|
|
105
134
|
* @param {T} descriptor
|
|
135
|
+
* @returns {number}
|
|
106
136
|
*/
|
|
107
137
|
create_resource(name, descriptor) {
|
|
108
138
|
assert.isString(name, 'name');
|
|
109
139
|
assert.defined(descriptor, 'descriptor');
|
|
110
140
|
assert.notNull(descriptor, 'descriptor');
|
|
141
|
+
assert.isObject(descriptor, 'descriptor');
|
|
111
142
|
|
|
112
143
|
const resource = this._createResourceEntry(descriptor);
|
|
113
144
|
|
|
@@ -160,11 +191,11 @@ export class RenderGraph {
|
|
|
160
191
|
|
|
161
192
|
/**
|
|
162
193
|
*
|
|
163
|
-
* @param {number}
|
|
164
|
-
* @returns {number}
|
|
194
|
+
* @param {number} node_id
|
|
195
|
+
* @returns {number} ID of the cloned resource node
|
|
165
196
|
*/
|
|
166
|
-
clone_resource(
|
|
167
|
-
const node = this.getResourceNode(
|
|
197
|
+
clone_resource(node_id) {
|
|
198
|
+
const node = this.getResourceNode(node_id);
|
|
168
199
|
|
|
169
200
|
const entry = this.__resource_registry[node.resource_id];
|
|
170
201
|
|
|
@@ -210,11 +241,12 @@ export class RenderGraph {
|
|
|
210
241
|
}
|
|
211
242
|
|
|
212
243
|
/**
|
|
244
|
+
* Add a new pass to the graph.
|
|
213
245
|
* @template T
|
|
214
246
|
* @param {string} name
|
|
215
247
|
* @param {T} data
|
|
216
248
|
* @param {function(data:T, resources: RenderPassResources, context:IRenderContext):void} execute
|
|
217
|
-
* @returns {
|
|
249
|
+
* @returns {RenderPassBuilder}
|
|
218
250
|
*/
|
|
219
251
|
add(name, data, execute) {
|
|
220
252
|
assert.isString(name, 'name');
|
|
@@ -227,7 +259,7 @@ export class RenderGraph {
|
|
|
227
259
|
|
|
228
260
|
const pass_nodes = this.__pass_nodes;
|
|
229
261
|
|
|
230
|
-
const builder = new
|
|
262
|
+
const builder = new RenderPassBuilder();
|
|
231
263
|
const node = new RenderPassNode();
|
|
232
264
|
|
|
233
265
|
node.id = pass_nodes.length;
|
|
@@ -253,6 +285,7 @@ export class RenderGraph {
|
|
|
253
285
|
validate(problem_consumer, problem_consumer_context) {
|
|
254
286
|
|
|
255
287
|
// TODO implement
|
|
288
|
+
// TODO check for "read before write"
|
|
256
289
|
|
|
257
290
|
return true;
|
|
258
291
|
}
|
|
@@ -402,6 +435,73 @@ export class RenderGraph {
|
|
|
402
435
|
}
|
|
403
436
|
|
|
404
437
|
/**
|
|
438
|
+
* Should only call after {@link compile}
|
|
439
|
+
*
|
|
440
|
+
* @see https://github.com/skaarj1989/FrameGraph/blob/viewer/JsonWriter.hpp
|
|
441
|
+
* @return {{passes: [], resources: []}}
|
|
442
|
+
*/
|
|
443
|
+
exportToJson() {
|
|
444
|
+
|
|
445
|
+
const resources = [];
|
|
446
|
+
|
|
447
|
+
this.__resource_registry.forEach((entry, entry_id) => {
|
|
448
|
+
const node = this.getResourceNode(entry.resource_id);
|
|
449
|
+
|
|
450
|
+
const j = {
|
|
451
|
+
id: entry_id,
|
|
452
|
+
name: node.name,
|
|
453
|
+
transient: entry.isTransient(),
|
|
454
|
+
};
|
|
455
|
+
|
|
456
|
+
const description = entry.resource_descriptor?.toString();
|
|
457
|
+
|
|
458
|
+
if (description) {
|
|
459
|
+
j.description = description;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
if (entry.producer !== null) {
|
|
463
|
+
j.createdBy = entry.producer.id;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
const readers = [];
|
|
467
|
+
const writers = [];
|
|
468
|
+
|
|
469
|
+
this.__pass_nodes.forEach(pass => {
|
|
470
|
+
if (pass.reads(entry.resource_id)) {
|
|
471
|
+
readers.push(pass.id);
|
|
472
|
+
}
|
|
473
|
+
if (pass.writes(entry.resource_id)) {
|
|
474
|
+
writers.push(pass.id);
|
|
475
|
+
}
|
|
476
|
+
})
|
|
477
|
+
|
|
478
|
+
if (readers.length > 0) {
|
|
479
|
+
j.readers = readers;
|
|
480
|
+
}
|
|
481
|
+
if (writers.length > 0) {
|
|
482
|
+
j.writers = writers;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
resources[entry_id] = j;
|
|
486
|
+
})
|
|
487
|
+
|
|
488
|
+
return {
|
|
489
|
+
passes: this.__pass_nodes.map(node => {
|
|
490
|
+
return {
|
|
491
|
+
id: node.id,
|
|
492
|
+
name: node.name,
|
|
493
|
+
culled: !node.can_execute(),
|
|
494
|
+
reads: node.resource_reads,
|
|
495
|
+
writes: node.resource_writes,
|
|
496
|
+
}
|
|
497
|
+
}),
|
|
498
|
+
resources
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
/**
|
|
503
|
+
* Export the graph diagram in GraphViz DOT format.
|
|
504
|
+
* Useful for debugging.
|
|
405
505
|
* @see https://en.wikipedia.org/wiki/DOT_(graph_description_language)
|
|
406
506
|
* @return {string}
|
|
407
507
|
*/
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Allows you to declare resources for the pass, reading/writing/creating resources that will be used by the pass.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* const pass_data = {};
|
|
6
|
+
* const pass_builder = graph.add("pass", pass_data, (data, resources, context) => { ... });
|
|
7
|
+
* pass_data.resource_a = pass_builder.create("A", {});
|
|
8
|
+
*/
|
|
9
|
+
export class RenderPassBuilder {
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
* @param {RenderGraph} graph
|
|
13
|
+
* @param {RenderPassNode} node
|
|
14
|
+
*/
|
|
15
|
+
init(graph: RenderGraph, node: RenderPassNode): void;
|
|
16
|
+
/**
|
|
17
|
+
* Create a new resource.
|
|
18
|
+
* Creation implies writing as well.
|
|
19
|
+
* @param {string} name
|
|
20
|
+
* @param {ResourceDescriptor} descriptor
|
|
21
|
+
* @returns {number} resource ID
|
|
22
|
+
*/
|
|
23
|
+
create(name: string, descriptor: ResourceDescriptor): number;
|
|
24
|
+
/**
|
|
25
|
+
* Read an existing resource
|
|
26
|
+
* @param {number} resource
|
|
27
|
+
* @returns {number} resource ID same as the input
|
|
28
|
+
*/
|
|
29
|
+
read(resource: number): number;
|
|
30
|
+
/**
|
|
31
|
+
* Write a resource
|
|
32
|
+
* @param {number} resource
|
|
33
|
+
* @returns {number} resource ID
|
|
34
|
+
*/
|
|
35
|
+
write(resource: number): number;
|
|
36
|
+
/**
|
|
37
|
+
* Indicate that this pass has side effects.
|
|
38
|
+
* Will force the node to always be executed, regardless if it contributes to the final outputs of the graph or not.
|
|
39
|
+
* Useful for debug purposes or cases where some of the resources written are not part of the graph.
|
|
40
|
+
*/
|
|
41
|
+
make_side_effect(): void;
|
|
42
|
+
#private;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=RenderPassBuilder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RenderPassBuilder.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/RenderPassBuilder.js"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH;IAgBI;;;;OAIG;IACH,qDAMC;IAED;;;;;;OAMG;IACH,aAJW,MAAM,mCAEJ,MAAM,CAYlB;IAED;;;;OAIG;IACH,eAHW,MAAM,GACJ,MAAM,CASlB;IAED;;;;OAIG;IACH,gBAHW,MAAM,GACJ,MAAM,CAsBlB;IAED;;;;OAIG;IACH,yBAEC;;CACJ"}
|
package/src/engine/graphics/render/frame_graph/{RenderGraphBuilder.js → RenderPassBuilder.js}
RENAMED
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
import { assert } from "../../../../core/assert.js";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Allows you to declare resources for the pass, reading/writing/creating resources that will be used by the pass.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* const pass_data = {};
|
|
8
|
+
* const pass_builder = graph.add("pass", pass_data, (data, resources, context) => { ... });
|
|
9
|
+
* pass_data.resource_a = pass_builder.create("A", {});
|
|
10
|
+
*/
|
|
11
|
+
export class RenderPassBuilder {
|
|
12
|
+
|
|
4
13
|
/**
|
|
5
14
|
*
|
|
6
15
|
* @type {RenderGraph}
|
|
7
16
|
* @private
|
|
8
17
|
*/
|
|
9
18
|
#graph = null;
|
|
19
|
+
|
|
10
20
|
/**
|
|
11
21
|
*
|
|
12
22
|
* @type {RenderPassNode}
|
|
@@ -20,12 +30,16 @@ export class RenderGraphBuilder {
|
|
|
20
30
|
* @param {RenderPassNode} node
|
|
21
31
|
*/
|
|
22
32
|
init(graph, node) {
|
|
33
|
+
assert.defined(graph, 'graph');
|
|
34
|
+
assert.defined(node, 'node');
|
|
35
|
+
|
|
23
36
|
this.#graph = graph;
|
|
24
37
|
this.#node = node;
|
|
25
38
|
}
|
|
26
39
|
|
|
27
40
|
/**
|
|
28
|
-
* Create a new resource
|
|
41
|
+
* Create a new resource.
|
|
42
|
+
* Creation implies writing as well.
|
|
29
43
|
* @param {string} name
|
|
30
44
|
* @param {ResourceDescriptor} descriptor
|
|
31
45
|
* @returns {number} resource ID
|
|
@@ -45,18 +59,21 @@ export class RenderGraphBuilder {
|
|
|
45
59
|
/**
|
|
46
60
|
* Read an existing resource
|
|
47
61
|
* @param {number} resource
|
|
48
|
-
* @returns {number}
|
|
62
|
+
* @returns {number} resource ID same as the input
|
|
49
63
|
*/
|
|
50
64
|
read(resource) {
|
|
51
65
|
assert.isNonNegativeInteger(resource, 'resource');
|
|
66
|
+
assert.defined(this.#graph.getResourceEntry(resource), 'resource node');
|
|
52
67
|
|
|
53
|
-
|
|
68
|
+
const node = this.#node;
|
|
69
|
+
|
|
70
|
+
return node.read(resource);
|
|
54
71
|
}
|
|
55
72
|
|
|
56
73
|
/**
|
|
57
74
|
* Write a resource
|
|
58
75
|
* @param {number} resource
|
|
59
|
-
* @returns {number}
|
|
76
|
+
* @returns {number} resource ID
|
|
60
77
|
*/
|
|
61
78
|
write(resource) {
|
|
62
79
|
assert.isNonNegativeInteger(resource, 'resource');
|
|
@@ -81,7 +98,9 @@ export class RenderGraphBuilder {
|
|
|
81
98
|
}
|
|
82
99
|
|
|
83
100
|
/**
|
|
84
|
-
*
|
|
101
|
+
* Indicate that this pass has side effects.
|
|
102
|
+
* Will force the node to always be executed, regardless if it contributes to the final outputs of the graph or not.
|
|
103
|
+
* Useful for debug purposes or cases where some of the resources written are not part of the graph.
|
|
85
104
|
*/
|
|
86
105
|
make_side_effect() {
|
|
87
106
|
this.#node.has_side_effects = true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderPassNode.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/RenderPassNode.js"],"names":[],"mappings":"AAIA;IAEI;;;OAGG;IACH,kBAAc;IAEd;;;OAGG;IACH,kBAFU,OAAO,CAEQ;IAEzB;;;OAGG;IACH,UAAU;IAEV;;;OAGG;IACH,kBAFU,MAAM,EAAE,CAEI;IAEtB;;;OAGG;IACH,gBAFU,MAAM,EAAE,CAEE;IAEpB;;;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
|
|
1
|
+
{"version":3,"file":"RenderPassNode.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/RenderPassNode.js"],"names":[],"mappings":"AAIA;IAEI;;;OAGG;IACH,kBAAc;IAEd;;;OAGG;IACH,kBAFU,OAAO,CAEQ;IAEzB;;;OAGG;IACH,UAAU;IAEV;;;OAGG;IACH,kBAFU,MAAM,EAAE,CAEI;IAEtB;;;OAGG;IACH,gBAFU,MAAM,EAAE,CAEE;IAEpB;;;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;;;;OAIG;IACH,eAHW,MAAM,GACJ,MAAM,CAUlB;IAED;;;OAGG;IACH,eAFY,OAAO,CAIlB;CACJ;0BAxGyB,gBAAgB"}
|
|
@@ -48,7 +48,15 @@ export class ResourceEntry<T> {
|
|
|
48
48
|
* @param {RenderResourceManager} resources
|
|
49
49
|
*/
|
|
50
50
|
destroy(resources: RenderResourceManager): void;
|
|
51
|
+
/**
|
|
52
|
+
*
|
|
53
|
+
* @return {boolean}
|
|
54
|
+
*/
|
|
51
55
|
isImported(): boolean;
|
|
56
|
+
/**
|
|
57
|
+
*
|
|
58
|
+
* @return {boolean}
|
|
59
|
+
*/
|
|
52
60
|
isTransient(): boolean;
|
|
53
61
|
toString(): any;
|
|
54
62
|
}
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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;;;OAGG;IACH,cAFY,OAAO,CAIlB;IAED;;;OAGG;IACH,eAFY,OAAO,CAIlB;IAED,gBAQC;CACJ"}
|
|
@@ -69,10 +69,18 @@ export class ResourceEntry {
|
|
|
69
69
|
resources.release(this.resource);
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
+
/**
|
|
73
|
+
*
|
|
74
|
+
* @return {boolean}
|
|
75
|
+
*/
|
|
72
76
|
isImported() {
|
|
73
77
|
return this.imported;
|
|
74
78
|
}
|
|
75
79
|
|
|
80
|
+
/**
|
|
81
|
+
*
|
|
82
|
+
* @return {boolean}
|
|
83
|
+
*/
|
|
76
84
|
isTransient() {
|
|
77
85
|
return !this.imported;
|
|
78
86
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"downloadSamplerAsPNG.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/sampler/downloadSamplerAsPNG.js"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,uEAFW,MAAM,
|
|
1
|
+
{"version":3,"file":"downloadSamplerAsPNG.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/sampler/downloadSamplerAsPNG.js"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,uEAFW,MAAM,QAahB"}
|
|
@@ -6,10 +6,15 @@ import { sampler2d_to_data_url } from "./sampler2d_to_data_url.js";
|
|
|
6
6
|
* @param {Sampler2D} sampler
|
|
7
7
|
* @param {string} [file_name] what should the file be named?
|
|
8
8
|
*/
|
|
9
|
-
export function downloadSampler2DAsPNG(
|
|
9
|
+
export function downloadSampler2DAsPNG(
|
|
10
|
+
sampler,
|
|
11
|
+
file_name = 'image'
|
|
12
|
+
) {
|
|
10
13
|
|
|
11
14
|
const dataURL = sampler2d_to_data_url(sampler);
|
|
12
15
|
|
|
13
16
|
downloadUrlAsFile(dataURL, `${file_name}.png`);
|
|
14
17
|
|
|
18
|
+
URL.revokeObjectURL(dataURL);
|
|
19
|
+
|
|
15
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sampler2d_compute_texel_value_conversion_scale_to_uint8.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/sampler/sampler2d_compute_texel_value_conversion_scale_to_uint8.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sampler2d_compute_texel_value_conversion_scale_to_uint8.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/sampler/sampler2d_compute_texel_value_conversion_scale_to_uint8.js"],"names":[],"mappings":"AAWA;;;;GAIG;AACH;YAFsB,MAAM;WAAS,MAAM;EAyC1C"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { assert } from "../../../../core/assert.js";
|
|
1
2
|
import { BinaryDataType } from "../../../../core/binary/type/BinaryDataType.js";
|
|
2
3
|
import {
|
|
3
4
|
compute_binary_data_type_from_typed_array
|
|
@@ -14,6 +15,10 @@ import { sampler2d_channel_compute_min } from "./sampler2d_channel_compute_min.j
|
|
|
14
15
|
* @returns {{offset: number, scale: number}}
|
|
15
16
|
*/
|
|
16
17
|
export function sampler2d_compute_texel_value_conversion_scale_to_uint8(sampler) {
|
|
18
|
+
assert.defined(sampler, 'sampler');
|
|
19
|
+
assert.notNull(sampler, 'sampler');
|
|
20
|
+
assert.isObject(sampler, 'sampler');
|
|
21
|
+
assert.equal(sampler.isSampler2D, true, 'sampler.isSampler2D !== true');
|
|
17
22
|
|
|
18
23
|
let dataType;
|
|
19
24
|
|
|
@@ -35,8 +40,8 @@ export function sampler2d_compute_texel_value_conversion_scale_to_uint8(sampler)
|
|
|
35
40
|
max = -Infinity;
|
|
36
41
|
for (let i = 0; i < sampler.itemSize; i++) {
|
|
37
42
|
|
|
38
|
-
min = min2(min,sampler2d_channel_compute_min(sampler,i).value)
|
|
39
|
-
max = max2(min, sampler2d_channel_compute_max(sampler,i).value)
|
|
43
|
+
min = min2(min, sampler2d_channel_compute_min(sampler, i).value)
|
|
44
|
+
max = max2(min, sampler2d_channel_compute_max(sampler, i).value)
|
|
40
45
|
}
|
|
41
46
|
}
|
|
42
47
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sampler2d_to_html_canvas.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/sampler/sampler2d_to_html_canvas.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sampler2d_to_html_canvas.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/sampler/sampler2d_to_html_canvas.js"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,kDANW,SAAS,4CAGT,iBAAiB,GACf,iBAAiB,CAqF7B;;0BA9FyB,gBAAgB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { assert } from "../../../../core/assert.js";
|
|
1
2
|
import { Sampler2D } from "./Sampler2D.js";
|
|
2
3
|
import { sampler2d_write_to_canvas_raw } from "./sampler2d_write_to_canvas_raw.js";
|
|
3
4
|
|
|
@@ -13,8 +14,18 @@ export function sampler2d_to_html_canvas(
|
|
|
13
14
|
sampler,
|
|
14
15
|
scale = 255,
|
|
15
16
|
offset = 0,
|
|
16
|
-
canvas= document.createElement("canvas")
|
|
17
|
+
canvas = document.createElement("canvas")
|
|
17
18
|
) {
|
|
19
|
+
assert.defined(sampler, 'sampler');
|
|
20
|
+
|
|
21
|
+
assert.isNumber(scale, 'scale');
|
|
22
|
+
assert.notNaN(scale, 'scale');
|
|
23
|
+
|
|
24
|
+
assert.isNumber(offset, 'offset');
|
|
25
|
+
assert.notNaN(offset, 'offset');
|
|
26
|
+
|
|
27
|
+
assert.defined(canvas, 'canvas');
|
|
28
|
+
|
|
18
29
|
const source_data = sampler.data;
|
|
19
30
|
|
|
20
31
|
const converted_sampler = Sampler2D.uint8clamped(4, sampler.width, sampler.height);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElasticSearchLogger.d.ts","sourceRoot":"","sources":["../../../../../src/engine/logging/elastic/ElasticSearchLogger.js"],"names":[],"mappings":"AAmCA;IACI;;;OAqDC;IA/CG;;;;OAIG;IACH,iBAA2B;IAE3B;;;;OAIG;IACH,qBAAuB;IACvB;;;;OAIG;IACH,wBAA2B;IAE3B;;;;OAIG;IACH,cAAgB;IAEhB;;;;OAIG;IACH,iBAAsB;IAEtB;;;;OAIG;IACH,qBAAsB;IAEtB;;;;OAIG;IACH,sBAA0C;IAG9C,cAuCC;IAlCO,
|
|
1
|
+
{"version":3,"file":"ElasticSearchLogger.d.ts","sourceRoot":"","sources":["../../../../../src/engine/logging/elastic/ElasticSearchLogger.js"],"names":[],"mappings":"AAmCA;IACI;;;OAqDC;IA/CG;;;;OAIG;IACH,iBAA2B;IAE3B;;;;OAIG;IACH,qBAAuB;IACvB;;;;OAIG;IACH,wBAA2B;IAE3B;;;;OAIG;IACH,cAAgB;IAEhB;;;;OAIG;IACH,iBAAsB;IAEtB;;;;OAIG;IACH,qBAAsB;IAEtB;;;;OAIG;IACH,sBAA0C;IAG9C,cAuCC;IAlCO,mCAAmB;IAoC3B,eAOC;IAED,oCAUC;CACJ;8BAvJ6B,qBAAqB"}
|