@onerjs/core 8.42.7 → 8.42.8
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/Animations/animatable.core.js +1 -1
- package/Animations/animatable.core.js.map +1 -1
- package/Animations/animatorAvatar.js +2 -2
- package/Animations/animatorAvatar.js.map +1 -1
- package/Animations/runtimeAnimation.js +1 -1
- package/Animations/runtimeAnimation.js.map +1 -1
- package/Audio/audioSceneComponent.js +1 -2
- package/Audio/audioSceneComponent.js.map +1 -1
- package/AudioV2/webAudio/subNodes/webAudioBusAndSoundSubGraph.js +3 -3
- package/AudioV2/webAudio/subNodes/webAudioBusAndSoundSubGraph.js.map +1 -1
- package/AudioV2/webAudio/webAudioEngine.js +1 -1
- package/AudioV2/webAudio/webAudioEngine.js.map +1 -1
- package/Behaviors/Meshes/followBehavior.js +1 -1
- package/Behaviors/Meshes/followBehavior.js.map +1 -1
- package/Behaviors/Meshes/pointerDragBehavior.js +1 -1
- package/Behaviors/Meshes/pointerDragBehavior.js.map +1 -1
- package/Bones/boneLookController.js +1 -1
- package/Bones/boneLookController.js.map +1 -1
- package/Buffers/buffer.js +1 -1
- package/Buffers/buffer.js.map +1 -1
- package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js +2 -2
- package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js.map +1 -1
- package/Cameras/camera.js +2 -2
- package/Cameras/camera.js.map +1 -1
- package/Engines/AbstractEngine/abstractEngine.renderPass.js +1 -0
- package/Engines/AbstractEngine/abstractEngine.renderPass.js.map +1 -1
- package/Engines/Extensions/engine.query.js +1 -1
- package/Engines/Extensions/engine.query.js.map +1 -1
- package/Engines/Processors/shaderProcessor.js +2 -3
- package/Engines/Processors/shaderProcessor.js.map +1 -1
- package/Engines/WebGL/webGLRenderTargetWrapper.js +1 -1
- package/Engines/WebGL/webGLRenderTargetWrapper.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.debugging.d.ts +87 -0
- package/Engines/WebGPU/Extensions/engine.debugging.js +123 -31
- package/Engines/WebGPU/Extensions/engine.debugging.js.map +1 -1
- package/Engines/WebGPU/webgpuBufferManager.js +1 -1
- package/Engines/WebGPU/webgpuBufferManager.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessor.js +1 -1
- package/Engines/WebGPU/webgpuShaderProcessor.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureManager.js +10 -5
- package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/engine.common.js +2 -2
- package/Engines/engine.common.js.map +1 -1
- package/Engines/engine.js +0 -1
- package/Engines/engine.js.map +1 -1
- package/Engines/thinEngine.functions.js +1 -1
- package/Engines/thinEngine.functions.js.map +1 -1
- package/Engines/thinEngine.js +4 -5
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/thinNativeEngine.js +2 -5
- package/Engines/thinNativeEngine.js.map +1 -1
- package/Engines/thinWebGPUEngine.d.ts +6 -4
- package/Engines/thinWebGPUEngine.js +49 -25
- package/Engines/thinWebGPUEngine.js.map +1 -1
- package/Engines/webgpuEngine.d.ts +2 -1
- package/Engines/webgpuEngine.js +18 -16
- package/Engines/webgpuEngine.js.map +1 -1
- package/FlowGraph/flowGraph.d.ts +1 -0
- package/FlowGraph/flowGraph.js.map +1 -1
- package/FlowGraph/flowGraphBlock.d.ts +1 -0
- package/FlowGraph/flowGraphBlock.js.map +1 -1
- package/FlowGraph/flowGraphContext.d.ts +1 -0
- package/FlowGraph/flowGraphContext.js.map +1 -1
- package/FlowGraph/flowGraphCoordinator.d.ts +1 -0
- package/FlowGraph/flowGraphCoordinator.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraph.d.ts +12 -1
- package/FrameGraph/Node/nodeRenderGraph.js +36 -2
- package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
- package/FrameGraph/Tasks/Layers/baseLayerTask.js +1 -1
- package/FrameGraph/Tasks/Layers/baseLayerTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/ssao2RenderingPipelineTask.js +3 -0
- package/FrameGraph/Tasks/PostProcesses/ssao2RenderingPipelineTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.js +3 -0
- package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/volumetricLightingTask.d.ts +3 -1
- package/FrameGraph/Tasks/PostProcesses/volumetricLightingTask.js +14 -0
- package/FrameGraph/Tasks/PostProcesses/volumetricLightingTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.d.ts +2 -2
- package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.js +20 -14
- package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.d.ts +3 -2
- package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.js +38 -14
- package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.js.map +1 -1
- package/Layers/glowLayer.js +1 -1
- package/Layers/glowLayer.js.map +1 -1
- package/Layers/highlightLayer.js +1 -1
- package/Layers/highlightLayer.js.map +1 -1
- package/Lights/Shadows/cascadedShadowGenerator.js +0 -1
- package/Lights/Shadows/cascadedShadowGenerator.js.map +1 -1
- package/Lights/Shadows/shadowGenerator.d.ts +28 -1
- package/Lights/Shadows/shadowGenerator.js +77 -11
- package/Lights/Shadows/shadowGenerator.js.map +1 -1
- package/Lights/lightingVolume.d.ts +1 -0
- package/Lights/lightingVolume.js +10 -2
- package/Lights/lightingVolume.js.map +1 -1
- package/Loading/sceneLoader.js +1 -1
- package/Loading/sceneLoader.js.map +1 -1
- package/Materials/Node/Blocks/Dual/fogBlock.js +1 -1
- package/Materials/Node/Blocks/Dual/fogBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/imageSourceBlock.js +1 -1
- package/Materials/Node/Blocks/Dual/imageSourceBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/sheenBlock.js +1 -2
- package/Materials/Node/Blocks/PBR/sheenBlock.js.map +1 -1
- package/Materials/Node/Blocks/cloudBlock.js +1 -1
- package/Materials/Node/Blocks/cloudBlock.js.map +1 -1
- package/Materials/Node/Blocks/curveBlock.js +2 -3
- package/Materials/Node/Blocks/curveBlock.js.map +1 -1
- package/Materials/Node/nodeMaterial.js +1 -2
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/PBR/openpbrMaterial.js +3 -5
- package/Materials/PBR/openpbrMaterial.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.js +2 -3
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/Textures/Procedurals/proceduralTexture.js +0 -1
- package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
- package/Materials/Textures/cubeTexture.js +1 -1
- package/Materials/Textures/cubeTexture.js.map +1 -1
- package/Materials/Textures/htmlElementTexture.js +2 -2
- package/Materials/Textures/htmlElementTexture.js.map +1 -1
- package/Materials/Textures/multiRenderTarget.js +1 -1
- package/Materials/Textures/multiRenderTarget.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.js +13 -2
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/effect.js +2 -1
- package/Materials/effect.js.map +1 -1
- package/Materials/materialHelper.functions.js +1 -1
- package/Materials/materialHelper.functions.js.map +1 -1
- package/Materials/multiMaterial.js +1 -1
- package/Materials/multiMaterial.js.map +1 -1
- package/Materials/standardMaterial.js +1 -2
- package/Materials/standardMaterial.js.map +1 -1
- package/Maths/math.geospatial.d.ts +17 -2
- package/Maths/math.geospatial.functions.d.ts +16 -2
- package/Maths/math.geospatial.functions.js +37 -4
- package/Maths/math.geospatial.functions.js.map +1 -1
- package/Maths/math.geospatial.js.map +1 -1
- package/Maths/math.path.js +1 -1
- package/Maths/math.path.js.map +1 -1
- package/Maths/math.scalar.functions.js +3 -3
- package/Maths/math.scalar.functions.js.map +1 -1
- package/Maths/math.vector.js +1 -1
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/Builders/boxBuilder.js +1 -2
- package/Meshes/Builders/boxBuilder.js.map +1 -1
- package/Meshes/Builders/cylinderBuilder.js +2 -2
- package/Meshes/Builders/cylinderBuilder.js.map +1 -1
- package/Meshes/Builders/decalBuilder.js +1 -2
- package/Meshes/Builders/decalBuilder.js.map +1 -1
- package/Meshes/Builders/latheBuilder.js +2 -2
- package/Meshes/Builders/latheBuilder.js.map +1 -1
- package/Meshes/Builders/linesBuilder.js +11 -15
- package/Meshes/Builders/linesBuilder.js.map +1 -1
- package/Meshes/Builders/polygonBuilder.js +6 -6
- package/Meshes/Builders/polygonBuilder.js.map +1 -1
- package/Meshes/Builders/polyhedronBuilder.js +2 -2
- package/Meshes/Builders/polyhedronBuilder.js.map +1 -1
- package/Meshes/Builders/ribbonBuilder.js +6 -6
- package/Meshes/Builders/ribbonBuilder.js.map +1 -1
- package/Meshes/Builders/shapeBuilder.js +2 -3
- package/Meshes/Builders/shapeBuilder.js.map +1 -1
- package/Meshes/Builders/tiledBoxBuilder.js +1 -1
- package/Meshes/Builders/tiledBoxBuilder.js.map +1 -1
- package/Meshes/Builders/tiledPlaneBuilder.js +1 -1
- package/Meshes/Builders/tiledPlaneBuilder.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineMesh.js +1 -2
- package/Meshes/GreasedLine/greasedLineMesh.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineRibbonMesh.js +1 -1
- package/Meshes/GreasedLine/greasedLineRibbonMesh.js.map +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.js +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.js +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.js.map +1 -1
- package/Meshes/Node/Blocks/mappingBlock.js +1 -1
- package/Meshes/Node/Blocks/mappingBlock.js.map +1 -1
- package/Meshes/abstractMesh.d.ts +4 -0
- package/Meshes/abstractMesh.js +14 -10
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/csg.js +1 -1
- package/Meshes/csg.js.map +1 -1
- package/Meshes/csg2.js +1 -1
- package/Meshes/csg2.js.map +1 -1
- package/Meshes/geodesicMesh.js +11 -13
- package/Meshes/geodesicMesh.js.map +1 -1
- package/Meshes/geometry.js +2 -2
- package/Meshes/geometry.js.map +1 -1
- package/Meshes/groundMesh.js +7 -7
- package/Meshes/groundMesh.js.map +1 -1
- package/Meshes/mesh.d.ts +2 -0
- package/Meshes/mesh.js +21 -7
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/mesh.vertexData.js +22 -22
- package/Meshes/mesh.vertexData.js.map +1 -1
- package/Meshes/meshSimplification.js +1 -1
- package/Meshes/meshSimplification.js.map +1 -1
- package/Meshes/polygonMesh.js +1 -1
- package/Meshes/polygonMesh.js.map +1 -1
- package/Meshes/trailMesh.js +1 -1
- package/Meshes/trailMesh.js.map +1 -1
- package/Misc/HighDynamicRange/hdr.js +4 -6
- package/Misc/HighDynamicRange/hdr.js.map +1 -1
- package/Misc/HighDynamicRange/panoramaToCubemap.js +1 -1
- package/Misc/HighDynamicRange/panoramaToCubemap.js.map +1 -1
- package/Misc/basisWorker.js +1 -1
- package/Misc/basisWorker.js.map +1 -1
- package/Misc/environmentTextureTools.js +1 -1
- package/Misc/environmentTextureTools.js.map +1 -1
- package/Misc/meshExploder.js +1 -2
- package/Misc/meshExploder.js.map +1 -1
- package/Misc/tga.js +2 -2
- package/Misc/tga.js.map +1 -1
- package/Misc/timer.js +4 -2
- package/Misc/timer.js.map +1 -1
- package/Misc/tools.d.ts +7 -0
- package/Misc/tools.js +20 -6
- package/Misc/tools.js.map +1 -1
- package/Morph/morphTargetManager.js +1 -1
- package/Morph/morphTargetManager.js.map +1 -1
- package/Particles/Node/Blocks/Update/updateNoiseBlock.js +1 -1
- package/Particles/Node/Blocks/Update/updateNoiseBlock.js.map +1 -1
- package/Particles/Node/Blocks/particleSourceTextureBlock.d.ts +11 -1
- package/Particles/Node/Blocks/particleSourceTextureBlock.js +25 -11
- package/Particles/Node/Blocks/particleSourceTextureBlock.js.map +1 -1
- package/Particles/Node/nodeParticleSystemSet.helper.js +3 -3
- package/Particles/Node/nodeParticleSystemSet.helper.js.map +1 -1
- package/Particles/Node/nodeParticleSystemSet.js +1 -1
- package/Particles/Node/nodeParticleSystemSet.js.map +1 -1
- package/Particles/computeShaderParticleSystem.js +2 -0
- package/Particles/computeShaderParticleSystem.js.map +1 -1
- package/Particles/gpuParticleSystem.d.ts +14 -0
- package/Particles/gpuParticleSystem.js +94 -12
- package/Particles/gpuParticleSystem.js.map +1 -1
- package/Particles/particleSystem.js +4 -1
- package/Particles/particleSystem.js.map +1 -1
- package/Particles/pointsCloudSystem.js +46 -47
- package/Particles/pointsCloudSystem.js.map +1 -1
- package/Particles/solidParticleSystem.js +5 -6
- package/Particles/solidParticleSystem.js.map +1 -1
- package/Particles/thinParticleSystem.js +3 -4
- package/Particles/thinParticleSystem.js.map +1 -1
- package/Particles/webgl2ParticleSystem.js +2 -1
- package/Particles/webgl2ParticleSystem.js.map +1 -1
- package/Physics/v1/Plugins/ammoJSPlugin.js +0 -8
- package/Physics/v1/Plugins/ammoJSPlugin.js.map +1 -1
- package/Physics/v2/characterController.js +4 -8
- package/Physics/v2/characterController.js.map +1 -1
- package/Physics/v2/ragdoll.js +1 -2
- package/Physics/v2/ragdoll.js.map +1 -1
- package/PostProcesses/postProcess.js +3 -3
- package/PostProcesses/postProcess.js.map +1 -1
- package/PostProcesses/thinDepthOfFieldEffect.js +2 -2
- package/PostProcesses/thinDepthOfFieldEffect.js.map +1 -1
- package/Probes/reflectionProbe.js +0 -1
- package/Probes/reflectionProbe.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.js +0 -5
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.js.map +1 -1
- package/Rendering/depthRenderer.js +0 -11
- package/Rendering/depthRenderer.js.map +1 -1
- package/Rendering/depthRendererSceneComponent.js +1 -1
- package/Rendering/depthRendererSceneComponent.js.map +1 -1
- package/Rendering/geometryBufferRenderer.js +0 -1
- package/Rendering/geometryBufferRenderer.js.map +1 -1
- package/Rendering/objectRenderer.js +7 -5
- package/Rendering/objectRenderer.js.map +1 -1
- package/Rendering/thinDepthPeelingRenderer.js +1 -1
- package/Rendering/thinDepthPeelingRenderer.js.map +1 -1
- package/Rendering/utilityLayerRenderer.js +1 -1
- package/Rendering/utilityLayerRenderer.js.map +1 -1
- package/Shaders/ShadersInclude/screenSpaceRayTrace.js +18 -8
- package/Shaders/ShadersInclude/screenSpaceRayTrace.js.map +1 -1
- package/Shaders/gpuRenderParticles.vertex.js +4 -0
- package/Shaders/gpuRenderParticles.vertex.js.map +1 -1
- package/Shaders/gpuUpdateParticles.vertex.js +15 -3
- package/Shaders/gpuUpdateParticles.vertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/screenSpaceRayTrace.js +18 -7
- package/ShadersWGSL/ShadersInclude/screenSpaceRayTrace.js.map +1 -1
- package/ShadersWGSL/gpuUpdateParticles.compute.js +16 -1
- package/ShadersWGSL/gpuUpdateParticles.compute.js.map +1 -1
- package/Sprites/spriteManager.js +4 -4
- package/Sprites/spriteManager.js.map +1 -1
- package/XR/features/WebXRAnchorSystem.js +2 -2
- package/XR/features/WebXRAnchorSystem.js.map +1 -1
- package/XR/features/WebXRHandTracking.js +1 -1
- package/XR/features/WebXRHandTracking.js.map +1 -1
- package/XR/features/WebXRNearInteraction.js +1 -1
- package/XR/features/WebXRNearInteraction.js.map +1 -1
- package/XR/motionController/webXRMicrosoftMixedRealityController.js +1 -1
- package/XR/motionController/webXRMicrosoftMixedRealityController.js.map +1 -1
- package/XR/motionController/webXROculusTouchMotionController.js +1 -1
- package/XR/motionController/webXROculusTouchMotionController.js.map +1 -1
- package/XR/webXRFeaturesManager.js +1 -1
- package/XR/webXRFeaturesManager.js.map +1 -1
- package/assetContainer.js +1 -1
- package/assetContainer.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +16 -0
- package/scene.js +28 -0
- package/scene.js.map +1 -1
- package/sceneComponent.js +1 -1
- package/sceneComponent.js.map +1 -1
|
@@ -41,11 +41,11 @@ export declare abstract class ThinWebGPUEngine extends AbstractEngine {
|
|
|
41
41
|
/** @internal */
|
|
42
42
|
_showGPUDebugMarkersLog: boolean;
|
|
43
43
|
/** @internal */
|
|
44
|
-
|
|
44
|
+
_debugMarkersEncoderGroups: string[];
|
|
45
45
|
/** @internal */
|
|
46
|
-
|
|
46
|
+
_debugMarkersPassGroups: string[];
|
|
47
47
|
/** @internal */
|
|
48
|
-
|
|
48
|
+
_debugMarkersPendingEncoderPops: number;
|
|
49
49
|
/**
|
|
50
50
|
* Gets the GPU time spent in the main render pass for the last frame rendered (in nanoseconds).
|
|
51
51
|
* You have to enable the "timestamp-query" extension in the engine constructor options and set engine.enableGPUTimingMeasurements = true.
|
|
@@ -70,5 +70,7 @@ export declare abstract class ThinWebGPUEngine extends AbstractEngine {
|
|
|
70
70
|
* @internal
|
|
71
71
|
*/
|
|
72
72
|
_generateMipmaps(texture: InternalTexture, commandEncoder?: GPUCommandEncoder): void;
|
|
73
|
-
protected
|
|
73
|
+
protected _debugPopBeforeEndOfEncoder(): void;
|
|
74
|
+
protected _debugPushAfterStartOfEncoder(): void;
|
|
75
|
+
protected _debugPendingPop(currentRenderPass: GPURenderPassEncoder): void;
|
|
74
76
|
}
|
|
@@ -26,11 +26,11 @@ export class ThinWebGPUEngine extends AbstractEngine {
|
|
|
26
26
|
/** @internal */
|
|
27
27
|
this._showGPUDebugMarkersLog = false;
|
|
28
28
|
/** @internal */
|
|
29
|
-
this.
|
|
29
|
+
this._debugMarkersEncoderGroups = [];
|
|
30
30
|
/** @internal */
|
|
31
|
-
this.
|
|
31
|
+
this._debugMarkersPassGroups = [];
|
|
32
32
|
/** @internal */
|
|
33
|
-
this.
|
|
33
|
+
this._debugMarkersPendingEncoderPops = 0;
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
36
|
* Enables or disables GPU timing measurements.
|
|
@@ -54,13 +54,7 @@ export class ThinWebGPUEngine extends AbstractEngine {
|
|
|
54
54
|
if (!this._currentRenderPass) {
|
|
55
55
|
return 0;
|
|
56
56
|
}
|
|
57
|
-
|
|
58
|
-
// We have pushed debug groups without popping them, we need to pop them before ending the render pass to avoid WebGPU validation errors
|
|
59
|
-
// We will re-push them after starting the new render pass (if any)
|
|
60
|
-
for (let i = 0; i < this._debugStackRenderPass.length; ++i) {
|
|
61
|
-
this._currentRenderPass.popDebugGroup();
|
|
62
|
-
}
|
|
63
|
-
}
|
|
57
|
+
this._debugPopBeforeEndOfEncoder();
|
|
64
58
|
const currentPassIndex = this._currentPassIsMainPass() ? 2 : 1;
|
|
65
59
|
if (!this._snapshotRendering.endRenderPass(this._currentRenderPass) && !this.compatibilityMode) {
|
|
66
60
|
this._bundleList.run(this._currentRenderPass);
|
|
@@ -71,16 +65,8 @@ export class ThinWebGPUEngine extends AbstractEngine {
|
|
|
71
65
|
? this._currentRenderTarget.gpuTimeInFrame
|
|
72
66
|
: this.gpuTimeInFrameForMainPass));
|
|
73
67
|
this._timestampIndex += 2;
|
|
74
|
-
|
|
75
|
-
while (this._debugNumPopPending-- > 0) {
|
|
76
|
-
if (this._showGPUDebugMarkersLog) {
|
|
77
|
-
Logger.Log(`[${this.frameId}] Re-popping pending debug group on render encoder '${this._renderEncoder.label}' after ending current render pass '${this._currentRenderPass.label}'`);
|
|
78
|
-
}
|
|
79
|
-
this._renderEncoder.popDebugGroup();
|
|
80
|
-
this._debugStackRenderEncoder.pop();
|
|
81
|
-
}
|
|
68
|
+
this._debugPendingPop(this._currentRenderPass);
|
|
82
69
|
this._currentRenderPass = null;
|
|
83
|
-
this._debugNumPopPending = 0;
|
|
84
70
|
return currentPassIndex;
|
|
85
71
|
}
|
|
86
72
|
/**
|
|
@@ -107,15 +93,53 @@ export class ThinWebGPUEngine extends AbstractEngine {
|
|
|
107
93
|
this._textureHelper.generateMipmaps(gpuHardwareTexture, mipmapCount, 0, commandEncoder);
|
|
108
94
|
}
|
|
109
95
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
96
|
+
_debugPopBeforeEndOfEncoder() {
|
|
97
|
+
if (!this._enableGPUDebugMarkers) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
// When a render pass is active, pop its groups; otherwise pop encoder-level groups.
|
|
101
|
+
// Pass-level groups are never pushed on the encoder, so we never pop them from it.
|
|
102
|
+
const groups = this._currentRenderPass ? this._debugMarkersPassGroups : this._debugMarkersEncoderGroups;
|
|
103
|
+
const target = this._currentRenderPass ?? this._renderEncoder;
|
|
104
|
+
for (let i = groups.length - 1; i >= 0; --i) {
|
|
114
105
|
if (this._showGPUDebugMarkersLog) {
|
|
115
|
-
Logger.Log(`[${this.frameId}]
|
|
106
|
+
Logger.Log(`[${this.frameId}] [E${this._debugMarkersEncoderGroups.length}|P${this._debugMarkersPassGroups.length}] [automatic] Popping debug group '${groups[i]}' on '${target.label}'.`);
|
|
116
107
|
}
|
|
117
|
-
|
|
108
|
+
target.popDebugGroup();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
_debugPushAfterStartOfEncoder() {
|
|
112
|
+
if (!this._enableGPUDebugMarkers) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
// When a render pass is active, re-push its floating groups onto it; otherwise re-push
|
|
116
|
+
// encoder-level groups onto the new render encoder.
|
|
117
|
+
// Pass-level groups stay floating until the next render pass starts.
|
|
118
|
+
const groups = this._currentRenderPass ? this._debugMarkersPassGroups : this._debugMarkersEncoderGroups;
|
|
119
|
+
const target = this._currentRenderPass ?? this._renderEncoder;
|
|
120
|
+
for (const groupName of groups) {
|
|
121
|
+
if (this._showGPUDebugMarkersLog) {
|
|
122
|
+
Logger.Log(`[${this.frameId}] [E${this._debugMarkersEncoderGroups.length}|P${this._debugMarkersPassGroups.length}] [automatic] Pushing debug group '${groupName}' on '${target.label}'.`);
|
|
123
|
+
}
|
|
124
|
+
target.pushDebugGroup(groupName);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
_debugPendingPop(currentRenderPass) {
|
|
128
|
+
if (!this._enableGPUDebugMarkers) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
// The user popped encoder-level groups while a render pass was active (the pass was the live
|
|
132
|
+
// object, so the pops were deferred). Now that the pass has ended we replay them on the render
|
|
133
|
+
// encoder. Because _debugMarkersEncoderGroups only ever contains encoder-level entries, popping
|
|
134
|
+
// from it here can never accidentally consume a pass-level group.
|
|
135
|
+
while (this._debugMarkersPendingEncoderPops-- > 0) {
|
|
136
|
+
const groupName = this._debugMarkersEncoderGroups.pop();
|
|
137
|
+
if (this._showGPUDebugMarkersLog) {
|
|
138
|
+
Logger.Log(`[${this.frameId}] [E${this._debugMarkersEncoderGroups.length}|P${this._debugMarkersPassGroups.length}] [automatic] Popping debug group '${groupName}' on render encoder '${this._renderEncoder.label}' after the end of render pass '${currentRenderPass.label}'.`);
|
|
139
|
+
}
|
|
140
|
+
this._renderEncoder.popDebugGroup();
|
|
118
141
|
}
|
|
142
|
+
this._debugMarkersPendingEncoderPops = 0;
|
|
119
143
|
}
|
|
120
144
|
}
|
|
121
145
|
//# sourceMappingURL=thinWebGPUEngine.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thinWebGPUEngine.js","sourceRoot":"","sources":["../../../../dev/core/src/Engines/thinWebGPUEngine.ts"],"names":[],"mappings":"AAEA,OAA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E,CAAC,EAAE,cAAc,CAAC,CAAC;QACtG,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,kBAAkB,EAAE,WAAW,EAAE,CAAC,EAAE,cAAc,CAAC,CAAC;QAC5F,CAAC;IACL,CAAC;IAES,uBAAuB,CAAC,aAAsB;QACpD,MAAM,UAAU,GAAG,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,IAAI,CAAC,wBAAwB,CAAC;QAC9F,MAAM,cAAc,GAAG,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC;QAErF,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;YACjC,IAAI,IAAI,CAAC,uBAAuB,EAAE,CAAC;gBAC/B,MAAM,CAAC,GAAG,CACN,IAAI,IAAI,CAAC,OAAO,6BAA6B,SAAS,QAAQ,aAAa,CAAC,CAAC,CAAC,uBAAuB,GAAG,IAAI,CAAC,kBAAkB,EAAE,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,kBAAkB,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,GAAG,GAAG,yBAAyB,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,gBAAgB,EAAE,CACjR,CAAC;YACN,CAAC;YACD,cAAe,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;QAC9C,CAAC;IACL,CAAC;CACJ","sourcesContent":["import type { InternalTexture } from \"core/Materials/Textures/internalTexture\";\r\nimport { InternalTextureSource } from \"core/Materials/Textures/internalTexture\";\r\nimport { AbstractEngine } from \"./abstractEngine\";\r\nimport type { WebGPUCacheRenderPipeline } from \"./WebGPU/webgpuCacheRenderPipeline\";\r\nimport type { WebGPUTextureManager } from \"./WebGPU/webgpuTextureManager\";\r\nimport type { WebGPUHardwareTexture } from \"./WebGPU/webgpuHardwareTexture\";\r\nimport type { Nullable } from \"core/types\";\r\nimport { Logger } from \"core/Misc/logger\";\r\nimport { WebGPUTextureHelper } from \"./WebGPU/webgpuTextureHelper\";\r\nimport type { WebGPURenderTargetWrapper } from \"./WebGPU/webgpuRenderTargetWrapper\";\r\nimport { WebGPUPerfCounter } from \"./WebGPU/webgpuPerfCounter\";\r\nimport type { WebGPUSnapshotRendering } from \"./WebGPU/webgpuSnapshotRendering\";\r\nimport { Constants } from \"./constants\";\r\nimport type { WebGPUBundleList } from \"./WebGPU/webgpuBundleList\";\r\nimport type { WebGPUTimestampQuery } from \"./WebGPU/webgpuTimestampQuery\";\r\nimport type { WebGPUOcclusionQuery } from \"./WebGPU/webgpuOcclusionQuery\";\r\n\r\n/**\r\n * The base engine class for WebGPU\r\n */\r\nexport abstract class ThinWebGPUEngine extends AbstractEngine {\r\n // TODO WEBGPU remove those variables when code stabilized\r\n /** @internal */\r\n public dbgShowShaderCode = false;\r\n /** @internal */\r\n public dbgSanityChecks = true;\r\n /** @internal */\r\n public dbgLogIfNotDrawWrapper = true;\r\n /** @internal */\r\n public dbgShowEmptyEnableEffectCalls = true;\r\n\r\n /** @internal */\r\n public _textureHelper: WebGPUTextureManager;\r\n /** @internal */\r\n public _cacheRenderPipeline: WebGPUCacheRenderPipeline;\r\n /** @internal */\r\n public _occlusionQuery: WebGPUOcclusionQuery;\r\n\r\n // Frame Life Cycle (recreated each frame)\r\n /** @internal */\r\n public _renderEncoder: GPUCommandEncoder;\r\n /** @internal */\r\n public _uploadEncoder: GPUCommandEncoder;\r\n\r\n /** @internal */\r\n public _currentRenderPass: Nullable<GPURenderPassEncoder> = null;\r\n\r\n protected _snapshotRendering: WebGPUSnapshotRendering;\r\n protected _snapshotRenderingMode = Constants.SNAPSHOTRENDERING_STANDARD;\r\n\r\n /** @internal */\r\n public _timestampQuery: WebGPUTimestampQuery;\r\n /** @internal */\r\n public _timestampIndex = 0;\r\n\r\n /** @internal */\r\n public _showGPUDebugMarkersLog = false;\r\n /** @internal */\r\n public _debugStackRenderEncoder: string[] = [];\r\n /** @internal */\r\n public _debugStackRenderPass: string[] = [];\r\n /** @internal */\r\n public _debugNumPopPending = 0;\r\n\r\n /**\r\n * Gets the GPU time spent in the main render pass for the last frame rendered (in nanoseconds).\r\n * You have to enable the \"timestamp-query\" extension in the engine constructor options and set engine.enableGPUTimingMeasurements = true.\r\n * It will only return time spent in the main pass, not additional render target / compute passes (if any)!\r\n */\r\n public readonly gpuTimeInFrameForMainPass?: WebGPUPerfCounter;\r\n\r\n /**\r\n * Used for both the compatibilityMode=false and the snapshot rendering modes (as both can't be enabled at the same time)\r\n * @internal\r\n */\r\n public _bundleList: WebGPUBundleList;\r\n\r\n /**\r\n * Enables or disables GPU timing measurements.\r\n * Note that this is only supported if the \"timestamp-query\" extension is enabled in the options.\r\n */\r\n public get enableGPUTimingMeasurements(): boolean {\r\n return this._timestampQuery.enable;\r\n }\r\n\r\n public set enableGPUTimingMeasurements(enable: boolean) {\r\n if (this._timestampQuery.enable === enable) {\r\n return;\r\n }\r\n (this.gpuTimeInFrameForMainPass as any) = enable ? new WebGPUPerfCounter() : undefined;\r\n this._timestampQuery.enable = enable;\r\n }\r\n\r\n protected _currentPassIsMainPass() {\r\n return this._currentRenderTarget === null;\r\n }\r\n\r\n /** @internal */\r\n public _endCurrentRenderPass(): number {\r\n if (!this._currentRenderPass) {\r\n return 0;\r\n }\r\n\r\n if (this._debugStackRenderPass.length !== 0) {\r\n // We have pushed debug groups without popping them, we need to pop them before ending the render pass to avoid WebGPU validation errors\r\n // We will re-push them after starting the new render pass (if any)\r\n for (let i = 0; i < this._debugStackRenderPass.length; ++i) {\r\n this._currentRenderPass.popDebugGroup();\r\n }\r\n }\r\n\r\n const currentPassIndex = this._currentPassIsMainPass() ? 2 : 1;\r\n\r\n if (!this._snapshotRendering.endRenderPass(this._currentRenderPass) && !this.compatibilityMode) {\r\n this._bundleList.run(this._currentRenderPass);\r\n this._bundleList.reset();\r\n }\r\n this._currentRenderPass.end();\r\n\r\n this._timestampQuery.endPass(\r\n this._timestampIndex,\r\n (this._currentRenderTarget && (this._currentRenderTarget as WebGPURenderTargetWrapper).gpuTimeInFrame\r\n ? (this._currentRenderTarget as WebGPURenderTargetWrapper).gpuTimeInFrame\r\n : this.gpuTimeInFrameForMainPass) as WebGPUPerfCounter\r\n );\r\n this._timestampIndex += 2;\r\n\r\n // Pop all pending debug groups that couldn't be popped while the render pass was active\r\n while (this._debugNumPopPending-- > 0) {\r\n if (this._showGPUDebugMarkersLog) {\r\n Logger.Log(\r\n `[${this.frameId}] Re-popping pending debug group on render encoder '${this._renderEncoder.label}' after ending current render pass '${this._currentRenderPass.label}'`\r\n );\r\n }\r\n this._renderEncoder.popDebugGroup();\r\n this._debugStackRenderEncoder.pop();\r\n }\r\n\r\n this._currentRenderPass = null;\r\n this._debugNumPopPending = 0;\r\n\r\n return currentPassIndex;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _generateMipmaps(texture: InternalTexture, commandEncoder?: GPUCommandEncoder) {\r\n commandEncoder = commandEncoder ?? this._renderEncoder;\r\n\r\n const gpuHardwareTexture = texture._hardwareTexture as Nullable<WebGPUHardwareTexture>;\r\n\r\n if (!gpuHardwareTexture) {\r\n return;\r\n }\r\n\r\n if (commandEncoder === this._renderEncoder) {\r\n // We must close the current pass (if any) because we are going to use the render encoder to generate the mipmaps (so, we are going to create a new render pass)\r\n this._endCurrentRenderPass();\r\n }\r\n\r\n const mipmapCount = WebGPUTextureHelper.ComputeNumMipmapLevels(texture.width, texture.height);\r\n\r\n if (texture.isCube) {\r\n this._textureHelper.generateCubeMipmaps(gpuHardwareTexture, mipmapCount, commandEncoder);\r\n } else if (texture._source === InternalTextureSource.Raw || texture._source === InternalTextureSource.Raw2DArray) {\r\n this._textureHelper.generateMipmaps(gpuHardwareTexture, texture.mipLevelCount, 0, commandEncoder);\r\n } else {\r\n this._textureHelper.generateMipmaps(gpuHardwareTexture, mipmapCount, 0, commandEncoder);\r\n }\r\n }\r\n\r\n protected _debugPushPendingGroups(forRenderPass: boolean) {\r\n const debugStack = forRenderPass ? this._debugStackRenderPass : this._debugStackRenderEncoder;\r\n const currentEncoder = forRenderPass ? this._currentRenderPass : this._renderEncoder;\r\n\r\n for (const groupName of debugStack) {\r\n if (this._showGPUDebugMarkersLog) {\r\n Logger.Log(\r\n `[${this.frameId}] Re-pushing debug group '${groupName}' on ${forRenderPass ? \"current render pass '\" + this._currentRenderPass?.label + \"'\" : \"render encoder '\" + this._renderEncoder.label + \"'\"} after starting a new ${forRenderPass ? \"render pass\" : \"render encoder\"}`\r\n );\r\n }\r\n currentEncoder!.pushDebugGroup(groupName);\r\n }\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"thinWebGPUEngine.js","sourceRoot":"","sources":["../../../../dev/core/src/Engines/thinWebGPUEngine.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAKlD,OAAO,EAAE,MAAM,EAAE,0BAAyB;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAKxC;;GAEG;AACH,MAAM,OAAgB,gBAAiB,SAAQ,cAAc;IAA7D;;QACI,0DAA0D;QAC1D,gBAAgB;QACT,sBAAiB,GAAG,KAAK,CAAC;QACjC,gBAAgB;QACT,oBAAe,GAAG,IAAI,CAAC;QAC9B,gBAAgB;QACT,2BAAsB,GAAG,IAAI,CAAC;QACrC,gBAAgB;QACT,kCAA6B,GAAG,IAAI,CAAC;QAe5C,gBAAgB;QACT,uBAAkB,GAAmC,IAAI,CAAC;QAGvD,2BAAsB,GAAG,SAAS,CAAC,0BAA0B,CAAC;QAIxE,gBAAgB;QACT,oBAAe,GAAG,CAAC,CAAC;QAE3B,gBAAgB;QACT,4BAAuB,GAAG,KAAK,CAAC;QACvC,gBAAgB;Q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,IAAI,CAAC,uBAAuB,EAAE,CAAC;gBAC/B,MAAM,CAAC,GAAG,CACN,IAAI,IAAI,CAAC,OAAO,OAAO,IAAI,CAAC,0BAA0B,CAAC,MAAM,KAAK,IAAI,CAAC,uBAAuB,CAAC,MAAM,sCAAsC,SAAS,SAAS,MAAM,CAAC,KAAK,IAAI,CAChL,CAAC;YACN,CAAC;YACD,MAAM,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;QACrC,CAAC;IACL,CAAC;IAES,gBAAgB,CAAC,iBAAuC;QAC9D,IAAI,CAAC,IAAI,CAAC,sBAAsB,EAAE,CAAC;YAC/B,OAAO;QACX,CAAC;QAED,6FAA6F;QAC7F,+FAA+F;QAC/F,gGAAgG;QAChG,kEAAkE;QAClE,OAAO,IAAI,CAAC,+BAA+B,EAAE,GAAG,CAAC,EAAE,CAAC;YAChD,MAAM,SAAS,GAAG,IAAI,CAAC,0BAA0B,CAAC,GAAG,EAAE,CAAC;YAExD,IAAI,IAAI,CAAC,uBAAuB,EAAE,CAAC;gBAC/B,MAAM,CAAC,GAAG,CACN,IAAI,IAAI,CAAC,OAAO,OAAO,IAAI,CAAC,0BAA0B,CAAC,MAAM,KAAK,IAAI,CAAC,uBAAuB,CAAC,MAAM,sCAAsC,SAAS,wBAAwB,IAAI,CAAC,cAAc,CAAC,KAAK,mCAAmC,iBAAiB,CAAC,KAAK,IAAI,CACtQ,CAAC;YACN,CAAC;YAED,IAAI,CAAC,cAAc,CAAC,aAAa,EAAE,CAAC;QACxC,CAAC;QAED,IAAI,CAAC,+BAA+B,GAAG,CAAC,CAAC;IAC7C,CAAC;CACJ","sourcesContent":["import type { InternalTexture } from \"core/Materials/Textures/internalTexture\";\r\nimport { InternalTextureSource } from \"core/Materials/Textures/internalTexture\";\r\nimport { AbstractEngine } from \"./abstractEngine\";\r\nimport type { WebGPUCacheRenderPipeline } from \"./WebGPU/webgpuCacheRenderPipeline\";\r\nimport type { WebGPUTextureManager } from \"./WebGPU/webgpuTextureManager\";\r\nimport type { WebGPUHardwareTexture } from \"./WebGPU/webgpuHardwareTexture\";\r\nimport type { Nullable } from \"core/types\";\r\nimport { Logger } from \"core/Misc/logger\";\r\nimport { WebGPUTextureHelper } from \"./WebGPU/webgpuTextureHelper\";\r\nimport type { WebGPURenderTargetWrapper } from \"./WebGPU/webgpuRenderTargetWrapper\";\r\nimport { WebGPUPerfCounter } from \"./WebGPU/webgpuPerfCounter\";\r\nimport type { WebGPUSnapshotRendering } from \"./WebGPU/webgpuSnapshotRendering\";\r\nimport { Constants } from \"./constants\";\r\nimport type { WebGPUBundleList } from \"./WebGPU/webgpuBundleList\";\r\nimport type { WebGPUTimestampQuery } from \"./WebGPU/webgpuTimestampQuery\";\r\nimport type { WebGPUOcclusionQuery } from \"./WebGPU/webgpuOcclusionQuery\";\r\n\r\n/**\r\n * The base engine class for WebGPU\r\n */\r\nexport abstract class ThinWebGPUEngine extends AbstractEngine {\r\n // TODO WEBGPU remove those variables when code stabilized\r\n /** @internal */\r\n public dbgShowShaderCode = false;\r\n /** @internal */\r\n public dbgSanityChecks = true;\r\n /** @internal */\r\n public dbgLogIfNotDrawWrapper = true;\r\n /** @internal */\r\n public dbgShowEmptyEnableEffectCalls = true;\r\n\r\n /** @internal */\r\n public _textureHelper: WebGPUTextureManager;\r\n /** @internal */\r\n public _cacheRenderPipeline: WebGPUCacheRenderPipeline;\r\n /** @internal */\r\n public _occlusionQuery: WebGPUOcclusionQuery;\r\n\r\n // Frame Life Cycle (recreated each frame)\r\n /** @internal */\r\n public _renderEncoder: GPUCommandEncoder;\r\n /** @internal */\r\n public _uploadEncoder: GPUCommandEncoder;\r\n\r\n /** @internal */\r\n public _currentRenderPass: Nullable<GPURenderPassEncoder> = null;\r\n\r\n protected _snapshotRendering: WebGPUSnapshotRendering;\r\n protected _snapshotRenderingMode = Constants.SNAPSHOTRENDERING_STANDARD;\r\n\r\n /** @internal */\r\n public _timestampQuery: WebGPUTimestampQuery;\r\n /** @internal */\r\n public _timestampIndex = 0;\r\n\r\n /** @internal */\r\n public _showGPUDebugMarkersLog = false;\r\n /** @internal */\r\n public _debugMarkersEncoderGroups: string[] = [];\r\n /** @internal */\r\n public _debugMarkersPassGroups: string[] = [];\r\n /** @internal */\r\n public _debugMarkersPendingEncoderPops = 0;\r\n\r\n /**\r\n * Gets the GPU time spent in the main render pass for the last frame rendered (in nanoseconds).\r\n * You have to enable the \"timestamp-query\" extension in the engine constructor options and set engine.enableGPUTimingMeasurements = true.\r\n * It will only return time spent in the main pass, not additional render target / compute passes (if any)!\r\n */\r\n public readonly gpuTimeInFrameForMainPass?: WebGPUPerfCounter;\r\n\r\n /**\r\n * Used for both the compatibilityMode=false and the snapshot rendering modes (as both can't be enabled at the same time)\r\n * @internal\r\n */\r\n public _bundleList: WebGPUBundleList;\r\n\r\n /**\r\n * Enables or disables GPU timing measurements.\r\n * Note that this is only supported if the \"timestamp-query\" extension is enabled in the options.\r\n */\r\n public get enableGPUTimingMeasurements(): boolean {\r\n return this._timestampQuery.enable;\r\n }\r\n\r\n public set enableGPUTimingMeasurements(enable: boolean) {\r\n if (this._timestampQuery.enable === enable) {\r\n return;\r\n }\r\n (this.gpuTimeInFrameForMainPass as any) = enable ? new WebGPUPerfCounter() : undefined;\r\n this._timestampQuery.enable = enable;\r\n }\r\n\r\n protected _currentPassIsMainPass() {\r\n return this._currentRenderTarget === null;\r\n }\r\n\r\n /** @internal */\r\n public _endCurrentRenderPass(): number {\r\n if (!this._currentRenderPass) {\r\n return 0;\r\n }\r\n\r\n this._debugPopBeforeEndOfEncoder();\r\n\r\n const currentPassIndex = this._currentPassIsMainPass() ? 2 : 1;\r\n\r\n if (!this._snapshotRendering.endRenderPass(this._currentRenderPass) && !this.compatibilityMode) {\r\n this._bundleList.run(this._currentRenderPass);\r\n this._bundleList.reset();\r\n }\r\n this._currentRenderPass.end();\r\n\r\n this._timestampQuery.endPass(\r\n this._timestampIndex,\r\n (this._currentRenderTarget && (this._currentRenderTarget as WebGPURenderTargetWrapper).gpuTimeInFrame\r\n ? (this._currentRenderTarget as WebGPURenderTargetWrapper).gpuTimeInFrame\r\n : this.gpuTimeInFrameForMainPass) as WebGPUPerfCounter\r\n );\r\n this._timestampIndex += 2;\r\n\r\n this._debugPendingPop(this._currentRenderPass);\r\n\r\n this._currentRenderPass = null;\r\n\r\n return currentPassIndex;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _generateMipmaps(texture: InternalTexture, commandEncoder?: GPUCommandEncoder) {\r\n commandEncoder = commandEncoder ?? this._renderEncoder;\r\n\r\n const gpuHardwareTexture = texture._hardwareTexture as Nullable<WebGPUHardwareTexture>;\r\n\r\n if (!gpuHardwareTexture) {\r\n return;\r\n }\r\n\r\n if (commandEncoder === this._renderEncoder) {\r\n // We must close the current pass (if any) because we are going to use the render encoder to generate the mipmaps (so, we are going to create a new render pass)\r\n this._endCurrentRenderPass();\r\n }\r\n\r\n const mipmapCount = WebGPUTextureHelper.ComputeNumMipmapLevels(texture.width, texture.height);\r\n\r\n if (texture.isCube) {\r\n this._textureHelper.generateCubeMipmaps(gpuHardwareTexture, mipmapCount, commandEncoder);\r\n } else if (texture._source === InternalTextureSource.Raw || texture._source === InternalTextureSource.Raw2DArray) {\r\n this._textureHelper.generateMipmaps(gpuHardwareTexture, texture.mipLevelCount, 0, commandEncoder);\r\n } else {\r\n this._textureHelper.generateMipmaps(gpuHardwareTexture, mipmapCount, 0, commandEncoder);\r\n }\r\n }\r\n\r\n protected _debugPopBeforeEndOfEncoder() {\r\n if (!this._enableGPUDebugMarkers) {\r\n return;\r\n }\r\n\r\n // When a render pass is active, pop its groups; otherwise pop encoder-level groups.\r\n // Pass-level groups are never pushed on the encoder, so we never pop them from it.\r\n const groups = this._currentRenderPass ? this._debugMarkersPassGroups : this._debugMarkersEncoderGroups;\r\n const target = this._currentRenderPass ?? this._renderEncoder;\r\n\r\n for (let i = groups.length - 1; i >= 0; --i) {\r\n if (this._showGPUDebugMarkersLog) {\r\n Logger.Log(\r\n `[${this.frameId}] [E${this._debugMarkersEncoderGroups.length}|P${this._debugMarkersPassGroups.length}] [automatic] Popping debug group '${groups[i]}' on '${target.label}'.`\r\n );\r\n }\r\n target.popDebugGroup();\r\n }\r\n }\r\n\r\n protected _debugPushAfterStartOfEncoder() {\r\n if (!this._enableGPUDebugMarkers) {\r\n return;\r\n }\r\n\r\n // When a render pass is active, re-push its floating groups onto it; otherwise re-push\r\n // encoder-level groups onto the new render encoder.\r\n // Pass-level groups stay floating until the next render pass starts.\r\n const groups = this._currentRenderPass ? this._debugMarkersPassGroups : this._debugMarkersEncoderGroups;\r\n const target = this._currentRenderPass ?? this._renderEncoder;\r\n\r\n for (const groupName of groups) {\r\n if (this._showGPUDebugMarkersLog) {\r\n Logger.Log(\r\n `[${this.frameId}] [E${this._debugMarkersEncoderGroups.length}|P${this._debugMarkersPassGroups.length}] [automatic] Pushing debug group '${groupName}' on '${target.label}'.`\r\n );\r\n }\r\n target.pushDebugGroup(groupName);\r\n }\r\n }\r\n\r\n protected _debugPendingPop(currentRenderPass: GPURenderPassEncoder) {\r\n if (!this._enableGPUDebugMarkers) {\r\n return;\r\n }\r\n\r\n // The user popped encoder-level groups while a render pass was active (the pass was the live\r\n // object, so the pops were deferred). Now that the pass has ended we replay them on the render\r\n // encoder. Because _debugMarkersEncoderGroups only ever contains encoder-level entries, popping\r\n // from it here can never accidentally consume a pass-level group.\r\n while (this._debugMarkersPendingEncoderPops-- > 0) {\r\n const groupName = this._debugMarkersEncoderGroups.pop();\r\n\r\n if (this._showGPUDebugMarkersLog) {\r\n Logger.Log(\r\n `[${this.frameId}] [E${this._debugMarkersEncoderGroups.length}|P${this._debugMarkersPassGroups.length}] [automatic] Popping debug group '${groupName}' on render encoder '${this._renderEncoder.label}' after the end of render pass '${currentRenderPass.label}'.`\r\n );\r\n }\r\n\r\n this._renderEncoder.popDebugGroup();\r\n }\r\n\r\n this._debugMarkersPendingEncoderPops = 0;\r\n }\r\n}\r\n"]}
|
|
@@ -860,8 +860,9 @@ export declare class WebGPUEngine extends ThinWebGPUEngine {
|
|
|
860
860
|
extractDriverInfo(): string;
|
|
861
861
|
/**
|
|
862
862
|
* Force a WebGPU flush (ie. a flush of all waiting commands)
|
|
863
|
+
* @internal @param _fromEndFrame defines whether the flush is triggered from endFrame or not (default: false)
|
|
863
864
|
*/
|
|
864
|
-
flushFramebuffer(): void;
|
|
865
|
+
flushFramebuffer(_fromEndFrame?: boolean): void;
|
|
865
866
|
/** @internal */
|
|
866
867
|
_currentFrameBufferIsDefaultFrameBuffer(): boolean;
|
|
867
868
|
/** @internal */
|
package/Engines/webgpuEngine.js
CHANGED
|
@@ -762,8 +762,8 @@ export class WebGPUEngine extends ThinWebGPUEngine {
|
|
|
762
762
|
this.beginFrame();
|
|
763
763
|
this._startMainRenderPass(true, null, true, false);
|
|
764
764
|
this._endCurrentRenderPass();
|
|
765
|
-
this.endFrame();
|
|
766
765
|
this._frameId--; // We don't want to count the frame as a real frame, because it was only used to initialize the depth texture
|
|
766
|
+
this.endFrame();
|
|
767
767
|
}
|
|
768
768
|
/**
|
|
769
769
|
* Shared initialization across engines types.
|
|
@@ -2051,7 +2051,7 @@ export class WebGPUEngine extends ThinWebGPUEngine {
|
|
|
2051
2051
|
texture.delayLoad();
|
|
2052
2052
|
return false;
|
|
2053
2053
|
}
|
|
2054
|
-
let internalTexture
|
|
2054
|
+
let internalTexture;
|
|
2055
2055
|
if (depthStencilTexture) {
|
|
2056
2056
|
internalTexture = texture.depthStencilTexture;
|
|
2057
2057
|
}
|
|
@@ -2249,7 +2249,7 @@ export class WebGPUEngine extends ThinWebGPUEngine {
|
|
|
2249
2249
|
this._timestampQuery.endFrame(this._renderEncoder);
|
|
2250
2250
|
this._timestampIndex = 0;
|
|
2251
2251
|
this._internalFrameCounter = 0;
|
|
2252
|
-
this.flushFramebuffer();
|
|
2252
|
+
this.flushFramebuffer(true);
|
|
2253
2253
|
this._textureHelper.destroyDeferredTextures();
|
|
2254
2254
|
this._bufferManager.destroyDeferredBuffers();
|
|
2255
2255
|
this.countersLastFrame.numEnableEffects = this._counters.numEnableEffects;
|
|
@@ -2270,26 +2270,28 @@ export class WebGPUEngine extends ThinWebGPUEngine {
|
|
|
2270
2270
|
}
|
|
2271
2271
|
/**
|
|
2272
2272
|
* Force a WebGPU flush (ie. a flush of all waiting commands)
|
|
2273
|
+
* @internal @param _fromEndFrame defines whether the flush is triggered from endFrame or not (default: false)
|
|
2273
2274
|
*/
|
|
2274
|
-
flushFramebuffer() {
|
|
2275
|
+
flushFramebuffer(_fromEndFrame = false) {
|
|
2275
2276
|
// we need to end the current render pass (main or rtt) if any as we are not allowed to submit the command buffers when being in a pass
|
|
2276
2277
|
this._endCurrentRenderPass();
|
|
2277
|
-
|
|
2278
|
-
// We have pushed debug groups without popping them, we need to pop them before ending the render encoder to avoid WebGPU validation errors
|
|
2279
|
-
// We will re-push them after creating the new render encoder
|
|
2280
|
-
for (let i = 0; i < this._debugStackRenderEncoder.length; ++i) {
|
|
2281
|
-
this._renderEncoder.popDebugGroup();
|
|
2282
|
-
}
|
|
2283
|
-
}
|
|
2278
|
+
this._debugPopBeforeEndOfEncoder();
|
|
2284
2279
|
this._commandBuffers[0] = this._uploadEncoder.finish();
|
|
2285
2280
|
this._commandBuffers[1] = this._renderEncoder.finish();
|
|
2286
2281
|
this._device.queue.submit(this._commandBuffers);
|
|
2287
2282
|
const frameCounter = this._internalFrameCounter++;
|
|
2288
|
-
|
|
2289
|
-
this.
|
|
2283
|
+
// If flushFramebuffer is called from endFrame, it means the encoders are created for the next frame, but because frameId is not yet incremented at the time of the call, we use frameId + 1
|
|
2284
|
+
this._uploadEncoderDescriptor.label = `[${_fromEndFrame ? this.frameId + 1 : this.frameId}|${frameCounter}] - UploadEncoder`;
|
|
2285
|
+
this._renderEncoderDescriptor.label = `[${_fromEndFrame ? this.frameId + 1 : this.frameId}|${frameCounter}] - RenderEncoder`;
|
|
2290
2286
|
this._uploadEncoder = this._device.createCommandEncoder(this._uploadEncoderDescriptor);
|
|
2291
2287
|
this._renderEncoder = this._device.createCommandEncoder(this._renderEncoderDescriptor);
|
|
2292
|
-
|
|
2288
|
+
if (_fromEndFrame) {
|
|
2289
|
+
this._debugMarkersEncoderGroups.length = 0;
|
|
2290
|
+
this._debugMarkersPassGroups.length = 0;
|
|
2291
|
+
}
|
|
2292
|
+
else {
|
|
2293
|
+
this._debugPushAfterStartOfEncoder();
|
|
2294
|
+
}
|
|
2293
2295
|
this._timestampQuery.startFrame(this._uploadEncoder);
|
|
2294
2296
|
this._textureHelper.setCommandEncoder(this._uploadEncoder);
|
|
2295
2297
|
this._bundleList.reset();
|
|
@@ -2437,7 +2439,7 @@ export class WebGPUEngine extends ThinWebGPUEngine {
|
|
|
2437
2439
|
};
|
|
2438
2440
|
this._timestampQuery.startPass(this._rttRenderPassWrapper.renderPassDescriptor, this._timestampIndex);
|
|
2439
2441
|
this._currentRenderPass = this._renderEncoder.beginRenderPass(this._rttRenderPassWrapper.renderPassDescriptor);
|
|
2440
|
-
this.
|
|
2442
|
+
this._debugPushAfterStartOfEncoder();
|
|
2441
2443
|
this._resetRenderPassStates();
|
|
2442
2444
|
if (!gpuDepthStencilWrapper || !WebGPUTextureHelper.HasStencilAspect(gpuDepthStencilWrapper.format)) {
|
|
2443
2445
|
this._stencilStateComposer.enabled = false;
|
|
@@ -2481,7 +2483,7 @@ export class WebGPUEngine extends ThinWebGPUEngine {
|
|
|
2481
2483
|
}
|
|
2482
2484
|
this._timestampQuery.startPass(this._mainRenderPassWrapper.renderPassDescriptor, this._timestampIndex);
|
|
2483
2485
|
this._currentRenderPass = this._renderEncoder.beginRenderPass(this._mainRenderPassWrapper.renderPassDescriptor);
|
|
2484
|
-
this.
|
|
2486
|
+
this._debugPushAfterStartOfEncoder();
|
|
2485
2487
|
this._setDepthTextureFormat(this._mainRenderPassWrapper);
|
|
2486
2488
|
this._setColorFormat(this._mainRenderPassWrapper);
|
|
2487
2489
|
this._resetRenderPassStates();
|