@babylonjs/core 7.6.1 → 7.7.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/Animations/animation.js +7 -5
- package/Animations/animation.js.map +1 -1
- package/Debug/debugLayer.d.ts +4 -0
- package/Debug/debugLayer.js.map +1 -1
- package/Engines/Native/nativeInterfaces.d.ts +2 -0
- package/Engines/Native/nativeInterfaces.js.map +1 -1
- package/Engines/Processors/iShaderProcessor.d.ts +3 -1
- package/Engines/Processors/iShaderProcessor.js.map +1 -1
- package/Engines/Processors/shaderProcessor.js +2 -2
- package/Engines/Processors/shaderProcessor.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js +1 -2
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessor.d.ts +0 -1
- package/Engines/WebGPU/webgpuShaderProcessor.js +0 -1
- package/Engines/WebGPU/webgpuShaderProcessor.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js +2 -1
- package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.d.ts +10 -1
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +45 -15
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/constants.d.ts +4 -0
- package/Engines/constants.js +4 -0
- package/Engines/constants.js.map +1 -1
- package/Engines/engine.common.js +2 -2
- package/Engines/engine.common.js.map +1 -1
- package/Engines/nativeEngine.d.ts +7 -2
- package/Engines/nativeEngine.js +25 -3
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/webgpuEngine.js +5 -9
- package/Engines/webgpuEngine.js.map +1 -1
- package/Lights/Shadows/cascadedShadowGenerator.js +4 -4
- package/Lights/Shadows/cascadedShadowGenerator.js.map +1 -1
- package/Lights/Shadows/shadowGenerator.js +11 -5
- package/Lights/Shadows/shadowGenerator.js.map +1 -1
- package/Lights/spotLight.js +1 -1
- package/Lights/spotLight.js.map +1 -1
- package/Materials/Node/Blocks/Dual/fogBlock.js +20 -3
- 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/Dual/lightBlock.d.ts +1 -0
- package/Materials/Node/Blocks/Dual/lightBlock.js +35 -27
- package/Materials/Node/Blocks/Dual/lightBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/textureBlock.d.ts +0 -1
- package/Materials/Node/Blocks/Dual/textureBlock.js +5 -18
- package/Materials/Node/Blocks/Dual/textureBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/discardBlock.js +1 -1
- package/Materials/Node/Blocks/Fragment/discardBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/fragCoordBlock.js +3 -1
- package/Materials/Node/Blocks/Fragment/fragCoordBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/fragDepthBlock.js +6 -4
- package/Materials/Node/Blocks/Fragment/fragDepthBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/frontFacingBlock.js +4 -1
- package/Materials/Node/Blocks/Fragment/frontFacingBlock.js.map +1 -1
- package/Materials/Node/Blocks/Input/inputBlock.js +1 -1
- package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/instancesBlock.js +11 -2
- package/Materials/Node/Blocks/Vertex/instancesBlock.js.map +1 -1
- package/Materials/Node/Blocks/biPlanarBlock.d.ts +2 -0
- package/Materials/Node/Blocks/biPlanarBlock.js +48 -23
- package/Materials/Node/Blocks/biPlanarBlock.js.map +1 -1
- package/Materials/Node/Blocks/clampBlock.js +4 -1
- package/Materials/Node/Blocks/clampBlock.js.map +1 -1
- package/Materials/Node/Blocks/cloudBlock.js +32 -17
- package/Materials/Node/Blocks/cloudBlock.js.map +1 -1
- package/Materials/Node/Blocks/conditionalBlock.js +9 -9
- package/Materials/Node/Blocks/conditionalBlock.js.map +1 -1
- package/Materials/Node/Blocks/curveBlock.js +12 -12
- package/Materials/Node/Blocks/curveBlock.js.map +1 -1
- package/Materials/Node/Blocks/matrixBuilderBlock.js +3 -1
- package/Materials/Node/Blocks/matrixBuilderBlock.js.map +1 -1
- package/Materials/Node/Blocks/matrixTransposeBlock.js +1 -1
- package/Materials/Node/Blocks/matrixTransposeBlock.js.map +1 -1
- package/Materials/Node/Blocks/normalBlendBlock.js +2 -2
- package/Materials/Node/Blocks/normalBlendBlock.js.map +1 -1
- package/Materials/Node/Blocks/simplexPerlin3DBlock.js +14 -6
- package/Materials/Node/Blocks/simplexPerlin3DBlock.js.map +1 -1
- package/Materials/Node/Blocks/transformBlock.js +1 -1
- package/Materials/Node/Blocks/transformBlock.js.map +1 -1
- package/Materials/Node/Blocks/triPlanarBlock.d.ts +2 -0
- package/Materials/Node/Blocks/triPlanarBlock.js +33 -14
- package/Materials/Node/Blocks/triPlanarBlock.js.map +1 -1
- package/Materials/Node/Blocks/worleyNoise3DBlock.js +17 -8
- package/Materials/Node/Blocks/worleyNoise3DBlock.js.map +1 -1
- package/Materials/Node/nodeMaterial.d.ts +2 -0
- package/Materials/Node/nodeMaterial.js +6 -18
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/Node/nodeMaterialBuildState.d.ts +10 -5
- package/Materials/Node/nodeMaterialBuildState.js +45 -18
- package/Materials/Node/nodeMaterialBuildState.js.map +1 -1
- package/Materials/materialHelper.functions.js +3 -3
- package/Materials/materialHelper.functions.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +8 -2
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
- package/Meshes/mesh.js +7 -7
- package/Meshes/mesh.js.map +1 -1
- package/Physics/v2/Plugins/havokPlugin.js +12 -4
- package/Physics/v2/Plugins/havokPlugin.js.map +1 -1
- package/Shaders/ShadersInclude/lightFragment.js +29 -29
- package/Shaders/ShadersInclude/lightFragment.js.map +1 -1
- package/Shaders/ShadersInclude/lightFragmentDeclaration.js +8 -8
- package/Shaders/ShadersInclude/lightFragmentDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/lightUboDeclaration.js +8 -8
- package/Shaders/ShadersInclude/lightUboDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/shadowsFragmentFunctions.js +1 -1
- package/Shaders/ShadersInclude/shadowsFragmentFunctions.js.map +1 -1
- package/Shaders/fluidRenderingRender.fragment.js +1 -1
- package/Shaders/fluidRenderingRender.fragment.js.map +1 -1
- package/Shaders/gaussianSplatting.vertex.js +2 -2
- package/Shaders/gaussianSplatting.vertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/fogFragmentDeclaration.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/fogFragmentDeclaration.js +24 -0
- package/ShadersWGSL/ShadersInclude/fogFragmentDeclaration.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/lightFragment.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/lightFragment.js +279 -0
- package/ShadersWGSL/ShadersInclude/lightFragment.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/lightUboDeclaration.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/lightUboDeclaration.js +70 -0
- package/ShadersWGSL/ShadersInclude/lightUboDeclaration.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/lightVxUboDeclaration.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/lightVxUboDeclaration.js +33 -0
- package/ShadersWGSL/ShadersInclude/lightVxUboDeclaration.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js +57 -0
- package/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/morphTargetsVertex.js +1 -1
- package/ShadersWGSL/ShadersInclude/morphTargetsVertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/shadowsFragmentFunctions.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/shadowsFragmentFunctions.js +307 -0
- package/ShadersWGSL/ShadersInclude/shadowsFragmentFunctions.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/shadowsVertex.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/shadowsVertex.js +53 -0
- package/ShadersWGSL/ShadersInclude/shadowsVertex.js.map +1 -0
- package/package.json +1 -1
package/Debug/debugLayer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debugLayer.js","sourceRoot":"","sources":["../../../../dev/core/src/Debug/debugLayer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AA4KrD,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,SAAS,EAAE,YAAY,EAAE;IACjD,GAAG,EAAE;QACD,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;YACnB,IAAI,CAAC,WAAW,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC;SAC3C;QACD,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;IACD,UAAU,EAAE,IAAI;IAChB,YAAY,EAAE,IAAI;CACrB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAN,IAAY,aAqBX;AArBD,WAAY,aAAa;IACrB;;OAEG;IACH,6DAAc,CAAA;IACd;;OAEG;IACH,mDAAS,CAAA;IACT;;OAEG;IACH,6DAAc,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CAAC,CAAC,CAAC,UAAU,CAAC,YAAY,CAAC;gBAEnG,uCAAuC;gBACvC,KAAK,CAAC,iBAAiB,CAAC,YAAY,EAAE,GAAG,EAAE;oBACvC,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;oBAC9B,OAAO,CAAC,IAAI,CAAC,CAAC;gBAClB,CAAC,CAAC,CAAC;aACN;iBAAM;gBACH,kCAAkC;gBAClC,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;gBAC9B,OAAO,CAAC,IAAI,CAAC,CAAC;aACjB;QACL,CAAC,CAAC,CAAC;IACP,CAAC;;AAlMD;;;;GAIG;AACW,uBAAY,GAAG,GAAG,KAAK,CAAC,cAAc,KAAK,MAAM,CAAC,OAAO,wCAAwC,AAArF,CAAsF;AAEhH;;GAEG;AACW,iBAAM,GAAsB;IACtC,OAAO,EAAE,KAAK;IACd,YAAY,EAAE,IAAI;IAClB,aAAa,EAAE,IAAI;IACnB,SAAS,EAAE,KAAK;IAChB,YAAY,EAAE,IAAI;IAClB,WAAW,EAAE,IAAI;CACpB,AAPmB,CAOlB","sourcesContent":["import { Tools } from \"../Misc/tools\";\r\nimport { Observable } from \"../Misc/observable\";\r\nimport { Scene } from \"../scene\";\r\nimport { Engine } from \"../Engines/engine\";\r\nimport { EngineStore } from \"../Engines/engineStore\";\r\nimport type { IInspectable } from \"../Misc/iInspectable\";\r\nimport type { Camera } from \"../Cameras/camera\";\r\n\r\n// declare INSPECTOR namespace for compilation issue\r\ndeclare let INSPECTOR: any;\r\ndeclare let BABYLON: any;\r\n// load the inspector using require, if not present in the global namespace.\r\n\r\n/**\r\n * Interface used to define scene explorer extensibility option\r\n */\r\nexport interface IExplorerExtensibilityOption {\r\n /**\r\n * Define the option label\r\n */\r\n label: string;\r\n /**\r\n * Defines the action to execute on click\r\n */\r\n action: (entity: any) => void;\r\n /**\r\n * Keep popup open after click\r\n */\r\n keepOpenAfterClick?: boolean;\r\n}\r\n\r\n/**\r\n * Defines a group of actions associated with a predicate to use when extending the Inspector scene explorer\r\n */\r\nexport interface IExplorerExtensibilityGroup {\r\n /**\r\n * Defines a predicate to test if a given type mut be extended\r\n */\r\n predicate: (entity: any) => boolean;\r\n /**\r\n * Gets the list of options added to a type\r\n */\r\n entries: IExplorerExtensibilityOption[];\r\n}\r\n\r\n/**\r\n * Defines a new node that will be displayed as top level node in the explorer\r\n */\r\nexport interface IExplorerAdditionalChild {\r\n /**\r\n * Gets the name of the additional node\r\n */\r\n name: string;\r\n /**\r\n * Function used to return the class name of the child node\r\n */\r\n getClassName(): string;\r\n /**\r\n * List of inspectable custom properties (used by the Inspector)\r\n * @see https://doc.babylonjs.com/toolsAndResources/inspector#extensibility\r\n */\r\n inspectableCustomProperties: IInspectable[];\r\n}\r\n\r\n/**\r\n * Defines a new node that will be displayed as top level node in the explorer\r\n */\r\nexport interface IExplorerAdditionalNode {\r\n /**\r\n * Gets the name of the additional node\r\n */\r\n name: string;\r\n /**\r\n * Function used to return the list of child entries\r\n */\r\n getContent(): IExplorerAdditionalChild[];\r\n}\r\n\r\nexport type IInspectorContextMenuType = \"pipeline\" | \"node\" | \"materials\" | \"spriteManagers\" | \"particleSystems\";\r\n\r\n/**\r\n * Context menu item\r\n */\r\nexport interface IInspectorContextMenuItem {\r\n /**\r\n * Display label - menu item\r\n */\r\n label: string;\r\n /**\r\n * Callback function that will be called when the menu item is selected\r\n * @param entity the entity that is currently selected in the scene explorer\r\n */\r\n action: (entity?: unknown) => void;\r\n}\r\n\r\n/**\r\n * Interface used to define the options to use to create the Inspector\r\n */\r\nexport interface IInspectorOptions {\r\n /**\r\n * Display in overlay mode (default: false)\r\n */\r\n overlay?: boolean;\r\n /**\r\n * HTML element to use as root (the parent of the rendering canvas will be used as default value)\r\n */\r\n globalRoot?: HTMLElement;\r\n /**\r\n * Display the Scene explorer\r\n */\r\n showExplorer?: boolean;\r\n /**\r\n * Display the property inspector\r\n */\r\n showInspector?: boolean;\r\n /**\r\n * Display in embed mode (both panes on the right)\r\n */\r\n embedMode?: boolean;\r\n /**\r\n * let the Inspector handles resize of the canvas when panes are resized (default to true)\r\n */\r\n handleResize?: boolean;\r\n /**\r\n * Allow the panes to popup (default: true)\r\n */\r\n enablePopup?: boolean;\r\n /**\r\n * Allow the panes to be closed by users (default: true)\r\n */\r\n enableClose?: boolean;\r\n /**\r\n * Optional list of extensibility entries\r\n */\r\n explorerExtensibility?: IExplorerExtensibilityGroup[];\r\n /**\r\n * Optional list of additional top level nodes\r\n */\r\n additionalNodes?: IExplorerAdditionalNode[];\r\n /**\r\n * Optional URL to get the inspector script from (by default it uses the babylonjs CDN).\r\n */\r\n inspectorURL?: string;\r\n /**\r\n * Optional initial tab (default to DebugLayerTab.Properties)\r\n */\r\n initialTab?: DebugLayerTab;\r\n /**\r\n * Optional camera to use to render the gizmos from the inspector (default to the scene.activeCamera or the latest from scene.activeCameras)\r\n */\r\n gizmoCamera?: Camera;\r\n /**\r\n * Context menu for inspector tools such as \"Post Process\", \"Nodes\", \"Materials\", etc.\r\n */\r\n contextMenu?: Partial<Record<IInspectorContextMenuType, IInspectorContextMenuItem[]>>;\r\n /**\r\n * List of context menu items that should be completely overridden by custom items from the contextMenu property.\r\n */\r\n contextMenuOverride?: IInspectorContextMenuType[];\r\n}\r\n\r\ndeclare module \"../scene\" {\r\n export interface Scene {\r\n /**\r\n * @internal\r\n * Backing field\r\n */\r\n _debugLayer: DebugLayer;\r\n\r\n /**\r\n * Gets the debug layer (aka Inspector) associated with the scene\r\n * @see https://doc.babylonjs.com/toolsAndResources/inspector\r\n */\r\n debugLayer: DebugLayer;\r\n }\r\n}\r\nObject.defineProperty(Scene.prototype, \"debugLayer\", {\r\n get: function (this: Scene) {\r\n if (!this._debugLayer) {\r\n this._debugLayer = new DebugLayer(this);\r\n }\r\n return this._debugLayer;\r\n },\r\n enumerable: true,\r\n configurable: true,\r\n});\r\n\r\n/**\r\n * Enum of inspector action tab\r\n */\r\nexport enum DebugLayerTab {\r\n /**\r\n * Properties tag (default)\r\n */\r\n Properties = 0,\r\n /**\r\n * Debug tab\r\n */\r\n Debug = 1,\r\n /**\r\n * Statistics tab\r\n */\r\n Statistics = 2,\r\n /**\r\n * Tools tab\r\n */\r\n Tools = 3,\r\n /**\r\n * Settings tab\r\n */\r\n Settings = 4,\r\n}\r\n\r\n/**\r\n * The debug layer (aka Inspector) is the go to tool in order to better understand\r\n * what is happening in your scene\r\n * @see https://doc.babylonjs.com/toolsAndResources/inspector\r\n */\r\nexport class DebugLayer {\r\n /**\r\n * Define the url to get the inspector script from.\r\n * By default it uses the babylonjs CDN.\r\n * @ignoreNaming\r\n */\r\n public static InspectorURL = `${Tools._DefaultCdnUrl}/v${Engine.Version}/inspector/babylon.inspector.bundle.js`;\r\n\r\n /**\r\n * The default configuration of the inspector\r\n */\r\n public static Config: IInspectorOptions = {\r\n overlay: false,\r\n showExplorer: true,\r\n showInspector: true,\r\n embedMode: false,\r\n handleResize: true,\r\n enablePopup: true,\r\n };\r\n\r\n private _scene: Scene;\r\n\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private BJSINSPECTOR = this._getGlobalInspector();\r\n\r\n private _onPropertyChangedObservable?: Observable<{ object: any; property: string; value: any; initialValue: any }>;\r\n /**\r\n * Observable triggered when a property is changed through the inspector.\r\n */\r\n public get onPropertyChangedObservable() {\r\n if (this.BJSINSPECTOR && this.BJSINSPECTOR.Inspector) {\r\n return this.BJSINSPECTOR.Inspector.OnPropertyChangedObservable;\r\n }\r\n\r\n if (!this._onPropertyChangedObservable) {\r\n this._onPropertyChangedObservable = new Observable<{ object: any; property: string; value: any; initialValue: any }>();\r\n }\r\n\r\n return this._onPropertyChangedObservable;\r\n }\r\n\r\n private _onSelectionChangedObservable?: Observable<any>;\r\n /**\r\n * Observable triggered when the selection is changed through the inspector.\r\n */\r\n public get onSelectionChangedObservable() {\r\n if (this.BJSINSPECTOR && this.BJSINSPECTOR.Inspector) {\r\n return this.BJSINSPECTOR.Inspector.OnSelectionChangeObservable;\r\n }\r\n\r\n if (!this._onSelectionChangedObservable) {\r\n this._onSelectionChangedObservable = new Observable<any>();\r\n }\r\n\r\n return this._onSelectionChangedObservable;\r\n }\r\n\r\n /**\r\n * Instantiates a new debug layer.\r\n * The debug layer (aka Inspector) is the go to tool in order to better understand\r\n * what is happening in your scene\r\n * @see https://doc.babylonjs.com/toolsAndResources/inspector\r\n * @param scene Defines the scene to inspect\r\n */\r\n constructor(scene?: Scene) {\r\n this._scene = scene || <Scene>EngineStore.LastCreatedScene;\r\n if (!this._scene) {\r\n return;\r\n }\r\n this._scene.onDisposeObservable.add(() => {\r\n // Debug layer\r\n if (this._scene._debugLayer) {\r\n this._scene._debugLayer.hide();\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Creates the inspector window.\r\n * @param config\r\n */\r\n private _createInspector(config?: Partial<IInspectorOptions>) {\r\n if (this.isVisible()) {\r\n return;\r\n }\r\n\r\n if (this._onPropertyChangedObservable) {\r\n for (const observer of this._onPropertyChangedObservable!.observers) {\r\n this.BJSINSPECTOR.Inspector.OnPropertyChangedObservable.add(observer);\r\n }\r\n this._onPropertyChangedObservable.clear();\r\n this._onPropertyChangedObservable = undefined;\r\n }\r\n\r\n if (this._onSelectionChangedObservable) {\r\n for (const observer of this._onSelectionChangedObservable!.observers) {\r\n this.BJSINSPECTOR.Inspector.OnSelectionChangedObservable.add(observer);\r\n }\r\n this._onSelectionChangedObservable.clear();\r\n this._onSelectionChangedObservable = undefined;\r\n }\r\n\r\n const userOptions: IInspectorOptions = {\r\n ...DebugLayer.Config,\r\n ...config,\r\n };\r\n\r\n this.BJSINSPECTOR = this.BJSINSPECTOR || this._getGlobalInspector();\r\n\r\n this.BJSINSPECTOR.Inspector.Show(this._scene, userOptions);\r\n }\r\n\r\n /**\r\n * Select a specific entity in the scene explorer and highlight a specific block in that entity property grid\r\n * @param entity defines the entity to select\r\n * @param lineContainerTitles defines the specific blocks to highlight (could be a string or an array of strings)\r\n */\r\n public select(entity: any, lineContainerTitles?: string | string[]) {\r\n if (this.BJSINSPECTOR) {\r\n if (lineContainerTitles) {\r\n if (Object.prototype.toString.call(lineContainerTitles) == \"[object String]\") {\r\n this.BJSINSPECTOR.Inspector.MarkLineContainerTitleForHighlighting(lineContainerTitles);\r\n } else {\r\n this.BJSINSPECTOR.Inspector.MarkMultipleLineContainerTitlesForHighlighting(lineContainerTitles);\r\n }\r\n }\r\n this.BJSINSPECTOR.Inspector.OnSelectionChangeObservable.notifyObservers(entity);\r\n }\r\n }\r\n\r\n /**\r\n * Get the inspector from bundle or global\r\n * @returns the inspector instance if found otherwise, null\r\n */\r\n private _getGlobalInspector(): any {\r\n // UMD Global name detection from Webpack Bundle UMD Name.\r\n if (typeof INSPECTOR !== \"undefined\") {\r\n return INSPECTOR;\r\n }\r\n\r\n // In case of module let s check the global emitted from the Inspector entry point.\r\n if (typeof BABYLON !== \"undefined\" && typeof BABYLON.Inspector !== \"undefined\") {\r\n return BABYLON;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Get if the inspector is visible or not.\r\n * @returns true if visible otherwise, false\r\n */\r\n public isVisible(): boolean {\r\n return this.BJSINSPECTOR && this.BJSINSPECTOR.Inspector.IsVisible;\r\n }\r\n\r\n /**\r\n * Hide the inspector and close its window.\r\n */\r\n public hide() {\r\n if (this.BJSINSPECTOR) {\r\n this.BJSINSPECTOR.Inspector.Hide();\r\n }\r\n }\r\n\r\n /**\r\n * Update the scene in the inspector\r\n */\r\n public setAsActiveScene() {\r\n if (this.BJSINSPECTOR) {\r\n this.BJSINSPECTOR.Inspector._SetNewScene(this._scene);\r\n }\r\n }\r\n\r\n /**\r\n * Launch the debugLayer.\r\n * @param config Define the configuration of the inspector\r\n * @returns a promise fulfilled when the debug layer is visible\r\n */\r\n public show(config?: IInspectorOptions): Promise<DebugLayer> {\r\n return new Promise((resolve) => {\r\n if (typeof this.BJSINSPECTOR == \"undefined\") {\r\n const inspectorUrl = config && config.inspectorURL ? config.inspectorURL : DebugLayer.InspectorURL;\r\n\r\n // Load inspector and add it to the DOM\r\n Tools.LoadBabylonScript(inspectorUrl, () => {\r\n this._createInspector(config);\r\n resolve(this);\r\n });\r\n } else {\r\n // Otherwise creates the inspector\r\n this._createInspector(config);\r\n resolve(this);\r\n }\r\n });\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"debugLayer.js","sourceRoot":"","sources":["../../../../dev/core/src/Debug/debugLayer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAiLrD,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,SAAS,EAAE,YAAY,EAAE;IACjD,GAAG,EAAE;QACD,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;YACnB,IAAI,CAAC,WAAW,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC;SAC3C;QACD,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;IACD,UAAU,EAAE,IAAI;IAChB,YAAY,EAAE,IAAI;CACrB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAN,IAAY,aAqBX;AArBD,WAAY,aAAa;IACrB;;OAEG;IACH,6DAAc,CAAA;IACd;;OAEG;IACH,mDAAS,CAAA;IACT;;OAEG;IACH,6DAAc,CAAA;IACd;;OAEG;IACH,mDAAS,CAAA;IACT;;OAEG;IACH,yDAAY,CAAA;AAChB,CAAC,EArBW,aAAa,KAAb,aAAa,QAqBxB;AAED;;;;GAIG;AACH,MAAM,OAAO,UAAU;IA0BnB;;OAEG;IACH,IAAW,2BAA2B;QAClC,IAAI,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC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C;aACN;iBAAM;gBACH,kCAAkC;gBAClC,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;gBAC9B,OAAO,CAAC,IAAI,CAAC,CAAC;aACjB;QACL,CAAC,CAAC,CAAC;IACP,CAAC;;AAlMD;;;;GAIG;AACW,uBAAY,GAAG,GAAG,KAAK,CAAC,cAAc,KAAK,MAAM,CAAC,OAAO,wCAAwC,AAArF,CAAsF;AAEhH;;GAEG;AACW,iBAAM,GAAsB;IACtC,OAAO,EAAE,KAAK;IACd,YAAY,EAAE,IAAI;IAClB,aAAa,EAAE,IAAI;IACnB,SAAS,EAAE,KAAK;IAChB,YAAY,EAAE,IAAI;IAClB,WAAW,EAAE,IAAI;CACpB,AAPmB,CAOlB","sourcesContent":["import { Tools } from \"../Misc/tools\";\r\nimport { Observable } from \"../Misc/observable\";\r\nimport { Scene } from \"../scene\";\r\nimport { Engine } from \"../Engines/engine\";\r\nimport { EngineStore } from \"../Engines/engineStore\";\r\nimport type { IInspectable } from \"../Misc/iInspectable\";\r\nimport type { Camera } from \"../Cameras/camera\";\r\n\r\n// declare INSPECTOR namespace for compilation issue\r\ndeclare let INSPECTOR: any;\r\ndeclare let BABYLON: any;\r\n// load the inspector using require, if not present in the global namespace.\r\n\r\n/**\r\n * Interface used to define scene explorer extensibility option\r\n */\r\nexport interface IExplorerExtensibilityOption {\r\n /**\r\n * Define the option label\r\n */\r\n label: string;\r\n /**\r\n * Defines the action to execute on click\r\n */\r\n action: (entity: any) => void;\r\n /**\r\n * Keep popup open after click\r\n */\r\n keepOpenAfterClick?: boolean;\r\n}\r\n\r\n/**\r\n * Defines a group of actions associated with a predicate to use when extending the Inspector scene explorer\r\n */\r\nexport interface IExplorerExtensibilityGroup {\r\n /**\r\n * Defines a predicate to test if a given type mut be extended\r\n */\r\n predicate: (entity: any) => boolean;\r\n /**\r\n * Gets the list of options added to a type\r\n */\r\n entries: IExplorerExtensibilityOption[];\r\n}\r\n\r\n/**\r\n * Defines a new node that will be displayed as top level node in the explorer\r\n */\r\nexport interface IExplorerAdditionalChild {\r\n /**\r\n * Gets the name of the additional node\r\n */\r\n name: string;\r\n /**\r\n * Function used to return the class name of the child node\r\n */\r\n getClassName(): string;\r\n /**\r\n * List of inspectable custom properties (used by the Inspector)\r\n * @see https://doc.babylonjs.com/toolsAndResources/inspector#extensibility\r\n */\r\n inspectableCustomProperties: IInspectable[];\r\n}\r\n\r\n/**\r\n * Defines a new node that will be displayed as top level node in the explorer\r\n */\r\nexport interface IExplorerAdditionalNode {\r\n /**\r\n * Gets the name of the additional node\r\n */\r\n name: string;\r\n /**\r\n * Function used to return the list of child entries\r\n */\r\n getContent(): IExplorerAdditionalChild[];\r\n}\r\n\r\nexport type IInspectorContextMenuType = \"pipeline\" | \"node\" | \"materials\" | \"spriteManagers\" | \"particleSystems\";\r\n\r\n/**\r\n * Context menu item\r\n */\r\nexport interface IInspectorContextMenuItem {\r\n /**\r\n * Display label - menu item\r\n */\r\n label: string;\r\n /**\r\n * Callback function that will be called when the menu item is selected\r\n * @param entity the entity that is currently selected in the scene explorer\r\n */\r\n action: (entity?: unknown) => void;\r\n}\r\n\r\n/**\r\n * Interface used to define the options to use to create the Inspector\r\n */\r\nexport interface IInspectorOptions {\r\n /**\r\n * Display in overlay mode (default: false)\r\n */\r\n overlay?: boolean;\r\n /**\r\n * HTML element to use as root (the parent of the rendering canvas will be used as default value)\r\n */\r\n globalRoot?: HTMLElement;\r\n /**\r\n * Display the Scene explorer\r\n */\r\n showExplorer?: boolean;\r\n /**\r\n * Display the property inspector\r\n */\r\n showInspector?: boolean;\r\n /**\r\n * Display in embed mode (both panes on the right)\r\n */\r\n embedMode?: boolean;\r\n /**\r\n * let the Inspector handles resize of the canvas when panes are resized (default to true)\r\n */\r\n handleResize?: boolean;\r\n /**\r\n * Allow the panes to popup (default: true)\r\n */\r\n enablePopup?: boolean;\r\n /**\r\n * Allow the panes to be closed by users (default: true)\r\n */\r\n enableClose?: boolean;\r\n /**\r\n * Optional list of extensibility entries\r\n */\r\n explorerExtensibility?: IExplorerExtensibilityGroup[];\r\n /**\r\n * Optional list of additional top level nodes\r\n */\r\n additionalNodes?: IExplorerAdditionalNode[];\r\n /**\r\n * Optional URL to get the inspector script from (by default it uses the babylonjs CDN).\r\n */\r\n inspectorURL?: string;\r\n /**\r\n * Optional initial tab (default to DebugLayerTab.Properties)\r\n */\r\n initialTab?: DebugLayerTab;\r\n /**\r\n * Optional camera to use to render the gizmos from the inspector (default to the scene.activeCamera or the latest from scene.activeCameras)\r\n */\r\n gizmoCamera?: Camera;\r\n /**\r\n * Context menu for inspector tools such as \"Post Process\", \"Nodes\", \"Materials\", etc.\r\n */\r\n contextMenu?: Partial<Record<IInspectorContextMenuType, IInspectorContextMenuItem[]>>;\r\n /**\r\n * List of context menu items that should be completely overridden by custom items from the contextMenu property.\r\n */\r\n contextMenuOverride?: IInspectorContextMenuType[];\r\n\r\n /**\r\n * Should the default font loading be skipped\r\n */\r\n skipDefaultFontLoading?: boolean;\r\n}\r\n\r\ndeclare module \"../scene\" {\r\n export interface Scene {\r\n /**\r\n * @internal\r\n * Backing field\r\n */\r\n _debugLayer: DebugLayer;\r\n\r\n /**\r\n * Gets the debug layer (aka Inspector) associated with the scene\r\n * @see https://doc.babylonjs.com/toolsAndResources/inspector\r\n */\r\n debugLayer: DebugLayer;\r\n }\r\n}\r\nObject.defineProperty(Scene.prototype, \"debugLayer\", {\r\n get: function (this: Scene) {\r\n if (!this._debugLayer) {\r\n this._debugLayer = new DebugLayer(this);\r\n }\r\n return this._debugLayer;\r\n },\r\n enumerable: true,\r\n configurable: true,\r\n});\r\n\r\n/**\r\n * Enum of inspector action tab\r\n */\r\nexport enum DebugLayerTab {\r\n /**\r\n * Properties tag (default)\r\n */\r\n Properties = 0,\r\n /**\r\n * Debug tab\r\n */\r\n Debug = 1,\r\n /**\r\n * Statistics tab\r\n */\r\n Statistics = 2,\r\n /**\r\n * Tools tab\r\n */\r\n Tools = 3,\r\n /**\r\n * Settings tab\r\n */\r\n Settings = 4,\r\n}\r\n\r\n/**\r\n * The debug layer (aka Inspector) is the go to tool in order to better understand\r\n * what is happening in your scene\r\n * @see https://doc.babylonjs.com/toolsAndResources/inspector\r\n */\r\nexport class DebugLayer {\r\n /**\r\n * Define the url to get the inspector script from.\r\n * By default it uses the babylonjs CDN.\r\n * @ignoreNaming\r\n */\r\n public static InspectorURL = `${Tools._DefaultCdnUrl}/v${Engine.Version}/inspector/babylon.inspector.bundle.js`;\r\n\r\n /**\r\n * The default configuration of the inspector\r\n */\r\n public static Config: IInspectorOptions = {\r\n overlay: false,\r\n showExplorer: true,\r\n showInspector: true,\r\n embedMode: false,\r\n handleResize: true,\r\n enablePopup: true,\r\n };\r\n\r\n private _scene: Scene;\r\n\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private BJSINSPECTOR = this._getGlobalInspector();\r\n\r\n private _onPropertyChangedObservable?: Observable<{ object: any; property: string; value: any; initialValue: any }>;\r\n /**\r\n * Observable triggered when a property is changed through the inspector.\r\n */\r\n public get onPropertyChangedObservable() {\r\n if (this.BJSINSPECTOR && this.BJSINSPECTOR.Inspector) {\r\n return this.BJSINSPECTOR.Inspector.OnPropertyChangedObservable;\r\n }\r\n\r\n if (!this._onPropertyChangedObservable) {\r\n this._onPropertyChangedObservable = new Observable<{ object: any; property: string; value: any; initialValue: any }>();\r\n }\r\n\r\n return this._onPropertyChangedObservable;\r\n }\r\n\r\n private _onSelectionChangedObservable?: Observable<any>;\r\n /**\r\n * Observable triggered when the selection is changed through the inspector.\r\n */\r\n public get onSelectionChangedObservable() {\r\n if (this.BJSINSPECTOR && this.BJSINSPECTOR.Inspector) {\r\n return this.BJSINSPECTOR.Inspector.OnSelectionChangeObservable;\r\n }\r\n\r\n if (!this._onSelectionChangedObservable) {\r\n this._onSelectionChangedObservable = new Observable<any>();\r\n }\r\n\r\n return this._onSelectionChangedObservable;\r\n }\r\n\r\n /**\r\n * Instantiates a new debug layer.\r\n * The debug layer (aka Inspector) is the go to tool in order to better understand\r\n * what is happening in your scene\r\n * @see https://doc.babylonjs.com/toolsAndResources/inspector\r\n * @param scene Defines the scene to inspect\r\n */\r\n constructor(scene?: Scene) {\r\n this._scene = scene || <Scene>EngineStore.LastCreatedScene;\r\n if (!this._scene) {\r\n return;\r\n }\r\n this._scene.onDisposeObservable.add(() => {\r\n // Debug layer\r\n if (this._scene._debugLayer) {\r\n this._scene._debugLayer.hide();\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Creates the inspector window.\r\n * @param config\r\n */\r\n private _createInspector(config?: Partial<IInspectorOptions>) {\r\n if (this.isVisible()) {\r\n return;\r\n }\r\n\r\n if (this._onPropertyChangedObservable) {\r\n for (const observer of this._onPropertyChangedObservable!.observers) {\r\n this.BJSINSPECTOR.Inspector.OnPropertyChangedObservable.add(observer);\r\n }\r\n this._onPropertyChangedObservable.clear();\r\n this._onPropertyChangedObservable = undefined;\r\n }\r\n\r\n if (this._onSelectionChangedObservable) {\r\n for (const observer of this._onSelectionChangedObservable!.observers) {\r\n this.BJSINSPECTOR.Inspector.OnSelectionChangedObservable.add(observer);\r\n }\r\n this._onSelectionChangedObservable.clear();\r\n this._onSelectionChangedObservable = undefined;\r\n }\r\n\r\n const userOptions: IInspectorOptions = {\r\n ...DebugLayer.Config,\r\n ...config,\r\n };\r\n\r\n this.BJSINSPECTOR = this.BJSINSPECTOR || this._getGlobalInspector();\r\n\r\n this.BJSINSPECTOR.Inspector.Show(this._scene, userOptions);\r\n }\r\n\r\n /**\r\n * Select a specific entity in the scene explorer and highlight a specific block in that entity property grid\r\n * @param entity defines the entity to select\r\n * @param lineContainerTitles defines the specific blocks to highlight (could be a string or an array of strings)\r\n */\r\n public select(entity: any, lineContainerTitles?: string | string[]) {\r\n if (this.BJSINSPECTOR) {\r\n if (lineContainerTitles) {\r\n if (Object.prototype.toString.call(lineContainerTitles) == \"[object String]\") {\r\n this.BJSINSPECTOR.Inspector.MarkLineContainerTitleForHighlighting(lineContainerTitles);\r\n } else {\r\n this.BJSINSPECTOR.Inspector.MarkMultipleLineContainerTitlesForHighlighting(lineContainerTitles);\r\n }\r\n }\r\n this.BJSINSPECTOR.Inspector.OnSelectionChangeObservable.notifyObservers(entity);\r\n }\r\n }\r\n\r\n /**\r\n * Get the inspector from bundle or global\r\n * @returns the inspector instance if found otherwise, null\r\n */\r\n private _getGlobalInspector(): any {\r\n // UMD Global name detection from Webpack Bundle UMD Name.\r\n if (typeof INSPECTOR !== \"undefined\") {\r\n return INSPECTOR;\r\n }\r\n\r\n // In case of module let s check the global emitted from the Inspector entry point.\r\n if (typeof BABYLON !== \"undefined\" && typeof BABYLON.Inspector !== \"undefined\") {\r\n return BABYLON;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Get if the inspector is visible or not.\r\n * @returns true if visible otherwise, false\r\n */\r\n public isVisible(): boolean {\r\n return this.BJSINSPECTOR && this.BJSINSPECTOR.Inspector.IsVisible;\r\n }\r\n\r\n /**\r\n * Hide the inspector and close its window.\r\n */\r\n public hide() {\r\n if (this.BJSINSPECTOR) {\r\n this.BJSINSPECTOR.Inspector.Hide();\r\n }\r\n }\r\n\r\n /**\r\n * Update the scene in the inspector\r\n */\r\n public setAsActiveScene() {\r\n if (this.BJSINSPECTOR) {\r\n this.BJSINSPECTOR.Inspector._SetNewScene(this._scene);\r\n }\r\n }\r\n\r\n /**\r\n * Launch the debugLayer.\r\n * @param config Define the configuration of the inspector\r\n * @returns a promise fulfilled when the debug layer is visible\r\n */\r\n public show(config?: IInspectorOptions): Promise<DebugLayer> {\r\n return new Promise((resolve) => {\r\n if (typeof this.BJSINSPECTOR == \"undefined\") {\r\n const inspectorUrl = config && config.inspectorURL ? config.inspectorURL : DebugLayer.InspectorURL;\r\n\r\n // Load inspector and add it to the DOM\r\n Tools.LoadBabylonScript(inspectorUrl, () => {\r\n this._createInspector(config);\r\n resolve(this);\r\n });\r\n } else {\r\n // Otherwise creates the inspector\r\n this._createInspector(config);\r\n resolve(this);\r\n }\r\n });\r\n }\r\n}\r\n"]}
|
|
@@ -242,6 +242,8 @@ interface INativeEngineConstructor {
|
|
|
242
242
|
readonly COMMAND_SETTEXTUREWRAPMODE: NativeData;
|
|
243
243
|
readonly COMMAND_SETTEXTUREANISOTROPICLEVEL: NativeData;
|
|
244
244
|
readonly COMMAND_SETTEXTURE: NativeData;
|
|
245
|
+
readonly COMMAND_UNSETTEXTURE?: NativeData;
|
|
246
|
+
readonly COMMAND_DISCARDALLTEXTURES?: NativeData;
|
|
245
247
|
readonly COMMAND_BINDVERTEXARRAY: NativeData;
|
|
246
248
|
readonly COMMAND_SETSTATE: NativeData;
|
|
247
249
|
readonly COMMAND_DELETEPROGRAM: NativeData;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nativeInterfaces.js","sourceRoot":"","sources":["../../../../../dev/core/src/Engines/Native/nativeInterfaces.ts"],"names":[],"mappings":"","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\nimport type { DeviceType } from \"../../DeviceInput/InputDevices/deviceEnums\";\r\nimport type { IDeviceInputSystem } from \"../../DeviceInput/inputInterfaces\";\r\nimport type { InternalTexture } from \"../../Materials/Textures/internalTexture\";\r\nimport type { Nullable } from \"../../types\";\r\nimport type { ICanvas, IImage } from \"../ICanvas\";\r\nimport type { NativeData, NativeDataStream } from \"./nativeDataStream\";\r\n\r\nexport type NativeTexture = NativeData;\r\nexport type NativeFramebuffer = NativeData;\r\nexport type NativeVertexArrayObject = NativeData;\r\nexport type NativeProgram = NativeData;\r\nexport type NativeUniform = NativeData;\r\n\r\n/** @internal */\r\nexport interface INativeEngine {\r\n dispose(): void;\r\n\r\n requestAnimationFrame(callback: () => void): void;\r\n setDeviceLostCallback(callback: () => void): void;\r\n\r\n createVertexArray(): NativeData;\r\n\r\n createIndexBuffer(dataBuffer: ArrayBuffer, dataByteOffset: number, dataByteLength: number, is32Bits: boolean, dynamic: boolean): NativeData;\r\n recordIndexBuffer(vertexArray: NativeData, indexBuffer: NativeData): void;\r\n updateDynamicIndexBuffer(indexBuffer: NativeData, data: ArrayBuffer, dataByteOffset: number, dataByteLength: number, startIndex: number): void;\r\n\r\n createVertexBuffer(dataBuffer: ArrayBuffer, dataByteOffset: number, dataByteLength: number, dynamic: boolean): NativeData;\r\n recordVertexBuffer(\r\n vertexArray: NativeData,\r\n vertexBuffer: NativeData,\r\n location: number,\r\n byteOffset: number,\r\n byteStride: number,\r\n numElements: number,\r\n type: number,\r\n normalized: boolean,\r\n instanceDivisor: number\r\n ): void;\r\n updateDynamicVertexBuffer(vertexBuffer: NativeData, dataBuffer: ArrayBuffer, dataByteOffset: number, dataByteLength: number, vertexByteOffset?: number): void;\r\n\r\n createProgram(vertexShader: string, fragmentShader: string): NativeProgram;\r\n createProgramAsync(vertexShader: string, fragmentShader: string, onSuccess: () => void, onError: (error: Error) => void): NativeProgram;\r\n getUniforms(shaderProgram: NativeProgram, uniformsNames: string[]): WebGLUniformLocation[];\r\n getAttributes(shaderProgram: NativeProgram, attributeNames: string[]): number[];\r\n\r\n createTexture(): NativeTexture;\r\n initializeTexture(texture: NativeTexture, width: number, height: number, hasMips: boolean, format: number, renderTarget: boolean, srgb: boolean, samples: number): void;\r\n loadTexture(texture: NativeTexture, data: ArrayBufferView, generateMips: boolean, invertY: boolean, srgb: boolean, onSuccess: () => void, onError: () => void): void;\r\n loadRawTexture(texture: NativeTexture, data: ArrayBufferView, width: number, height: number, format: number, generateMips: boolean, invertY: boolean): void;\r\n loadRawTexture2DArray(\r\n texture: NativeTexture,\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n depth: number,\r\n format: number,\r\n generateMipMaps: boolean,\r\n invertY: boolean\r\n ): void;\r\n loadCubeTexture(texture: NativeTexture, data: Array<ArrayBufferView>, generateMips: boolean, invertY: boolean, srgb: boolean, onSuccess: () => void, onError: () => void): void;\r\n loadCubeTextureWithMips(texture: NativeTexture, data: Array<Array<ArrayBufferView>>, invertY: boolean, srgb: boolean, onSuccess: () => void, onError: () => void): void;\r\n getTextureWidth(texture: NativeTexture): number;\r\n getTextureHeight(texture: NativeTexture): number;\r\n copyTexture(desination: NativeTexture, source: NativeTexture): void;\r\n deleteTexture(texture: NativeTexture): void;\r\n readTexture(\r\n texture: NativeTexture,\r\n mipLevel: number,\r\n x: number,\r\n y: number,\r\n width: number,\r\n height: number,\r\n buffer: Nullable<ArrayBuffer>,\r\n bufferOffset: number,\r\n bufferLength: number\r\n ): Promise<ArrayBuffer>;\r\n\r\n createImageBitmap(data: ArrayBufferView | IImage): ImageBitmap;\r\n resizeImageBitmap(image: ImageBitmap, bufferWidth: number, bufferHeight: number): Uint8Array;\r\n\r\n createFrameBuffer(\r\n texture: Nullable<NativeTexture>,\r\n width: number,\r\n height: number,\r\n generateStencilBuffer: boolean,\r\n generateDepthBuffer: boolean,\r\n samples: number\r\n ): NativeFramebuffer;\r\n\r\n getRenderWidth(): number;\r\n getRenderHeight(): number;\r\n\r\n setHardwareScalingLevel(level: number): void;\r\n\r\n setViewPort(x: number, y: number, width: number, height: number): void;\r\n\r\n setCommandDataStream(dataStream: NativeDataStream): void;\r\n submitCommands(): void;\r\n}\r\n\r\n/** @internal */\r\ninterface INativeEngineConstructor {\r\n prototype: INativeEngine;\r\n new (): INativeEngine;\r\n\r\n readonly PROTOCOL_VERSION: number;\r\n\r\n readonly CAPS_LIMITS_MAX_TEXTURE_SIZE: number;\r\n readonly CAPS_LIMITS_MAX_TEXTURE_LAYERS: number;\r\n\r\n readonly TEXTURE_NEAREST_NEAREST: number;\r\n readonly TEXTURE_LINEAR_LINEAR: number;\r\n readonly TEXTURE_LINEAR_LINEAR_MIPLINEAR: number;\r\n readonly TEXTURE_NEAREST_NEAREST_MIPNEAREST: number;\r\n readonly TEXTURE_NEAREST_LINEAR_MIPNEAREST: number;\r\n readonly TEXTURE_NEAREST_LINEAR_MIPLINEAR: number;\r\n readonly TEXTURE_NEAREST_LINEAR: number;\r\n readonly TEXTURE_NEAREST_NEAREST_MIPLINEAR: number;\r\n readonly TEXTURE_LINEAR_NEAREST_MIPNEAREST: number;\r\n readonly TEXTURE_LINEAR_NEAREST_MIPLINEAR: number;\r\n readonly TEXTURE_LINEAR_LINEAR_MIPNEAREST: number;\r\n readonly TEXTURE_LINEAR_NEAREST: number;\r\n\r\n readonly DEPTH_TEST_LESS: number;\r\n readonly DEPTH_TEST_LEQUAL: number;\r\n readonly DEPTH_TEST_EQUAL: number;\r\n readonly DEPTH_TEST_GEQUAL: number;\r\n readonly DEPTH_TEST_GREATER: number;\r\n readonly DEPTH_TEST_NOTEQUAL: number;\r\n readonly DEPTH_TEST_NEVER: number;\r\n readonly DEPTH_TEST_ALWAYS: number;\r\n\r\n readonly ADDRESS_MODE_WRAP: number;\r\n readonly ADDRESS_MODE_MIRROR: number;\r\n readonly ADDRESS_MODE_CLAMP: number;\r\n readonly ADDRESS_MODE_BORDER: number;\r\n readonly ADDRESS_MODE_MIRROR_ONCE: number;\r\n\r\n readonly TEXTURE_FORMAT_BC1: number;\r\n readonly TEXTURE_FORMAT_BC2: number;\r\n readonly TEXTURE_FORMAT_BC3: number;\r\n readonly TEXTURE_FORMAT_BC4: number;\r\n readonly TEXTURE_FORMAT_BC5: number;\r\n readonly TEXTURE_FORMAT_BC6H: number;\r\n readonly TEXTURE_FORMAT_BC7: number;\r\n readonly TEXTURE_FORMAT_ETC1: number;\r\n readonly TEXTURE_FORMAT_ETC2: number;\r\n readonly TEXTURE_FORMAT_ETC2A: number;\r\n readonly TEXTURE_FORMAT_ETC2A1: number;\r\n readonly TEXTURE_FORMAT_PTC12: number;\r\n readonly TEXTURE_FORMAT_PTC14: number;\r\n readonly TEXTURE_FORMAT_PTC12A: number;\r\n readonly TEXTURE_FORMAT_PTC14A: number;\r\n readonly TEXTURE_FORMAT_PTC22: number;\r\n readonly TEXTURE_FORMAT_PTC24: number;\r\n readonly TEXTURE_FORMAT_ATC: number;\r\n readonly TEXTURE_FORMAT_ATCE: number;\r\n readonly TEXTURE_FORMAT_ATCI: number;\r\n readonly TEXTURE_FORMAT_ASTC4x4: number;\r\n readonly TEXTURE_FORMAT_ASTC5x4: number;\r\n readonly TEXTURE_FORMAT_ASTC5x5: number;\r\n readonly TEXTURE_FORMAT_ASTC6x5: number;\r\n readonly TEXTURE_FORMAT_ASTC6x6: number;\r\n readonly TEXTURE_FORMAT_ASTC8x5: number;\r\n readonly TEXTURE_FORMAT_ASTC8x6: number;\r\n readonly TEXTURE_FORMAT_ASTC8x8: number;\r\n readonly TEXTURE_FORMAT_ASTC10x5: number;\r\n readonly TEXTURE_FORMAT_ASTC10x6: number;\r\n readonly TEXTURE_FORMAT_ASTC10x8: number;\r\n readonly TEXTURE_FORMAT_ASTC10x10: number;\r\n readonly TEXTURE_FORMAT_ASTC12x10: number;\r\n readonly TEXTURE_FORMAT_ASTC12x12: number;\r\n\r\n readonly TEXTURE_FORMAT_R1: number;\r\n readonly TEXTURE_FORMAT_A8: number;\r\n readonly TEXTURE_FORMAT_R8: number;\r\n readonly TEXTURE_FORMAT_R8I: number;\r\n readonly TEXTURE_FORMAT_R8U: number;\r\n readonly TEXTURE_FORMAT_R8S: number;\r\n readonly TEXTURE_FORMAT_R16: number;\r\n readonly TEXTURE_FORMAT_R16I: number;\r\n readonly TEXTURE_FORMAT_R16U: number;\r\n readonly TEXTURE_FORMAT_R16F: number;\r\n readonly TEXTURE_FORMAT_R16S: number;\r\n readonly TEXTURE_FORMAT_R32I: number;\r\n readonly TEXTURE_FORMAT_R32U: number;\r\n readonly TEXTURE_FORMAT_R32F: number;\r\n readonly TEXTURE_FORMAT_RG8: number;\r\n readonly TEXTURE_FORMAT_RG8I: number;\r\n readonly TEXTURE_FORMAT_RG8U: number;\r\n readonly TEXTURE_FORMAT_RG8S: number;\r\n readonly TEXTURE_FORMAT_RG16: number;\r\n readonly TEXTURE_FORMAT_RG16I: number;\r\n readonly TEXTURE_FORMAT_RG16U: number;\r\n readonly TEXTURE_FORMAT_RG16F: number;\r\n readonly TEXTURE_FORMAT_RG16S: number;\r\n readonly TEXTURE_FORMAT_RG32I: number;\r\n readonly TEXTURE_FORMAT_RG32U: number;\r\n readonly TEXTURE_FORMAT_RG32F: number;\r\n readonly TEXTURE_FORMAT_RGB8: number;\r\n readonly TEXTURE_FORMAT_RGB8I: number;\r\n readonly TEXTURE_FORMAT_RGB8U: number;\r\n readonly TEXTURE_FORMAT_RGB8S: number;\r\n readonly TEXTURE_FORMAT_RGB9E5F: number;\r\n readonly TEXTURE_FORMAT_BGRA8: number;\r\n readonly TEXTURE_FORMAT_RGBA8: number;\r\n readonly TEXTURE_FORMAT_RGBA8I: number;\r\n readonly TEXTURE_FORMAT_RGBA8U: number;\r\n readonly TEXTURE_FORMAT_RGBA8S: number;\r\n readonly TEXTURE_FORMAT_RGBA16: number;\r\n readonly TEXTURE_FORMAT_RGBA16I: number;\r\n readonly TEXTURE_FORMAT_RGBA16U: number;\r\n readonly TEXTURE_FORMAT_RGBA16F: number;\r\n readonly TEXTURE_FORMAT_RGBA16S: number;\r\n readonly TEXTURE_FORMAT_RGBA32I: number;\r\n readonly TEXTURE_FORMAT_RGBA32U: number;\r\n readonly TEXTURE_FORMAT_RGBA32F: number;\r\n readonly TEXTURE_FORMAT_B5G6R5: number;\r\n readonly TEXTURE_FORMAT_R5G6B5: number;\r\n readonly TEXTURE_FORMAT_BGRA4: number;\r\n readonly TEXTURE_FORMAT_RGBA4: number;\r\n readonly TEXTURE_FORMAT_BGR5A1: number;\r\n readonly TEXTURE_FORMAT_RGB5A1: number;\r\n readonly TEXTURE_FORMAT_RGB10A2: number;\r\n readonly TEXTURE_FORMAT_RG11B10F: number;\r\n\r\n readonly TEXTURE_FORMAT_D16: number;\r\n readonly TEXTURE_FORMAT_D24: number;\r\n readonly TEXTURE_FORMAT_D24S8: number;\r\n readonly TEXTURE_FORMAT_D32: number;\r\n readonly TEXTURE_FORMAT_D16F: number;\r\n readonly TEXTURE_FORMAT_D24F: number;\r\n readonly TEXTURE_FORMAT_D32F: number;\r\n readonly TEXTURE_FORMAT_D0S8: number;\r\n\r\n readonly ATTRIB_TYPE_INT8: number;\r\n readonly ATTRIB_TYPE_UINT8: number;\r\n readonly ATTRIB_TYPE_INT16: number;\r\n readonly ATTRIB_TYPE_UINT16: number;\r\n readonly ATTRIB_TYPE_FLOAT: number;\r\n\r\n readonly ALPHA_DISABLE: number;\r\n readonly ALPHA_ADD: number;\r\n readonly ALPHA_COMBINE: number;\r\n readonly ALPHA_SUBTRACT: number;\r\n readonly ALPHA_MULTIPLY: number;\r\n readonly ALPHA_MAXIMIZED: number;\r\n readonly ALPHA_ONEONE: number;\r\n readonly ALPHA_PREMULTIPLIED: number;\r\n readonly ALPHA_PREMULTIPLIED_PORTERDUFF: number;\r\n readonly ALPHA_INTERPOLATE: number;\r\n readonly ALPHA_SCREENMODE: number;\r\n\r\n readonly STENCIL_TEST_LESS: number;\r\n readonly STENCIL_TEST_LEQUAL: number;\r\n readonly STENCIL_TEST_EQUAL: number;\r\n readonly STENCIL_TEST_GEQUAL: number;\r\n readonly STENCIL_TEST_GREATER: number;\r\n readonly STENCIL_TEST_NOTEQUAL: number;\r\n readonly STENCIL_TEST_NEVER: number;\r\n readonly STENCIL_TEST_ALWAYS: number;\r\n\r\n readonly STENCIL_OP_FAIL_S_ZERO: number;\r\n readonly STENCIL_OP_FAIL_S_KEEP: number;\r\n readonly STENCIL_OP_FAIL_S_REPLACE: number;\r\n readonly STENCIL_OP_FAIL_S_INCR: number;\r\n readonly STENCIL_OP_FAIL_S_INCRSAT: number;\r\n readonly STENCIL_OP_FAIL_S_DECR: number;\r\n readonly STENCIL_OP_FAIL_S_DECRSAT: number;\r\n readonly STENCIL_OP_FAIL_S_INVERT: number;\r\n\r\n readonly STENCIL_OP_FAIL_Z_ZERO: number;\r\n readonly STENCIL_OP_FAIL_Z_KEEP: number;\r\n readonly STENCIL_OP_FAIL_Z_REPLACE: number;\r\n readonly STENCIL_OP_FAIL_Z_INCR: number;\r\n readonly STENCIL_OP_FAIL_Z_INCRSAT: number;\r\n readonly STENCIL_OP_FAIL_Z_DECR: number;\r\n readonly STENCIL_OP_FAIL_Z_DECRSAT: number;\r\n readonly STENCIL_OP_FAIL_Z_INVERT: number;\r\n\r\n readonly STENCIL_OP_PASS_Z_ZERO: number;\r\n readonly STENCIL_OP_PASS_Z_KEEP: number;\r\n readonly STENCIL_OP_PASS_Z_REPLACE: number;\r\n readonly STENCIL_OP_PASS_Z_INCR: number;\r\n readonly STENCIL_OP_PASS_Z_INCRSAT: number;\r\n readonly STENCIL_OP_PASS_Z_DECR: number;\r\n readonly STENCIL_OP_PASS_Z_DECRSAT: number;\r\n readonly STENCIL_OP_PASS_Z_INVERT: number;\r\n\r\n readonly COMMAND_DELETEVERTEXARRAY: NativeData;\r\n readonly COMMAND_DELETEINDEXBUFFER: NativeData;\r\n readonly COMMAND_DELETEVERTEXBUFFER: NativeData;\r\n readonly COMMAND_SETPROGRAM: NativeData;\r\n readonly COMMAND_SETMATRIX: NativeData;\r\n readonly COMMAND_SETMATRIX3X3: NativeData;\r\n readonly COMMAND_SETMATRIX2X2: NativeData;\r\n readonly COMMAND_SETMATRICES: NativeData;\r\n readonly COMMAND_SETINT: NativeData;\r\n readonly COMMAND_SETINTARRAY: NativeData;\r\n readonly COMMAND_SETINTARRAY2: NativeData;\r\n readonly COMMAND_SETINTARRAY3: NativeData;\r\n readonly COMMAND_SETINTARRAY4: NativeData;\r\n readonly COMMAND_SETFLOATARRAY: NativeData;\r\n readonly COMMAND_SETFLOATARRAY2: NativeData;\r\n readonly COMMAND_SETFLOATARRAY3: NativeData;\r\n readonly COMMAND_SETFLOATARRAY4: NativeData;\r\n readonly COMMAND_SETTEXTURESAMPLING: NativeData;\r\n readonly COMMAND_SETTEXTUREWRAPMODE: NativeData;\r\n readonly COMMAND_SETTEXTUREANISOTROPICLEVEL: NativeData;\r\n readonly COMMAND_SETTEXTURE: NativeData;\r\n readonly COMMAND_BINDVERTEXARRAY: NativeData;\r\n readonly COMMAND_SETSTATE: NativeData;\r\n readonly COMMAND_DELETEPROGRAM: NativeData;\r\n readonly COMMAND_SETZOFFSET: NativeData;\r\n readonly COMMAND_SETZOFFSETUNITS: NativeData;\r\n readonly COMMAND_SETDEPTHTEST: NativeData;\r\n readonly COMMAND_SETDEPTHWRITE: NativeData;\r\n readonly COMMAND_SETCOLORWRITE: NativeData;\r\n readonly COMMAND_SETBLENDMODE: NativeData;\r\n readonly COMMAND_SETFLOAT: NativeData;\r\n readonly COMMAND_SETFLOAT2: NativeData;\r\n readonly COMMAND_SETFLOAT3: NativeData;\r\n readonly COMMAND_SETFLOAT4: NativeData;\r\n readonly COMMAND_BINDFRAMEBUFFER: NativeData;\r\n readonly COMMAND_UNBINDFRAMEBUFFER: NativeData;\r\n readonly COMMAND_DELETEFRAMEBUFFER: NativeData;\r\n readonly COMMAND_DRAWINDEXED: NativeData;\r\n readonly COMMAND_DRAWINDEXEDINSTANCED?: NativeData;\r\n readonly COMMAND_DRAW: NativeData;\r\n readonly COMMAND_DRAWINSTANCED?: NativeData;\r\n readonly COMMAND_CLEAR: NativeData;\r\n readonly COMMAND_SETSTENCIL: NativeData;\r\n readonly COMMAND_SETVIEWPORT: NativeData;\r\n readonly COMMAND_SETSCISSOR: NativeData;\r\n}\r\n\r\n/** @internal */\r\nexport interface INativeCamera {\r\n createVideo(constraints: MediaTrackConstraints): any;\r\n updateVideoTexture(texture: Nullable<InternalTexture>, video: HTMLVideoElement, invertY: boolean): void;\r\n}\r\n\r\n/** @internal */\r\ninterface INativeCameraConstructor {\r\n prototype: INativeCamera;\r\n new (): INativeCamera;\r\n}\r\n\r\n/** @internal */\r\ninterface INativeCanvasConstructor {\r\n prototype: ICanvas;\r\n new (): ICanvas;\r\n\r\n loadTTFAsync(fontName: string, buffer: ArrayBuffer): void;\r\n}\r\n\r\n/** @internal */\r\ninterface INativeImageConstructor {\r\n prototype: IImage;\r\n new (): IImage;\r\n}\r\n\r\n/** @internal */\r\ninterface IDeviceInputSystemConstructor {\r\n prototype: IDeviceInputSystem;\r\n new (\r\n onDeviceConnected: (deviceType: DeviceType, deviceSlot: number) => void,\r\n onDeviceDisconnected: (deviceType: DeviceType, deviceSlot: number) => void,\r\n onInputChanged: (deviceType: DeviceType, deviceSlot: number, inputIndex: number, currentState: number) => void\r\n ): IDeviceInputSystem;\r\n}\r\n\r\n/** @internal */\r\nexport interface INativeDataStream {\r\n writeBuffer(buffer: ArrayBuffer, length: number): void;\r\n}\r\n\r\n/** @internal */\r\ninterface INativeDataStreamConstructor {\r\n prototype: INativeDataStream;\r\n new (requestFlushCallback: () => void): INativeDataStream;\r\n\r\n readonly VALIDATION_ENABLED: boolean;\r\n readonly VALIDATION_UINT_32: number;\r\n readonly VALIDATION_INT_32: number;\r\n readonly VALIDATION_FLOAT_32: number;\r\n readonly VALIDATION_UINT_32_ARRAY: number;\r\n readonly VALIDATION_INT_32_ARRAY: number;\r\n readonly VALIDATION_FLOAT_32_ARRAY: number;\r\n readonly VALIDATION_NATIVE_DATA: number;\r\n readonly VALIDATION_BOOLEAN: number;\r\n}\r\n\r\n/** @internal */\r\nexport interface INative {\r\n Engine: INativeEngineConstructor;\r\n Camera: INativeCameraConstructor;\r\n Canvas: INativeCanvasConstructor;\r\n Image: INativeImageConstructor;\r\n XMLHttpRequest: any; // TODO: how to do this?\r\n DeviceInputSystem: IDeviceInputSystemConstructor;\r\n NativeDataStream: INativeDataStreamConstructor;\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"nativeInterfaces.js","sourceRoot":"","sources":["../../../../../dev/core/src/Engines/Native/nativeInterfaces.ts"],"names":[],"mappings":"","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\nimport type { DeviceType } from \"../../DeviceInput/InputDevices/deviceEnums\";\r\nimport type { IDeviceInputSystem } from \"../../DeviceInput/inputInterfaces\";\r\nimport type { InternalTexture } from \"../../Materials/Textures/internalTexture\";\r\nimport type { Nullable } from \"../../types\";\r\nimport type { ICanvas, IImage } from \"../ICanvas\";\r\nimport type { NativeData, NativeDataStream } from \"./nativeDataStream\";\r\n\r\nexport type NativeTexture = NativeData;\r\nexport type NativeFramebuffer = NativeData;\r\nexport type NativeVertexArrayObject = NativeData;\r\nexport type NativeProgram = NativeData;\r\nexport type NativeUniform = NativeData;\r\n\r\n/** @internal */\r\nexport interface INativeEngine {\r\n dispose(): void;\r\n\r\n requestAnimationFrame(callback: () => void): void;\r\n setDeviceLostCallback(callback: () => void): void;\r\n\r\n createVertexArray(): NativeData;\r\n\r\n createIndexBuffer(dataBuffer: ArrayBuffer, dataByteOffset: number, dataByteLength: number, is32Bits: boolean, dynamic: boolean): NativeData;\r\n recordIndexBuffer(vertexArray: NativeData, indexBuffer: NativeData): void;\r\n updateDynamicIndexBuffer(indexBuffer: NativeData, data: ArrayBuffer, dataByteOffset: number, dataByteLength: number, startIndex: number): void;\r\n\r\n createVertexBuffer(dataBuffer: ArrayBuffer, dataByteOffset: number, dataByteLength: number, dynamic: boolean): NativeData;\r\n recordVertexBuffer(\r\n vertexArray: NativeData,\r\n vertexBuffer: NativeData,\r\n location: number,\r\n byteOffset: number,\r\n byteStride: number,\r\n numElements: number,\r\n type: number,\r\n normalized: boolean,\r\n instanceDivisor: number\r\n ): void;\r\n updateDynamicVertexBuffer(vertexBuffer: NativeData, dataBuffer: ArrayBuffer, dataByteOffset: number, dataByteLength: number, vertexByteOffset?: number): void;\r\n\r\n createProgram(vertexShader: string, fragmentShader: string): NativeProgram;\r\n createProgramAsync(vertexShader: string, fragmentShader: string, onSuccess: () => void, onError: (error: Error) => void): NativeProgram;\r\n getUniforms(shaderProgram: NativeProgram, uniformsNames: string[]): WebGLUniformLocation[];\r\n getAttributes(shaderProgram: NativeProgram, attributeNames: string[]): number[];\r\n\r\n createTexture(): NativeTexture;\r\n initializeTexture(texture: NativeTexture, width: number, height: number, hasMips: boolean, format: number, renderTarget: boolean, srgb: boolean, samples: number): void;\r\n loadTexture(texture: NativeTexture, data: ArrayBufferView, generateMips: boolean, invertY: boolean, srgb: boolean, onSuccess: () => void, onError: () => void): void;\r\n loadRawTexture(texture: NativeTexture, data: ArrayBufferView, width: number, height: number, format: number, generateMips: boolean, invertY: boolean): void;\r\n loadRawTexture2DArray(\r\n texture: NativeTexture,\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n depth: number,\r\n format: number,\r\n generateMipMaps: boolean,\r\n invertY: boolean\r\n ): void;\r\n loadCubeTexture(texture: NativeTexture, data: Array<ArrayBufferView>, generateMips: boolean, invertY: boolean, srgb: boolean, onSuccess: () => void, onError: () => void): void;\r\n loadCubeTextureWithMips(texture: NativeTexture, data: Array<Array<ArrayBufferView>>, invertY: boolean, srgb: boolean, onSuccess: () => void, onError: () => void): void;\r\n getTextureWidth(texture: NativeTexture): number;\r\n getTextureHeight(texture: NativeTexture): number;\r\n copyTexture(desination: NativeTexture, source: NativeTexture): void;\r\n deleteTexture(texture: NativeTexture): void;\r\n readTexture(\r\n texture: NativeTexture,\r\n mipLevel: number,\r\n x: number,\r\n y: number,\r\n width: number,\r\n height: number,\r\n buffer: Nullable<ArrayBuffer>,\r\n bufferOffset: number,\r\n bufferLength: number\r\n ): Promise<ArrayBuffer>;\r\n\r\n createImageBitmap(data: ArrayBufferView | IImage): ImageBitmap;\r\n resizeImageBitmap(image: ImageBitmap, bufferWidth: number, bufferHeight: number): Uint8Array;\r\n\r\n createFrameBuffer(\r\n texture: Nullable<NativeTexture>,\r\n width: number,\r\n height: number,\r\n generateStencilBuffer: boolean,\r\n generateDepthBuffer: boolean,\r\n samples: number\r\n ): NativeFramebuffer;\r\n\r\n getRenderWidth(): number;\r\n getRenderHeight(): number;\r\n\r\n setHardwareScalingLevel(level: number): void;\r\n\r\n setViewPort(x: number, y: number, width: number, height: number): void;\r\n\r\n setCommandDataStream(dataStream: NativeDataStream): void;\r\n submitCommands(): void;\r\n}\r\n\r\n/** @internal */\r\ninterface INativeEngineConstructor {\r\n prototype: INativeEngine;\r\n new (): INativeEngine;\r\n\r\n readonly PROTOCOL_VERSION: number;\r\n\r\n readonly CAPS_LIMITS_MAX_TEXTURE_SIZE: number;\r\n readonly CAPS_LIMITS_MAX_TEXTURE_LAYERS: number;\r\n\r\n readonly TEXTURE_NEAREST_NEAREST: number;\r\n readonly TEXTURE_LINEAR_LINEAR: number;\r\n readonly TEXTURE_LINEAR_LINEAR_MIPLINEAR: number;\r\n readonly TEXTURE_NEAREST_NEAREST_MIPNEAREST: number;\r\n readonly TEXTURE_NEAREST_LINEAR_MIPNEAREST: number;\r\n readonly TEXTURE_NEAREST_LINEAR_MIPLINEAR: number;\r\n readonly TEXTURE_NEAREST_LINEAR: number;\r\n readonly TEXTURE_NEAREST_NEAREST_MIPLINEAR: number;\r\n readonly TEXTURE_LINEAR_NEAREST_MIPNEAREST: number;\r\n readonly TEXTURE_LINEAR_NEAREST_MIPLINEAR: number;\r\n readonly TEXTURE_LINEAR_LINEAR_MIPNEAREST: number;\r\n readonly TEXTURE_LINEAR_NEAREST: number;\r\n\r\n readonly DEPTH_TEST_LESS: number;\r\n readonly DEPTH_TEST_LEQUAL: number;\r\n readonly DEPTH_TEST_EQUAL: number;\r\n readonly DEPTH_TEST_GEQUAL: number;\r\n readonly DEPTH_TEST_GREATER: number;\r\n readonly DEPTH_TEST_NOTEQUAL: number;\r\n readonly DEPTH_TEST_NEVER: number;\r\n readonly DEPTH_TEST_ALWAYS: number;\r\n\r\n readonly ADDRESS_MODE_WRAP: number;\r\n readonly ADDRESS_MODE_MIRROR: number;\r\n readonly ADDRESS_MODE_CLAMP: number;\r\n readonly ADDRESS_MODE_BORDER: number;\r\n readonly ADDRESS_MODE_MIRROR_ONCE: number;\r\n\r\n readonly TEXTURE_FORMAT_BC1: number;\r\n readonly TEXTURE_FORMAT_BC2: number;\r\n readonly TEXTURE_FORMAT_BC3: number;\r\n readonly TEXTURE_FORMAT_BC4: number;\r\n readonly TEXTURE_FORMAT_BC5: number;\r\n readonly TEXTURE_FORMAT_BC6H: number;\r\n readonly TEXTURE_FORMAT_BC7: number;\r\n readonly TEXTURE_FORMAT_ETC1: number;\r\n readonly TEXTURE_FORMAT_ETC2: number;\r\n readonly TEXTURE_FORMAT_ETC2A: number;\r\n readonly TEXTURE_FORMAT_ETC2A1: number;\r\n readonly TEXTURE_FORMAT_PTC12: number;\r\n readonly TEXTURE_FORMAT_PTC14: number;\r\n readonly TEXTURE_FORMAT_PTC12A: number;\r\n readonly TEXTURE_FORMAT_PTC14A: number;\r\n readonly TEXTURE_FORMAT_PTC22: number;\r\n readonly TEXTURE_FORMAT_PTC24: number;\r\n readonly TEXTURE_FORMAT_ATC: number;\r\n readonly TEXTURE_FORMAT_ATCE: number;\r\n readonly TEXTURE_FORMAT_ATCI: number;\r\n readonly TEXTURE_FORMAT_ASTC4x4: number;\r\n readonly TEXTURE_FORMAT_ASTC5x4: number;\r\n readonly TEXTURE_FORMAT_ASTC5x5: number;\r\n readonly TEXTURE_FORMAT_ASTC6x5: number;\r\n readonly TEXTURE_FORMAT_ASTC6x6: number;\r\n readonly TEXTURE_FORMAT_ASTC8x5: number;\r\n readonly TEXTURE_FORMAT_ASTC8x6: number;\r\n readonly TEXTURE_FORMAT_ASTC8x8: number;\r\n readonly TEXTURE_FORMAT_ASTC10x5: number;\r\n readonly TEXTURE_FORMAT_ASTC10x6: number;\r\n readonly TEXTURE_FORMAT_ASTC10x8: number;\r\n readonly TEXTURE_FORMAT_ASTC10x10: number;\r\n readonly TEXTURE_FORMAT_ASTC12x10: number;\r\n readonly TEXTURE_FORMAT_ASTC12x12: number;\r\n\r\n readonly TEXTURE_FORMAT_R1: number;\r\n readonly TEXTURE_FORMAT_A8: number;\r\n readonly TEXTURE_FORMAT_R8: number;\r\n readonly TEXTURE_FORMAT_R8I: number;\r\n readonly TEXTURE_FORMAT_R8U: number;\r\n readonly TEXTURE_FORMAT_R8S: number;\r\n readonly TEXTURE_FORMAT_R16: number;\r\n readonly TEXTURE_FORMAT_R16I: number;\r\n readonly TEXTURE_FORMAT_R16U: number;\r\n readonly TEXTURE_FORMAT_R16F: number;\r\n readonly TEXTURE_FORMAT_R16S: number;\r\n readonly TEXTURE_FORMAT_R32I: number;\r\n readonly TEXTURE_FORMAT_R32U: number;\r\n readonly TEXTURE_FORMAT_R32F: number;\r\n readonly TEXTURE_FORMAT_RG8: number;\r\n readonly TEXTURE_FORMAT_RG8I: number;\r\n readonly TEXTURE_FORMAT_RG8U: number;\r\n readonly TEXTURE_FORMAT_RG8S: number;\r\n readonly TEXTURE_FORMAT_RG16: number;\r\n readonly TEXTURE_FORMAT_RG16I: number;\r\n readonly TEXTURE_FORMAT_RG16U: number;\r\n readonly TEXTURE_FORMAT_RG16F: number;\r\n readonly TEXTURE_FORMAT_RG16S: number;\r\n readonly TEXTURE_FORMAT_RG32I: number;\r\n readonly TEXTURE_FORMAT_RG32U: number;\r\n readonly TEXTURE_FORMAT_RG32F: number;\r\n readonly TEXTURE_FORMAT_RGB8: number;\r\n readonly TEXTURE_FORMAT_RGB8I: number;\r\n readonly TEXTURE_FORMAT_RGB8U: number;\r\n readonly TEXTURE_FORMAT_RGB8S: number;\r\n readonly TEXTURE_FORMAT_RGB9E5F: number;\r\n readonly TEXTURE_FORMAT_BGRA8: number;\r\n readonly TEXTURE_FORMAT_RGBA8: number;\r\n readonly TEXTURE_FORMAT_RGBA8I: number;\r\n readonly TEXTURE_FORMAT_RGBA8U: number;\r\n readonly TEXTURE_FORMAT_RGBA8S: number;\r\n readonly TEXTURE_FORMAT_RGBA16: number;\r\n readonly TEXTURE_FORMAT_RGBA16I: number;\r\n readonly TEXTURE_FORMAT_RGBA16U: number;\r\n readonly TEXTURE_FORMAT_RGBA16F: number;\r\n readonly TEXTURE_FORMAT_RGBA16S: number;\r\n readonly TEXTURE_FORMAT_RGBA32I: number;\r\n readonly TEXTURE_FORMAT_RGBA32U: number;\r\n readonly TEXTURE_FORMAT_RGBA32F: number;\r\n readonly TEXTURE_FORMAT_B5G6R5: number;\r\n readonly TEXTURE_FORMAT_R5G6B5: number;\r\n readonly TEXTURE_FORMAT_BGRA4: number;\r\n readonly TEXTURE_FORMAT_RGBA4: number;\r\n readonly TEXTURE_FORMAT_BGR5A1: number;\r\n readonly TEXTURE_FORMAT_RGB5A1: number;\r\n readonly TEXTURE_FORMAT_RGB10A2: number;\r\n readonly TEXTURE_FORMAT_RG11B10F: number;\r\n\r\n readonly TEXTURE_FORMAT_D16: number;\r\n readonly TEXTURE_FORMAT_D24: number;\r\n readonly TEXTURE_FORMAT_D24S8: number;\r\n readonly TEXTURE_FORMAT_D32: number;\r\n readonly TEXTURE_FORMAT_D16F: number;\r\n readonly TEXTURE_FORMAT_D24F: number;\r\n readonly TEXTURE_FORMAT_D32F: number;\r\n readonly TEXTURE_FORMAT_D0S8: number;\r\n\r\n readonly ATTRIB_TYPE_INT8: number;\r\n readonly ATTRIB_TYPE_UINT8: number;\r\n readonly ATTRIB_TYPE_INT16: number;\r\n readonly ATTRIB_TYPE_UINT16: number;\r\n readonly ATTRIB_TYPE_FLOAT: number;\r\n\r\n readonly ALPHA_DISABLE: number;\r\n readonly ALPHA_ADD: number;\r\n readonly ALPHA_COMBINE: number;\r\n readonly ALPHA_SUBTRACT: number;\r\n readonly ALPHA_MULTIPLY: number;\r\n readonly ALPHA_MAXIMIZED: number;\r\n readonly ALPHA_ONEONE: number;\r\n readonly ALPHA_PREMULTIPLIED: number;\r\n readonly ALPHA_PREMULTIPLIED_PORTERDUFF: number;\r\n readonly ALPHA_INTERPOLATE: number;\r\n readonly ALPHA_SCREENMODE: number;\r\n\r\n readonly STENCIL_TEST_LESS: number;\r\n readonly STENCIL_TEST_LEQUAL: number;\r\n readonly STENCIL_TEST_EQUAL: number;\r\n readonly STENCIL_TEST_GEQUAL: number;\r\n readonly STENCIL_TEST_GREATER: number;\r\n readonly STENCIL_TEST_NOTEQUAL: number;\r\n readonly STENCIL_TEST_NEVER: number;\r\n readonly STENCIL_TEST_ALWAYS: number;\r\n\r\n readonly STENCIL_OP_FAIL_S_ZERO: number;\r\n readonly STENCIL_OP_FAIL_S_KEEP: number;\r\n readonly STENCIL_OP_FAIL_S_REPLACE: number;\r\n readonly STENCIL_OP_FAIL_S_INCR: number;\r\n readonly STENCIL_OP_FAIL_S_INCRSAT: number;\r\n readonly STENCIL_OP_FAIL_S_DECR: number;\r\n readonly STENCIL_OP_FAIL_S_DECRSAT: number;\r\n readonly STENCIL_OP_FAIL_S_INVERT: number;\r\n\r\n readonly STENCIL_OP_FAIL_Z_ZERO: number;\r\n readonly STENCIL_OP_FAIL_Z_KEEP: number;\r\n readonly STENCIL_OP_FAIL_Z_REPLACE: number;\r\n readonly STENCIL_OP_FAIL_Z_INCR: number;\r\n readonly STENCIL_OP_FAIL_Z_INCRSAT: number;\r\n readonly STENCIL_OP_FAIL_Z_DECR: number;\r\n readonly STENCIL_OP_FAIL_Z_DECRSAT: number;\r\n readonly STENCIL_OP_FAIL_Z_INVERT: number;\r\n\r\n readonly STENCIL_OP_PASS_Z_ZERO: number;\r\n readonly STENCIL_OP_PASS_Z_KEEP: number;\r\n readonly STENCIL_OP_PASS_Z_REPLACE: number;\r\n readonly STENCIL_OP_PASS_Z_INCR: number;\r\n readonly STENCIL_OP_PASS_Z_INCRSAT: number;\r\n readonly STENCIL_OP_PASS_Z_DECR: number;\r\n readonly STENCIL_OP_PASS_Z_DECRSAT: number;\r\n readonly STENCIL_OP_PASS_Z_INVERT: number;\r\n\r\n readonly COMMAND_DELETEVERTEXARRAY: NativeData;\r\n readonly COMMAND_DELETEINDEXBUFFER: NativeData;\r\n readonly COMMAND_DELETEVERTEXBUFFER: NativeData;\r\n readonly COMMAND_SETPROGRAM: NativeData;\r\n readonly COMMAND_SETMATRIX: NativeData;\r\n readonly COMMAND_SETMATRIX3X3: NativeData;\r\n readonly COMMAND_SETMATRIX2X2: NativeData;\r\n readonly COMMAND_SETMATRICES: NativeData;\r\n readonly COMMAND_SETINT: NativeData;\r\n readonly COMMAND_SETINTARRAY: NativeData;\r\n readonly COMMAND_SETINTARRAY2: NativeData;\r\n readonly COMMAND_SETINTARRAY3: NativeData;\r\n readonly COMMAND_SETINTARRAY4: NativeData;\r\n readonly COMMAND_SETFLOATARRAY: NativeData;\r\n readonly COMMAND_SETFLOATARRAY2: NativeData;\r\n readonly COMMAND_SETFLOATARRAY3: NativeData;\r\n readonly COMMAND_SETFLOATARRAY4: NativeData;\r\n readonly COMMAND_SETTEXTURESAMPLING: NativeData;\r\n readonly COMMAND_SETTEXTUREWRAPMODE: NativeData;\r\n readonly COMMAND_SETTEXTUREANISOTROPICLEVEL: NativeData;\r\n readonly COMMAND_SETTEXTURE: NativeData;\r\n readonly COMMAND_UNSETTEXTURE?: NativeData;\r\n readonly COMMAND_DISCARDALLTEXTURES?: NativeData;\r\n readonly COMMAND_BINDVERTEXARRAY: NativeData;\r\n readonly COMMAND_SETSTATE: NativeData;\r\n readonly COMMAND_DELETEPROGRAM: NativeData;\r\n readonly COMMAND_SETZOFFSET: NativeData;\r\n readonly COMMAND_SETZOFFSETUNITS: NativeData;\r\n readonly COMMAND_SETDEPTHTEST: NativeData;\r\n readonly COMMAND_SETDEPTHWRITE: NativeData;\r\n readonly COMMAND_SETCOLORWRITE: NativeData;\r\n readonly COMMAND_SETBLENDMODE: NativeData;\r\n readonly COMMAND_SETFLOAT: NativeData;\r\n readonly COMMAND_SETFLOAT2: NativeData;\r\n readonly COMMAND_SETFLOAT3: NativeData;\r\n readonly COMMAND_SETFLOAT4: NativeData;\r\n readonly COMMAND_BINDFRAMEBUFFER: NativeData;\r\n readonly COMMAND_UNBINDFRAMEBUFFER: NativeData;\r\n readonly COMMAND_DELETEFRAMEBUFFER: NativeData;\r\n readonly COMMAND_DRAWINDEXED: NativeData;\r\n readonly COMMAND_DRAWINDEXEDINSTANCED?: NativeData;\r\n readonly COMMAND_DRAW: NativeData;\r\n readonly COMMAND_DRAWINSTANCED?: NativeData;\r\n readonly COMMAND_CLEAR: NativeData;\r\n readonly COMMAND_SETSTENCIL: NativeData;\r\n readonly COMMAND_SETVIEWPORT: NativeData;\r\n readonly COMMAND_SETSCISSOR: NativeData;\r\n}\r\n\r\n/** @internal */\r\nexport interface INativeCamera {\r\n createVideo(constraints: MediaTrackConstraints): any;\r\n updateVideoTexture(texture: Nullable<InternalTexture>, video: HTMLVideoElement, invertY: boolean): void;\r\n}\r\n\r\n/** @internal */\r\ninterface INativeCameraConstructor {\r\n prototype: INativeCamera;\r\n new (): INativeCamera;\r\n}\r\n\r\n/** @internal */\r\ninterface INativeCanvasConstructor {\r\n prototype: ICanvas;\r\n new (): ICanvas;\r\n\r\n loadTTFAsync(fontName: string, buffer: ArrayBuffer): void;\r\n}\r\n\r\n/** @internal */\r\ninterface INativeImageConstructor {\r\n prototype: IImage;\r\n new (): IImage;\r\n}\r\n\r\n/** @internal */\r\ninterface IDeviceInputSystemConstructor {\r\n prototype: IDeviceInputSystem;\r\n new (\r\n onDeviceConnected: (deviceType: DeviceType, deviceSlot: number) => void,\r\n onDeviceDisconnected: (deviceType: DeviceType, deviceSlot: number) => void,\r\n onInputChanged: (deviceType: DeviceType, deviceSlot: number, inputIndex: number, currentState: number) => void\r\n ): IDeviceInputSystem;\r\n}\r\n\r\n/** @internal */\r\nexport interface INativeDataStream {\r\n writeBuffer(buffer: ArrayBuffer, length: number): void;\r\n}\r\n\r\n/** @internal */\r\ninterface INativeDataStreamConstructor {\r\n prototype: INativeDataStream;\r\n new (requestFlushCallback: () => void): INativeDataStream;\r\n\r\n readonly VALIDATION_ENABLED: boolean;\r\n readonly VALIDATION_UINT_32: number;\r\n readonly VALIDATION_INT_32: number;\r\n readonly VALIDATION_FLOAT_32: number;\r\n readonly VALIDATION_UINT_32_ARRAY: number;\r\n readonly VALIDATION_INT_32_ARRAY: number;\r\n readonly VALIDATION_FLOAT_32_ARRAY: number;\r\n readonly VALIDATION_NATIVE_DATA: number;\r\n readonly VALIDATION_BOOLEAN: number;\r\n}\r\n\r\n/** @internal */\r\nexport interface INative {\r\n Engine: INativeEngineConstructor;\r\n Camera: INativeCameraConstructor;\r\n Canvas: INativeCanvasConstructor;\r\n Image: INativeImageConstructor;\r\n XMLHttpRequest: any; // TODO: how to do this?\r\n DeviceInputSystem: IDeviceInputSystemConstructor;\r\n NativeDataStream: INativeDataStreamConstructor;\r\n}\r\n"]}
|
|
@@ -29,7 +29,9 @@ export interface IShaderProcessor {
|
|
|
29
29
|
}, processingContext: Nullable<ShaderProcessingContext>) => string;
|
|
30
30
|
endOfUniformBufferProcessor?: (closingBracketLine: string, isFragment: boolean, processingContext: Nullable<ShaderProcessingContext>) => string;
|
|
31
31
|
lineProcessor?: (line: string, isFragment: boolean, processingContext: Nullable<ShaderProcessingContext>) => string;
|
|
32
|
-
preProcessor?: (code: string, defines: string[],
|
|
32
|
+
preProcessor?: (code: string, defines: string[], preProcessors: {
|
|
33
|
+
[key: string]: string;
|
|
34
|
+
}, isFragment: boolean, processingContext: Nullable<ShaderProcessingContext>) => string;
|
|
33
35
|
postProcessor?: (code: string, defines: string[], isFragment: boolean, processingContext: Nullable<ShaderProcessingContext>, patameters: {
|
|
34
36
|
[key: string]: number | string | boolean | undefined;
|
|
35
37
|
}) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iShaderProcessor.js","sourceRoot":"","sources":["../../../../../dev/core/src/Engines/Processors/iShaderProcessor.ts"],"names":[],"mappings":"","sourcesContent":["import type { ShaderLanguage } from \"../../Materials/shaderLanguage\";\r\nimport type { Nullable } from \"../../types\";\r\nimport type { ShaderProcessingContext } from \"./shaderProcessingOptions\";\r\n\r\n/** @internal */\r\nexport interface IShaderProcessor {\r\n shaderLanguage: ShaderLanguage;\r\n\r\n uniformRegexp?: RegExp;\r\n uniformBufferRegexp?: RegExp;\r\n textureRegexp?: RegExp;\r\n noPrecision?: boolean;\r\n parseGLES3?: boolean;\r\n\r\n attributeKeywordName?: string;\r\n varyingVertexKeywordName?: string;\r\n varyingFragmentKeywordName?: string;\r\n\r\n preProcessShaderCode?: (code: string, isFragment: boolean) => string;\r\n attributeProcessor?: (attribute: string, preProcessors: { [key: string]: string }, processingContext: Nullable<ShaderProcessingContext>) => string;\r\n varyingCheck?: (varying: string, isFragment: boolean) => boolean;\r\n varyingProcessor?: (varying: string, isFragment: boolean, preProcessors: { [key: string]: string }, processingContext: Nullable<ShaderProcessingContext>) => string;\r\n uniformProcessor?: (uniform: string, isFragment: boolean, preProcessors: { [key: string]: string }, processingContext: Nullable<ShaderProcessingContext>) => string;\r\n uniformBufferProcessor?: (uniformBuffer: string, isFragment: boolean, processingContext: Nullable<ShaderProcessingContext>) => string;\r\n textureProcessor?: (texture: string, isFragment: boolean, preProcessors: { [key: string]: string }, processingContext: Nullable<ShaderProcessingContext>) => string;\r\n endOfUniformBufferProcessor?: (closingBracketLine: string, isFragment: boolean, processingContext: Nullable<ShaderProcessingContext>) => string;\r\n lineProcessor?: (line: string, isFragment: boolean, processingContext: Nullable<ShaderProcessingContext>) => string;\r\n preProcessor?: (code: string, defines: string[], isFragment: boolean, processingContext: Nullable<ShaderProcessingContext>) => string;\r\n postProcessor?: (\r\n code: string,\r\n defines: string[],\r\n isFragment: boolean,\r\n processingContext: Nullable<ShaderProcessingContext>,\r\n patameters: {\r\n [key: string]: number | string | boolean | undefined;\r\n }\r\n ) => string;\r\n initializeShaders?: (processingContext: Nullable<ShaderProcessingContext>) => void;\r\n finalizeShaders?: (vertexCode: string, fragmentCode: string, processingContext: Nullable<ShaderProcessingContext>) => { vertexCode: string; fragmentCode: string };\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"iShaderProcessor.js","sourceRoot":"","sources":["../../../../../dev/core/src/Engines/Processors/iShaderProcessor.ts"],"names":[],"mappings":"","sourcesContent":["import type { ShaderLanguage } from \"../../Materials/shaderLanguage\";\r\nimport type { Nullable } from \"../../types\";\r\nimport type { ShaderProcessingContext } from \"./shaderProcessingOptions\";\r\n\r\n/** @internal */\r\nexport interface IShaderProcessor {\r\n shaderLanguage: ShaderLanguage;\r\n\r\n uniformRegexp?: RegExp;\r\n uniformBufferRegexp?: RegExp;\r\n textureRegexp?: RegExp;\r\n noPrecision?: boolean;\r\n parseGLES3?: boolean;\r\n\r\n attributeKeywordName?: string;\r\n varyingVertexKeywordName?: string;\r\n varyingFragmentKeywordName?: string;\r\n\r\n preProcessShaderCode?: (code: string, isFragment: boolean) => string;\r\n attributeProcessor?: (attribute: string, preProcessors: { [key: string]: string }, processingContext: Nullable<ShaderProcessingContext>) => string;\r\n varyingCheck?: (varying: string, isFragment: boolean) => boolean;\r\n varyingProcessor?: (varying: string, isFragment: boolean, preProcessors: { [key: string]: string }, processingContext: Nullable<ShaderProcessingContext>) => string;\r\n uniformProcessor?: (uniform: string, isFragment: boolean, preProcessors: { [key: string]: string }, processingContext: Nullable<ShaderProcessingContext>) => string;\r\n uniformBufferProcessor?: (uniformBuffer: string, isFragment: boolean, processingContext: Nullable<ShaderProcessingContext>) => string;\r\n textureProcessor?: (texture: string, isFragment: boolean, preProcessors: { [key: string]: string }, processingContext: Nullable<ShaderProcessingContext>) => string;\r\n endOfUniformBufferProcessor?: (closingBracketLine: string, isFragment: boolean, processingContext: Nullable<ShaderProcessingContext>) => string;\r\n lineProcessor?: (line: string, isFragment: boolean, processingContext: Nullable<ShaderProcessingContext>) => string;\r\n preProcessor?: (code: string, defines: string[], preProcessors: { [key: string]: string }, isFragment: boolean, processingContext: Nullable<ShaderProcessingContext>) => string;\r\n postProcessor?: (\r\n code: string,\r\n defines: string[],\r\n isFragment: boolean,\r\n processingContext: Nullable<ShaderProcessingContext>,\r\n patameters: {\r\n [key: string]: number | string | boolean | undefined;\r\n }\r\n ) => string;\r\n initializeShaders?: (processingContext: Nullable<ShaderProcessingContext>) => void;\r\n finalizeShaders?: (vertexCode: string, fragmentCode: string, processingContext: Nullable<ShaderProcessingContext>) => { vertexCode: string; fragmentCode: string };\r\n}\r\n"]}
|
|
@@ -262,7 +262,7 @@ function _ProcessShaderConversion(sourceCode, options, engine) {
|
|
|
262
262
|
const preprocessors = _PreparePreProcessors(options, engine);
|
|
263
263
|
// General pre processing
|
|
264
264
|
if (options.processor.preProcessor) {
|
|
265
|
-
preparedSourceCode = options.processor.preProcessor(preparedSourceCode, defines, options.isFragment, options.processingContext);
|
|
265
|
+
preparedSourceCode = options.processor.preProcessor(preparedSourceCode, defines, preprocessors, options.isFragment, options.processingContext);
|
|
266
266
|
}
|
|
267
267
|
preparedSourceCode = _EvaluatePreProcessors(preparedSourceCode, preprocessors, options);
|
|
268
268
|
// Post processing
|
|
@@ -285,7 +285,7 @@ function _ApplyPreProcessing(sourceCode, options, engine) {
|
|
|
285
285
|
const preprocessors = _PreparePreProcessors(options, engine);
|
|
286
286
|
// General pre processing
|
|
287
287
|
if (options.processor?.preProcessor) {
|
|
288
|
-
preparedSourceCode = options.processor.preProcessor(preparedSourceCode, defines, options.isFragment, options.processingContext);
|
|
288
|
+
preparedSourceCode = options.processor.preProcessor(preparedSourceCode, defines, preprocessors, options.isFragment, options.processingContext);
|
|
289
289
|
}
|
|
290
290
|
preparedSourceCode = _EvaluatePreProcessors(preparedSourceCode, preprocessors, options);
|
|
291
291
|
// Post processing
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shaderProcessor.js","sourceRoot":"","sources":["../../../../../dev/core/src/Engines/Processors/shaderProcessor.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,6BAA6B,EAAE,MAAM,uDAAuD,CAAC;AACtG,OAAO,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AACxF,OAAO,EAAE,uBAAuB,EAAE,MAAM,iDAAiD,CAAC;AAC1F,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC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gBAClE,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;YACxD,CAAC,CAAC,CAAC;YACH,OAAO;SACV;KACJ;IACD,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC;IAE3B,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAE7B,IAAI,cAAc,EAAE;QAChB,gBAAgB,CAAC,WAAW,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;KAC/D;SAAM;QACH,QAAQ,CAAC,WAAW,CAAC,CAAC;KACzB;AACL,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAC9B;;;;;;;;;;OAUG;IACH,QAAQ,EAAE,CACN,GAAW,EACX,SAAqE,EACrE,UAAwC,EACxC,eAAkC,EAClC,cAAwB,EACxB,OAAmE,EACvD,EAAE;QACd,MAAM,WAAW,CAAC,WAAW,CAAC,CAAC;IACnC,CAAC;CACJ,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\r\nimport { ShaderCodeNode } from \"./shaderCodeNode\";\r\nimport { ShaderCodeCursor } from \"./shaderCodeCursor\";\r\nimport { ShaderCodeConditionNode } from \"./shaderCodeConditionNode\";\r\nimport { ShaderCodeTestNode } from \"./shaderCodeTestNode\";\r\nimport { ShaderDefineIsDefinedOperator } from \"./Expressions/Operators/shaderDefineIsDefinedOperator\";\r\nimport { ShaderDefineOrOperator } from \"./Expressions/Operators/shaderDefineOrOperator\";\r\nimport { ShaderDefineAndOperator } from \"./Expressions/Operators/shaderDefineAndOperator\";\r\nimport { ShaderDefineExpression } from \"./Expressions/shaderDefineExpression\";\r\nimport { ShaderDefineArithmeticOperator } from \"./Expressions/Operators/shaderDefineArithmeticOperator\";\r\nimport type { ProcessingOptions } from \"./shaderProcessingOptions\";\r\nimport { _WarnImport } from \"../../Misc/devTools\";\r\nimport { ShaderLanguage } from \"../../Materials/shaderLanguage\";\r\n\r\nimport type { WebRequest } from \"../../Misc/webRequest\";\r\nimport type { LoadFileError } from \"../../Misc/fileTools\";\r\nimport type { IOfflineProvider } from \"../../Offline/IOfflineProvider\";\r\nimport type { IFileRequest } from \"../../Misc/fileRequest\";\r\nimport { _getGlobalDefines } from \"../abstractEngine.functions\";\r\nimport type { AbstractEngine } from \"../abstractEngine\";\r\n\r\nconst regexSE = /defined\\s*?\\((.+?)\\)/g;\r\nconst regexSERevert = /defined\\s*?\\[(.+?)\\]/g;\r\nconst regexShaderInclude = /#include\\s?<(.+)>(\\((.*)\\))*(\\[(.*)\\])*/g;\r\nconst regexShaderDecl = /__decl__/;\r\nconst regexLightX = /light\\{X\\}.(\\w*)/g;\r\nconst regexX = /\\{X\\}/g;\r\nconst reusableMatches: RegExpMatchArray[] = [];\r\n\r\nconst _MoveCursorRegex = /(#ifdef)|(#else)|(#elif)|(#endif)|(#ifndef)|(#if)/;\r\n\r\nexport function Initialize(options: ProcessingOptions): void {\r\n if (options.processor && options.processor.initializeShaders) {\r\n options.processor.initializeShaders(options.processingContext);\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport function Process(sourceCode: string, options: ProcessingOptions, callback: (migratedCode: string, codeBeforeMigration: string) => void, engine?: AbstractEngine) {\r\n if (options.processor?.preProcessShaderCode) {\r\n sourceCode = options.processor.preProcessShaderCode(sourceCode, options.isFragment);\r\n }\r\n _ProcessIncludes(sourceCode, options, (codeWithIncludes) => {\r\n if (options.processCodeAfterIncludes) {\r\n codeWithIncludes = options.processCodeAfterIncludes(options.isFragment ? \"fragment\" : \"vertex\", codeWithIncludes);\r\n }\r\n const migratedCode = _ProcessShaderConversion(codeWithIncludes, options, engine);\r\n callback(migratedCode, codeWithIncludes);\r\n });\r\n}\r\n\r\n/** @internal */\r\nexport function PreProcess(sourceCode: string, options: ProcessingOptions, callback: (migratedCode: string, codeBeforeMigration: string) => void, engine: AbstractEngine) {\r\n if (options.processor?.preProcessShaderCode) {\r\n sourceCode = options.processor.preProcessShaderCode(sourceCode, options.isFragment);\r\n }\r\n _ProcessIncludes(sourceCode, options, (codeWithIncludes) => {\r\n if (options.processCodeAfterIncludes) {\r\n codeWithIncludes = options.processCodeAfterIncludes(options.isFragment ? \"fragment\" : \"vertex\", codeWithIncludes);\r\n }\r\n const migratedCode = _ApplyPreProcessing(codeWithIncludes, options, engine);\r\n callback(migratedCode, codeWithIncludes);\r\n });\r\n}\r\n\r\n/** @internal */\r\nexport function Finalize(vertexCode: string, fragmentCode: string, options: ProcessingOptions): { vertexCode: string; fragmentCode: string } {\r\n if (!options.processor || !options.processor.finalizeShaders) {\r\n return { vertexCode, fragmentCode };\r\n }\r\n\r\n return options.processor.finalizeShaders(vertexCode, fragmentCode, options.processingContext);\r\n}\r\n\r\nfunction _ProcessPrecision(source: string, options: ProcessingOptions): string {\r\n if (options.processor?.noPrecision) {\r\n return source;\r\n }\r\n\r\n const shouldUseHighPrecisionShader = options.shouldUseHighPrecisionShader;\r\n\r\n if (source.indexOf(\"precision highp float\") === -1) {\r\n if (!shouldUseHighPrecisionShader) {\r\n source = \"precision mediump float;\\n\" + source;\r\n } else {\r\n source = \"precision highp float;\\n\" + source;\r\n }\r\n } else {\r\n if (!shouldUseHighPrecisionShader) {\r\n // Moving highp to mediump\r\n source = source.replace(\"precision highp float\", \"precision mediump float\");\r\n }\r\n }\r\n\r\n return source;\r\n}\r\n\r\nfunction _ExtractOperation(expression: string) {\r\n const regex = /defined\\((.+)\\)/;\r\n\r\n const match = regex.exec(expression);\r\n\r\n if (match && match.length) {\r\n return new ShaderDefineIsDefinedOperator(match[1].trim(), expression[0] === \"!\");\r\n }\r\n\r\n const operators = [\"==\", \"!=\", \">=\", \"<=\", \"<\", \">\"];\r\n let operator = \"\";\r\n let indexOperator = 0;\r\n\r\n for (operator of operators) {\r\n indexOperator = expression.indexOf(operator);\r\n\r\n if (indexOperator > -1) {\r\n break;\r\n }\r\n }\r\n\r\n if (indexOperator === -1) {\r\n return new ShaderDefineIsDefinedOperator(expression);\r\n }\r\n\r\n const define = expression.substring(0, indexOperator).trim();\r\n const value = expression.substring(indexOperator + operator.length).trim();\r\n\r\n return new ShaderDefineArithmeticOperator(define, operator, value);\r\n}\r\n\r\nfunction _BuildSubExpression(expression: string): ShaderDefineExpression {\r\n expression = expression.replace(regexSE, \"defined[$1]\");\r\n\r\n const postfix = ShaderDefineExpression.infixToPostfix(expression);\r\n\r\n const stack: (string | ShaderDefineExpression)[] = [];\r\n\r\n for (const c of postfix) {\r\n if (c !== \"||\" && c !== \"&&\") {\r\n stack.push(c);\r\n } else if (stack.length >= 2) {\r\n let v1 = stack[stack.length - 1],\r\n v2 = stack[stack.length - 2];\r\n\r\n stack.length -= 2;\r\n\r\n const operator = c == \"&&\" ? new ShaderDefineAndOperator() : new ShaderDefineOrOperator();\r\n\r\n if (typeof v1 === \"string\") {\r\n v1 = v1.replace(regexSERevert, \"defined($1)\");\r\n }\r\n\r\n if (typeof v2 === \"string\") {\r\n v2 = v2.replace(regexSERevert, \"defined($1)\");\r\n }\r\n\r\n operator.leftOperand = typeof v2 === \"string\" ? _ExtractOperation(v2) : v2;\r\n operator.rightOperand = typeof v1 === \"string\" ? _ExtractOperation(v1) : v1;\r\n\r\n stack.push(operator);\r\n }\r\n }\r\n\r\n let result = stack[stack.length - 1];\r\n\r\n if (typeof result === \"string\") {\r\n result = result.replace(regexSERevert, \"defined($1)\");\r\n }\r\n\r\n // note: stack.length !== 1 if there was an error in the parsing\r\n\r\n return typeof result === \"string\" ? _ExtractOperation(result) : result;\r\n}\r\n\r\nfunction _BuildExpression(line: string, start: number): ShaderCodeTestNode {\r\n const node = new ShaderCodeTestNode();\r\n const command = line.substring(0, start);\r\n let expression = line.substring(start);\r\n\r\n expression = expression.substring(0, (expression.indexOf(\"//\") + 1 || expression.length + 1) - 1).trim();\r\n\r\n if (command === \"#ifdef\") {\r\n node.testExpression = new ShaderDefineIsDefinedOperator(expression);\r\n } else if (command === \"#ifndef\") {\r\n node.testExpression = new ShaderDefineIsDefinedOperator(expression, true);\r\n } else {\r\n node.testExpression = _BuildSubExpression(expression);\r\n }\r\n\r\n return node;\r\n}\r\n\r\nfunction _MoveCursorWithinIf(cursor: ShaderCodeCursor, rootNode: ShaderCodeConditionNode, ifNode: ShaderCodeNode) {\r\n let line = cursor.currentLine;\r\n while (_MoveCursor(cursor, ifNode)) {\r\n line = cursor.currentLine;\r\n const first5 = line.substring(0, 5).toLowerCase();\r\n\r\n if (first5 === \"#else\") {\r\n const elseNode = new ShaderCodeNode();\r\n rootNode.children.push(elseNode);\r\n _MoveCursor(cursor, elseNode);\r\n return;\r\n } else if (first5 === \"#elif\") {\r\n const elifNode = _BuildExpression(line, 5);\r\n\r\n rootNode.children.push(elifNode);\r\n ifNode = elifNode;\r\n }\r\n }\r\n}\r\n\r\nfunction _MoveCursor(cursor: ShaderCodeCursor, rootNode: ShaderCodeNode): boolean {\r\n while (cursor.canRead) {\r\n cursor.lineIndex++;\r\n const line = cursor.currentLine;\r\n\r\n if (line.indexOf(\"#\") >= 0) {\r\n const matches = _MoveCursorRegex.exec(line);\r\n\r\n if (matches && matches.length) {\r\n const keyword = matches[0];\r\n\r\n switch (keyword) {\r\n case \"#ifdef\": {\r\n const newRootNode = new ShaderCodeConditionNode();\r\n rootNode.children.push(newRootNode);\r\n\r\n const ifNode = _BuildExpression(line, 6);\r\n newRootNode.children.push(ifNode);\r\n _MoveCursorWithinIf(cursor, newRootNode, ifNode);\r\n break;\r\n }\r\n case \"#else\":\r\n case \"#elif\":\r\n return true;\r\n case \"#endif\":\r\n return false;\r\n case \"#ifndef\": {\r\n const newRootNode = new ShaderCodeConditionNode();\r\n rootNode.children.push(newRootNode);\r\n\r\n const ifNode = _BuildExpression(line, 7);\r\n newRootNode.children.push(ifNode);\r\n _MoveCursorWithinIf(cursor, newRootNode, ifNode);\r\n break;\r\n }\r\n case \"#if\": {\r\n const newRootNode = new ShaderCodeConditionNode();\r\n const ifNode = _BuildExpression(line, 3);\r\n rootNode.children.push(newRootNode);\r\n\r\n newRootNode.children.push(ifNode);\r\n _MoveCursorWithinIf(cursor, newRootNode, ifNode);\r\n break;\r\n }\r\n }\r\n continue;\r\n }\r\n }\r\n\r\n const newNode = new ShaderCodeNode();\r\n newNode.line = line;\r\n rootNode.children.push(newNode);\r\n\r\n // Detect additional defines\r\n if (line[0] === \"#\" && line[1] === \"d\") {\r\n const split = line.replace(\";\", \"\").split(\" \");\r\n newNode.additionalDefineKey = split[1];\r\n\r\n if (split.length === 3) {\r\n newNode.additionalDefineValue = split[2];\r\n }\r\n }\r\n }\r\n return false;\r\n}\r\n\r\nfunction _EvaluatePreProcessors(sourceCode: string, preprocessors: { [key: string]: string }, options: ProcessingOptions): string {\r\n const rootNode = new ShaderCodeNode();\r\n const cursor = new ShaderCodeCursor();\r\n\r\n cursor.lineIndex = -1;\r\n cursor.lines = sourceCode.split(\"\\n\");\r\n\r\n // Decompose (We keep it in 2 steps so it is easier to maintain and perf hit is insignificant)\r\n _MoveCursor(cursor, rootNode);\r\n\r\n // Recompose\r\n return rootNode.process(preprocessors, options);\r\n}\r\n\r\nfunction _PreparePreProcessors(options: ProcessingOptions, engine?: AbstractEngine): { [key: string]: string } {\r\n const defines = options.defines;\r\n const preprocessors: { [key: string]: string } = {};\r\n\r\n for (const define of defines) {\r\n const keyValue = define.replace(\"#define\", \"\").replace(\";\", \"\").trim();\r\n const split = keyValue.split(\" \");\r\n preprocessors[split[0]] = split.length > 1 ? split[1] : \"\";\r\n }\r\n\r\n if (options.processor?.shaderLanguage === ShaderLanguage.GLSL) {\r\n preprocessors[\"GL_ES\"] = \"true\";\r\n }\r\n preprocessors[\"__VERSION__\"] = options.version;\r\n preprocessors[options.platformName] = \"true\";\r\n\r\n _getGlobalDefines(preprocessors, engine?.isNDCHalfZRange, engine?.useReverseDepthBuffer, engine?.useExactSrgbConversions);\r\n\r\n return preprocessors;\r\n}\r\n\r\nfunction _ProcessShaderConversion(sourceCode: string, options: ProcessingOptions, engine?: AbstractEngine): string {\r\n let preparedSourceCode = _ProcessPrecision(sourceCode, options);\r\n\r\n if (!options.processor) {\r\n return preparedSourceCode;\r\n }\r\n\r\n // Already converted\r\n if (options.processor.shaderLanguage === ShaderLanguage.GLSL && preparedSourceCode.indexOf(\"#version 3\") !== -1) {\r\n preparedSourceCode = preparedSourceCode.replace(\"#version 300 es\", \"\");\r\n if (!options.processor.parseGLES3) {\r\n return preparedSourceCode;\r\n }\r\n }\r\n\r\n const defines = options.defines;\r\n\r\n const preprocessors = _PreparePreProcessors(options, engine);\r\n\r\n // General pre processing\r\n if (options.processor.preProcessor) {\r\n preparedSourceCode = options.processor.preProcessor(preparedSourceCode, defines, options.isFragment, options.processingContext);\r\n }\r\n\r\n preparedSourceCode = _EvaluatePreProcessors(preparedSourceCode, preprocessors, options);\r\n\r\n // Post processing\r\n if (options.processor.postProcessor) {\r\n preparedSourceCode = options.processor.postProcessor(\r\n preparedSourceCode,\r\n defines,\r\n options.isFragment,\r\n options.processingContext,\r\n engine\r\n ? {\r\n drawBuffersExtensionDisabled: engine.getCaps().drawBuffersExtension ? false : true,\r\n }\r\n : {}\r\n );\r\n }\r\n\r\n // Inline functions tagged with #define inline\r\n if (engine?._features.needShaderCodeInlining) {\r\n preparedSourceCode = engine.inlineShaderCode(preparedSourceCode);\r\n }\r\n\r\n return preparedSourceCode;\r\n}\r\n\r\nfunction _ApplyPreProcessing(sourceCode: string, options: ProcessingOptions, engine: AbstractEngine): string {\r\n let preparedSourceCode = sourceCode;\r\n\r\n const defines = options.defines;\r\n\r\n const preprocessors = _PreparePreProcessors(options, engine);\r\n\r\n // General pre processing\r\n if (options.processor?.preProcessor) {\r\n preparedSourceCode = options.processor.preProcessor(preparedSourceCode, defines, options.isFragment, options.processingContext);\r\n }\r\n\r\n preparedSourceCode = _EvaluatePreProcessors(preparedSourceCode, preprocessors, options);\r\n\r\n // Post processing\r\n if (options.processor?.postProcessor) {\r\n preparedSourceCode = options.processor.postProcessor(\r\n preparedSourceCode,\r\n defines,\r\n options.isFragment,\r\n options.processingContext,\r\n engine\r\n ? {\r\n drawBuffersExtensionDisabled: engine.getCaps().drawBuffersExtension ? false : true,\r\n }\r\n : {}\r\n );\r\n }\r\n\r\n // Inline functions tagged with #define inline\r\n if (engine._features.needShaderCodeInlining) {\r\n preparedSourceCode = engine.inlineShaderCode(preparedSourceCode);\r\n }\r\n\r\n return preparedSourceCode;\r\n}\r\n\r\n/** @internal */\r\nexport function _ProcessIncludes(sourceCode: string, options: ProcessingOptions, callback: (data: any) => void): void {\r\n reusableMatches.length = 0;\r\n let match: RegExpMatchArray | null;\r\n // stay back-compat to the old matchAll syntax\r\n while ((match = regexShaderInclude.exec(sourceCode)) !== null) {\r\n reusableMatches.push(match);\r\n }\r\n\r\n let returnValue = String(sourceCode);\r\n let parts = [sourceCode];\r\n\r\n let keepProcessing = false;\r\n\r\n for (const match of reusableMatches) {\r\n let includeFile = match[1];\r\n\r\n // Uniform declaration\r\n if (includeFile.indexOf(\"__decl__\") !== -1) {\r\n includeFile = includeFile.replace(regexShaderDecl, \"\");\r\n if (options.supportsUniformBuffers) {\r\n includeFile = includeFile.replace(\"Vertex\", \"Ubo\").replace(\"Fragment\", \"Ubo\");\r\n }\r\n includeFile = includeFile + \"Declaration\";\r\n }\r\n\r\n if (options.includesShadersStore[includeFile]) {\r\n // Substitution\r\n let includeContent = options.includesShadersStore[includeFile];\r\n if (match[2]) {\r\n const splits = match[3].split(\",\");\r\n\r\n for (let index = 0; index < splits.length; index += 2) {\r\n const source = new RegExp(splits[index], \"g\");\r\n const dest = splits[index + 1];\r\n\r\n includeContent = includeContent.replace(source, dest);\r\n }\r\n }\r\n\r\n if (match[4]) {\r\n const indexString = match[5];\r\n\r\n if (indexString.indexOf(\"..\") !== -1) {\r\n const indexSplits = indexString.split(\"..\");\r\n const minIndex = parseInt(indexSplits[0]);\r\n let maxIndex = parseInt(indexSplits[1]);\r\n let sourceIncludeContent = includeContent.slice(0);\r\n includeContent = \"\";\r\n\r\n if (isNaN(maxIndex)) {\r\n maxIndex = options.indexParameters[indexSplits[1]];\r\n }\r\n\r\n for (let i = minIndex; i < maxIndex; i++) {\r\n if (!options.supportsUniformBuffers) {\r\n // Ubo replacement\r\n sourceIncludeContent = sourceIncludeContent.replace(regexLightX, (str: string, p1: string) => {\r\n return p1 + \"{X}\";\r\n });\r\n }\r\n includeContent += sourceIncludeContent.replace(regexX, i.toString()) + \"\\n\";\r\n }\r\n } else {\r\n if (!options.supportsUniformBuffers) {\r\n // Ubo replacement\r\n includeContent = includeContent.replace(regexLightX, (str: string, p1: string) => {\r\n return p1 + \"{X}\";\r\n });\r\n }\r\n includeContent = includeContent.replace(regexX, indexString);\r\n }\r\n }\r\n\r\n // Replace\r\n // Split all parts on match[0] and intersperse the parts with the include content\r\n const newParts = [];\r\n for (const part of parts) {\r\n const splitPart = part.split(match[0]);\r\n for (let i = 0; i < splitPart.length - 1; i++) {\r\n newParts.push(splitPart[i]);\r\n newParts.push(includeContent);\r\n }\r\n newParts.push(splitPart[splitPart.length - 1]);\r\n }\r\n parts = newParts;\r\n\r\n keepProcessing = keepProcessing || includeContent.indexOf(\"#include<\") >= 0 || includeContent.indexOf(\"#include <\") >= 0;\r\n } else {\r\n const includeShaderUrl = options.shadersRepository + \"ShadersInclude/\" + includeFile + \".fx\";\r\n\r\n _functionContainer.loadFile(includeShaderUrl, (fileContent) => {\r\n options.includesShadersStore[includeFile] = fileContent as string;\r\n _ProcessIncludes(parts.join(\"\"), options, callback);\r\n });\r\n return;\r\n }\r\n }\r\n reusableMatches.length = 0;\r\n\r\n returnValue = parts.join(\"\");\r\n\r\n if (keepProcessing) {\r\n _ProcessIncludes(returnValue.toString(), options, callback);\r\n } else {\r\n callback(returnValue);\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport const _functionContainer = {\r\n /**\r\n * Loads a file from a url\r\n * @param url url to load\r\n * @param onSuccess callback called when the file successfully loads\r\n * @param onProgress callback called while file is loading (if the server supports this mode)\r\n * @param offlineProvider defines the offline provider for caching\r\n * @param useArrayBuffer defines a boolean indicating that date must be returned as ArrayBuffer\r\n * @param onError callback called when the file fails to load\r\n * @returns a file request object\r\n * @internal\r\n */\r\n loadFile: (\r\n url: string,\r\n onSuccess: (data: string | ArrayBuffer, responseURL?: string) => void,\r\n onProgress?: (ev: ProgressEvent) => void,\r\n offlineProvider?: IOfflineProvider,\r\n useArrayBuffer?: boolean,\r\n onError?: (request?: WebRequest, exception?: LoadFileError) => void\r\n ): IFileRequest => {\r\n throw _WarnImport(\"FileTools\");\r\n },\r\n};\r\n"]}
|
|
1
|
+
{"version":3,"file":"shaderProcessor.js","sourceRoot":"","sources":["../../../../../dev/core/src/Engines/Processors/shaderProcessor.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,6BAA6B,EAAE,MAAM,uDAAuD,CAAC;AACtG,OAAO,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AACxF,OAAO,EAAE,uBAAuB,EAAE,MAAM,iDAAiD,CAAC;AAC1F,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,8BAA8B,EAAE,MAAM,wDAAwD,CAAC;AAExG,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAMhE,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAGhE,MAAM,OAAO,GAAG,uBAAuB,CAAC;AACxC,MAAM,aAAa,GAAG,uBAAuB,CAAC;AAC9C,MAAM,kBAAkB,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AAW,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;KAC/D;SAAM;QACH,QAAQ,CAAC,WAAW,CAAC,CAAC;KACzB;AACL,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAC9B;;;;;;;;;;OAUG;IACH,QAAQ,EAAE,CACN,GAAW,EACX,SAAqE,EACrE,UAAwC,EACxC,eAAkC,EAClC,cAAwB,EACxB,OAAmE,EACvD,EAAE;QACd,MAAM,WAAW,CAAC,WAAW,CAAC,CAAC;IACnC,CAAC;CACJ,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\r\nimport { ShaderCodeNode } from \"./shaderCodeNode\";\r\nimport { ShaderCodeCursor } from \"./shaderCodeCursor\";\r\nimport { ShaderCodeConditionNode } from \"./shaderCodeConditionNode\";\r\nimport { ShaderCodeTestNode } from \"./shaderCodeTestNode\";\r\nimport { ShaderDefineIsDefinedOperator } from \"./Expressions/Operators/shaderDefineIsDefinedOperator\";\r\nimport { ShaderDefineOrOperator } from \"./Expressions/Operators/shaderDefineOrOperator\";\r\nimport { ShaderDefineAndOperator } from \"./Expressions/Operators/shaderDefineAndOperator\";\r\nimport { ShaderDefineExpression } from \"./Expressions/shaderDefineExpression\";\r\nimport { ShaderDefineArithmeticOperator } from \"./Expressions/Operators/shaderDefineArithmeticOperator\";\r\nimport type { ProcessingOptions } from \"./shaderProcessingOptions\";\r\nimport { _WarnImport } from \"../../Misc/devTools\";\r\nimport { ShaderLanguage } from \"../../Materials/shaderLanguage\";\r\n\r\nimport type { WebRequest } from \"../../Misc/webRequest\";\r\nimport type { LoadFileError } from \"../../Misc/fileTools\";\r\nimport type { IOfflineProvider } from \"../../Offline/IOfflineProvider\";\r\nimport type { IFileRequest } from \"../../Misc/fileRequest\";\r\nimport { _getGlobalDefines } from \"../abstractEngine.functions\";\r\nimport type { AbstractEngine } from \"../abstractEngine\";\r\n\r\nconst regexSE = /defined\\s*?\\((.+?)\\)/g;\r\nconst regexSERevert = /defined\\s*?\\[(.+?)\\]/g;\r\nconst regexShaderInclude = /#include\\s?<(.+)>(\\((.*)\\))*(\\[(.*)\\])*/g;\r\nconst regexShaderDecl = /__decl__/;\r\nconst regexLightX = /light\\{X\\}.(\\w*)/g;\r\nconst regexX = /\\{X\\}/g;\r\nconst reusableMatches: RegExpMatchArray[] = [];\r\n\r\nconst _MoveCursorRegex = /(#ifdef)|(#else)|(#elif)|(#endif)|(#ifndef)|(#if)/;\r\n\r\nexport function Initialize(options: ProcessingOptions): void {\r\n if (options.processor && options.processor.initializeShaders) {\r\n options.processor.initializeShaders(options.processingContext);\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport function Process(sourceCode: string, options: ProcessingOptions, callback: (migratedCode: string, codeBeforeMigration: string) => void, engine?: AbstractEngine) {\r\n if (options.processor?.preProcessShaderCode) {\r\n sourceCode = options.processor.preProcessShaderCode(sourceCode, options.isFragment);\r\n }\r\n _ProcessIncludes(sourceCode, options, (codeWithIncludes) => {\r\n if (options.processCodeAfterIncludes) {\r\n codeWithIncludes = options.processCodeAfterIncludes(options.isFragment ? \"fragment\" : \"vertex\", codeWithIncludes);\r\n }\r\n const migratedCode = _ProcessShaderConversion(codeWithIncludes, options, engine);\r\n callback(migratedCode, codeWithIncludes);\r\n });\r\n}\r\n\r\n/** @internal */\r\nexport function PreProcess(sourceCode: string, options: ProcessingOptions, callback: (migratedCode: string, codeBeforeMigration: string) => void, engine: AbstractEngine) {\r\n if (options.processor?.preProcessShaderCode) {\r\n sourceCode = options.processor.preProcessShaderCode(sourceCode, options.isFragment);\r\n }\r\n _ProcessIncludes(sourceCode, options, (codeWithIncludes) => {\r\n if (options.processCodeAfterIncludes) {\r\n codeWithIncludes = options.processCodeAfterIncludes(options.isFragment ? \"fragment\" : \"vertex\", codeWithIncludes);\r\n }\r\n const migratedCode = _ApplyPreProcessing(codeWithIncludes, options, engine);\r\n callback(migratedCode, codeWithIncludes);\r\n });\r\n}\r\n\r\n/** @internal */\r\nexport function Finalize(vertexCode: string, fragmentCode: string, options: ProcessingOptions): { vertexCode: string; fragmentCode: string } {\r\n if (!options.processor || !options.processor.finalizeShaders) {\r\n return { vertexCode, fragmentCode };\r\n }\r\n\r\n return options.processor.finalizeShaders(vertexCode, fragmentCode, options.processingContext);\r\n}\r\n\r\nfunction _ProcessPrecision(source: string, options: ProcessingOptions): string {\r\n if (options.processor?.noPrecision) {\r\n return source;\r\n }\r\n\r\n const shouldUseHighPrecisionShader = options.shouldUseHighPrecisionShader;\r\n\r\n if (source.indexOf(\"precision highp float\") === -1) {\r\n if (!shouldUseHighPrecisionShader) {\r\n source = \"precision mediump float;\\n\" + source;\r\n } else {\r\n source = \"precision highp float;\\n\" + source;\r\n }\r\n } else {\r\n if (!shouldUseHighPrecisionShader) {\r\n // Moving highp to mediump\r\n source = source.replace(\"precision highp float\", \"precision mediump float\");\r\n }\r\n }\r\n\r\n return source;\r\n}\r\n\r\nfunction _ExtractOperation(expression: string) {\r\n const regex = /defined\\((.+)\\)/;\r\n\r\n const match = regex.exec(expression);\r\n\r\n if (match && match.length) {\r\n return new ShaderDefineIsDefinedOperator(match[1].trim(), expression[0] === \"!\");\r\n }\r\n\r\n const operators = [\"==\", \"!=\", \">=\", \"<=\", \"<\", \">\"];\r\n let operator = \"\";\r\n let indexOperator = 0;\r\n\r\n for (operator of operators) {\r\n indexOperator = expression.indexOf(operator);\r\n\r\n if (indexOperator > -1) {\r\n break;\r\n }\r\n }\r\n\r\n if (indexOperator === -1) {\r\n return new ShaderDefineIsDefinedOperator(expression);\r\n }\r\n\r\n const define = expression.substring(0, indexOperator).trim();\r\n const value = expression.substring(indexOperator + operator.length).trim();\r\n\r\n return new ShaderDefineArithmeticOperator(define, operator, value);\r\n}\r\n\r\nfunction _BuildSubExpression(expression: string): ShaderDefineExpression {\r\n expression = expression.replace(regexSE, \"defined[$1]\");\r\n\r\n const postfix = ShaderDefineExpression.infixToPostfix(expression);\r\n\r\n const stack: (string | ShaderDefineExpression)[] = [];\r\n\r\n for (const c of postfix) {\r\n if (c !== \"||\" && c !== \"&&\") {\r\n stack.push(c);\r\n } else if (stack.length >= 2) {\r\n let v1 = stack[stack.length - 1],\r\n v2 = stack[stack.length - 2];\r\n\r\n stack.length -= 2;\r\n\r\n const operator = c == \"&&\" ? new ShaderDefineAndOperator() : new ShaderDefineOrOperator();\r\n\r\n if (typeof v1 === \"string\") {\r\n v1 = v1.replace(regexSERevert, \"defined($1)\");\r\n }\r\n\r\n if (typeof v2 === \"string\") {\r\n v2 = v2.replace(regexSERevert, \"defined($1)\");\r\n }\r\n\r\n operator.leftOperand = typeof v2 === \"string\" ? _ExtractOperation(v2) : v2;\r\n operator.rightOperand = typeof v1 === \"string\" ? _ExtractOperation(v1) : v1;\r\n\r\n stack.push(operator);\r\n }\r\n }\r\n\r\n let result = stack[stack.length - 1];\r\n\r\n if (typeof result === \"string\") {\r\n result = result.replace(regexSERevert, \"defined($1)\");\r\n }\r\n\r\n // note: stack.length !== 1 if there was an error in the parsing\r\n\r\n return typeof result === \"string\" ? _ExtractOperation(result) : result;\r\n}\r\n\r\nfunction _BuildExpression(line: string, start: number): ShaderCodeTestNode {\r\n const node = new ShaderCodeTestNode();\r\n const command = line.substring(0, start);\r\n let expression = line.substring(start);\r\n\r\n expression = expression.substring(0, (expression.indexOf(\"//\") + 1 || expression.length + 1) - 1).trim();\r\n\r\n if (command === \"#ifdef\") {\r\n node.testExpression = new ShaderDefineIsDefinedOperator(expression);\r\n } else if (command === \"#ifndef\") {\r\n node.testExpression = new ShaderDefineIsDefinedOperator(expression, true);\r\n } else {\r\n node.testExpression = _BuildSubExpression(expression);\r\n }\r\n\r\n return node;\r\n}\r\n\r\nfunction _MoveCursorWithinIf(cursor: ShaderCodeCursor, rootNode: ShaderCodeConditionNode, ifNode: ShaderCodeNode) {\r\n let line = cursor.currentLine;\r\n while (_MoveCursor(cursor, ifNode)) {\r\n line = cursor.currentLine;\r\n const first5 = line.substring(0, 5).toLowerCase();\r\n\r\n if (first5 === \"#else\") {\r\n const elseNode = new ShaderCodeNode();\r\n rootNode.children.push(elseNode);\r\n _MoveCursor(cursor, elseNode);\r\n return;\r\n } else if (first5 === \"#elif\") {\r\n const elifNode = _BuildExpression(line, 5);\r\n\r\n rootNode.children.push(elifNode);\r\n ifNode = elifNode;\r\n }\r\n }\r\n}\r\n\r\nfunction _MoveCursor(cursor: ShaderCodeCursor, rootNode: ShaderCodeNode): boolean {\r\n while (cursor.canRead) {\r\n cursor.lineIndex++;\r\n const line = cursor.currentLine;\r\n\r\n if (line.indexOf(\"#\") >= 0) {\r\n const matches = _MoveCursorRegex.exec(line);\r\n\r\n if (matches && matches.length) {\r\n const keyword = matches[0];\r\n\r\n switch (keyword) {\r\n case \"#ifdef\": {\r\n const newRootNode = new ShaderCodeConditionNode();\r\n rootNode.children.push(newRootNode);\r\n\r\n const ifNode = _BuildExpression(line, 6);\r\n newRootNode.children.push(ifNode);\r\n _MoveCursorWithinIf(cursor, newRootNode, ifNode);\r\n break;\r\n }\r\n case \"#else\":\r\n case \"#elif\":\r\n return true;\r\n case \"#endif\":\r\n return false;\r\n case \"#ifndef\": {\r\n const newRootNode = new ShaderCodeConditionNode();\r\n rootNode.children.push(newRootNode);\r\n\r\n const ifNode = _BuildExpression(line, 7);\r\n newRootNode.children.push(ifNode);\r\n _MoveCursorWithinIf(cursor, newRootNode, ifNode);\r\n break;\r\n }\r\n case \"#if\": {\r\n const newRootNode = new ShaderCodeConditionNode();\r\n const ifNode = _BuildExpression(line, 3);\r\n rootNode.children.push(newRootNode);\r\n\r\n newRootNode.children.push(ifNode);\r\n _MoveCursorWithinIf(cursor, newRootNode, ifNode);\r\n break;\r\n }\r\n }\r\n continue;\r\n }\r\n }\r\n\r\n const newNode = new ShaderCodeNode();\r\n newNode.line = line;\r\n rootNode.children.push(newNode);\r\n\r\n // Detect additional defines\r\n if (line[0] === \"#\" && line[1] === \"d\") {\r\n const split = line.replace(\";\", \"\").split(\" \");\r\n newNode.additionalDefineKey = split[1];\r\n\r\n if (split.length === 3) {\r\n newNode.additionalDefineValue = split[2];\r\n }\r\n }\r\n }\r\n return false;\r\n}\r\n\r\nfunction _EvaluatePreProcessors(sourceCode: string, preprocessors: { [key: string]: string }, options: ProcessingOptions): string {\r\n const rootNode = new ShaderCodeNode();\r\n const cursor = new ShaderCodeCursor();\r\n\r\n cursor.lineIndex = -1;\r\n cursor.lines = sourceCode.split(\"\\n\");\r\n\r\n // Decompose (We keep it in 2 steps so it is easier to maintain and perf hit is insignificant)\r\n _MoveCursor(cursor, rootNode);\r\n\r\n // Recompose\r\n return rootNode.process(preprocessors, options);\r\n}\r\n\r\nfunction _PreparePreProcessors(options: ProcessingOptions, engine?: AbstractEngine): { [key: string]: string } {\r\n const defines = options.defines;\r\n const preprocessors: { [key: string]: string } = {};\r\n\r\n for (const define of defines) {\r\n const keyValue = define.replace(\"#define\", \"\").replace(\";\", \"\").trim();\r\n const split = keyValue.split(\" \");\r\n preprocessors[split[0]] = split.length > 1 ? split[1] : \"\";\r\n }\r\n\r\n if (options.processor?.shaderLanguage === ShaderLanguage.GLSL) {\r\n preprocessors[\"GL_ES\"] = \"true\";\r\n }\r\n preprocessors[\"__VERSION__\"] = options.version;\r\n preprocessors[options.platformName] = \"true\";\r\n\r\n _getGlobalDefines(preprocessors, engine?.isNDCHalfZRange, engine?.useReverseDepthBuffer, engine?.useExactSrgbConversions);\r\n\r\n return preprocessors;\r\n}\r\n\r\nfunction _ProcessShaderConversion(sourceCode: string, options: ProcessingOptions, engine?: AbstractEngine): string {\r\n let preparedSourceCode = _ProcessPrecision(sourceCode, options);\r\n\r\n if (!options.processor) {\r\n return preparedSourceCode;\r\n }\r\n\r\n // Already converted\r\n if (options.processor.shaderLanguage === ShaderLanguage.GLSL && preparedSourceCode.indexOf(\"#version 3\") !== -1) {\r\n preparedSourceCode = preparedSourceCode.replace(\"#version 300 es\", \"\");\r\n if (!options.processor.parseGLES3) {\r\n return preparedSourceCode;\r\n }\r\n }\r\n\r\n const defines = options.defines;\r\n\r\n const preprocessors = _PreparePreProcessors(options, engine);\r\n\r\n // General pre processing\r\n if (options.processor.preProcessor) {\r\n preparedSourceCode = options.processor.preProcessor(preparedSourceCode, defines, preprocessors, options.isFragment, options.processingContext);\r\n }\r\n\r\n preparedSourceCode = _EvaluatePreProcessors(preparedSourceCode, preprocessors, options);\r\n\r\n // Post processing\r\n if (options.processor.postProcessor) {\r\n preparedSourceCode = options.processor.postProcessor(\r\n preparedSourceCode,\r\n defines,\r\n options.isFragment,\r\n options.processingContext,\r\n engine\r\n ? {\r\n drawBuffersExtensionDisabled: engine.getCaps().drawBuffersExtension ? false : true,\r\n }\r\n : {}\r\n );\r\n }\r\n\r\n // Inline functions tagged with #define inline\r\n if (engine?._features.needShaderCodeInlining) {\r\n preparedSourceCode = engine.inlineShaderCode(preparedSourceCode);\r\n }\r\n\r\n return preparedSourceCode;\r\n}\r\n\r\nfunction _ApplyPreProcessing(sourceCode: string, options: ProcessingOptions, engine: AbstractEngine): string {\r\n let preparedSourceCode = sourceCode;\r\n\r\n const defines = options.defines;\r\n\r\n const preprocessors = _PreparePreProcessors(options, engine);\r\n\r\n // General pre processing\r\n if (options.processor?.preProcessor) {\r\n preparedSourceCode = options.processor.preProcessor(preparedSourceCode, defines, preprocessors, options.isFragment, options.processingContext);\r\n }\r\n\r\n preparedSourceCode = _EvaluatePreProcessors(preparedSourceCode, preprocessors, options);\r\n\r\n // Post processing\r\n if (options.processor?.postProcessor) {\r\n preparedSourceCode = options.processor.postProcessor(\r\n preparedSourceCode,\r\n defines,\r\n options.isFragment,\r\n options.processingContext,\r\n engine\r\n ? {\r\n drawBuffersExtensionDisabled: engine.getCaps().drawBuffersExtension ? false : true,\r\n }\r\n : {}\r\n );\r\n }\r\n\r\n // Inline functions tagged with #define inline\r\n if (engine._features.needShaderCodeInlining) {\r\n preparedSourceCode = engine.inlineShaderCode(preparedSourceCode);\r\n }\r\n\r\n return preparedSourceCode;\r\n}\r\n\r\n/** @internal */\r\nexport function _ProcessIncludes(sourceCode: string, options: ProcessingOptions, callback: (data: any) => void): void {\r\n reusableMatches.length = 0;\r\n let match: RegExpMatchArray | null;\r\n // stay back-compat to the old matchAll syntax\r\n while ((match = regexShaderInclude.exec(sourceCode)) !== null) {\r\n reusableMatches.push(match);\r\n }\r\n\r\n let returnValue = String(sourceCode);\r\n let parts = [sourceCode];\r\n\r\n let keepProcessing = false;\r\n\r\n for (const match of reusableMatches) {\r\n let includeFile = match[1];\r\n\r\n // Uniform declaration\r\n if (includeFile.indexOf(\"__decl__\") !== -1) {\r\n includeFile = includeFile.replace(regexShaderDecl, \"\");\r\n if (options.supportsUniformBuffers) {\r\n includeFile = includeFile.replace(\"Vertex\", \"Ubo\").replace(\"Fragment\", \"Ubo\");\r\n }\r\n includeFile = includeFile + \"Declaration\";\r\n }\r\n\r\n if (options.includesShadersStore[includeFile]) {\r\n // Substitution\r\n let includeContent = options.includesShadersStore[includeFile];\r\n if (match[2]) {\r\n const splits = match[3].split(\",\");\r\n\r\n for (let index = 0; index < splits.length; index += 2) {\r\n const source = new RegExp(splits[index], \"g\");\r\n const dest = splits[index + 1];\r\n\r\n includeContent = includeContent.replace(source, dest);\r\n }\r\n }\r\n\r\n if (match[4]) {\r\n const indexString = match[5];\r\n\r\n if (indexString.indexOf(\"..\") !== -1) {\r\n const indexSplits = indexString.split(\"..\");\r\n const minIndex = parseInt(indexSplits[0]);\r\n let maxIndex = parseInt(indexSplits[1]);\r\n let sourceIncludeContent = includeContent.slice(0);\r\n includeContent = \"\";\r\n\r\n if (isNaN(maxIndex)) {\r\n maxIndex = options.indexParameters[indexSplits[1]];\r\n }\r\n\r\n for (let i = minIndex; i < maxIndex; i++) {\r\n if (!options.supportsUniformBuffers) {\r\n // Ubo replacement\r\n sourceIncludeContent = sourceIncludeContent.replace(regexLightX, (str: string, p1: string) => {\r\n return p1 + \"{X}\";\r\n });\r\n }\r\n includeContent += sourceIncludeContent.replace(regexX, i.toString()) + \"\\n\";\r\n }\r\n } else {\r\n if (!options.supportsUniformBuffers) {\r\n // Ubo replacement\r\n includeContent = includeContent.replace(regexLightX, (str: string, p1: string) => {\r\n return p1 + \"{X}\";\r\n });\r\n }\r\n includeContent = includeContent.replace(regexX, indexString);\r\n }\r\n }\r\n\r\n // Replace\r\n // Split all parts on match[0] and intersperse the parts with the include content\r\n const newParts = [];\r\n for (const part of parts) {\r\n const splitPart = part.split(match[0]);\r\n for (let i = 0; i < splitPart.length - 1; i++) {\r\n newParts.push(splitPart[i]);\r\n newParts.push(includeContent);\r\n }\r\n newParts.push(splitPart[splitPart.length - 1]);\r\n }\r\n parts = newParts;\r\n\r\n keepProcessing = keepProcessing || includeContent.indexOf(\"#include<\") >= 0 || includeContent.indexOf(\"#include <\") >= 0;\r\n } else {\r\n const includeShaderUrl = options.shadersRepository + \"ShadersInclude/\" + includeFile + \".fx\";\r\n\r\n _functionContainer.loadFile(includeShaderUrl, (fileContent) => {\r\n options.includesShadersStore[includeFile] = fileContent as string;\r\n _ProcessIncludes(parts.join(\"\"), options, callback);\r\n });\r\n return;\r\n }\r\n }\r\n reusableMatches.length = 0;\r\n\r\n returnValue = parts.join(\"\");\r\n\r\n if (keepProcessing) {\r\n _ProcessIncludes(returnValue.toString(), options, callback);\r\n } else {\r\n callback(returnValue);\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport const _functionContainer = {\r\n /**\r\n * Loads a file from a url\r\n * @param url url to load\r\n * @param onSuccess callback called when the file successfully loads\r\n * @param onProgress callback called while file is loading (if the server supports this mode)\r\n * @param offlineProvider defines the offline provider for caching\r\n * @param useArrayBuffer defines a boolean indicating that date must be returned as ArrayBuffer\r\n * @param onError callback called when the file fails to load\r\n * @returns a file request object\r\n * @internal\r\n */\r\n loadFile: (\r\n url: string,\r\n onSuccess: (data: string | ArrayBuffer, responseURL?: string) => void,\r\n onProgress?: (ev: ProgressEvent) => void,\r\n offlineProvider?: IOfflineProvider,\r\n useArrayBuffer?: boolean,\r\n onError?: (request?: WebRequest, exception?: LoadFileError) => void\r\n ): IFileRequest => {\r\n throw _WarnImport(\"FileTools\");\r\n },\r\n};\r\n"]}
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
import * as WebGPUConstants from "./webgpuConstants.js";
|
|
6
6
|
import { VertexBuffer } from "../../Buffers/buffer.js";
|
|
7
|
-
import { WebGPUShaderProcessor } from "./webgpuShaderProcessor.js";
|
|
8
7
|
import { WebGPUTextureHelper } from "./webgpuTextureHelper.js";
|
|
9
8
|
import { renderableTextureFormatToIndex } from "./webgpuTextureManager.js";
|
|
10
9
|
var StatePosition;
|
|
@@ -698,7 +697,7 @@ export class WebGPUCacheRenderPipeline {
|
|
|
698
697
|
if (entry.texture) {
|
|
699
698
|
const name = shaderProcessingContext.bindGroupLayoutEntryInfo[i][entry.binding].name;
|
|
700
699
|
const textureInfo = shaderProcessingContext.availableTextures[name];
|
|
701
|
-
const samplerInfo = textureInfo.autoBindSampler ? shaderProcessingContext.availableSamplers[name +
|
|
700
|
+
const samplerInfo = textureInfo.autoBindSampler ? shaderProcessingContext.availableSamplers[name + `Sampler`] : null;
|
|
702
701
|
let sampleType = textureInfo.sampleType;
|
|
703
702
|
let samplerType = samplerInfo?.type ?? WebGPUConstants.SamplerBindingType.Filtering;
|
|
704
703
|
if (this._textureState & bitVal && sampleType !== WebGPUConstants.TextureSampleType.Depth) {
|