@babylonjs/core 7.46.0 → 7.47.0
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/Cameras/arcRotateCamera.d.ts +13 -0
- package/Cameras/arcRotateCamera.js +28 -12
- package/Cameras/arcRotateCamera.js.map +1 -1
- package/Engines/WebGPU/webgpuSnapshotRendering.d.ts +2 -0
- package/Engines/WebGPU/webgpuSnapshotRendering.js +22 -6
- package/Engines/WebGPU/webgpuSnapshotRendering.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/thinEngine.functions.d.ts +1 -0
- package/Engines/thinEngine.functions.js +1 -1
- package/Engines/thinEngine.functions.js.map +1 -1
- package/Engines/thinEngine.js +2 -1
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.js +2 -1
- package/Engines/webgpuEngine.js.map +1 -1
- package/Loading/loadingScreen.js +2 -2
- package/Loading/loadingScreen.js.map +1 -1
- package/Materials/effect.d.ts +6 -1
- package/Materials/effect.functions.d.ts +5 -0
- package/Materials/effect.functions.js +6 -2
- package/Materials/effect.functions.js.map +1 -1
- package/Materials/effect.js +3 -1
- package/Materials/effect.js.map +1 -1
- package/Materials/effect.webgl.functions.js +1 -0
- package/Materials/effect.webgl.functions.js.map +1 -1
- package/Materials/materialHelper.functions.js +1 -1
- package/Materials/materialHelper.functions.js.map +1 -1
- package/Misc/snapshotRenderingHelper.d.ts +12 -0
- package/Misc/snapshotRenderingHelper.js +74 -20
- package/Misc/snapshotRenderingHelper.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
|
|
2
|
+
import { Logger } from "../../Misc/logger.js";
|
|
2
3
|
/** @internal */
|
|
3
4
|
export class WebGPUSnapshotRendering {
|
|
4
5
|
constructor(engine, renderingMode, bundleList) {
|
|
@@ -7,6 +8,7 @@ export class WebGPUSnapshotRendering {
|
|
|
7
8
|
this._playBundleListIndex = 0;
|
|
8
9
|
this._allBundleLists = [];
|
|
9
10
|
this._enabled = false;
|
|
11
|
+
this.showDebugLogs = false;
|
|
10
12
|
this._engine = engine;
|
|
11
13
|
this._mode = renderingMode;
|
|
12
14
|
this._bundleList = bundleList;
|
|
@@ -21,6 +23,7 @@ export class WebGPUSnapshotRendering {
|
|
|
21
23
|
return this._record;
|
|
22
24
|
}
|
|
23
25
|
set enabled(activate) {
|
|
26
|
+
this._log("enabled", `activate=${activate}, mode=${this._mode}`);
|
|
24
27
|
this._allBundleLists.length = 0;
|
|
25
28
|
this._record = this._enabled = activate;
|
|
26
29
|
this._play = false;
|
|
@@ -45,22 +48,28 @@ export class WebGPUSnapshotRendering {
|
|
|
45
48
|
// Snapshot rendering mode is not enabled
|
|
46
49
|
return false;
|
|
47
50
|
}
|
|
48
|
-
let bundleList;
|
|
51
|
+
let bundleList = null;
|
|
49
52
|
if (this._record) {
|
|
50
53
|
bundleList = this._bundleList.clone();
|
|
51
54
|
this._allBundleLists.push(bundleList);
|
|
52
55
|
this._bundleList.reset();
|
|
56
|
+
this._log("endRenderPass", `bundleList recorded at position #${this._allBundleLists.length - 1}`);
|
|
53
57
|
}
|
|
54
58
|
else {
|
|
55
59
|
// We are playing the snapshot
|
|
56
60
|
if (this._playBundleListIndex >= this._allBundleLists.length) {
|
|
57
|
-
|
|
61
|
+
this._log("endRenderPass", `empty or out-of-sync bundleList (_allBundleLists.length=${this._allBundleLists.length}, playBundleListIndex=${this._playBundleListIndex})`);
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
this._log("endRenderPass", `run bundleList #${this._playBundleListIndex}`);
|
|
65
|
+
bundleList = this._allBundleLists[this._playBundleListIndex++];
|
|
58
66
|
}
|
|
59
|
-
bundleList = this._allBundleLists[this._playBundleListIndex++];
|
|
60
67
|
}
|
|
61
|
-
bundleList
|
|
62
|
-
|
|
63
|
-
this.
|
|
68
|
+
if (bundleList) {
|
|
69
|
+
bundleList.run(currentRenderPass);
|
|
70
|
+
if (this._mode === 1) {
|
|
71
|
+
this._engine._reportDrawCall(bundleList.numDrawCalls);
|
|
72
|
+
}
|
|
64
73
|
}
|
|
65
74
|
return true;
|
|
66
75
|
}
|
|
@@ -70,15 +79,22 @@ export class WebGPUSnapshotRendering {
|
|
|
70
79
|
this._record = false;
|
|
71
80
|
this._play = true;
|
|
72
81
|
this._mode = this._modeSaved;
|
|
82
|
+
this._log("endFrame", "bundles recorded, switching to play mode");
|
|
73
83
|
}
|
|
74
84
|
this._playBundleListIndex = 0;
|
|
75
85
|
}
|
|
76
86
|
reset() {
|
|
87
|
+
this._log("reset", "called");
|
|
77
88
|
if (this._record) {
|
|
78
89
|
this._mode = this._modeSaved;
|
|
79
90
|
}
|
|
80
91
|
this.enabled = false;
|
|
81
92
|
this.enabled = true;
|
|
82
93
|
}
|
|
94
|
+
_log(funcName, message) {
|
|
95
|
+
if (this.showDebugLogs) {
|
|
96
|
+
Logger.Log(`[Frame: ${this._engine.frameId}] WebGPUSnapshotRendering:${funcName} - ${message}`);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
83
99
|
}
|
|
84
100
|
//# sourceMappingURL=webgpuSnapshotRendering.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgpuSnapshotRendering.js","sourceRoot":"","sources":["../../../../../dev/core/src/Engines/WebGPU/webgpuSnapshotRendering.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"webgpuSnapshotRendering.js","sourceRoot":"","sources":["../../../../../dev/core/src/Engines/WebGPU/webgpuSnapshotRendering.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,OAAO,EAAE,MAAM,EAAE,6BAAyB;AAE1C,gBAAgB;AAChB,MAAM,OAAO,uBAAuB;IAahC,YAAY,MAAoB,EAAE,aAAqB,EAAE,UAA4B;QAV7E,YAAO,GAAG,KAAK,CAAC;QAChB,UAAK,GAAG,KAAK,CAAC;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M,QAAQ;QACX,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACf,kEAAkE;YAClE,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;YACrB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;YAClB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC;YAC7B,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,0CAA0C,CAAC,CAAC;QACtE,CAAC;QAED,IAAI,CAAC,oBAAoB,GAAG,CAAC,CAAC;IAClC,CAAC;IAEM,KAAK;QACR,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QAC7B,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACf,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC;QACjC,CAAC;QACD,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACxB,CAAC;IAEO,IAAI,CAAC,QAAgB,EAAE,OAAe;QAC1C,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;YACrB,MAAM,CAAC,GAAG,CAAC,WAAW,IAAI,CAAC,OAAO,CAAC,OAAO,6BAA6B,QAAQ,MAAM,OAAO,EAAE,CAAC,CAAC;QACpG,CAAC;IACL,CAAC;CACJ","sourcesContent":["import type { Nullable } from \"core/types\";\r\nimport { Constants } from \"../constants\";\r\nimport type { WebGPUEngine } from \"../webgpuEngine\";\r\nimport type { WebGPUBundleList } from \"./webgpuBundleList\";\r\nimport { Logger } from \"core/Misc/logger\";\r\n\r\n/** @internal */\r\nexport class WebGPUSnapshotRendering {\r\n private _engine: WebGPUEngine;\r\n\r\n private _record = false;\r\n private _play = false;\r\n private _playBundleListIndex = 0;\r\n private _allBundleLists: WebGPUBundleList[] = [];\r\n private _modeSaved: number;\r\n private _bundleList: WebGPUBundleList;\r\n\r\n private _enabled = false;\r\n private _mode: number;\r\n\r\n constructor(engine: WebGPUEngine, renderingMode: number, bundleList: WebGPUBundleList) {\r\n this._engine = engine;\r\n this._mode = renderingMode;\r\n this._bundleList = bundleList;\r\n }\r\n\r\n public showDebugLogs = false;\r\n\r\n public get enabled(): boolean {\r\n return this._enabled;\r\n }\r\n\r\n public get play() {\r\n return this._play;\r\n }\r\n\r\n public get record() {\r\n return this._record;\r\n }\r\n\r\n public set enabled(activate: boolean) {\r\n this._log(\"enabled\", `activate=${activate}, mode=${this._mode}`);\r\n\r\n this._allBundleLists.length = 0;\r\n this._record = this._enabled = activate;\r\n this._play = false;\r\n if (activate) {\r\n this._modeSaved = this._mode;\r\n this._mode = Constants.SNAPSHOTRENDERING_STANDARD; // need to reset to standard for the recording pass to avoid some code being bypassed\r\n }\r\n }\r\n\r\n public get mode(): number {\r\n return this._mode;\r\n }\r\n\r\n public set mode(mode: number) {\r\n if (this._record) {\r\n this._modeSaved = mode;\r\n } else {\r\n this._mode = mode;\r\n }\r\n }\r\n\r\n public endRenderPass(currentRenderPass: GPURenderPassEncoder): boolean {\r\n if (!this._record && !this._play) {\r\n // Snapshot rendering mode is not enabled\r\n return false;\r\n }\r\n\r\n let bundleList: Nullable<WebGPUBundleList> = null;\r\n\r\n if (this._record) {\r\n bundleList = this._bundleList.clone();\r\n this._allBundleLists.push(bundleList);\r\n this._bundleList.reset();\r\n this._log(\"endRenderPass\", `bundleList recorded at position #${this._allBundleLists.length - 1}`);\r\n } else {\r\n // We are playing the snapshot\r\n if (this._playBundleListIndex >= this._allBundleLists.length) {\r\n this._log(\r\n \"endRenderPass\",\r\n `empty or out-of-sync bundleList (_allBundleLists.length=${this._allBundleLists.length}, playBundleListIndex=${this._playBundleListIndex})`\r\n );\r\n } else {\r\n this._log(\"endRenderPass\", `run bundleList #${this._playBundleListIndex}`);\r\n bundleList = this._allBundleLists[this._playBundleListIndex++];\r\n }\r\n }\r\n\r\n if (bundleList) {\r\n bundleList.run(currentRenderPass);\r\n\r\n if (this._mode === Constants.SNAPSHOTRENDERING_FAST) {\r\n this._engine._reportDrawCall(bundleList.numDrawCalls);\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n public endFrame(): void {\r\n if (this._record) {\r\n // We stop recording and switch to replay mode for the next frames\r\n this._record = false;\r\n this._play = true;\r\n this._mode = this._modeSaved;\r\n this._log(\"endFrame\", \"bundles recorded, switching to play mode\");\r\n }\r\n\r\n this._playBundleListIndex = 0;\r\n }\r\n\r\n public reset(): void {\r\n this._log(\"reset\", \"called\");\r\n if (this._record) {\r\n this._mode = this._modeSaved;\r\n }\r\n this.enabled = false;\r\n this.enabled = true;\r\n }\r\n\r\n private _log(funcName: string, message: string) {\r\n if (this.showDebugLogs) {\r\n Logger.Log(`[Frame: ${this._engine.frameId}] WebGPUSnapshotRendering:${funcName} - ${message}`);\r\n }\r\n }\r\n}\r\n"]}
|
|
@@ -769,13 +769,13 @@ export class AbstractEngine {
|
|
|
769
769
|
*/
|
|
770
770
|
// Not mixed with Version for tooling purpose.
|
|
771
771
|
static get NpmPackage() {
|
|
772
|
-
return "babylonjs@7.
|
|
772
|
+
return "babylonjs@7.47.0";
|
|
773
773
|
}
|
|
774
774
|
/**
|
|
775
775
|
* Returns the current version of the framework
|
|
776
776
|
*/
|
|
777
777
|
static get Version() {
|
|
778
|
-
return "7.
|
|
778
|
+
return "7.47.0";
|
|
779
779
|
}
|
|
780
780
|
/**
|
|
781
781
|
* Gets the HTML canvas attached with the current webGL context
|