55969a0ee60f9f8e1d6b152f763bc1b519824d5a7dc8aef1387e5c67a2ff18e6.json 9.4 KB

1
  1. {"ast":null,"code":"import { WebGPUEngine } from \"../../webgpuEngine.js\";\nWebGPUEngine.prototype._debugPushGroup = function (groupName, targetObject) {\n if (!this._options.enableGPUDebugMarkers) {\n return;\n }\n if (targetObject === 0 || targetObject === 1) {\n if (targetObject === 1) {\n if (this._currentRenderTarget) {\n this.unBindFramebuffer(this._currentRenderTarget);\n } else {\n this._endCurrentRenderPass();\n }\n }\n this._renderEncoder.pushDebugGroup(groupName);\n } else if (this._currentRenderPass) {\n this._currentRenderPass.pushDebugGroup(groupName);\n this._debugStackRenderPass.push(groupName);\n } else {\n this._pendingDebugCommands.push([\"push\", groupName, targetObject]);\n }\n};\nWebGPUEngine.prototype._debugPopGroup = function (targetObject) {\n if (!this._options.enableGPUDebugMarkers) {\n return;\n }\n if (targetObject === 0 || targetObject === 1) {\n if (targetObject === 1) {\n if (this._currentRenderTarget) {\n this.unBindFramebuffer(this._currentRenderTarget);\n } else {\n this._endCurrentRenderPass();\n }\n }\n this._renderEncoder.popDebugGroup();\n } else if (this._currentRenderPass) {\n this._currentRenderPass.popDebugGroup();\n this._debugStackRenderPass.pop();\n } else {\n this._pendingDebugCommands.push([\"pop\", null, targetObject]);\n }\n};\nWebGPUEngine.prototype._debugInsertMarker = function (text, targetObject) {\n if (!this._options.enableGPUDebugMarkers) {\n return;\n }\n if (targetObject === 0 || targetObject === 1) {\n if (targetObject === 1) {\n if (this._currentRenderTarget) {\n this.unBindFramebuffer(this._currentRenderTarget);\n } else {\n this._endCurrentRenderPass();\n }\n }\n this._renderEncoder.insertDebugMarker(text);\n } else if (this._currentRenderPass) {\n this._currentRenderPass.insertDebugMarker(text);\n } else {\n this._pendingDebugCommands.push([\"insert\", text, targetObject]);\n }\n};\nWebGPUEngine.prototype._debugFlushPendingCommands = function () {\n if (this._debugStackRenderPass.length !== 0) {\n const currentDebugStack = this._debugStackRenderPass.slice();\n this._debugStackRenderPass.length = 0;\n for (let i = 0; i < currentDebugStack.length; ++i) {\n this._debugPushGroup(currentDebugStack[i], 2);\n }\n }\n for (let i = 0; i < this._pendingDebugCommands.length; ++i) {\n const [name, param, targetObject] = this._pendingDebugCommands[i];\n switch (name) {\n case \"push\":\n this._debugPushGroup(param, targetObject);\n break;\n case \"pop\":\n this._debugPopGroup(targetObject);\n break;\n case \"insert\":\n this._debugInsertMarker(param, targetObject);\n break;\n }\n }\n this._pendingDebugCommands.length = 0;\n};","map":{"version":3,"names":["WebGPUEngine","prototype","_debugPushGroup","groupName","targetObject","_options","enableGPUDebugMarkers","_currentRenderTarget","unBindFramebuffer","_endCurrentRenderPass","_renderEncoder","pushDebugGroup","_currentRenderPass","_debugStackRenderPass","push","_pendingDebugCommands","_debugPopGroup","popDebugGroup","pop","_debugInsertMarker","text","insertDebugMarker","_debugFlushPendingCommands","length","currentDebugStack","slice","i","name","param"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.debugging.js"],"sourcesContent":["import { WebGPUEngine } from \"../../webgpuEngine.js\";\nWebGPUEngine.prototype._debugPushGroup = function (groupName, targetObject) {\n if (!this._options.enableGPUDebugMarkers) {\n return;\n }\n if (targetObject === 0 || targetObject === 1) {\n if (targetObject === 1) {\n if (this._currentRenderTarget) {\n this.unBindFramebuffer(this._currentRenderTarget);\n }\n else {\n this._endCurrentRenderPass();\n }\n }\n this._renderEncoder.pushDebugGroup(groupName);\n }\n else if (this._currentRenderPass) {\n this._currentRenderPass.pushDebugGroup(groupName);\n this._debugStackRenderPass.push(groupName);\n }\n else {\n this._pendingDebugCommands.push([\"push\", groupName, targetObject]);\n }\n};\nWebGPUEngine.prototype._debugPopGroup = function (targetObject) {\n if (!this._options.enableGPUDebugMarkers) {\n return;\n }\n if (targetObject === 0 || targetObject === 1) {\n if (targetObject === 1) {\n if (this._currentRenderTarget) {\n this.unBindFramebuffer(this._currentRenderTarget);\n }\n else {\n this._endCurrentRenderPass();\n }\n }\n this._renderEncoder.popDebugGroup();\n }\n else if (this._currentRenderPass) {\n this._currentRenderPass.popDebugGroup();\n this._debugStackRenderPass.pop();\n }\n else {\n this._pendingDebugCommands.push([\"pop\", null, targetObject]);\n }\n};\nWebGPUEngine.prototype._debugInsertMarker = function (text, targetObject) {\n if (!this._options.enableGPUDebugMarkers) {\n return;\n }\n if (targetObject === 0 || targetObject === 1) {\n if (targetObject === 1) {\n if (this._currentRenderTarget) {\n this.unBindFramebuffer(this._currentRenderTarget);\n }\n else {\n this._endCurrentRenderPass();\n }\n }\n this._renderEncoder.insertDebugMarker(text);\n }\n else if (this._currentRenderPass) {\n this._currentRenderPass.insertDebugMarker(text);\n }\n else {\n this._pendingDebugCommands.push([\"insert\", text, targetObject]);\n }\n};\nWebGPUEngine.prototype._debugFlushPendingCommands = function () {\n if (this._debugStackRenderPass.length !== 0) {\n const currentDebugStack = this._debugStackRenderPass.slice();\n this._debugStackRenderPass.length = 0;\n for (let i = 0; i < currentDebugStack.length; ++i) {\n this._debugPushGroup(currentDebugStack[i], 2);\n }\n }\n for (let i = 0; i < this._pendingDebugCommands.length; ++i) {\n const [name, param, targetObject] = this._pendingDebugCommands[i];\n switch (name) {\n case \"push\":\n this._debugPushGroup(param, targetObject);\n break;\n case \"pop\":\n this._debugPopGroup(targetObject);\n break;\n case \"insert\":\n this._debugInsertMarker(param, targetObject);\n break;\n }\n }\n this._pendingDebugCommands.length = 0;\n};\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,uBAAuB;AACpDA,YAAY,CAACC,SAAS,CAACC,eAAe,GAAG,UAAUC,SAAS,EAAEC,YAAY,EAAE;EACxE,IAAI,CAAC,IAAI,CAACC,QAAQ,CAACC,qBAAqB,EAAE;IACtC;EACJ;EACA,IAAIF,YAAY,KAAK,CAAC,IAAIA,YAAY,KAAK,CAAC,EAAE;IAC1C,IAAIA,YAAY,KAAK,CAAC,EAAE;MACpB,IAAI,IAAI,CAACG,oBAA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