docstring_tokens
stringlengths
0
76.5k
code_tokens
stringlengths
75
1.81M
label_window
listlengths
4
2.12k
html_url
stringlengths
74
116
file_name
stringlengths
3
311
this._hideTeleportationTarget();
<mask> this._moveTeleportationSelectorTo(hit); <mask> return; <mask> } <mask> // If not, we're in a selection scenario <mask> this._hideTeleportationCircle(); <mask> this._teleportationAllowed = false; <mask> if (hit.pickedMesh !== this._currentMeshSelected) { <mask> if (this.meshSelectionPredicate(hit.pickedMesh)) { <mask> this._currentMeshSelected = hit.pickedMesh; <mask> if (hit.pickedMesh.isPickable && hit.pickedMesh.actionManager) { </s> Exposing teleportationTarget mesh Former-commit-id: af4bcb5133f14f80b169526ea01534992ae5fc61 </s> remove this._displayTeleportationCircle(); </s> add this._displayTeleportationTarget(); </s> remove this._createTeleportationCircles(); </s> add if (this._isDefaultTeleportationTarget) { this._createTeleportationCircles(); } </s> remove this._hideTeleportationCircle(); </s> add this._hideTeleportationTarget(); </s> remove && mesh.name.indexOf("teleportationCircle") === -1 </s> add && mesh.name.indexOf("teleportationTarget") === -1 </s> remove this._teleportationCircle.isVisible = true; (<Mesh>this._teleportationCircle.getChildren()[0]).isVisible = true; </s> add this._teleportationTarget.isVisible = true; if (this._isDefaultTeleportationTarget) { (<Mesh>this._teleportationTarget.getChildren()[0]).isVisible = true; }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e81d51d4b83d43904c34bbed25af551355604f73
src/Cameras/VR/babylon.vrExperienceHelper.ts
this._hideTeleportationTarget();
<mask> else { <mask> this._currentHit = null; <mask> this._currentMeshSelected = null; <mask> this._teleportationAllowed = false; <mask> this._hideTeleportationCircle(); <mask> this.changeGazeColor(new BABYLON.Color3(0.7, 0.7, 0.7)); <mask> this.changeLaserColor(new BABYLON.Color3(0.7, 0.7, 0.7)); <mask> } <mask> } <mask> </s> Exposing teleportationTarget mesh Former-commit-id: af4bcb5133f14f80b169526ea01534992ae5fc61 </s> remove this._displayTeleportationCircle(); </s> add this._displayTeleportationTarget(); </s> remove this._hideTeleportationCircle(); </s> add this._hideTeleportationTarget(); </s> remove this._hideTeleportationCircle(); </s> add this._hideTeleportationTarget(); </s> remove this._teleportationCircle.position.copyFrom(hit.pickedPoint); </s> add this._teleportationTarget.position.copyFrom(hit.pickedPoint); </s> remove private _displayTeleportationCircle() { </s> add private _displayTeleportationTarget() {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e81d51d4b83d43904c34bbed25af551355604f73
src/Cameras/VR/babylon.vrExperienceHelper.ts
this._teleportationTarget.dispose();
<mask> this._deviceOrientationCamera.dispose(); <mask> } <mask> <mask> this._gazeTracker.dispose(); <mask> this._teleportationCircle.dispose(); <mask> <mask> this._floorMeshesCollection = []; <mask> <mask> document.removeEventListener("keydown", this._onKeyDown); <mask> window.removeEventListener('vrdisplaypresentchange', this._onVrDisplayPresentChange); </s> Exposing teleportationTarget mesh Former-commit-id: af4bcb5133f14f80b169526ea01534992ae5fc61 </s> remove torus.parent = this._teleportationCircle; </s> add torus.parent = this._teleportationTarget; </s> remove private _hideTeleportationCircle() { </s> add private _hideTeleportationTarget() { </s> remove this._teleportationCircle.isVisible = true; (<Mesh>this._teleportationCircle.getChildren()[0]).isVisible = true; </s> add this._teleportationTarget.isVisible = true; if (this._isDefaultTeleportationTarget) { (<Mesh>this._teleportationTarget.getChildren()[0]).isVisible = true; } </s> remove this._teleportationCircle.isVisible = false; (<Mesh>this._teleportationCircle.getChildren()[0]).isVisible = false; </s> add this._teleportationTarget.isVisible = false; if (this._isDefaultTeleportationTarget) { (<Mesh>this._teleportationTarget.getChildren()[0]).isVisible = false; } </s> remove this._teleportationCircle.position.y += 0.1; </s> add this._teleportationTarget.position.y += 0.1;
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e81d51d4b83d43904c34bbed25af551355604f73
src/Cameras/VR/babylon.vrExperienceHelper.ts
this._refTexture = this._refTexture || new Texture(refractionTextureUrl, cam.getScene());
<mask> constructor(name: string, refractionTextureUrl: string, public color: Color3, public depth: number, public colorLevel: number, options: number | PostProcessOptions, camera: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean) { <mask> super(name, "refraction", ["baseColor", "depth", "colorLevel"], ["refractionSampler"], options, camera, samplingMode, engine, reusable); <mask> <mask> this.onActivateObservable.add((cam: Camera) => { <mask> this._refRexture = this._refRexture || new Texture(refractionTextureUrl, cam.getScene()); <mask> }); <mask> <mask> this.onApplyObservable.add((effect: Effect) => { <mask> effect.setColor3("baseColor", this.color); <mask> effect.setFloat("depth", this.depth); </s> add entry point to ref texture for RefractionPostProcess Former-commit-id: faf5a5a0c4df118f9d2306169f0f307b8ad881c0 </s> remove effect.setTexture("refractionSampler", this._refRexture); </s> add effect.setTexture("refractionSampler", this._refTexture); </s> remove if (this._refRexture) { this._refRexture.dispose(); </s> add if (this._refTexture && this._ownRefractionTexture) { this._refTexture.dispose(); (<any>this._refTexture) = null;
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e8dc92eb3d27fd1fbb9b47de381077117b71ccd5
src/PostProcess/babylon.refractionPostProcess.ts
effect.setTexture("refractionSampler", this._refTexture);
<mask> effect.setColor3("baseColor", this.color); <mask> effect.setFloat("depth", this.depth); <mask> effect.setFloat("colorLevel", this.colorLevel); <mask> <mask> effect.setTexture("refractionSampler", this._refRexture); <mask> }); <mask> } <mask> <mask> // Methods <mask> public dispose(camera: Camera): void { </s> add entry point to ref texture for RefractionPostProcess Former-commit-id: faf5a5a0c4df118f9d2306169f0f307b8ad881c0 </s> remove if (this._refRexture) { this._refRexture.dispose(); </s> add if (this._refTexture && this._ownRefractionTexture) { this._refTexture.dispose(); (<any>this._refTexture) = null; </s> remove this._refRexture = this._refRexture || new Texture(refractionTextureUrl, cam.getScene()); </s> add this._refTexture = this._refTexture || new Texture(refractionTextureUrl, cam.getScene());
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e8dc92eb3d27fd1fbb9b47de381077117b71ccd5
src/PostProcess/babylon.refractionPostProcess.ts
if (this._refTexture && this._ownRefractionTexture) { this._refTexture.dispose(); (<any>this._refTexture) = null;
<mask> } <mask> <mask> // Methods <mask> public dispose(camera: Camera): void { <mask> if (this._refRexture) { <mask> this._refRexture.dispose(); <mask> } <mask> <mask> super.dispose(camera); <mask> } <mask> } </s> add entry point to ref texture for RefractionPostProcess Former-commit-id: faf5a5a0c4df118f9d2306169f0f307b8ad881c0 </s> remove effect.setTexture("refractionSampler", this._refRexture); </s> add effect.setTexture("refractionSampler", this._refTexture); </s> remove this._refRexture = this._refRexture || new Texture(refractionTextureUrl, cam.getScene()); </s> add this._refTexture = this._refTexture || new Texture(refractionTextureUrl, cam.getScene());
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e8dc92eb3d27fd1fbb9b47de381077117b71ccd5
src/PostProcess/babylon.refractionPostProcess.ts
BABYLON.ShaderStore.ShadersRepositoryWGSL = "/src/ShadersWGSL/";
<mask> if (BABYLON) { <mask> BABYLON.Engine.ShadersRepository = "/src/Shaders/"; <mask> } <mask> if (callback) { <mask> callback(); <mask> } </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove effectLocation = "../../Materials/effect"; </s> add shaderStoreLocation = "../../Engines/shaderStore"; </s> remove Effect.ShadersStore[`${name}PixelShader`] = pixelShader; </s> add EngineShaderStore.GetShadersStore(shaderLanguage)[`${name}PixelShader`] = pixelShader; </s> remove if (addGLES) { </s> add if (options.shaderLanguage === ShaderLanguage.GLSL) { </s> remove webGpuContext.stages = this._compileRawPipelineStageDescriptor(vertexSourceCode, fragmentSourceCode); } else { webGpuContext.stages = this._compilePipelineStageDescriptor(vertexSourceCode, fragmentSourceCode, defines); </s> add webGpuContext.stages = this._compileRawPipelineStageDescriptor(vertexSourceCode, fragmentSourceCode, shaderLanguage); } else { webGpuContext.stages = this._compilePipelineStageDescriptor(vertexSourceCode, fragmentSourceCode, defines, shaderLanguage);
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
Tools/DevLoader/BabylonLoader.js
`import { ShaderStore } from "##SHADERSTORELOCATION_PLACEHOLDER##";
<mask> /** <mask> * Template creating hidden ts file containing the shaders. <mask> */ <mask> let tsShaderTemplate = <mask> `import { Effect } from "##EFFECTLOCATION_PLACEHOLDER##"; <mask> ##INCLUDES_PLACEHOLDER## <mask> let name = '##NAME_PLACEHOLDER##'; <mask> let shader = \`##SHADER_PLACEHOLDER##\`; <mask> <mask> Effect.##SHADERSTORE_PLACEHOLDER##[name] = shader; </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove Effect.##SHADERSTORE_PLACEHOLDER##[name] = shader; </s> add ShaderStore.##SHADERSTORE_PLACEHOLDER##[name] = shader; </s> remove ShaderStore.ShadersStore[`${name}ComputeShader`] = computeShader; </s> add ShaderStore.GetShadersStore(ShaderLanguage.WGSL)[`${name}ComputeShader`] = computeShader; </s> remove /** * Gets or sets the relative url used to load shaders if using the engine in non-minified mode */ public static ShadersRepository = "src/Shaders/"; /** * Store of each shader (The can be looked up using effect.key) */ public static ShadersStore: { [key: string]: string } = {}; /** * Store of each included file for a shader (The can be looked up using effect.key) */ public static IncludesShadersStore: { [key: string]: string } = {}; </s> add /** * Gets or sets the relative url used to load shaders if using the engine in non-minified mode */ public static ShadersRepository = "src/Shaders/"; /** * Store of each shader (The can be looked up using effect.key) */ public static ShadersStore: { [key: string]: string } = {}; /** * Store of each included file for a shader (The can be looked up using effect.key) */ public static IncludesShadersStore: { [key: string]: string } = {}; /** * Gets or sets the relative url used to load shaders (WGSL) if using the engine in non-minified mode */ public static ShadersRepositoryWGSL = "src/ShadersWGSL/"; /** * Store of each shader (WGSL) */ public static ShadersStoreWGSL: { [key: string]: string } = {}; /** * Store of each included file for a shader (WGSL) */ public static IncludesShadersStoreWGSL: { [key: string]: string } = {}; /** * Gets the shaders repository path for a given shader language * @param shaderLanguage the shader language * @returns the path to the shaders repository */ public static GetShadersRepository(shaderLanguage = ShaderLanguage.GLSL): string { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.ShadersRepository : ShaderStore.ShadersRepositoryWGSL; } /** * Gets the shaders store of a given shader language * @param shaderLanguage the shader language * @returns the shaders store */ public static GetShadersStore(shaderLanguage = ShaderLanguage.GLSL): { [key: string]: string } { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.ShadersStore : ShaderStore.ShadersStoreWGSL; } /** * Gets the include shaders store of a given shader language * @param shaderLanguage the shader language * @returns the include shaders store */ public static GetIncludesShadersStore(shaderLanguage = ShaderLanguage.GLSL): { [key: string]: string } { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.IncludesShadersStore : ShaderStore.IncludesShadersStoreWGSL; } </s> remove * * string: try first to find the code in ShaderStore.ShadersStore[shaderPath + "ComputeShader"]. If not, assumes it is a file with name shaderPath.compute.fx in index.html folder. </s> add * * string: try first to find the code in ShaderStore.ShadersStoreWGSL[shaderPath + "ComputeShader"]. If not, assumes it is a file with name shaderPath.compute.fx in index.html folder. </s> remove includeText = includeText + `import "babylonjs/Shaders/ShadersInclude/${entry}"; </s> add includeText = includeText + `import "babylonjs/Shaders${appendDirName}/ShadersInclude/${entry}";
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
Tools/Gulp/helpers/gulp-processShaders.js
ShaderStore.##SHADERSTORE_PLACEHOLDER##[name] = shader;
<mask> ##INCLUDES_PLACEHOLDER## <mask> let name = '##NAME_PLACEHOLDER##'; <mask> let shader = \`##SHADER_PLACEHOLDER##\`; <mask> <mask> Effect.##SHADERSTORE_PLACEHOLDER##[name] = shader; <mask> ##EXPORT_PLACEHOLDER## <mask> `; <mask> <mask> <mask> /** </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove `import { Effect } from "##EFFECTLOCATION_PLACEHOLDER##"; </s> add `import { ShaderStore } from "##SHADERSTORELOCATION_PLACEHOLDER##"; </s> remove includeText = includeText + `import "babylonjs/Shaders/ShadersInclude/${entry}"; </s> add includeText = includeText + `import "babylonjs/Shaders${appendDirName}/ShadersInclude/${entry}"; </s> remove shaderUrl = ShaderStore.ShadersRepository + shader; </s> add shaderUrl = ShaderStore.GetShadersRepository(this._shaderLanguage) + shader; </s> remove ShaderStore.ShadersStore[`${name}ComputeShader`] = computeShader; </s> add ShaderStore.GetShadersStore(ShaderLanguage.WGSL)[`${name}ComputeShader`] = computeShader; </s> remove const shaderStore = isInclude ? "IncludesShadersStore" : "ShadersStore"; let effectLocation; </s> add const shaderStore = isInclude ? `IncludesShadersStore${appendDirName}` : `ShadersStore${appendDirName}`; let shaderStoreLocation;
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
Tools/Gulp/helpers/gulp-processShaders.js
const isWGSL = directory.indexOf("ShadersWGSL") > -1; const appendDirName = isWGSL ? "WGSL" : "";
<mask> const normalized = path.normalize(file.path); <mask> const directory = path.dirname(normalized); <mask> const shaderName = getShaderName(filename); <mask> const tsFilename = filename.replace('.fx', '.ts').replace('.wgsl', '.ts'); <mask> let fxData = file.contents.toString(); <mask> <mask> // Remove Trailing whitespace... <mask> fxData = fxData.replace(/[^\S\r\n]+$/gm, ""); </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove const shaderStore = isInclude ? "IncludesShadersStore" : "ShadersStore"; let effectLocation; </s> add const shaderStore = isInclude ? `IncludesShadersStore${appendDirName}` : `ShadersStore${appendDirName}`; let shaderStoreLocation; </s> remove effectLocation = "../../Materials/effect"; </s> add shaderStoreLocation = "../../Engines/shaderStore"; </s> remove let preprocessors = this._PreparePreProcessors(options, engine, false); </s> add let preprocessors = this._PreparePreProcessors(options, engine);
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
Tools/Gulp/helpers/gulp-processShaders.js
includeText = includeText + `import "babylonjs/Shaders${appendDirName}/ShadersInclude/${entry}";
<mask> includeText = includeText + `import "./ShadersInclude/${entry}"; <mask> `; <mask> } <mask> else { <mask> includeText = includeText + `import "babylonjs/Shaders/ShadersInclude/${entry}"; <mask> `; <mask> } <mask> }); <mask> <mask> // Chose shader store. </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove const shaderStore = isInclude ? "IncludesShadersStore" : "ShadersStore"; let effectLocation; </s> add const shaderStore = isInclude ? `IncludesShadersStore${appendDirName}` : `ShadersStore${appendDirName}`; let shaderStoreLocation; </s> remove effectLocation = "../Materials/effect"; </s> add shaderStoreLocation = "../Engines/shaderStore"; </s> remove effectLocation = "../../Materials/effect"; </s> add shaderStoreLocation = "../../Engines/shaderStore"; </s> remove `import { Effect } from "##EFFECTLOCATION_PLACEHOLDER##"; </s> add `import { ShaderStore } from "##SHADERSTORELOCATION_PLACEHOLDER##"; </s> remove shaderUrl = ShaderStore.ShadersRepository + shader; </s> add shaderUrl = ShaderStore.GetShadersRepository(this._shaderLanguage) + shader;
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
Tools/Gulp/helpers/gulp-processShaders.js
const shaderStore = isInclude ? `IncludesShadersStore${appendDirName}` : `ShadersStore${appendDirName}`; let shaderStoreLocation;
<mask> }); <mask> <mask> // Chose shader store. <mask> const isInclude = directory.indexOf("ShadersInclude") > -1; <mask> const shaderStore = isInclude ? "IncludesShadersStore" : "ShadersStore"; <mask> let effectLocation; <mask> if (isCore) { <mask> if (isInclude) { <mask> effectLocation = "../../Materials/effect"; <mask> includeText = includeText.replace(/ShadersInclude\//g, ""); <mask> } </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove effectLocation = "../../Materials/effect"; </s> add shaderStoreLocation = "../../Engines/shaderStore"; </s> remove effectLocation = "../Materials/effect"; </s> add shaderStoreLocation = "../Engines/shaderStore"; </s> remove includeText = includeText + `import "babylonjs/Shaders/ShadersInclude/${entry}"; </s> add includeText = includeText + `import "babylonjs/Shaders${appendDirName}/ShadersInclude/${entry}";
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
Tools/Gulp/helpers/gulp-processShaders.js
shaderStoreLocation = "../../Engines/shaderStore";
<mask> const shaderStore = isInclude ? "IncludesShadersStore" : "ShadersStore"; <mask> let effectLocation; <mask> if (isCore) { <mask> if (isInclude) { <mask> effectLocation = "../../Materials/effect"; <mask> includeText = includeText.replace(/ShadersInclude\//g, ""); <mask> } <mask> else { <mask> effectLocation = "../Materials/effect"; <mask> } </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove const shaderStore = isInclude ? "IncludesShadersStore" : "ShadersStore"; let effectLocation; </s> add const shaderStore = isInclude ? `IncludesShadersStore${appendDirName}` : `ShadersStore${appendDirName}`; let shaderStoreLocation; </s> remove effectLocation = "../Materials/effect"; </s> add shaderStoreLocation = "../Engines/shaderStore"; </s> remove effectLocation = "babylonjs/Materials/effect"; </s> add shaderStoreLocation = "babylonjs/Engines/shaderStore"; </s> remove if (addGLES) { </s> add if (options.shaderLanguage === ShaderLanguage.GLSL) { </s> remove includeText = includeText + `import "babylonjs/Shaders/ShadersInclude/${entry}"; </s> add includeText = includeText + `import "babylonjs/Shaders${appendDirName}/ShadersInclude/${entry}";
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
Tools/Gulp/helpers/gulp-processShaders.js
shaderStoreLocation = "../Engines/shaderStore";
<mask> effectLocation = "../../Materials/effect"; <mask> includeText = includeText.replace(/ShadersInclude\//g, ""); <mask> } <mask> else { <mask> effectLocation = "../Materials/effect"; <mask> } <mask> } <mask> else { <mask> effectLocation = "babylonjs/Materials/effect"; <mask> } </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove effectLocation = "../../Materials/effect"; </s> add shaderStoreLocation = "../../Engines/shaderStore"; </s> remove effectLocation = "babylonjs/Materials/effect"; </s> add shaderStoreLocation = "babylonjs/Engines/shaderStore"; </s> remove const shaderStore = isInclude ? "IncludesShadersStore" : "ShadersStore"; let effectLocation; </s> add const shaderStore = isInclude ? `IncludesShadersStore${appendDirName}` : `ShadersStore${appendDirName}`; let shaderStoreLocation; </s> remove includeText = includeText + `import "babylonjs/Shaders/ShadersInclude/${entry}"; </s> add includeText = includeText + `import "babylonjs/Shaders${appendDirName}/ShadersInclude/${entry}"; </s> remove let tsContent = tsShaderTemplate.replace('##EFFECTLOCATION_PLACEHOLDER##', effectLocation); </s> add let tsContent = tsShaderTemplate.replace('##SHADERSTORELOCATION_PLACEHOLDER##', shaderStoreLocation);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
Tools/Gulp/helpers/gulp-processShaders.js
shaderStoreLocation = "babylonjs/Engines/shaderStore";
<mask> effectLocation = "../Materials/effect"; <mask> } <mask> } <mask> else { <mask> effectLocation = "babylonjs/Materials/effect"; <mask> } <mask> <mask> // Fill template in. <mask> let tsContent = tsShaderTemplate.replace('##EFFECTLOCATION_PLACEHOLDER##', effectLocation); <mask> tsContent = tsContent.replace('##INCLUDES_PLACEHOLDER##', includeText); </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove let tsContent = tsShaderTemplate.replace('##EFFECTLOCATION_PLACEHOLDER##', effectLocation); </s> add let tsContent = tsShaderTemplate.replace('##SHADERSTORELOCATION_PLACEHOLDER##', shaderStoreLocation); </s> remove effectLocation = "../Materials/effect"; </s> add shaderStoreLocation = "../Engines/shaderStore"; </s> remove effectLocation = "../../Materials/effect"; </s> add shaderStoreLocation = "../../Engines/shaderStore"; </s> remove const shaderStore = isInclude ? "IncludesShadersStore" : "ShadersStore"; let effectLocation; </s> add const shaderStore = isInclude ? `IncludesShadersStore${appendDirName}` : `ShadersStore${appendDirName}`; let shaderStoreLocation; </s> remove includeText = includeText + `import "babylonjs/Shaders/ShadersInclude/${entry}"; </s> add includeText = includeText + `import "babylonjs/Shaders${appendDirName}/ShadersInclude/${entry}";
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
Tools/Gulp/helpers/gulp-processShaders.js
let tsContent = tsShaderTemplate.replace('##SHADERSTORELOCATION_PLACEHOLDER##', shaderStoreLocation);
<mask> effectLocation = "babylonjs/Materials/effect"; <mask> } <mask> <mask> // Fill template in. <mask> let tsContent = tsShaderTemplate.replace('##EFFECTLOCATION_PLACEHOLDER##', effectLocation); <mask> tsContent = tsContent.replace('##INCLUDES_PLACEHOLDER##', includeText); <mask> tsContent = tsContent.replace('##NAME_PLACEHOLDER##', shaderName); <mask> tsContent = tsContent.replace('##SHADER_PLACEHOLDER##', fxData); <mask> tsContent = tsContent.replace('##SHADERSTORE_PLACEHOLDER##', shaderStore); <mask> tsContent = tsContent.replace('##EXPORT_PLACEHOLDER##', `/** @hidden */ </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove effectLocation = "babylonjs/Materials/effect"; </s> add shaderStoreLocation = "babylonjs/Engines/shaderStore"; </s> remove effectLocation = "../Materials/effect"; </s> add shaderStoreLocation = "../Engines/shaderStore"; </s> remove effectLocation = "../../Materials/effect"; </s> add shaderStoreLocation = "../../Engines/shaderStore"; </s> remove const shaderStore = isInclude ? "IncludesShadersStore" : "ShadersStore"; let effectLocation; </s> add const shaderStore = isInclude ? `IncludesShadersStore${appendDirName}` : `ShadersStore${appendDirName}`; let shaderStoreLocation; </s> remove let preprocessors = this._PreparePreProcessors(options, engine, false); </s> add let preprocessors = this._PreparePreProcessors(options, engine);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
Tools/Gulp/helpers/gulp-processShaders.js
const fxFilter = filter(['**', '!**/*.fragment.ts', '!**/*.vertex.ts', '!**/*.compute.ts', '!**/ShadersInclude/**'], { restore: false });
<mask> /* <mask> * TsLint all typescript files from the src directory. <mask> */ <mask> var tsLintExternalLibrary = function(settings) { <mask> const fxFilter = filter(['**', '!**/*.fragment.ts', '!**/*.vertex.ts', '!**/ShadersInclude/**'], { restore: false }); <mask> return gulp.src(settings.computed.tsGlob) <mask> .pipe(fxFilter) <mask> .pipe(gulpTslint(tsLintConfig)) <mask> .pipe(gulpTslint.report()); <mask> } </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove import { ShaderProcessingContext } from "../Processors/shaderProcessingOptions"; </s> add import { ShaderLanguage, ShaderProcessingContext } from "../Processors/shaderProcessingOptions"; </s> remove `import { Effect } from "##EFFECTLOCATION_PLACEHOLDER##"; </s> add `import { ShaderStore } from "##SHADERSTORELOCATION_PLACEHOLDER##"; </s> remove /** * Gets or sets the relative url used to load shaders if using the engine in non-minified mode */ public static ShadersRepository = "src/Shaders/"; /** * Store of each shader (The can be looked up using effect.key) */ public static ShadersStore: { [key: string]: string } = {}; /** * Store of each included file for a shader (The can be looked up using effect.key) */ public static IncludesShadersStore: { [key: string]: string } = {}; </s> add /** * Gets or sets the relative url used to load shaders if using the engine in non-minified mode */ public static ShadersRepository = "src/Shaders/"; /** * Store of each shader (The can be looked up using effect.key) */ public static ShadersStore: { [key: string]: string } = {}; /** * Store of each included file for a shader (The can be looked up using effect.key) */ public static IncludesShadersStore: { [key: string]: string } = {}; /** * Gets or sets the relative url used to load shaders (WGSL) if using the engine in non-minified mode */ public static ShadersRepositoryWGSL = "src/ShadersWGSL/"; /** * Store of each shader (WGSL) */ public static ShadersStoreWGSL: { [key: string]: string } = {}; /** * Store of each included file for a shader (WGSL) */ public static IncludesShadersStoreWGSL: { [key: string]: string } = {}; /** * Gets the shaders repository path for a given shader language * @param shaderLanguage the shader language * @returns the path to the shaders repository */ public static GetShadersRepository(shaderLanguage = ShaderLanguage.GLSL): string { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.ShadersRepository : ShaderStore.ShadersRepositoryWGSL; } /** * Gets the shaders store of a given shader language * @param shaderLanguage the shader language * @returns the shaders store */ public static GetShadersStore(shaderLanguage = ShaderLanguage.GLSL): { [key: string]: string } { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.ShadersStore : ShaderStore.ShadersStoreWGSL; } /** * Gets the include shaders store of a given shader language * @param shaderLanguage the shader language * @returns the include shaders store */ public static GetIncludesShadersStore(shaderLanguage = ShaderLanguage.GLSL): { [key: string]: string } { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.IncludesShadersStore : ShaderStore.IncludesShadersStoreWGSL; } </s> remove const shaderStore = isInclude ? "IncludesShadersStore" : "ShadersStore"; let effectLocation; </s> add const shaderStore = isInclude ? `IncludesShadersStore${appendDirName}` : `ShadersStore${appendDirName}`; let shaderStoreLocation;
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
Tools/Gulp/tasks/gulpTasks-tsLint.js
import { ProcessingOptions, ShaderLanguage } from "../Engines/Processors/shaderProcessingOptions";
<mask> import { Observable } from "../Misc/observable"; <mask> import { IComputePipelineContext } from "./IComputePipelineContext"; <mask> import { DomManagement } from "../Misc/domManagement"; <mask> import { ShaderProcessor } from "../Engines/Processors/shaderProcessor"; <mask> import { ProcessingOptions } from "../Engines/Processors/shaderProcessingOptions"; <mask> import { ShaderStore } from '../Engines/shaderStore'; <mask> <mask> declare type Engine = import("../Engines/engine").Engine; <mask> <mask> /** </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove import { ShaderStore as EngineShaderStore } from '../Engines/shaderStore'; </s> add import { ShaderStore as EngineShaderStore, ShaderStore } from '../Engines/shaderStore'; </s> remove import { ProcessingOptions } from './shaderProcessingOptions'; </s> add import { ProcessingOptions, ShaderLanguage } from './shaderProcessingOptions'; </s> remove import { ProcessingOptions, ShaderProcessingContext } from '../Engines/Processors/shaderProcessingOptions'; </s> add import { ProcessingOptions, ShaderLanguage, ShaderProcessingContext } from '../Engines/Processors/shaderProcessingOptions'; </s> remove import { ShaderProcessingContext } from "./Processors/shaderProcessingOptions"; </s> add import { ShaderLanguage, ShaderProcessingContext } from "./Processors/shaderProcessingOptions"; </s> remove import { ShaderProcessingContext } from "./Processors/shaderProcessingOptions"; </s> add import { ShaderLanguage, ShaderProcessingContext } from "./Processors/shaderProcessingOptions";
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Compute/computeEffect.ts
private _shaderLanguage = ShaderLanguage.WGSL;
<mask> private _rawComputeSourceCode: string = ""; <mask> private _entryPoint: string; <mask> <mask> /** <mask> * Creates a compute effect that can be used to execute a compute shader <mask> * @param baseName Name of the effect <mask> * @param options Set of all options to create the effect <mask> * @param engine The engine the effect is created for </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove * * object: { compute: "custom" }, used with ShaderStore.ShadersStore["customComputeShader"] </s> add * * object: { compute: "custom" }, used with ShaderStore.ShadersStoreWGSL["customComputeShader"] </s> remove /** * Gets or sets the relative url used to load shaders if using the engine in non-minified mode */ public static ShadersRepository = "src/Shaders/"; /** * Store of each shader (The can be looked up using effect.key) */ public static ShadersStore: { [key: string]: string } = {}; /** * Store of each included file for a shader (The can be looked up using effect.key) */ public static IncludesShadersStore: { [key: string]: string } = {}; </s> add /** * Gets or sets the relative url used to load shaders if using the engine in non-minified mode */ public static ShadersRepository = "src/Shaders/"; /** * Store of each shader (The can be looked up using effect.key) */ public static ShadersStore: { [key: string]: string } = {}; /** * Store of each included file for a shader (The can be looked up using effect.key) */ public static IncludesShadersStore: { [key: string]: string } = {}; /** * Gets or sets the relative url used to load shaders (WGSL) if using the engine in non-minified mode */ public static ShadersRepositoryWGSL = "src/ShadersWGSL/"; /** * Store of each shader (WGSL) */ public static ShadersStoreWGSL: { [key: string]: string } = {}; /** * Store of each included file for a shader (WGSL) */ public static IncludesShadersStoreWGSL: { [key: string]: string } = {}; /** * Gets the shaders repository path for a given shader language * @param shaderLanguage the shader language * @returns the path to the shaders repository */ public static GetShadersRepository(shaderLanguage = ShaderLanguage.GLSL): string { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.ShadersRepository : ShaderStore.ShadersRepositoryWGSL; } /** * Gets the shaders store of a given shader language * @param shaderLanguage the shader language * @returns the shaders store */ public static GetShadersStore(shaderLanguage = ShaderLanguage.GLSL): { [key: string]: string } { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.ShadersStore : ShaderStore.ShadersStoreWGSL; } /** * Gets the include shaders store of a given shader language * @param shaderLanguage the shader language * @returns the include shaders store */ public static GetIncludesShadersStore(shaderLanguage = ShaderLanguage.GLSL): { [key: string]: string } { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.IncludesShadersStore : ShaderStore.IncludesShadersStoreWGSL; } </s> remove * * string: try first to find the code in ShaderStore.ShadersStore[shaderPath + "ComputeShader"]. If not, assumes it is a file with name shaderPath.compute.fx in index.html folder. </s> add * * string: try first to find the code in ShaderStore.ShadersStoreWGSL[shaderPath + "ComputeShader"]. If not, assumes it is a file with name shaderPath.compute.fx in index.html folder. </s> remove ShaderStore.ShadersStore[`${name}ComputeShader`] = computeShader; </s> add ShaderStore.GetShadersStore(ShaderLanguage.WGSL)[`${name}ComputeShader`] = computeShader;
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Compute/computeEffect.ts
shadersRepository: ShaderStore.GetShadersRepository(this._shaderLanguage), includesShadersStore: ShaderStore.GetIncludesShadersStore(this._shaderLanguage),
<mask> isFragment: false, <mask> shouldUseHighPrecisionShader: false, <mask> processor: null, <mask> supportsUniformBuffers: this._engine.supportsUniformBuffers, <mask> shadersRepository: ShaderStore.ShadersRepository, <mask> includesShadersStore: ShaderStore.IncludesShadersStore, <mask> version: (this._engine.version * 100).toString(), <mask> platformName: this._engine.shaderPlatformName, <mask> processingContext: null, <mask> isNDCHalfZRange: this._engine.isNDCHalfZRange, <mask> useReverseDepthBuffer: this._engine.useReverseDepthBuffer, </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove shadersRepository: Effect.ShadersRepository, includesShadersStore: Effect.IncludesShadersStore, </s> add shadersRepository: ShaderStore.GetShadersRepository(this._shaderLanguage), includesShadersStore: ShaderStore.GetIncludesShadersStore(this._shaderLanguage), </s> remove this._processingContext = this._engine._getShaderProcessingContext(); </s> add this._processingContext = this._engine._getShaderProcessingContext(this._shaderLanguage);
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Compute/computeEffect.ts
shaderLanguage: this._shaderLanguage,
<mask> processingContext: null, <mask> isNDCHalfZRange: this._engine.isNDCHalfZRange, <mask> useReverseDepthBuffer: this._engine.useReverseDepthBuffer, <mask> }; <mask> <mask> this._loadShader(computeSource, "Compute", "", (computeCode) => { <mask> ShaderProcessor.Initialize(processorOptions); </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove shadersRepository: ShaderStore.ShadersRepository, includesShadersStore: ShaderStore.IncludesShadersStore, </s> add shadersRepository: ShaderStore.GetShadersRepository(this._shaderLanguage), includesShadersStore: ShaderStore.GetIncludesShadersStore(this._shaderLanguage), </s> remove shadersRepository: Effect.ShadersRepository, includesShadersStore: Effect.IncludesShadersStore, </s> add shadersRepository: ShaderStore.GetShadersRepository(this._shaderLanguage), includesShadersStore: ShaderStore.GetIncludesShadersStore(this._shaderLanguage),
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Compute/computeEffect.ts
if (ShaderStore.GetShadersStore(this._shaderLanguage)[shader + key + "Shader"]) { callback(ShaderStore.GetShadersStore(this._shaderLanguage)[shader + key + "Shader"]);
<mask> return; <mask> } <mask> <mask> // Is in local store ? <mask> if (ShaderStore.ShadersStore[shader + key + "Shader"]) { <mask> callback(ShaderStore.ShadersStore[shader + key + "Shader"]); <mask> return; <mask> } <mask> <mask> if (optionalKey && ShaderStore.ShadersStore[shader + optionalKey + "Shader"]) { <mask> callback(ShaderStore.ShadersStore[shader + optionalKey + "Shader"]); </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove if (optionalKey && ShaderStore.ShadersStore[shader + optionalKey + "Shader"]) { callback(ShaderStore.ShadersStore[shader + optionalKey + "Shader"]); </s> add if (optionalKey && ShaderStore.GetShadersStore(this._shaderLanguage)[shader + optionalKey + "Shader"]) { callback(ShaderStore.GetShadersStore(this._shaderLanguage)[shader + optionalKey + "Shader"]); </s> remove this._vertexSourceCode = "#define SHADER_NAME vertex:" + vertex + "\n" + migratedVertexCode; this._fragmentSourceCode = "#define SHADER_NAME fragment:" + fragment + "\n" + migratedFragmentCode; </s> add this._vertexSourceCode = (this._shaderLanguage === ShaderLanguage.WGSL ? "//" : "") + "#define SHADER_NAME vertex:" + vertex + "\n" + migratedVertexCode; this._fragmentSourceCode = (this._shaderLanguage === ShaderLanguage.WGSL ? "//" : "") + "#define SHADER_NAME fragment:" + fragment + "\n" + migratedFragmentCode; </s> remove shaderUrl = ShaderStore.ShadersRepository + shader; </s> add shaderUrl = ShaderStore.GetShadersRepository(this._shaderLanguage) + shader; </s> remove private _createPipelineStageDescriptor(vertexShader: Uint32Array, fragmentShader: Uint32Array): IWebGPURenderPipelineStageDescriptor { if (this._tintWASM) { vertexShader = this._tintWASM.convertSpirV2WGSL(vertexShader) as any; fragmentShader = this._tintWASM.convertSpirV2WGSL(fragmentShader) as any; </s> add private _getWGSLShader(source: string, type: string, defines: Nullable<string>, shaderVersion: string): string { if (defines) { defines = "//" + defines.split("\n").join("\n//") + "\n"; } else { defines = ""; } return defines + source; } private _createPipelineStageDescriptor(vertexShader: Uint32Array | string, fragmentShader: Uint32Array | string, shaderLanguage: ShaderLanguage): IWebGPURenderPipelineStageDescriptor { if (this._tintWASM && shaderLanguage === ShaderLanguage.GLSL) { vertexShader = this._tintWASM.convertSpirV2WGSL(vertexShader as Uint32Array) as any; fragmentShader = this._tintWASM.convertSpirV2WGSL(fragmentShader as Uint32Array) as any; </s> remove includeText = includeText + `import "babylonjs/Shaders/ShadersInclude/${entry}"; </s> add includeText = includeText + `import "babylonjs/Shaders${appendDirName}/ShadersInclude/${entry}";
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Compute/computeEffect.ts
if (optionalKey && ShaderStore.GetShadersStore(this._shaderLanguage)[shader + optionalKey + "Shader"]) { callback(ShaderStore.GetShadersStore(this._shaderLanguage)[shader + optionalKey + "Shader"]);
<mask> callback(ShaderStore.ShadersStore[shader + key + "Shader"]); <mask> return; <mask> } <mask> <mask> if (optionalKey && ShaderStore.ShadersStore[shader + optionalKey + "Shader"]) { <mask> callback(ShaderStore.ShadersStore[shader + optionalKey + "Shader"]); <mask> return; <mask> } <mask> <mask> let shaderUrl; <mask> </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove if (ShaderStore.ShadersStore[shader + key + "Shader"]) { callback(ShaderStore.ShadersStore[shader + key + "Shader"]); </s> add if (ShaderStore.GetShadersStore(this._shaderLanguage)[shader + key + "Shader"]) { callback(ShaderStore.GetShadersStore(this._shaderLanguage)[shader + key + "Shader"]); </s> remove shaderUrl = ShaderStore.ShadersRepository + shader; </s> add shaderUrl = ShaderStore.GetShadersRepository(this._shaderLanguage) + shader; </s> remove this._vertexSourceCode = "#define SHADER_NAME vertex:" + vertex + "\n" + migratedVertexCode; this._fragmentSourceCode = "#define SHADER_NAME fragment:" + fragment + "\n" + migratedFragmentCode; </s> add this._vertexSourceCode = (this._shaderLanguage === ShaderLanguage.WGSL ? "//" : "") + "#define SHADER_NAME vertex:" + vertex + "\n" + migratedVertexCode; this._fragmentSourceCode = (this._shaderLanguage === ShaderLanguage.WGSL ? "//" : "") + "#define SHADER_NAME fragment:" + fragment + "\n" + migratedFragmentCode; </s> remove private _createPipelineStageDescriptor(vertexShader: Uint32Array, fragmentShader: Uint32Array): IWebGPURenderPipelineStageDescriptor { if (this._tintWASM) { vertexShader = this._tintWASM.convertSpirV2WGSL(vertexShader) as any; fragmentShader = this._tintWASM.convertSpirV2WGSL(fragmentShader) as any; </s> add private _getWGSLShader(source: string, type: string, defines: Nullable<string>, shaderVersion: string): string { if (defines) { defines = "//" + defines.split("\n").join("\n//") + "\n"; } else { defines = ""; } return defines + source; } private _createPipelineStageDescriptor(vertexShader: Uint32Array | string, fragmentShader: Uint32Array | string, shaderLanguage: ShaderLanguage): IWebGPURenderPipelineStageDescriptor { if (this._tintWASM && shaderLanguage === ShaderLanguage.GLSL) { vertexShader = this._tintWASM.convertSpirV2WGSL(vertexShader as Uint32Array) as any; fragmentShader = this._tintWASM.convertSpirV2WGSL(fragmentShader as Uint32Array) as any; </s> remove includeText = includeText + `import "babylonjs/Shaders/ShadersInclude/${entry}"; </s> add includeText = includeText + `import "babylonjs/Shaders${appendDirName}/ShadersInclude/${entry}";
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Compute/computeEffect.ts
shaderUrl = ShaderStore.GetShadersRepository(this._shaderLanguage) + shader;
<mask> <mask> if (shader[0] === "." || shader[0] === "/" || shader.indexOf("http") > -1) { <mask> shaderUrl = shader; <mask> } else { <mask> shaderUrl = ShaderStore.ShadersRepository + shader; <mask> } <mask> <mask> this._engine._loadFile(shaderUrl + "." + key.toLowerCase() + ".fx", callback); <mask> } <mask> </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove this._vertexSourceCode = "#define SHADER_NAME vertex:" + vertex + "\n" + migratedVertexCode; this._fragmentSourceCode = "#define SHADER_NAME fragment:" + fragment + "\n" + migratedFragmentCode; </s> add this._vertexSourceCode = (this._shaderLanguage === ShaderLanguage.WGSL ? "//" : "") + "#define SHADER_NAME vertex:" + vertex + "\n" + migratedVertexCode; this._fragmentSourceCode = (this._shaderLanguage === ShaderLanguage.WGSL ? "//" : "") + "#define SHADER_NAME fragment:" + fragment + "\n" + migratedFragmentCode; </s> remove private _createPipelineStageDescriptor(vertexShader: Uint32Array, fragmentShader: Uint32Array): IWebGPURenderPipelineStageDescriptor { if (this._tintWASM) { vertexShader = this._tintWASM.convertSpirV2WGSL(vertexShader) as any; fragmentShader = this._tintWASM.convertSpirV2WGSL(fragmentShader) as any; </s> add private _getWGSLShader(source: string, type: string, defines: Nullable<string>, shaderVersion: string): string { if (defines) { defines = "//" + defines.split("\n").join("\n//") + "\n"; } else { defines = ""; } return defines + source; } private _createPipelineStageDescriptor(vertexShader: Uint32Array | string, fragmentShader: Uint32Array | string, shaderLanguage: ShaderLanguage): IWebGPURenderPipelineStageDescriptor { if (this._tintWASM && shaderLanguage === ShaderLanguage.GLSL) { vertexShader = this._tintWASM.convertSpirV2WGSL(vertexShader as Uint32Array) as any; fragmentShader = this._tintWASM.convertSpirV2WGSL(fragmentShader as Uint32Array) as any; </s> remove includeText = includeText + `import "babylonjs/Shaders/ShadersInclude/${entry}"; </s> add includeText = includeText + `import "babylonjs/Shaders${appendDirName}/ShadersInclude/${entry}"; </s> remove if (ShaderStore.ShadersStore[shader + key + "Shader"]) { callback(ShaderStore.ShadersStore[shader + key + "Shader"]); </s> add if (ShaderStore.GetShadersStore(this._shaderLanguage)[shader + key + "Shader"]) { callback(ShaderStore.GetShadersStore(this._shaderLanguage)[shader + key + "Shader"]);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Compute/computeEffect.ts
ShaderStore.GetShadersStore(ShaderLanguage.WGSL)[`${name}ComputeShader`] = computeShader;
<mask> * @param name the name of the shader <mask> * @param computeShader compute shader content <mask> */ <mask> public static RegisterShader(name: string, computeShader: string) { <mask> ShaderStore.ShadersStore[`${name}ComputeShader`] = computeShader; <mask> } <mask> } </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove public static RegisterShader(name: string, pixelShader?: string, vertexShader?: string) { </s> add public static RegisterShader(name: string, pixelShader?: string, vertexShader?: string, shaderLanguage = ShaderLanguage.GLSL) { </s> remove Effect.ShadersStore[`${name}PixelShader`] = pixelShader; </s> add EngineShaderStore.GetShadersStore(shaderLanguage)[`${name}PixelShader`] = pixelShader; </s> remove * * object: { compute: "custom" }, used with ShaderStore.ShadersStore["customComputeShader"] </s> add * * object: { compute: "custom" }, used with ShaderStore.ShadersStoreWGSL["customComputeShader"] </s> remove /** * Gets or sets the relative url used to load shaders if using the engine in non-minified mode */ public static ShadersRepository = "src/Shaders/"; /** * Store of each shader (The can be looked up using effect.key) */ public static ShadersStore: { [key: string]: string } = {}; /** * Store of each included file for a shader (The can be looked up using effect.key) */ public static IncludesShadersStore: { [key: string]: string } = {}; </s> add /** * Gets or sets the relative url used to load shaders if using the engine in non-minified mode */ public static ShadersRepository = "src/Shaders/"; /** * Store of each shader (The can be looked up using effect.key) */ public static ShadersStore: { [key: string]: string } = {}; /** * Store of each included file for a shader (The can be looked up using effect.key) */ public static IncludesShadersStore: { [key: string]: string } = {}; /** * Gets or sets the relative url used to load shaders (WGSL) if using the engine in non-minified mode */ public static ShadersRepositoryWGSL = "src/ShadersWGSL/"; /** * Store of each shader (WGSL) */ public static ShadersStoreWGSL: { [key: string]: string } = {}; /** * Store of each included file for a shader (WGSL) */ public static IncludesShadersStoreWGSL: { [key: string]: string } = {}; /** * Gets the shaders repository path for a given shader language * @param shaderLanguage the shader language * @returns the path to the shaders repository */ public static GetShadersRepository(shaderLanguage = ShaderLanguage.GLSL): string { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.ShadersRepository : ShaderStore.ShadersRepositoryWGSL; } /** * Gets the shaders store of a given shader language * @param shaderLanguage the shader language * @returns the shaders store */ public static GetShadersStore(shaderLanguage = ShaderLanguage.GLSL): { [key: string]: string } { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.ShadersStore : ShaderStore.ShadersStoreWGSL; } /** * Gets the include shaders store of a given shader language * @param shaderLanguage the shader language * @returns the include shaders store */ public static GetIncludesShadersStore(shaderLanguage = ShaderLanguage.GLSL): { [key: string]: string } { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.IncludesShadersStore : ShaderStore.IncludesShadersStoreWGSL; }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Compute/computeEffect.ts
* * object: { compute: "custom" }, used with ShaderStore.ShadersStoreWGSL["customComputeShader"]
<mask> * Instantiates a new compute shader. <mask> * @param name Defines the name of the compute shader in the scene <mask> * @param engine Defines the engine the compute shader belongs to <mask> * @param shaderPath Defines the route to the shader code in one of three ways: <mask> * * object: { compute: "custom" }, used with ShaderStore.ShadersStore["customComputeShader"] <mask> * * object: { computeElement: "HTMLElementId" }, used with shader code in script tags <mask> * * object: { computeSource: "compute shader code string" using with string containing the shader code <mask> * * string: try first to find the code in ShaderStore.ShadersStore[shaderPath + "ComputeShader"]. If not, assumes it is a file with name shaderPath.compute.fx in index.html folder. <mask> * @param options Define the options used to create the shader <mask> */ </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove * * string: try first to find the code in ShaderStore.ShadersStore[shaderPath + "ComputeShader"]. If not, assumes it is a file with name shaderPath.compute.fx in index.html folder. </s> add * * string: try first to find the code in ShaderStore.ShadersStoreWGSL[shaderPath + "ComputeShader"]. If not, assumes it is a file with name shaderPath.compute.fx in index.html folder. </s> remove /** * Gets or sets the relative url used to load shaders if using the engine in non-minified mode */ public static ShadersRepository = "src/Shaders/"; /** * Store of each shader (The can be looked up using effect.key) */ public static ShadersStore: { [key: string]: string } = {}; /** * Store of each included file for a shader (The can be looked up using effect.key) */ public static IncludesShadersStore: { [key: string]: string } = {}; </s> add /** * Gets or sets the relative url used to load shaders if using the engine in non-minified mode */ public static ShadersRepository = "src/Shaders/"; /** * Store of each shader (The can be looked up using effect.key) */ public static ShadersStore: { [key: string]: string } = {}; /** * Store of each included file for a shader (The can be looked up using effect.key) */ public static IncludesShadersStore: { [key: string]: string } = {}; /** * Gets or sets the relative url used to load shaders (WGSL) if using the engine in non-minified mode */ public static ShadersRepositoryWGSL = "src/ShadersWGSL/"; /** * Store of each shader (WGSL) */ public static ShadersStoreWGSL: { [key: string]: string } = {}; /** * Store of each included file for a shader (WGSL) */ public static IncludesShadersStoreWGSL: { [key: string]: string } = {}; /** * Gets the shaders repository path for a given shader language * @param shaderLanguage the shader language * @returns the path to the shaders repository */ public static GetShadersRepository(shaderLanguage = ShaderLanguage.GLSL): string { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.ShadersRepository : ShaderStore.ShadersRepositoryWGSL; } /** * Gets the shaders store of a given shader language * @param shaderLanguage the shader language * @returns the shaders store */ public static GetShadersStore(shaderLanguage = ShaderLanguage.GLSL): { [key: string]: string } { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.ShadersStore : ShaderStore.ShadersStoreWGSL; } /** * Gets the include shaders store of a given shader language * @param shaderLanguage the shader language * @returns the include shaders store */ public static GetIncludesShadersStore(shaderLanguage = ShaderLanguage.GLSL): { [key: string]: string } { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.IncludesShadersStore : ShaderStore.IncludesShadersStoreWGSL; } </s> remove ShaderStore.ShadersStore[`${name}ComputeShader`] = computeShader; </s> add ShaderStore.GetShadersStore(ShaderLanguage.WGSL)[`${name}ComputeShader`] = computeShader;
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Compute/computeShader.ts
* * string: try first to find the code in ShaderStore.ShadersStoreWGSL[shaderPath + "ComputeShader"]. If not, assumes it is a file with name shaderPath.compute.fx in index.html folder.
<mask> * @param shaderPath Defines the route to the shader code in one of three ways: <mask> * * object: { compute: "custom" }, used with ShaderStore.ShadersStore["customComputeShader"] <mask> * * object: { computeElement: "HTMLElementId" }, used with shader code in script tags <mask> * * object: { computeSource: "compute shader code string" using with string containing the shader code <mask> * * string: try first to find the code in ShaderStore.ShadersStore[shaderPath + "ComputeShader"]. If not, assumes it is a file with name shaderPath.compute.fx in index.html folder. <mask> * @param options Define the options used to create the shader <mask> */ <mask> constructor(name: string, engine: ThinEngine, shaderPath: any, options: Partial<IComputeShaderOptions> = {}) { <mask> this.name = name; <mask> this._engine = engine; </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove * * object: { compute: "custom" }, used with ShaderStore.ShadersStore["customComputeShader"] </s> add * * object: { compute: "custom" }, used with ShaderStore.ShadersStoreWGSL["customComputeShader"] </s> remove /** * Gets or sets the relative url used to load shaders if using the engine in non-minified mode */ public static ShadersRepository = "src/Shaders/"; /** * Store of each shader (The can be looked up using effect.key) */ public static ShadersStore: { [key: string]: string } = {}; /** * Store of each included file for a shader (The can be looked up using effect.key) */ public static IncludesShadersStore: { [key: string]: string } = {}; </s> add /** * Gets or sets the relative url used to load shaders if using the engine in non-minified mode */ public static ShadersRepository = "src/Shaders/"; /** * Store of each shader (The can be looked up using effect.key) */ public static ShadersStore: { [key: string]: string } = {}; /** * Store of each included file for a shader (The can be looked up using effect.key) */ public static IncludesShadersStore: { [key: string]: string } = {}; /** * Gets or sets the relative url used to load shaders (WGSL) if using the engine in non-minified mode */ public static ShadersRepositoryWGSL = "src/ShadersWGSL/"; /** * Store of each shader (WGSL) */ public static ShadersStoreWGSL: { [key: string]: string } = {}; /** * Store of each included file for a shader (WGSL) */ public static IncludesShadersStoreWGSL: { [key: string]: string } = {}; /** * Gets the shaders repository path for a given shader language * @param shaderLanguage the shader language * @returns the path to the shaders repository */ public static GetShadersRepository(shaderLanguage = ShaderLanguage.GLSL): string { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.ShadersRepository : ShaderStore.ShadersRepositoryWGSL; } /** * Gets the shaders store of a given shader language * @param shaderLanguage the shader language * @returns the shaders store */ public static GetShadersStore(shaderLanguage = ShaderLanguage.GLSL): { [key: string]: string } { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.ShadersStore : ShaderStore.ShadersStoreWGSL; } /** * Gets the include shaders store of a given shader language * @param shaderLanguage the shader language * @returns the include shaders store */ public static GetIncludesShadersStore(shaderLanguage = ShaderLanguage.GLSL): { [key: string]: string } { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.IncludesShadersStore : ShaderStore.IncludesShadersStoreWGSL; } </s> remove ShaderStore.ShadersStore[`${name}ComputeShader`] = computeShader; </s> add ShaderStore.GetShadersStore(ShaderLanguage.WGSL)[`${name}ComputeShader`] = computeShader; </s> remove public static RegisterShader(name: string, pixelShader?: string, vertexShader?: string) { </s> add public static RegisterShader(name: string, pixelShader?: string, vertexShader?: string, shaderLanguage = ShaderLanguage.GLSL) {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Compute/computeShader.ts
if (processor && !options.disableNodeProcessing) {
<mask> let result = ""; <mask> if (this.line) { <mask> let value: string = this.line; <mask> let processor = options.processor; <mask> if (processor) { <mask> // This must be done before other replacements to avoid mistakenly changing something that was already changed. <mask> if (processor.lineProcessor) { <mask> value = processor.lineProcessor(value, options.isFragment, options.processingContext); <mask> } <mask> </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove let preprocessors = this._PreparePreProcessors(options, engine, false); </s> add let preprocessors = this._PreparePreProcessors(options, engine); </s> remove if (addGLES) { </s> add if (options.shaderLanguage === ShaderLanguage.GLSL) { </s> remove private static _PreparePreProcessors(options: ProcessingOptions, engine: ThinEngine, addGLES = true): { [key: string]: string } { </s> add private static _PreparePreProcessors(options: ProcessingOptions, engine: ThinEngine): { [key: string]: string } { </s> remove const shaderStore = isInclude ? "IncludesShadersStore" : "ShadersStore"; let effectLocation; </s> add const shaderStore = isInclude ? `IncludesShadersStore${appendDirName}` : `ShadersStore${appendDirName}`; let shaderStoreLocation; </s> remove effectLocation = "../../Materials/effect"; </s> add shaderStoreLocation = "../../Engines/shaderStore";
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Engines/Processors/shaderCodeNode.ts
/** * Language of the shader code */ export enum ShaderLanguage { GLSL, WGSL }
<mask> import { IShaderProcessor } from './iShaderProcessor'; <mask> import { Nullable } from '../../types'; <mask> <mask> /** @hidden */ <mask> export interface ShaderProcessingContext { } <mask> <mask> /** @hidden */ <mask> export interface ProcessingOptions { <mask> defines: string[]; </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove import { ShaderProcessingContext } from "../Processors/shaderProcessingOptions"; </s> add import { ShaderLanguage, ShaderProcessingContext } from "../Processors/shaderProcessingOptions"; </s> remove import { ShaderProcessingContext } from "./Processors/shaderProcessingOptions"; </s> add import { ShaderLanguage, ShaderProcessingContext } from "./Processors/shaderProcessingOptions"; </s> remove import { ProcessingOptions } from "../Engines/Processors/shaderProcessingOptions"; </s> add import { ProcessingOptions, ShaderLanguage } from "../Engines/Processors/shaderProcessingOptions"; </s> remove import { ShaderProcessingContext } from "./Processors/shaderProcessingOptions"; </s> add import { ShaderLanguage, ShaderProcessingContext } from "./Processors/shaderProcessingOptions"; </s> remove import { ProcessingOptions, ShaderProcessingContext } from '../Engines/Processors/shaderProcessingOptions'; </s> add import { ProcessingOptions, ShaderLanguage, ShaderProcessingContext } from '../Engines/Processors/shaderProcessingOptions';
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Engines/Processors/shaderProcessingOptions.ts
shaderLanguage: ShaderLanguage; disableNodeProcessing?: boolean;
<mask> processingContext: Nullable<ShaderProcessingContext>; <mask> isNDCHalfZRange: boolean; <mask> useReverseDepthBuffer: boolean; <mask> } </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove shadersRepository: Effect.ShadersRepository, includesShadersStore: Effect.IncludesShadersStore, </s> add shadersRepository: ShaderStore.GetShadersRepository(this._shaderLanguage), includesShadersStore: ShaderStore.GetIncludesShadersStore(this._shaderLanguage), </s> remove shadersRepository: ShaderStore.ShadersRepository, includesShadersStore: ShaderStore.IncludesShadersStore, </s> add shadersRepository: ShaderStore.GetShadersRepository(this._shaderLanguage), includesShadersStore: ShaderStore.GetIncludesShadersStore(this._shaderLanguage),
[ "keep", "keep", "add", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Engines/Processors/shaderProcessingOptions.ts
import { ProcessingOptions, ShaderLanguage } from './shaderProcessingOptions';
<mask> import { ShaderDefineOrOperator } from './Expressions/Operators/shaderDefineOrOperator'; <mask> import { ShaderDefineAndOperator } from './Expressions/Operators/shaderDefineAndOperator'; <mask> import { ShaderDefineExpression } from './Expressions/shaderDefineExpression'; <mask> import { ShaderDefineArithmeticOperator } from './Expressions/Operators/shaderDefineArithmeticOperator'; <mask> import { ProcessingOptions } from './shaderProcessingOptions'; <mask> import { _DevTools } from '../../Misc/devTools'; <mask> <mask> declare type WebRequest = import("../../Misc/webRequest").WebRequest; <mask> declare type LoadFileError = import("../../Misc/fileTools").LoadFileError; <mask> declare type IOfflineProvider = import("../../Offline/IOfflineProvider").IOfflineProvider; </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove import { ShaderStore as EngineShaderStore } from '../Engines/shaderStore'; </s> add import { ShaderStore as EngineShaderStore, ShaderStore } from '../Engines/shaderStore'; </s> remove import { ProcessingOptions } from "../Engines/Processors/shaderProcessingOptions"; </s> add import { ProcessingOptions, ShaderLanguage } from "../Engines/Processors/shaderProcessingOptions"; </s> remove import { ShaderProcessingContext } from "./Processors/shaderProcessingOptions"; </s> add import { ShaderLanguage, ShaderProcessingContext } from "./Processors/shaderProcessingOptions"; </s> remove import { ShaderProcessingContext } from "./Processors/shaderProcessingOptions"; </s> add import { ShaderLanguage, ShaderProcessingContext } from "./Processors/shaderProcessingOptions"; </s> remove import { ProcessingOptions, ShaderProcessingContext } from '../Engines/Processors/shaderProcessingOptions'; </s> add import { ProcessingOptions, ShaderLanguage, ShaderProcessingContext } from '../Engines/Processors/shaderProcessingOptions';
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Engines/Processors/shaderProcessor.ts
if (options.shaderLanguage === ShaderLanguage.WGSL) { return source; }
<mask> } <mask> <mask> private static _ProcessPrecision(source: string, options: ProcessingOptions): string { <mask> const shouldUseHighPrecisionShader = options.shouldUseHighPrecisionShader; <mask> <mask> if (source.indexOf("precision highp float") === -1) { <mask> if (!shouldUseHighPrecisionShader) { <mask> source = "precision mediump float;\n" + source; <mask> } else { </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove private _createPipelineStageDescriptor(vertexShader: Uint32Array, fragmentShader: Uint32Array): IWebGPURenderPipelineStageDescriptor { if (this._tintWASM) { vertexShader = this._tintWASM.convertSpirV2WGSL(vertexShader) as any; fragmentShader = this._tintWASM.convertSpirV2WGSL(fragmentShader) as any; </s> add private _getWGSLShader(source: string, type: string, defines: Nullable<string>, shaderVersion: string): string { if (defines) { defines = "//" + defines.split("\n").join("\n//") + "\n"; } else { defines = ""; } return defines + source; } private _createPipelineStageDescriptor(vertexShader: Uint32Array | string, fragmentShader: Uint32Array | string, shaderLanguage: ShaderLanguage): IWebGPURenderPipelineStageDescriptor { if (this._tintWASM && shaderLanguage === ShaderLanguage.GLSL) { vertexShader = this._tintWASM.convertSpirV2WGSL(vertexShader as Uint32Array) as any; fragmentShader = this._tintWASM.convertSpirV2WGSL(fragmentShader as Uint32Array) as any; </s> remove shaderUrl = ShaderStore.ShadersRepository + shader; </s> add shaderUrl = ShaderStore.GetShadersRepository(this._shaderLanguage) + shader; </s> remove private static _PreparePreProcessors(options: ProcessingOptions, engine: ThinEngine, addGLES = true): { [key: string]: string } { </s> add private static _PreparePreProcessors(options: ProcessingOptions, engine: ThinEngine): { [key: string]: string } { </s> remove Effect.ShadersStore[`${name}PixelShader`] = pixelShader; </s> add EngineShaderStore.GetShadersStore(shaderLanguage)[`${name}PixelShader`] = pixelShader; </s> remove if (preparedSourceCode.indexOf("#version 3") !== -1) { </s> add if (options.shaderLanguage === ShaderLanguage.GLSL && preparedSourceCode.indexOf("#version 3") !== -1) {
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Engines/Processors/shaderProcessor.ts
private static _PreparePreProcessors(options: ProcessingOptions, engine: ThinEngine): { [key: string]: string } {
<mask> // Recompose <mask> return rootNode.process(preprocessors, options); <mask> } <mask> <mask> private static _PreparePreProcessors(options: ProcessingOptions, engine: ThinEngine, addGLES = true): { [key: string]: string } { <mask> let defines = options.defines; <mask> let preprocessors: { [key: string]: string } = {}; <mask> <mask> for (var define of defines) { <mask> let keyValue = define.replace("#define", "").replace(";", "").trim(); </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove /** * Gets or sets the relative url used to load shaders if using the engine in non-minified mode */ public static ShadersRepository = "src/Shaders/"; /** * Store of each shader (The can be looked up using effect.key) */ public static ShadersStore: { [key: string]: string } = {}; /** * Store of each included file for a shader (The can be looked up using effect.key) */ public static IncludesShadersStore: { [key: string]: string } = {}; </s> add /** * Gets or sets the relative url used to load shaders if using the engine in non-minified mode */ public static ShadersRepository = "src/Shaders/"; /** * Store of each shader (The can be looked up using effect.key) */ public static ShadersStore: { [key: string]: string } = {}; /** * Store of each included file for a shader (The can be looked up using effect.key) */ public static IncludesShadersStore: { [key: string]: string } = {}; /** * Gets or sets the relative url used to load shaders (WGSL) if using the engine in non-minified mode */ public static ShadersRepositoryWGSL = "src/ShadersWGSL/"; /** * Store of each shader (WGSL) */ public static ShadersStoreWGSL: { [key: string]: string } = {}; /** * Store of each included file for a shader (WGSL) */ public static IncludesShadersStoreWGSL: { [key: string]: string } = {}; /** * Gets the shaders repository path for a given shader language * @param shaderLanguage the shader language * @returns the path to the shaders repository */ public static GetShadersRepository(shaderLanguage = ShaderLanguage.GLSL): string { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.ShadersRepository : ShaderStore.ShadersRepositoryWGSL; } /** * Gets the shaders store of a given shader language * @param shaderLanguage the shader language * @returns the shaders store */ public static GetShadersStore(shaderLanguage = ShaderLanguage.GLSL): { [key: string]: string } { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.ShadersStore : ShaderStore.ShadersStoreWGSL; } /** * Gets the include shaders store of a given shader language * @param shaderLanguage the shader language * @returns the include shaders store */ public static GetIncludesShadersStore(shaderLanguage = ShaderLanguage.GLSL): { [key: string]: string } { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.IncludesShadersStore : ShaderStore.IncludesShadersStoreWGSL; } </s> remove if (preparedSourceCode.indexOf("#version 3") !== -1) { </s> add if (options.shaderLanguage === ShaderLanguage.GLSL && preparedSourceCode.indexOf("#version 3") !== -1) { </s> remove let preprocessors = this._PreparePreProcessors(options, engine, false); </s> add let preprocessors = this._PreparePreProcessors(options, engine); </s> remove private _createPipelineStageDescriptor(vertexShader: Uint32Array, fragmentShader: Uint32Array): IWebGPURenderPipelineStageDescriptor { if (this._tintWASM) { vertexShader = this._tintWASM.convertSpirV2WGSL(vertexShader) as any; fragmentShader = this._tintWASM.convertSpirV2WGSL(fragmentShader) as any; </s> add private _getWGSLShader(source: string, type: string, defines: Nullable<string>, shaderVersion: string): string { if (defines) { defines = "//" + defines.split("\n").join("\n//") + "\n"; } else { defines = ""; } return defines + source; } private _createPipelineStageDescriptor(vertexShader: Uint32Array | string, fragmentShader: Uint32Array | string, shaderLanguage: ShaderLanguage): IWebGPURenderPipelineStageDescriptor { if (this._tintWASM && shaderLanguage === ShaderLanguage.GLSL) { vertexShader = this._tintWASM.convertSpirV2WGSL(vertexShader as Uint32Array) as any; fragmentShader = this._tintWASM.convertSpirV2WGSL(fragmentShader as Uint32Array) as any;
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Engines/Processors/shaderProcessor.ts
if (options.shaderLanguage === ShaderLanguage.GLSL) {
<mask> let split = keyValue.split(" "); <mask> preprocessors[split[0]] = split.length > 1 ? split[1] : ""; <mask> } <mask> <mask> if (addGLES) { <mask> preprocessors["GL_ES"] = "true"; <mask> } <mask> preprocessors["__VERSION__"] = options.version; <mask> preprocessors[options.platformName] = "true"; <mask> </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove const shaderStore = isInclude ? "IncludesShadersStore" : "ShadersStore"; let effectLocation; </s> add const shaderStore = isInclude ? `IncludesShadersStore${appendDirName}` : `ShadersStore${appendDirName}`; let shaderStoreLocation; </s> remove effectLocation = "../../Materials/effect"; </s> add shaderStoreLocation = "../../Engines/shaderStore"; </s> remove public _getShaderProcessingContext(): Nullable<ShaderProcessingContext> { </s> add public _getShaderProcessingContext(shaderLanguage: ShaderLanguage): Nullable<ShaderProcessingContext> { </s> remove if (processor) { </s> add if (processor && !options.disableNodeProcessing) {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Engines/Processors/shaderProcessor.ts
if (options.shaderLanguage === ShaderLanguage.GLSL && preparedSourceCode.indexOf("#version 3") !== -1) {
<mask> return preparedSourceCode; <mask> } <mask> <mask> // Already converted <mask> if (preparedSourceCode.indexOf("#version 3") !== -1) { <mask> return preparedSourceCode.replace("#version 300 es", ""); <mask> } <mask> <mask> let defines = options.defines; <mask> </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove private static _PreparePreProcessors(options: ProcessingOptions, engine: ThinEngine, addGLES = true): { [key: string]: string } { </s> add private static _PreparePreProcessors(options: ProcessingOptions, engine: ThinEngine): { [key: string]: string } { </s> remove let preprocessors = this._PreparePreProcessors(options, engine, false); </s> add let preprocessors = this._PreparePreProcessors(options, engine); </s> remove private _createPipelineStageDescriptor(vertexShader: Uint32Array, fragmentShader: Uint32Array): IWebGPURenderPipelineStageDescriptor { if (this._tintWASM) { vertexShader = this._tintWASM.convertSpirV2WGSL(vertexShader) as any; fragmentShader = this._tintWASM.convertSpirV2WGSL(fragmentShader) as any; </s> add private _getWGSLShader(source: string, type: string, defines: Nullable<string>, shaderVersion: string): string { if (defines) { defines = "//" + defines.split("\n").join("\n//") + "\n"; } else { defines = ""; } return defines + source; } private _createPipelineStageDescriptor(vertexShader: Uint32Array | string, fragmentShader: Uint32Array | string, shaderLanguage: ShaderLanguage): IWebGPURenderPipelineStageDescriptor { if (this._tintWASM && shaderLanguage === ShaderLanguage.GLSL) { vertexShader = this._tintWASM.convertSpirV2WGSL(vertexShader as Uint32Array) as any; fragmentShader = this._tintWASM.convertSpirV2WGSL(fragmentShader as Uint32Array) as any;
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Engines/Processors/shaderProcessor.ts
let preprocessors = this._PreparePreProcessors(options, engine);
<mask> let preparedSourceCode = sourceCode; <mask> <mask> const defines = options.defines; <mask> <mask> let preprocessors = this._PreparePreProcessors(options, engine, false); <mask> <mask> // General pre processing <mask> if (options.processor?.preProcessor) { <mask> preparedSourceCode = options.processor.preProcessor(preparedSourceCode, defines, options.isFragment, options.processingContext); <mask> } </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove if (processor) { </s> add if (processor && !options.disableNodeProcessing) { </s> remove private static _PreparePreProcessors(options: ProcessingOptions, engine: ThinEngine, addGLES = true): { [key: string]: string } { </s> add private static _PreparePreProcessors(options: ProcessingOptions, engine: ThinEngine): { [key: string]: string } { </s> remove if (preparedSourceCode.indexOf("#version 3") !== -1) { </s> add if (options.shaderLanguage === ShaderLanguage.GLSL && preparedSourceCode.indexOf("#version 3") !== -1) { </s> remove const shaderStore = isInclude ? "IncludesShadersStore" : "ShadersStore"; let effectLocation; </s> add const shaderStore = isInclude ? `IncludesShadersStore${appendDirName}` : `ShadersStore${appendDirName}`; let shaderStoreLocation; </s> remove let program = this._createPipelineStageDescriptor(vertexShader, fragmentShader); </s> add let program = this._createPipelineStageDescriptor(vertexShader, fragmentShader, shaderLanguage);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Engines/Processors/shaderProcessor.ts
import { ShaderLanguage } from "../Processors/shaderProcessingOptions";
<mask> import { Effect } from '../../Materials/effect'; <mask> import { WebGPUShaderProcessingContext } from './webgpuShaderProcessingContext'; <mask> import { UniformBuffer } from "../../Materials/uniformBuffer"; <mask> import { IMatrixLike, IVector2Like, IVector3Like, IVector4Like, IColor3Like, IColor4Like } from '../../Maths/math.like'; <mask> <mask> const _uniformSizes: { [type: string]: number } = { <mask> "bool": 1, <mask> "int": 1, </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove import { ProcessingOptions, ShaderProcessingContext } from '../Engines/Processors/shaderProcessingOptions'; </s> add import { ProcessingOptions, ShaderLanguage, ShaderProcessingContext } from '../Engines/Processors/shaderProcessingOptions'; </s> remove import { ShaderStore as EngineShaderStore } from '../Engines/shaderStore'; </s> add import { ShaderStore as EngineShaderStore, ShaderStore } from '../Engines/shaderStore'; </s> remove import { ShaderProcessingContext } from "../Processors/shaderProcessingOptions"; </s> add import { ShaderLanguage, ShaderProcessingContext } from "../Processors/shaderProcessingOptions"; </s> remove import { ShaderProcessingContext } from "./Processors/shaderProcessingOptions"; </s> add import { ShaderLanguage, ShaderProcessingContext } from "./Processors/shaderProcessingOptions"; </s> remove import { ShaderProcessingContext } from "./Processors/shaderProcessingOptions"; </s> add import { ShaderLanguage, ShaderProcessingContext } from "./Processors/shaderProcessingOptions";
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Engines/WebGPU/webgpuPipelineContext.ts
if (this.shaderProcessingContext.shaderLanguage === ShaderLanguage.GLSL) { // Build the uniform layout for the left over uniforms. this.buildUniformLayout(); }
<mask> for (let attr of engine.getAttributes(this, attributesNames)) { <mask> attributes.push(attr); <mask> } <mask> <mask> // Build the uniform layout for the left over uniforms. <mask> this.buildUniformLayout(); <mask> <mask> let attributeNamesFromEffect: string[] = []; <mask> let attributeLocationsFromEffect: number[] = []; <mask> for (index = 0; index < attributesNames.length; index++) { <mask> const location = attributes[index]; </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove private static _PreparePreProcessors(options: ProcessingOptions, engine: ThinEngine, addGLES = true): { [key: string]: string } { </s> add private static _PreparePreProcessors(options: ProcessingOptions, engine: ThinEngine): { [key: string]: string } { </s> remove webGpuContext.stages = this._compileRawPipelineStageDescriptor(vertexSourceCode, fragmentSourceCode); } else { webGpuContext.stages = this._compilePipelineStageDescriptor(vertexSourceCode, fragmentSourceCode, defines); </s> add webGpuContext.stages = this._compileRawPipelineStageDescriptor(vertexSourceCode, fragmentSourceCode, shaderLanguage); } else { webGpuContext.stages = this._compilePipelineStageDescriptor(vertexSourceCode, fragmentSourceCode, defines, shaderLanguage); </s> remove /** * Gets or sets the relative url used to load shaders if using the engine in non-minified mode */ public static ShadersRepository = "src/Shaders/"; /** * Store of each shader (The can be looked up using effect.key) */ public static ShadersStore: { [key: string]: string } = {}; /** * Store of each included file for a shader (The can be looked up using effect.key) */ public static IncludesShadersStore: { [key: string]: string } = {}; </s> add /** * Gets or sets the relative url used to load shaders if using the engine in non-minified mode */ public static ShadersRepository = "src/Shaders/"; /** * Store of each shader (The can be looked up using effect.key) */ public static ShadersStore: { [key: string]: string } = {}; /** * Store of each included file for a shader (The can be looked up using effect.key) */ public static IncludesShadersStore: { [key: string]: string } = {}; /** * Gets or sets the relative url used to load shaders (WGSL) if using the engine in non-minified mode */ public static ShadersRepositoryWGSL = "src/ShadersWGSL/"; /** * Store of each shader (WGSL) */ public static ShadersStoreWGSL: { [key: string]: string } = {}; /** * Store of each included file for a shader (WGSL) */ public static IncludesShadersStoreWGSL: { [key: string]: string } = {}; /** * Gets the shaders repository path for a given shader language * @param shaderLanguage the shader language * @returns the path to the shaders repository */ public static GetShadersRepository(shaderLanguage = ShaderLanguage.GLSL): string { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.ShadersRepository : ShaderStore.ShadersRepositoryWGSL; } /** * Gets the shaders store of a given shader language * @param shaderLanguage the shader language * @returns the shaders store */ public static GetShadersStore(shaderLanguage = ShaderLanguage.GLSL): { [key: string]: string } { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.ShadersStore : ShaderStore.ShadersStoreWGSL; } /** * Gets the include shaders store of a given shader language * @param shaderLanguage the shader language * @returns the include shaders store */ public static GetIncludesShadersStore(shaderLanguage = ShaderLanguage.GLSL): { [key: string]: string } { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.IncludesShadersStore : ShaderStore.IncludesShadersStoreWGSL; }
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Engines/WebGPU/webgpuPipelineContext.ts
import { ShaderLanguage, ShaderProcessingContext } from "../Processors/shaderProcessingOptions";
<mask> import { ShaderProcessingContext } from "../Processors/shaderProcessingOptions"; <mask> <mask> const _maxSets = 4; <mask> const _maxBindingsPerSet = 16; <mask> <mask> // all types not listed are assumed to consume 1 location </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove import { ShaderProcessingContext } from "../Processors/shaderProcessingOptions"; </s> add import { ShaderLanguage, ShaderProcessingContext } from "../Processors/shaderProcessingOptions"; </s> remove const fxFilter = filter(['**', '!**/*.fragment.ts', '!**/*.vertex.ts', '!**/ShadersInclude/**'], { restore: false }); </s> add const fxFilter = filter(['**', '!**/*.fragment.ts', '!**/*.vertex.ts', '!**/*.compute.ts', '!**/ShadersInclude/**'], { restore: false }); </s> remove import { ShaderStore as EngineShaderStore } from '../Engines/shaderStore'; </s> add import { ShaderStore as EngineShaderStore, ShaderStore } from '../Engines/shaderStore';
[ "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Engines/WebGPU/webgpuShaderProcessingContext.ts
public shaderLanguage: ShaderLanguage;
<mask> * @hidden <mask> */ <mask> export class WebGPUShaderProcessingContext implements ShaderProcessingContext { <mask> public uboNextBindingIndex: number; <mask> public freeSetIndex: number; <mask> public freeBindingIndex: number; <mask> <mask> public availableVaryings: { [key: string]: number }; </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove /** * Gets or sets the relative url used to load shaders if using the engine in non-minified mode */ public static ShadersRepository = "src/Shaders/"; /** * Store of each shader (The can be looked up using effect.key) */ public static ShadersStore: { [key: string]: string } = {}; /** * Store of each included file for a shader (The can be looked up using effect.key) */ public static IncludesShadersStore: { [key: string]: string } = {}; </s> add /** * Gets or sets the relative url used to load shaders if using the engine in non-minified mode */ public static ShadersRepository = "src/Shaders/"; /** * Store of each shader (The can be looked up using effect.key) */ public static ShadersStore: { [key: string]: string } = {}; /** * Store of each included file for a shader (The can be looked up using effect.key) */ public static IncludesShadersStore: { [key: string]: string } = {}; /** * Gets or sets the relative url used to load shaders (WGSL) if using the engine in non-minified mode */ public static ShadersRepositoryWGSL = "src/ShadersWGSL/"; /** * Store of each shader (WGSL) */ public static ShadersStoreWGSL: { [key: string]: string } = {}; /** * Store of each included file for a shader (WGSL) */ public static IncludesShadersStoreWGSL: { [key: string]: string } = {}; /** * Gets the shaders repository path for a given shader language * @param shaderLanguage the shader language * @returns the path to the shaders repository */ public static GetShadersRepository(shaderLanguage = ShaderLanguage.GLSL): string { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.ShadersRepository : ShaderStore.ShadersRepositoryWGSL; } /** * Gets the shaders store of a given shader language * @param shaderLanguage the shader language * @returns the shaders store */ public static GetShadersStore(shaderLanguage = ShaderLanguage.GLSL): { [key: string]: string } { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.ShadersStore : ShaderStore.ShadersStoreWGSL; } /** * Gets the include shaders store of a given shader language * @param shaderLanguage the shader language * @returns the include shaders store */ public static GetIncludesShadersStore(shaderLanguage = ShaderLanguage.GLSL): { [key: string]: string } { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.IncludesShadersStore : ShaderStore.IncludesShadersStoreWGSL; } </s> remove constructor() { </s> add constructor(shaderLanguage: ShaderLanguage) { this.shaderLanguage = shaderLanguage; </s> remove public _getShaderProcessingContext(): Nullable<ShaderProcessingContext> { return new WebGPUShaderProcessingContext(); </s> add public _getShaderProcessingContext(shaderLanguage: ShaderLanguage): Nullable<ShaderProcessingContext> { return new WebGPUShaderProcessingContext(shaderLanguage); </s> remove public _getShaderProcessingContext(): Nullable<ShaderProcessingContext> { </s> add public _getShaderProcessingContext(shaderLanguage: ShaderLanguage): Nullable<ShaderProcessingContext> {
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Engines/WebGPU/webgpuShaderProcessingContext.ts
constructor(shaderLanguage: ShaderLanguage) { this.shaderLanguage = shaderLanguage;
<mask> <mask> private _attributeNextLocation: number; <mask> private _varyingNextLocation: number; <mask> <mask> constructor() { <mask> this._attributeNextLocation = 0; <mask> this._varyingNextLocation = 0; <mask> this.freeSetIndex = 2; <mask> this.freeBindingIndex = 0; <mask> </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove // Build the uniform layout for the left over uniforms. this.buildUniformLayout(); </s> add if (this.shaderProcessingContext.shaderLanguage === ShaderLanguage.GLSL) { // Build the uniform layout for the left over uniforms. this.buildUniformLayout(); }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Engines/WebGPU/webgpuShaderProcessingContext.ts
import { ShaderLanguage, ShaderProcessingContext } from "../Processors/shaderProcessingOptions";
<mask> import { Nullable } from '../../types'; <mask> import { IShaderProcessor } from '../Processors/iShaderProcessor'; <mask> import { ShaderProcessingContext } from "../Processors/shaderProcessingOptions"; <mask> import { WebGPUTextureSamplerBindingDescription, WebGPUShaderProcessingContext } from './webgpuShaderProcessingContext'; <mask> import * as WebGPUConstants from './webgpuConstants'; <mask> import { Logger } from '../../Misc/logger'; <mask> import { ThinEngine } from "../thinEngine"; <mask> </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove import { ShaderProcessingContext } from "./Processors/shaderProcessingOptions"; </s> add import { ShaderLanguage, ShaderProcessingContext } from "./Processors/shaderProcessingOptions"; </s> remove import { ProcessingOptions, ShaderProcessingContext } from '../Engines/Processors/shaderProcessingOptions'; </s> add import { ProcessingOptions, ShaderLanguage, ShaderProcessingContext } from '../Engines/Processors/shaderProcessingOptions'; </s> remove import { ShaderProcessingContext } from "./Processors/shaderProcessingOptions"; </s> add import { ShaderLanguage, ShaderProcessingContext } from "./Processors/shaderProcessingOptions"; </s> remove import { ShaderStore as EngineShaderStore } from '../Engines/shaderStore'; </s> add import { ShaderStore as EngineShaderStore, ShaderStore } from '../Engines/shaderStore';
[ "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Engines/WebGPU/webgpuShaderProcessors.ts
protected _shaderLanguage: ShaderLanguage;
<mask> export class WebGPUShaderProcessor implements IShaderProcessor { <mask> <mask> protected _missingVaryings: Array<string> = []; <mask> protected _textureArrayProcessing: Array<string> = []; <mask> protected _preProcessors: { [key: string]: string }; <mask> <mask> private _getArraySize(name: string, preProcessors: { [key: string]: string }): [string, number] { <mask> let length = 0; </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove private static _PreparePreProcessors(options: ProcessingOptions, engine: ThinEngine, addGLES = true): { [key: string]: string } { </s> add private static _PreparePreProcessors(options: ProcessingOptions, engine: ThinEngine): { [key: string]: string } { </s> remove /** * Gets or sets the relative url used to load shaders if using the engine in non-minified mode */ public static ShadersRepository = "src/Shaders/"; /** * Store of each shader (The can be looked up using effect.key) */ public static ShadersStore: { [key: string]: string } = {}; /** * Store of each included file for a shader (The can be looked up using effect.key) */ public static IncludesShadersStore: { [key: string]: string } = {}; </s> add /** * Gets or sets the relative url used to load shaders if using the engine in non-minified mode */ public static ShadersRepository = "src/Shaders/"; /** * Store of each shader (The can be looked up using effect.key) */ public static ShadersStore: { [key: string]: string } = {}; /** * Store of each included file for a shader (The can be looked up using effect.key) */ public static IncludesShadersStore: { [key: string]: string } = {}; /** * Gets or sets the relative url used to load shaders (WGSL) if using the engine in non-minified mode */ public static ShadersRepositoryWGSL = "src/ShadersWGSL/"; /** * Store of each shader (WGSL) */ public static ShadersStoreWGSL: { [key: string]: string } = {}; /** * Store of each included file for a shader (WGSL) */ public static IncludesShadersStoreWGSL: { [key: string]: string } = {}; /** * Gets the shaders repository path for a given shader language * @param shaderLanguage the shader language * @returns the path to the shaders repository */ public static GetShadersRepository(shaderLanguage = ShaderLanguage.GLSL): string { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.ShadersRepository : ShaderStore.ShadersRepositoryWGSL; } /** * Gets the shaders store of a given shader language * @param shaderLanguage the shader language * @returns the shaders store */ public static GetShadersStore(shaderLanguage = ShaderLanguage.GLSL): { [key: string]: string } { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.ShadersStore : ShaderStore.ShadersStoreWGSL; } /** * Gets the include shaders store of a given shader language * @param shaderLanguage the shader language * @returns the include shaders store */ public static GetIncludesShadersStore(shaderLanguage = ShaderLanguage.GLSL): { [key: string]: string } { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.IncludesShadersStore : ShaderStore.IncludesShadersStoreWGSL; } </s> remove // Build the uniform layout for the left over uniforms. this.buildUniformLayout(); </s> add if (this.shaderProcessingContext.shaderLanguage === ShaderLanguage.GLSL) { // Build the uniform layout for the left over uniforms. this.buildUniformLayout(); } </s> remove constructor() { </s> add constructor(shaderLanguage: ShaderLanguage) { this.shaderLanguage = shaderLanguage;
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Engines/WebGPU/webgpuShaderProcessors.ts
this._shaderLanguage = (processingContext as WebGPUShaderProcessingContext).shaderLanguage;
<mask> } <mask> <mask> public initializeShaders(processingContext: Nullable<ShaderProcessingContext>): void { <mask> this._missingVaryings.length = 0; <mask> this._textureArrayProcessing.length = 0; <mask> } <mask> </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove constructor() { </s> add constructor(shaderLanguage: ShaderLanguage) { this.shaderLanguage = shaderLanguage; </s> remove public _getShaderProcessingContext(): Nullable<ShaderProcessingContext> { </s> add public _getShaderProcessingContext(shaderLanguage: ShaderLanguage): Nullable<ShaderProcessingContext> { </s> remove // Build the uniform layout for the left over uniforms. this.buildUniformLayout(); </s> add if (this.shaderProcessingContext.shaderLanguage === ShaderLanguage.GLSL) { // Build the uniform layout for the left over uniforms. this.buildUniformLayout(); }
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Engines/WebGPU/webgpuShaderProcessors.ts
if (this._shaderLanguage === ShaderLanguage.WGSL) { return code; }
<mask> return uniformBuffer; <mask> } <mask> <mask> public postProcessor(code: string, defines: string[], isFragment: boolean, processingContext: Nullable<ShaderProcessingContext>, engine: ThinEngine) { <mask> const hasDrawBuffersExtension = code.search(/#extension.+GL_EXT_draw_buffers.+require/) !== -1; <mask> <mask> // Remove extensions <mask> var regex = /#extension.+(GL_OVR_multiview2|GL_OES_standard_derivatives|GL_EXT_shader_texture_lod|GL_EXT_frag_depth|GL_EXT_draw_buffers).+(enable|require)/g; <mask> code = code.replace(regex, ""); <mask> </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove if (preparedSourceCode.indexOf("#version 3") !== -1) { </s> add if (options.shaderLanguage === ShaderLanguage.GLSL && preparedSourceCode.indexOf("#version 3") !== -1) { </s> remove private _compilePipelineStageDescriptor(vertexCode: string, fragmentCode: string, defines: Nullable<string>): IWebGPURenderPipelineStageDescriptor { </s> add private _compilePipelineStageDescriptor(vertexCode: string, fragmentCode: string, defines: Nullable<string>, shaderLanguage: ShaderLanguage): IWebGPURenderPipelineStageDescriptor { </s> remove return this._createPipelineStageDescriptor(vertexShader, fragmentShader); </s> add return this._createPipelineStageDescriptor(vertexShader, fragmentShader, shaderLanguage); </s> remove const shaderStore = isInclude ? "IncludesShadersStore" : "ShadersStore"; let effectLocation; </s> add const shaderStore = isInclude ? `IncludesShadersStore${appendDirName}` : `ShadersStore${appendDirName}`; let shaderStoreLocation;
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Engines/WebGPU/webgpuShaderProcessors.ts
/** * Gets or sets the relative url used to load shaders if using the engine in non-minified mode */ public static ShadersRepository = "src/Shaders/"; /** * Store of each shader (The can be looked up using effect.key) */ public static ShadersStore: { [key: string]: string } = {}; /** * Store of each included file for a shader (The can be looked up using effect.key) */ public static IncludesShadersStore: { [key: string]: string } = {}; /** * Gets or sets the relative url used to load shaders (WGSL) if using the engine in non-minified mode */ public static ShadersRepositoryWGSL = "src/ShadersWGSL/"; /** * Store of each shader (WGSL) */ public static ShadersStoreWGSL: { [key: string]: string } = {}; /** * Store of each included file for a shader (WGSL) */ public static IncludesShadersStoreWGSL: { [key: string]: string } = {}; /** * Gets the shaders repository path for a given shader language * @param shaderLanguage the shader language * @returns the path to the shaders repository */ public static GetShadersRepository(shaderLanguage = ShaderLanguage.GLSL): string { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.ShadersRepository : ShaderStore.ShadersRepositoryWGSL; } /** * Gets the shaders store of a given shader language * @param shaderLanguage the shader language * @returns the shaders store */ public static GetShadersStore(shaderLanguage = ShaderLanguage.GLSL): { [key: string]: string } { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.ShadersStore : ShaderStore.ShadersStoreWGSL; } /** * Gets the include shaders store of a given shader language * @param shaderLanguage the shader language * @returns the include shaders store */ public static GetIncludesShadersStore(shaderLanguage = ShaderLanguage.GLSL): { [key: string]: string } { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.IncludesShadersStore : ShaderStore.IncludesShadersStoreWGSL; }
<mask> /** <mask> * Defines the shader related stores and directory <mask> */ <mask> export class ShaderStore { <mask> /** <mask> * Gets or sets the relative url used to load shaders if using the engine in non-minified mode <mask> */ <mask> public static ShadersRepository = "src/Shaders/"; <mask> /** <mask> * Store of each shader (The can be looked up using effect.key) <mask> */ <mask> public static ShadersStore: { [key: string]: string } = {}; <mask> /** <mask> * Store of each included file for a shader (The can be looked up using effect.key) <mask> */ <mask> public static IncludesShadersStore: { [key: string]: string } = {}; <mask> } </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove Effect.ShadersStore[`${name}VertexShader`] = vertexShader; </s> add EngineShaderStore.GetShadersStore(shaderLanguage)[`${name}VertexShader`] = vertexShader; </s> remove private static _PreparePreProcessors(options: ProcessingOptions, engine: ThinEngine, addGLES = true): { [key: string]: string } { </s> add private static _PreparePreProcessors(options: ProcessingOptions, engine: ThinEngine): { [key: string]: string } { </s> remove * * object: { compute: "custom" }, used with ShaderStore.ShadersStore["customComputeShader"] </s> add * * object: { compute: "custom" }, used with ShaderStore.ShadersStoreWGSL["customComputeShader"] </s> remove ShaderStore.ShadersStore[`${name}ComputeShader`] = computeShader; </s> add ShaderStore.GetShadersStore(ShaderLanguage.WGSL)[`${name}ComputeShader`] = computeShader;
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Engines/shaderStore.ts
import { ShaderLanguage, ShaderProcessingContext } from "./Processors/shaderProcessingOptions";
<mask> import { IInternalTextureLoader } from '../Materials/Textures/internalTextureLoader'; <mask> import { Effect, IEffectCreationOptions } from '../Materials/effect'; <mask> import { _DevTools } from '../Misc/devTools'; <mask> import { IShaderProcessor } from './Processors/iShaderProcessor'; <mask> import { ShaderProcessingContext } from "./Processors/shaderProcessingOptions"; <mask> import { UniformBuffer } from '../Materials/uniformBuffer'; <mask> import { Nullable, DataArray, IndicesArray } from '../types'; <mask> import { EngineCapabilities } from './engineCapabilities'; <mask> import { Observable } from '../Misc/observable'; <mask> import { DepthCullingState } from '../States/depthCullingState'; </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove import { ShaderProcessingContext } from "./Processors/shaderProcessingOptions"; </s> add import { ShaderLanguage, ShaderProcessingContext } from "./Processors/shaderProcessingOptions"; </s> remove import { ShaderProcessingContext } from "../Processors/shaderProcessingOptions"; </s> add import { ShaderLanguage, ShaderProcessingContext } from "../Processors/shaderProcessingOptions"; </s> remove import { ProcessingOptions, ShaderProcessingContext } from '../Engines/Processors/shaderProcessingOptions'; </s> add import { ProcessingOptions, ShaderLanguage, ShaderProcessingContext } from '../Engines/Processors/shaderProcessingOptions'; </s> remove import { ProcessingOptions } from "../Engines/Processors/shaderProcessingOptions"; </s> add import { ProcessingOptions, ShaderLanguage } from "../Engines/Processors/shaderProcessingOptions"; </s> remove import { ProcessingOptions } from './shaderProcessingOptions'; </s> add import { ProcessingOptions, ShaderLanguage } from './shaderProcessingOptions';
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Engines/thinEngine.ts
public _getShaderProcessingContext(shaderLanguage: ShaderLanguage): Nullable<ShaderProcessingContext> {
<mask> return (this.webGLVersion > 1 ? new WebGL2ShaderProcessor() : new WebGLShaderProcessor()); <mask> } <mask> <mask> /** @hidden */ <mask> public _getShaderProcessingContext(): Nullable<ShaderProcessingContext> { <mask> return null; <mask> } <mask> <mask> private _rebuildInternalTextures(): void { <mask> let currentState = this._internalTexturesCache.slice(); // Do a copy because the rebuild will add proxies </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove public _getShaderProcessingContext(): Nullable<ShaderProcessingContext> { return new WebGPUShaderProcessingContext(); </s> add public _getShaderProcessingContext(shaderLanguage: ShaderLanguage): Nullable<ShaderProcessingContext> { return new WebGPUShaderProcessingContext(shaderLanguage); </s> remove /** * Gets or sets the relative url used to load shaders if using the engine in non-minified mode */ public static ShadersRepository = "src/Shaders/"; /** * Store of each shader (The can be looked up using effect.key) */ public static ShadersStore: { [key: string]: string } = {}; /** * Store of each included file for a shader (The can be looked up using effect.key) */ public static IncludesShadersStore: { [key: string]: string } = {}; </s> add /** * Gets or sets the relative url used to load shaders if using the engine in non-minified mode */ public static ShadersRepository = "src/Shaders/"; /** * Store of each shader (The can be looked up using effect.key) */ public static ShadersStore: { [key: string]: string } = {}; /** * Store of each included file for a shader (The can be looked up using effect.key) */ public static IncludesShadersStore: { [key: string]: string } = {}; /** * Gets or sets the relative url used to load shaders (WGSL) if using the engine in non-minified mode */ public static ShadersRepositoryWGSL = "src/ShadersWGSL/"; /** * Store of each shader (WGSL) */ public static ShadersStoreWGSL: { [key: string]: string } = {}; /** * Store of each included file for a shader (WGSL) */ public static IncludesShadersStoreWGSL: { [key: string]: string } = {}; /** * Gets the shaders repository path for a given shader language * @param shaderLanguage the shader language * @returns the path to the shaders repository */ public static GetShadersRepository(shaderLanguage = ShaderLanguage.GLSL): string { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.ShadersRepository : ShaderStore.ShadersRepositoryWGSL; } /** * Gets the shaders store of a given shader language * @param shaderLanguage the shader language * @returns the shaders store */ public static GetShadersStore(shaderLanguage = ShaderLanguage.GLSL): { [key: string]: string } { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.ShadersStore : ShaderStore.ShadersStoreWGSL; } /** * Gets the include shaders store of a given shader language * @param shaderLanguage the shader language * @returns the include shaders store */ public static GetIncludesShadersStore(shaderLanguage = ShaderLanguage.GLSL): { [key: string]: string } { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.IncludesShadersStore : ShaderStore.IncludesShadersStoreWGSL; } </s> remove if (addGLES) { </s> add if (options.shaderLanguage === ShaderLanguage.GLSL) { </s> remove private _compileRawPipelineStageDescriptor(vertexCode: string, fragmentCode: string): IWebGPURenderPipelineStageDescriptor { var vertexShader = this._compileRawShaderToSpirV(vertexCode, "vertex"); var fragmentShader = this._compileRawShaderToSpirV(fragmentCode, "fragment"); </s> add private _compileRawPipelineStageDescriptor(vertexCode: string, fragmentCode: string, shaderLanguage: ShaderLanguage): IWebGPURenderPipelineStageDescriptor { var vertexShader = shaderLanguage === ShaderLanguage.GLSL ? this._compileRawShaderToSpirV(vertexCode, "vertex") : vertexCode; var fragmentShader = shaderLanguage === ShaderLanguage.GLSL ? this._compileRawShaderToSpirV(fragmentCode, "fragment") : fragmentCode;
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Engines/thinEngine.ts
import { ShaderLanguage, ShaderProcessingContext } from "./Processors/shaderProcessingOptions";
<mask> import { WebGPUDataBuffer } from '../Meshes/WebGPU/webgpuDataBuffer'; <mask> import { BaseTexture } from "../Materials/Textures/baseTexture"; <mask> import { IShaderProcessor } from "./Processors/iShaderProcessor"; <mask> import { WebGPUShaderProcessor } from "./WebGPU/webgpuShaderProcessors"; <mask> import { ShaderProcessingContext } from "./Processors/shaderProcessingOptions"; <mask> import { WebGPUShaderProcessingContext } from "./WebGPU/webgpuShaderProcessingContext"; <mask> import { Tools } from "../Misc/tools"; <mask> import { WebGPUTextureHelper } from './WebGPU/webgpuTextureHelper'; <mask> import { ISceneLike } from './thinEngine'; <mask> import { WebGPUBufferManager } from './WebGPU/webgpuBufferManager'; </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove import { ShaderProcessingContext } from "./Processors/shaderProcessingOptions"; </s> add import { ShaderLanguage, ShaderProcessingContext } from "./Processors/shaderProcessingOptions"; </s> remove import { ShaderProcessingContext } from "../Processors/shaderProcessingOptions"; </s> add import { ShaderLanguage, ShaderProcessingContext } from "../Processors/shaderProcessingOptions"; </s> remove import { ProcessingOptions, ShaderProcessingContext } from '../Engines/Processors/shaderProcessingOptions'; </s> add import { ProcessingOptions, ShaderLanguage, ShaderProcessingContext } from '../Engines/Processors/shaderProcessingOptions'; </s> remove import { ProcessingOptions } from "../Engines/Processors/shaderProcessingOptions"; </s> add import { ProcessingOptions, ShaderLanguage } from "../Engines/Processors/shaderProcessingOptions";
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Engines/webgpuEngine.ts
public _getShaderProcessingContext(shaderLanguage: ShaderLanguage): Nullable<ShaderProcessingContext> { return new WebGPUShaderProcessingContext(shaderLanguage);
<mask> return new WebGPUShaderProcessor(); <mask> } <mask> <mask> /** @hidden */ <mask> public _getShaderProcessingContext(): Nullable<ShaderProcessingContext> { <mask> return new WebGPUShaderProcessingContext(); <mask> } <mask> <mask> //------------------------------------------------------------------------------ <mask> // Static Pipeline WebGPU States <mask> //------------------------------------------------------------------------------ </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove public _getShaderProcessingContext(): Nullable<ShaderProcessingContext> { </s> add public _getShaderProcessingContext(shaderLanguage: ShaderLanguage): Nullable<ShaderProcessingContext> { </s> remove /** * Gets or sets the relative url used to load shaders if using the engine in non-minified mode */ public static ShadersRepository = "src/Shaders/"; /** * Store of each shader (The can be looked up using effect.key) */ public static ShadersStore: { [key: string]: string } = {}; /** * Store of each included file for a shader (The can be looked up using effect.key) */ public static IncludesShadersStore: { [key: string]: string } = {}; </s> add /** * Gets or sets the relative url used to load shaders if using the engine in non-minified mode */ public static ShadersRepository = "src/Shaders/"; /** * Store of each shader (The can be looked up using effect.key) */ public static ShadersStore: { [key: string]: string } = {}; /** * Store of each included file for a shader (The can be looked up using effect.key) */ public static IncludesShadersStore: { [key: string]: string } = {}; /** * Gets or sets the relative url used to load shaders (WGSL) if using the engine in non-minified mode */ public static ShadersRepositoryWGSL = "src/ShadersWGSL/"; /** * Store of each shader (WGSL) */ public static ShadersStoreWGSL: { [key: string]: string } = {}; /** * Store of each included file for a shader (WGSL) */ public static IncludesShadersStoreWGSL: { [key: string]: string } = {}; /** * Gets the shaders repository path for a given shader language * @param shaderLanguage the shader language * @returns the path to the shaders repository */ public static GetShadersRepository(shaderLanguage = ShaderLanguage.GLSL): string { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.ShadersRepository : ShaderStore.ShadersRepositoryWGSL; } /** * Gets the shaders store of a given shader language * @param shaderLanguage the shader language * @returns the shaders store */ public static GetShadersStore(shaderLanguage = ShaderLanguage.GLSL): { [key: string]: string } { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.ShadersStore : ShaderStore.ShadersStoreWGSL; } /** * Gets the include shaders store of a given shader language * @param shaderLanguage the shader language * @returns the include shaders store */ public static GetIncludesShadersStore(shaderLanguage = ShaderLanguage.GLSL): { [key: string]: string } { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.IncludesShadersStore : ShaderStore.IncludesShadersStoreWGSL; } </s> remove if (preparedSourceCode.indexOf("#version 3") !== -1) { </s> add if (options.shaderLanguage === ShaderLanguage.GLSL && preparedSourceCode.indexOf("#version 3") !== -1) {
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Engines/webgpuEngine.ts
private _getWGSLShader(source: string, type: string, defines: Nullable<string>, shaderVersion: string): string { if (defines) { defines = "//" + defines.split("\n").join("\n//") + "\n"; } else { defines = ""; } return defines + source; } private _createPipelineStageDescriptor(vertexShader: Uint32Array | string, fragmentShader: Uint32Array | string, shaderLanguage: ShaderLanguage): IWebGPURenderPipelineStageDescriptor { if (this._tintWASM && shaderLanguage === ShaderLanguage.GLSL) { vertexShader = this._tintWASM.convertSpirV2WGSL(vertexShader as Uint32Array) as any; fragmentShader = this._tintWASM.convertSpirV2WGSL(fragmentShader as Uint32Array) as any;
<mask> private _compileShaderToSpirV(source: string, type: string, defines: Nullable<string>, shaderVersion: string): Uint32Array { <mask> return this._compileRawShaderToSpirV(shaderVersion + (defines ? defines + "\n" : "") + source, type); <mask> } <mask> <mask> private _createPipelineStageDescriptor(vertexShader: Uint32Array, fragmentShader: Uint32Array): IWebGPURenderPipelineStageDescriptor { <mask> if (this._tintWASM) { <mask> vertexShader = this._tintWASM.convertSpirV2WGSL(vertexShader) as any; <mask> fragmentShader = this._tintWASM.convertSpirV2WGSL(fragmentShader) as any; <mask> } <mask> <mask> return { <mask> vertexStage: { <mask> module: this._device.createShaderModule({ </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove private _compileRawPipelineStageDescriptor(vertexCode: string, fragmentCode: string): IWebGPURenderPipelineStageDescriptor { var vertexShader = this._compileRawShaderToSpirV(vertexCode, "vertex"); var fragmentShader = this._compileRawShaderToSpirV(fragmentCode, "fragment"); </s> add private _compileRawPipelineStageDescriptor(vertexCode: string, fragmentCode: string, shaderLanguage: ShaderLanguage): IWebGPURenderPipelineStageDescriptor { var vertexShader = shaderLanguage === ShaderLanguage.GLSL ? this._compileRawShaderToSpirV(vertexCode, "vertex") : vertexCode; var fragmentShader = shaderLanguage === ShaderLanguage.GLSL ? this._compileRawShaderToSpirV(fragmentCode, "fragment") : fragmentCode; </s> remove return this._createPipelineStageDescriptor(vertexShader, fragmentShader); </s> add return this._createPipelineStageDescriptor(vertexShader, fragmentShader, shaderLanguage); </s> remove private _compilePipelineStageDescriptor(vertexCode: string, fragmentCode: string, defines: Nullable<string>): IWebGPURenderPipelineStageDescriptor { </s> add private _compilePipelineStageDescriptor(vertexCode: string, fragmentCode: string, defines: Nullable<string>, shaderLanguage: ShaderLanguage): IWebGPURenderPipelineStageDescriptor { </s> remove this._vertexSourceCode = "#define SHADER_NAME vertex:" + vertex + "\n" + migratedVertexCode; this._fragmentSourceCode = "#define SHADER_NAME fragment:" + fragment + "\n" + migratedFragmentCode; </s> add this._vertexSourceCode = (this._shaderLanguage === ShaderLanguage.WGSL ? "//" : "") + "#define SHADER_NAME vertex:" + vertex + "\n" + migratedVertexCode; this._fragmentSourceCode = (this._shaderLanguage === ShaderLanguage.WGSL ? "//" : "") + "#define SHADER_NAME fragment:" + fragment + "\n" + migratedFragmentCode;
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Engines/webgpuEngine.ts
private _compileRawPipelineStageDescriptor(vertexCode: string, fragmentCode: string, shaderLanguage: ShaderLanguage): IWebGPURenderPipelineStageDescriptor { var vertexShader = shaderLanguage === ShaderLanguage.GLSL ? this._compileRawShaderToSpirV(vertexCode, "vertex") : vertexCode; var fragmentShader = shaderLanguage === ShaderLanguage.GLSL ? this._compileRawShaderToSpirV(fragmentCode, "fragment") : fragmentCode;
<mask> } <mask> }; <mask> } <mask> <mask> private _compileRawPipelineStageDescriptor(vertexCode: string, fragmentCode: string): IWebGPURenderPipelineStageDescriptor { <mask> var vertexShader = this._compileRawShaderToSpirV(vertexCode, "vertex"); <mask> var fragmentShader = this._compileRawShaderToSpirV(fragmentCode, "fragment"); <mask> <mask> return this._createPipelineStageDescriptor(vertexShader, fragmentShader); <mask> } <mask> <mask> private _compilePipelineStageDescriptor(vertexCode: string, fragmentCode: string, defines: Nullable<string>): IWebGPURenderPipelineStageDescriptor { </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove return this._createPipelineStageDescriptor(vertexShader, fragmentShader); </s> add return this._createPipelineStageDescriptor(vertexShader, fragmentShader, shaderLanguage); </s> remove private _compilePipelineStageDescriptor(vertexCode: string, fragmentCode: string, defines: Nullable<string>): IWebGPURenderPipelineStageDescriptor { </s> add private _compilePipelineStageDescriptor(vertexCode: string, fragmentCode: string, defines: Nullable<string>, shaderLanguage: ShaderLanguage): IWebGPURenderPipelineStageDescriptor { </s> remove var vertexShader = this._compileShaderToSpirV(vertexCode, "vertex", defines, shaderVersion); var fragmentShader = this._compileShaderToSpirV(fragmentCode, "fragment", defines, shaderVersion); </s> add var vertexShader = shaderLanguage === ShaderLanguage.GLSL ? this._compileShaderToSpirV(vertexCode, "vertex", defines, shaderVersion) : this._getWGSLShader(vertexCode, "vertex", defines, shaderVersion); var fragmentShader = shaderLanguage === ShaderLanguage.GLSL ? this._compileShaderToSpirV(fragmentCode, "fragment", defines, shaderVersion) : this._getWGSLShader(fragmentCode, "fragment", defines, shaderVersion); </s> remove private _createPipelineStageDescriptor(vertexShader: Uint32Array, fragmentShader: Uint32Array): IWebGPURenderPipelineStageDescriptor { if (this._tintWASM) { vertexShader = this._tintWASM.convertSpirV2WGSL(vertexShader) as any; fragmentShader = this._tintWASM.convertSpirV2WGSL(fragmentShader) as any; </s> add private _getWGSLShader(source: string, type: string, defines: Nullable<string>, shaderVersion: string): string { if (defines) { defines = "//" + defines.split("\n").join("\n//") + "\n"; } else { defines = ""; } return defines + source; } private _createPipelineStageDescriptor(vertexShader: Uint32Array | string, fragmentShader: Uint32Array | string, shaderLanguage: ShaderLanguage): IWebGPURenderPipelineStageDescriptor { if (this._tintWASM && shaderLanguage === ShaderLanguage.GLSL) { vertexShader = this._tintWASM.convertSpirV2WGSL(vertexShader as Uint32Array) as any; fragmentShader = this._tintWASM.convertSpirV2WGSL(fragmentShader as Uint32Array) as any; </s> remove let program = this._createPipelineStageDescriptor(vertexShader, fragmentShader); </s> add let program = this._createPipelineStageDescriptor(vertexShader, fragmentShader, shaderLanguage);
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Engines/webgpuEngine.ts
return this._createPipelineStageDescriptor(vertexShader, fragmentShader, shaderLanguage);
<mask> private _compileRawPipelineStageDescriptor(vertexCode: string, fragmentCode: string): IWebGPURenderPipelineStageDescriptor { <mask> var vertexShader = this._compileRawShaderToSpirV(vertexCode, "vertex"); <mask> var fragmentShader = this._compileRawShaderToSpirV(fragmentCode, "fragment"); <mask> <mask> return this._createPipelineStageDescriptor(vertexShader, fragmentShader); <mask> } <mask> <mask> private _compilePipelineStageDescriptor(vertexCode: string, fragmentCode: string, defines: Nullable<string>): IWebGPURenderPipelineStageDescriptor { <mask> this.onBeforeShaderCompilationObservable.notifyObservers(this); <mask> </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove private _compileRawPipelineStageDescriptor(vertexCode: string, fragmentCode: string): IWebGPURenderPipelineStageDescriptor { var vertexShader = this._compileRawShaderToSpirV(vertexCode, "vertex"); var fragmentShader = this._compileRawShaderToSpirV(fragmentCode, "fragment"); </s> add private _compileRawPipelineStageDescriptor(vertexCode: string, fragmentCode: string, shaderLanguage: ShaderLanguage): IWebGPURenderPipelineStageDescriptor { var vertexShader = shaderLanguage === ShaderLanguage.GLSL ? this._compileRawShaderToSpirV(vertexCode, "vertex") : vertexCode; var fragmentShader = shaderLanguage === ShaderLanguage.GLSL ? this._compileRawShaderToSpirV(fragmentCode, "fragment") : fragmentCode; </s> remove private _compilePipelineStageDescriptor(vertexCode: string, fragmentCode: string, defines: Nullable<string>): IWebGPURenderPipelineStageDescriptor { </s> add private _compilePipelineStageDescriptor(vertexCode: string, fragmentCode: string, defines: Nullable<string>, shaderLanguage: ShaderLanguage): IWebGPURenderPipelineStageDescriptor { </s> remove var vertexShader = this._compileShaderToSpirV(vertexCode, "vertex", defines, shaderVersion); var fragmentShader = this._compileShaderToSpirV(fragmentCode, "fragment", defines, shaderVersion); </s> add var vertexShader = shaderLanguage === ShaderLanguage.GLSL ? this._compileShaderToSpirV(vertexCode, "vertex", defines, shaderVersion) : this._getWGSLShader(vertexCode, "vertex", defines, shaderVersion); var fragmentShader = shaderLanguage === ShaderLanguage.GLSL ? this._compileShaderToSpirV(fragmentCode, "fragment", defines, shaderVersion) : this._getWGSLShader(fragmentCode, "fragment", defines, shaderVersion); </s> remove private _createPipelineStageDescriptor(vertexShader: Uint32Array, fragmentShader: Uint32Array): IWebGPURenderPipelineStageDescriptor { if (this._tintWASM) { vertexShader = this._tintWASM.convertSpirV2WGSL(vertexShader) as any; fragmentShader = this._tintWASM.convertSpirV2WGSL(fragmentShader) as any; </s> add private _getWGSLShader(source: string, type: string, defines: Nullable<string>, shaderVersion: string): string { if (defines) { defines = "//" + defines.split("\n").join("\n//") + "\n"; } else { defines = ""; } return defines + source; } private _createPipelineStageDescriptor(vertexShader: Uint32Array | string, fragmentShader: Uint32Array | string, shaderLanguage: ShaderLanguage): IWebGPURenderPipelineStageDescriptor { if (this._tintWASM && shaderLanguage === ShaderLanguage.GLSL) { vertexShader = this._tintWASM.convertSpirV2WGSL(vertexShader as Uint32Array) as any; fragmentShader = this._tintWASM.convertSpirV2WGSL(fragmentShader as Uint32Array) as any; </s> remove let program = this._createPipelineStageDescriptor(vertexShader, fragmentShader); </s> add let program = this._createPipelineStageDescriptor(vertexShader, fragmentShader, shaderLanguage);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Engines/webgpuEngine.ts
private _compilePipelineStageDescriptor(vertexCode: string, fragmentCode: string, defines: Nullable<string>, shaderLanguage: ShaderLanguage): IWebGPURenderPipelineStageDescriptor {
<mask> <mask> return this._createPipelineStageDescriptor(vertexShader, fragmentShader); <mask> } <mask> <mask> private _compilePipelineStageDescriptor(vertexCode: string, fragmentCode: string, defines: Nullable<string>): IWebGPURenderPipelineStageDescriptor { <mask> this.onBeforeShaderCompilationObservable.notifyObservers(this); <mask> <mask> var shaderVersion = "#version 450\n"; <mask> var vertexShader = this._compileShaderToSpirV(vertexCode, "vertex", defines, shaderVersion); <mask> var fragmentShader = this._compileShaderToSpirV(fragmentCode, "fragment", defines, shaderVersion); </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove var vertexShader = this._compileShaderToSpirV(vertexCode, "vertex", defines, shaderVersion); var fragmentShader = this._compileShaderToSpirV(fragmentCode, "fragment", defines, shaderVersion); </s> add var vertexShader = shaderLanguage === ShaderLanguage.GLSL ? this._compileShaderToSpirV(vertexCode, "vertex", defines, shaderVersion) : this._getWGSLShader(vertexCode, "vertex", defines, shaderVersion); var fragmentShader = shaderLanguage === ShaderLanguage.GLSL ? this._compileShaderToSpirV(fragmentCode, "fragment", defines, shaderVersion) : this._getWGSLShader(fragmentCode, "fragment", defines, shaderVersion); </s> remove let program = this._createPipelineStageDescriptor(vertexShader, fragmentShader); </s> add let program = this._createPipelineStageDescriptor(vertexShader, fragmentShader, shaderLanguage); </s> remove return this._createPipelineStageDescriptor(vertexShader, fragmentShader); </s> add return this._createPipelineStageDescriptor(vertexShader, fragmentShader, shaderLanguage); </s> remove private _compileRawPipelineStageDescriptor(vertexCode: string, fragmentCode: string): IWebGPURenderPipelineStageDescriptor { var vertexShader = this._compileRawShaderToSpirV(vertexCode, "vertex"); var fragmentShader = this._compileRawShaderToSpirV(fragmentCode, "fragment"); </s> add private _compileRawPipelineStageDescriptor(vertexCode: string, fragmentCode: string, shaderLanguage: ShaderLanguage): IWebGPURenderPipelineStageDescriptor { var vertexShader = shaderLanguage === ShaderLanguage.GLSL ? this._compileRawShaderToSpirV(vertexCode, "vertex") : vertexCode; var fragmentShader = shaderLanguage === ShaderLanguage.GLSL ? this._compileRawShaderToSpirV(fragmentCode, "fragment") : fragmentCode; </s> remove private _createPipelineStageDescriptor(vertexShader: Uint32Array, fragmentShader: Uint32Array): IWebGPURenderPipelineStageDescriptor { if (this._tintWASM) { vertexShader = this._tintWASM.convertSpirV2WGSL(vertexShader) as any; fragmentShader = this._tintWASM.convertSpirV2WGSL(fragmentShader) as any; </s> add private _getWGSLShader(source: string, type: string, defines: Nullable<string>, shaderVersion: string): string { if (defines) { defines = "//" + defines.split("\n").join("\n//") + "\n"; } else { defines = ""; } return defines + source; } private _createPipelineStageDescriptor(vertexShader: Uint32Array | string, fragmentShader: Uint32Array | string, shaderLanguage: ShaderLanguage): IWebGPURenderPipelineStageDescriptor { if (this._tintWASM && shaderLanguage === ShaderLanguage.GLSL) { vertexShader = this._tintWASM.convertSpirV2WGSL(vertexShader as Uint32Array) as any; fragmentShader = this._tintWASM.convertSpirV2WGSL(fragmentShader as Uint32Array) as any;
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Engines/webgpuEngine.ts
var vertexShader = shaderLanguage === ShaderLanguage.GLSL ? this._compileShaderToSpirV(vertexCode, "vertex", defines, shaderVersion) : this._getWGSLShader(vertexCode, "vertex", defines, shaderVersion); var fragmentShader = shaderLanguage === ShaderLanguage.GLSL ? this._compileShaderToSpirV(fragmentCode, "fragment", defines, shaderVersion) : this._getWGSLShader(fragmentCode, "fragment", defines, shaderVersion);
<mask> private _compilePipelineStageDescriptor(vertexCode: string, fragmentCode: string, defines: Nullable<string>): IWebGPURenderPipelineStageDescriptor { <mask> this.onBeforeShaderCompilationObservable.notifyObservers(this); <mask> <mask> var shaderVersion = "#version 450\n"; <mask> var vertexShader = this._compileShaderToSpirV(vertexCode, "vertex", defines, shaderVersion); <mask> var fragmentShader = this._compileShaderToSpirV(fragmentCode, "fragment", defines, shaderVersion); <mask> <mask> let program = this._createPipelineStageDescriptor(vertexShader, fragmentShader); <mask> <mask> this.onAfterShaderCompilationObservable.notifyObservers(this); <mask> </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove private _compilePipelineStageDescriptor(vertexCode: string, fragmentCode: string, defines: Nullable<string>): IWebGPURenderPipelineStageDescriptor { </s> add private _compilePipelineStageDescriptor(vertexCode: string, fragmentCode: string, defines: Nullable<string>, shaderLanguage: ShaderLanguage): IWebGPURenderPipelineStageDescriptor { </s> remove let program = this._createPipelineStageDescriptor(vertexShader, fragmentShader); </s> add let program = this._createPipelineStageDescriptor(vertexShader, fragmentShader, shaderLanguage); </s> remove return this._createPipelineStageDescriptor(vertexShader, fragmentShader); </s> add return this._createPipelineStageDescriptor(vertexShader, fragmentShader, shaderLanguage); </s> remove private _compileRawPipelineStageDescriptor(vertexCode: string, fragmentCode: string): IWebGPURenderPipelineStageDescriptor { var vertexShader = this._compileRawShaderToSpirV(vertexCode, "vertex"); var fragmentShader = this._compileRawShaderToSpirV(fragmentCode, "fragment"); </s> add private _compileRawPipelineStageDescriptor(vertexCode: string, fragmentCode: string, shaderLanguage: ShaderLanguage): IWebGPURenderPipelineStageDescriptor { var vertexShader = shaderLanguage === ShaderLanguage.GLSL ? this._compileRawShaderToSpirV(vertexCode, "vertex") : vertexCode; var fragmentShader = shaderLanguage === ShaderLanguage.GLSL ? this._compileRawShaderToSpirV(fragmentCode, "fragment") : fragmentCode; </s> remove private _createPipelineStageDescriptor(vertexShader: Uint32Array, fragmentShader: Uint32Array): IWebGPURenderPipelineStageDescriptor { if (this._tintWASM) { vertexShader = this._tintWASM.convertSpirV2WGSL(vertexShader) as any; fragmentShader = this._tintWASM.convertSpirV2WGSL(fragmentShader) as any; </s> add private _getWGSLShader(source: string, type: string, defines: Nullable<string>, shaderVersion: string): string { if (defines) { defines = "//" + defines.split("\n").join("\n//") + "\n"; } else { defines = ""; } return defines + source; } private _createPipelineStageDescriptor(vertexShader: Uint32Array | string, fragmentShader: Uint32Array | string, shaderLanguage: ShaderLanguage): IWebGPURenderPipelineStageDescriptor { if (this._tintWASM && shaderLanguage === ShaderLanguage.GLSL) { vertexShader = this._tintWASM.convertSpirV2WGSL(vertexShader as Uint32Array) as any; fragmentShader = this._tintWASM.convertSpirV2WGSL(fragmentShader as Uint32Array) as any;
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Engines/webgpuEngine.ts
let program = this._createPipelineStageDescriptor(vertexShader, fragmentShader, shaderLanguage);
<mask> var shaderVersion = "#version 450\n"; <mask> var vertexShader = this._compileShaderToSpirV(vertexCode, "vertex", defines, shaderVersion); <mask> var fragmentShader = this._compileShaderToSpirV(fragmentCode, "fragment", defines, shaderVersion); <mask> <mask> let program = this._createPipelineStageDescriptor(vertexShader, fragmentShader); <mask> <mask> this.onAfterShaderCompilationObservable.notifyObservers(this); <mask> <mask> return program; <mask> } </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove var vertexShader = this._compileShaderToSpirV(vertexCode, "vertex", defines, shaderVersion); var fragmentShader = this._compileShaderToSpirV(fragmentCode, "fragment", defines, shaderVersion); </s> add var vertexShader = shaderLanguage === ShaderLanguage.GLSL ? this._compileShaderToSpirV(vertexCode, "vertex", defines, shaderVersion) : this._getWGSLShader(vertexCode, "vertex", defines, shaderVersion); var fragmentShader = shaderLanguage === ShaderLanguage.GLSL ? this._compileShaderToSpirV(fragmentCode, "fragment", defines, shaderVersion) : this._getWGSLShader(fragmentCode, "fragment", defines, shaderVersion); </s> remove private _compilePipelineStageDescriptor(vertexCode: string, fragmentCode: string, defines: Nullable<string>): IWebGPURenderPipelineStageDescriptor { </s> add private _compilePipelineStageDescriptor(vertexCode: string, fragmentCode: string, defines: Nullable<string>, shaderLanguage: ShaderLanguage): IWebGPURenderPipelineStageDescriptor { </s> remove return this._createPipelineStageDescriptor(vertexShader, fragmentShader); </s> add return this._createPipelineStageDescriptor(vertexShader, fragmentShader, shaderLanguage); </s> remove private _compileRawPipelineStageDescriptor(vertexCode: string, fragmentCode: string): IWebGPURenderPipelineStageDescriptor { var vertexShader = this._compileRawShaderToSpirV(vertexCode, "vertex"); var fragmentShader = this._compileRawShaderToSpirV(fragmentCode, "fragment"); </s> add private _compileRawPipelineStageDescriptor(vertexCode: string, fragmentCode: string, shaderLanguage: ShaderLanguage): IWebGPURenderPipelineStageDescriptor { var vertexShader = shaderLanguage === ShaderLanguage.GLSL ? this._compileRawShaderToSpirV(vertexCode, "vertex") : vertexCode; var fragmentShader = shaderLanguage === ShaderLanguage.GLSL ? this._compileRawShaderToSpirV(fragmentCode, "fragment") : fragmentCode;
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Engines/webgpuEngine.ts
const shaderLanguage = webGpuContext.shaderProcessingContext.shaderLanguage;
<mask> key: string) { <mask> const webGpuContext = pipelineContext as WebGPUPipelineContext; <mask> <mask> if (this.dbgShowShaderCode) { <mask> console.log(defines); <mask> console.log(vertexSourceCode); </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove private _createPipelineStageDescriptor(vertexShader: Uint32Array, fragmentShader: Uint32Array): IWebGPURenderPipelineStageDescriptor { if (this._tintWASM) { vertexShader = this._tintWASM.convertSpirV2WGSL(vertexShader) as any; fragmentShader = this._tintWASM.convertSpirV2WGSL(fragmentShader) as any; </s> add private _getWGSLShader(source: string, type: string, defines: Nullable<string>, shaderVersion: string): string { if (defines) { defines = "//" + defines.split("\n").join("\n//") + "\n"; } else { defines = ""; } return defines + source; } private _createPipelineStageDescriptor(vertexShader: Uint32Array | string, fragmentShader: Uint32Array | string, shaderLanguage: ShaderLanguage): IWebGPURenderPipelineStageDescriptor { if (this._tintWASM && shaderLanguage === ShaderLanguage.GLSL) { vertexShader = this._tintWASM.convertSpirV2WGSL(vertexShader as Uint32Array) as any; fragmentShader = this._tintWASM.convertSpirV2WGSL(fragmentShader as Uint32Array) as any; </s> remove Effect.ShadersStore[`${name}PixelShader`] = pixelShader; </s> add EngineShaderStore.GetShadersStore(shaderLanguage)[`${name}PixelShader`] = pixelShader; </s> remove public static RegisterShader(name: string, pixelShader?: string, vertexShader?: string) { </s> add public static RegisterShader(name: string, pixelShader?: string, vertexShader?: string, shaderLanguage = ShaderLanguage.GLSL) { </s> remove import { ShaderStore as EngineShaderStore } from '../Engines/shaderStore'; </s> add import { ShaderStore as EngineShaderStore, ShaderStore } from '../Engines/shaderStore';
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Engines/webgpuEngine.ts
webGpuContext.stages = this._compileRawPipelineStageDescriptor(vertexSourceCode, fragmentSourceCode, shaderLanguage); } else { webGpuContext.stages = this._compilePipelineStageDescriptor(vertexSourceCode, fragmentSourceCode, defines, shaderLanguage);
<mask> rawFragment: rawFragmentSourceCode, <mask> }; <mask> <mask> if (createAsRaw) { <mask> webGpuContext.stages = this._compileRawPipelineStageDescriptor(vertexSourceCode, fragmentSourceCode); <mask> } <mask> else { <mask> webGpuContext.stages = this._compilePipelineStageDescriptor(vertexSourceCode, fragmentSourceCode, defines); <mask> } <mask> } <mask> <mask> /** <mask> * Gets the list of active attributes for a given WebGPU program </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove /** * Gets or sets the relative url used to load shaders if using the engine in non-minified mode */ public static ShadersRepository = "src/Shaders/"; /** * Store of each shader (The can be looked up using effect.key) */ public static ShadersStore: { [key: string]: string } = {}; /** * Store of each included file for a shader (The can be looked up using effect.key) */ public static IncludesShadersStore: { [key: string]: string } = {}; </s> add /** * Gets or sets the relative url used to load shaders if using the engine in non-minified mode */ public static ShadersRepository = "src/Shaders/"; /** * Store of each shader (The can be looked up using effect.key) */ public static ShadersStore: { [key: string]: string } = {}; /** * Store of each included file for a shader (The can be looked up using effect.key) */ public static IncludesShadersStore: { [key: string]: string } = {}; /** * Gets or sets the relative url used to load shaders (WGSL) if using the engine in non-minified mode */ public static ShadersRepositoryWGSL = "src/ShadersWGSL/"; /** * Store of each shader (WGSL) */ public static ShadersStoreWGSL: { [key: string]: string } = {}; /** * Store of each included file for a shader (WGSL) */ public static IncludesShadersStoreWGSL: { [key: string]: string } = {}; /** * Gets the shaders repository path for a given shader language * @param shaderLanguage the shader language * @returns the path to the shaders repository */ public static GetShadersRepository(shaderLanguage = ShaderLanguage.GLSL): string { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.ShadersRepository : ShaderStore.ShadersRepositoryWGSL; } /** * Gets the shaders store of a given shader language * @param shaderLanguage the shader language * @returns the shaders store */ public static GetShadersStore(shaderLanguage = ShaderLanguage.GLSL): { [key: string]: string } { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.ShadersStore : ShaderStore.ShadersStoreWGSL; } /** * Gets the include shaders store of a given shader language * @param shaderLanguage the shader language * @returns the include shaders store */ public static GetIncludesShadersStore(shaderLanguage = ShaderLanguage.GLSL): { [key: string]: string } { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.IncludesShadersStore : ShaderStore.IncludesShadersStoreWGSL; } </s> remove // Build the uniform layout for the left over uniforms. this.buildUniformLayout(); </s> add if (this.shaderProcessingContext.shaderLanguage === ShaderLanguage.GLSL) { // Build the uniform layout for the left over uniforms. this.buildUniformLayout(); } </s> remove Effect.ShadersStore[`${name}VertexShader`] = vertexShader; </s> add EngineShaderStore.GetShadersStore(shaderLanguage)[`${name}VertexShader`] = vertexShader; </s> remove effectLocation = "../Materials/effect"; </s> add shaderStoreLocation = "../Engines/shaderStore";
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Engines/webgpuEngine.ts
import { ProcessingOptions, ShaderLanguage, ShaderProcessingContext } from '../Engines/Processors/shaderProcessingOptions';
<mask> import { IDisposable } from '../scene'; <mask> import { IPipelineContext } from '../Engines/IPipelineContext'; <mask> import { DataBuffer } from '../Buffers/dataBuffer'; <mask> import { ShaderProcessor } from '../Engines/Processors/shaderProcessor'; <mask> import { ProcessingOptions, ShaderProcessingContext } from '../Engines/Processors/shaderProcessingOptions'; <mask> import { IMatrixLike, IVector2Like, IVector3Like, IVector4Like, IColor3Like, IColor4Like } from '../Maths/math.like'; <mask> import { ThinEngine } from '../Engines/thinEngine'; <mask> import { IEffectFallbacks } from './iEffectFallbacks'; <mask> import { ShaderStore as EngineShaderStore } from '../Engines/shaderStore'; <mask> </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove import { ShaderStore as EngineShaderStore } from '../Engines/shaderStore'; </s> add import { ShaderStore as EngineShaderStore, ShaderStore } from '../Engines/shaderStore'; </s> remove import { ProcessingOptions } from "../Engines/Processors/shaderProcessingOptions"; </s> add import { ProcessingOptions, ShaderLanguage } from "../Engines/Processors/shaderProcessingOptions"; </s> remove import { ShaderProcessingContext } from "../Processors/shaderProcessingOptions"; </s> add import { ShaderLanguage, ShaderProcessingContext } from "../Processors/shaderProcessingOptions"; </s> remove import { ShaderProcessingContext } from "./Processors/shaderProcessingOptions"; </s> add import { ShaderLanguage, ShaderProcessingContext } from "./Processors/shaderProcessingOptions";
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Materials/effect.ts
import { ShaderStore as EngineShaderStore, ShaderStore } from '../Engines/shaderStore';
<mask> import { ProcessingOptions, ShaderProcessingContext } from '../Engines/Processors/shaderProcessingOptions'; <mask> import { IMatrixLike, IVector2Like, IVector3Like, IVector4Like, IColor3Like, IColor4Like } from '../Maths/math.like'; <mask> import { ThinEngine } from '../Engines/thinEngine'; <mask> import { IEffectFallbacks } from './iEffectFallbacks'; <mask> import { ShaderStore as EngineShaderStore } from '../Engines/shaderStore'; <mask> <mask> declare type Engine = import("../Engines/engine").Engine; <mask> declare type InternalTexture = import("../Materials/Textures/internalTexture").InternalTexture; <mask> declare type ThinTexture = import("../Materials/Textures/thinTexture").ThinTexture; <mask> declare type RenderTargetTexture = import("../Materials/Textures/renderTargetTexture").RenderTargetTexture; </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove import { ProcessingOptions, ShaderProcessingContext } from '../Engines/Processors/shaderProcessingOptions'; </s> add import { ProcessingOptions, ShaderLanguage, ShaderProcessingContext } from '../Engines/Processors/shaderProcessingOptions'; </s> remove import { ProcessingOptions } from './shaderProcessingOptions'; </s> add import { ProcessingOptions, ShaderLanguage } from './shaderProcessingOptions'; </s> remove import { ProcessingOptions } from "../Engines/Processors/shaderProcessingOptions"; </s> add import { ProcessingOptions, ShaderLanguage } from "../Engines/Processors/shaderProcessingOptions"; </s> remove import { ShaderProcessingContext } from "../Processors/shaderProcessingOptions"; </s> add import { ShaderLanguage, ShaderProcessingContext } from "../Processors/shaderProcessingOptions";
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Materials/effect.ts
/** * The language the shader is written with (default: GLSL) */ shaderLanguage?: ShaderLanguage;
<mask> /** <mask> * Is this effect rendering to several color attachments ? <mask> */ <mask> multiTarget?: boolean; <mask> } <mask> <mask> /** <mask> * Effect containing vertex and fragment shader that can be executed on an object. <mask> */ </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove /** * Gets or sets the relative url used to load shaders if using the engine in non-minified mode */ public static ShadersRepository = "src/Shaders/"; /** * Store of each shader (The can be looked up using effect.key) */ public static ShadersStore: { [key: string]: string } = {}; /** * Store of each included file for a shader (The can be looked up using effect.key) */ public static IncludesShadersStore: { [key: string]: string } = {}; </s> add /** * Gets or sets the relative url used to load shaders if using the engine in non-minified mode */ public static ShadersRepository = "src/Shaders/"; /** * Store of each shader (The can be looked up using effect.key) */ public static ShadersStore: { [key: string]: string } = {}; /** * Store of each included file for a shader (The can be looked up using effect.key) */ public static IncludesShadersStore: { [key: string]: string } = {}; /** * Gets or sets the relative url used to load shaders (WGSL) if using the engine in non-minified mode */ public static ShadersRepositoryWGSL = "src/ShadersWGSL/"; /** * Store of each shader (WGSL) */ public static ShadersStoreWGSL: { [key: string]: string } = {}; /** * Store of each included file for a shader (WGSL) */ public static IncludesShadersStoreWGSL: { [key: string]: string } = {}; /** * Gets the shaders repository path for a given shader language * @param shaderLanguage the shader language * @returns the path to the shaders repository */ public static GetShadersRepository(shaderLanguage = ShaderLanguage.GLSL): string { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.ShadersRepository : ShaderStore.ShadersRepositoryWGSL; } /** * Gets the shaders store of a given shader language * @param shaderLanguage the shader language * @returns the shaders store */ public static GetShadersStore(shaderLanguage = ShaderLanguage.GLSL): { [key: string]: string } { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.ShadersStore : ShaderStore.ShadersStoreWGSL; } /** * Gets the include shaders store of a given shader language * @param shaderLanguage the shader language * @returns the include shaders store */ public static GetIncludesShadersStore(shaderLanguage = ShaderLanguage.GLSL): { [key: string]: string } { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.IncludesShadersStore : ShaderStore.IncludesShadersStoreWGSL; } </s> remove `import { Effect } from "##EFFECTLOCATION_PLACEHOLDER##"; </s> add `import { ShaderStore } from "##SHADERSTORELOCATION_PLACEHOLDER##"; </s> remove Effect.ShadersStore[`${name}VertexShader`] = vertexShader; </s> add EngineShaderStore.GetShadersStore(shaderLanguage)[`${name}VertexShader`] = vertexShader;
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Materials/effect.ts
private _shaderLanguage: ShaderLanguage;
<mask> private _fallbacks: Nullable<IEffectFallbacks> = null; <mask> private _vertexSourceCodeOverride: string = ""; <mask> private _fragmentSourceCodeOverride: string = ""; <mask> private _transformFeedbackVaryings: Nullable<string[]> = null; <mask> /** <mask> * Compiled shader to webGL program. <mask> * @hidden <mask> */ <mask> public _pipelineContext: Nullable<IPipelineContext> = null; </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove public _getShaderProcessingContext(): Nullable<ShaderProcessingContext> { </s> add public _getShaderProcessingContext(shaderLanguage: ShaderLanguage): Nullable<ShaderProcessingContext> { </s> remove /** * Gets or sets the relative url used to load shaders if using the engine in non-minified mode */ public static ShadersRepository = "src/Shaders/"; /** * Store of each shader (The can be looked up using effect.key) */ public static ShadersStore: { [key: string]: string } = {}; /** * Store of each included file for a shader (The can be looked up using effect.key) */ public static IncludesShadersStore: { [key: string]: string } = {}; </s> add /** * Gets or sets the relative url used to load shaders if using the engine in non-minified mode */ public static ShadersRepository = "src/Shaders/"; /** * Store of each shader (The can be looked up using effect.key) */ public static ShadersStore: { [key: string]: string } = {}; /** * Store of each included file for a shader (The can be looked up using effect.key) */ public static IncludesShadersStore: { [key: string]: string } = {}; /** * Gets or sets the relative url used to load shaders (WGSL) if using the engine in non-minified mode */ public static ShadersRepositoryWGSL = "src/ShadersWGSL/"; /** * Store of each shader (WGSL) */ public static ShadersStoreWGSL: { [key: string]: string } = {}; /** * Store of each included file for a shader (WGSL) */ public static IncludesShadersStoreWGSL: { [key: string]: string } = {}; /** * Gets the shaders repository path for a given shader language * @param shaderLanguage the shader language * @returns the path to the shaders repository */ public static GetShadersRepository(shaderLanguage = ShaderLanguage.GLSL): string { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.ShadersRepository : ShaderStore.ShadersRepositoryWGSL; } /** * Gets the shaders store of a given shader language * @param shaderLanguage the shader language * @returns the shaders store */ public static GetShadersStore(shaderLanguage = ShaderLanguage.GLSL): { [key: string]: string } { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.ShadersStore : ShaderStore.ShadersStoreWGSL; } /** * Gets the include shaders store of a given shader language * @param shaderLanguage the shader language * @returns the include shaders store */ public static GetIncludesShadersStore(shaderLanguage = ShaderLanguage.GLSL): { [key: string]: string } { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.IncludesShadersStore : ShaderStore.IncludesShadersStoreWGSL; } </s> remove private static _PreparePreProcessors(options: ProcessingOptions, engine: ThinEngine, addGLES = true): { [key: string]: string } { </s> add private static _PreparePreProcessors(options: ProcessingOptions, engine: ThinEngine): { [key: string]: string } { </s> remove private _createPipelineStageDescriptor(vertexShader: Uint32Array, fragmentShader: Uint32Array): IWebGPURenderPipelineStageDescriptor { if (this._tintWASM) { vertexShader = this._tintWASM.convertSpirV2WGSL(vertexShader) as any; fragmentShader = this._tintWASM.convertSpirV2WGSL(fragmentShader) as any; </s> add private _getWGSLShader(source: string, type: string, defines: Nullable<string>, shaderVersion: string): string { if (defines) { defines = "//" + defines.split("\n").join("\n//") + "\n"; } else { defines = ""; } return defines + source; } private _createPipelineStageDescriptor(vertexShader: Uint32Array | string, fragmentShader: Uint32Array | string, shaderLanguage: ShaderLanguage): IWebGPURenderPipelineStageDescriptor { if (this._tintWASM && shaderLanguage === ShaderLanguage.GLSL) { vertexShader = this._tintWASM.convertSpirV2WGSL(vertexShader as Uint32Array) as any; fragmentShader = this._tintWASM.convertSpirV2WGSL(fragmentShader as Uint32Array) as any;
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Materials/effect.ts
this._shaderLanguage = options.shaderLanguage ?? ShaderLanguage.GLSL;
<mask> this._fallbacks = options.fallbacks; <mask> this._indexParameters = options.indexParameters; <mask> this._transformFeedbackVaryings = options.transformFeedbackVaryings || null; <mask> this._multiTarget = !!options.multiTarget; <mask> <mask> if (options.uniformBuffersNames) { <mask> this._uniformBuffersNamesList = options.uniformBuffersNames.slice(); <mask> for (var i = 0; i < options.uniformBuffersNames.length; i++) { <mask> this._uniformBuffersNames[options.uniformBuffersNames[i]] = i; </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove // Build the uniform layout for the left over uniforms. this.buildUniformLayout(); </s> add if (this.shaderProcessingContext.shaderLanguage === ShaderLanguage.GLSL) { // Build the uniform layout for the left over uniforms. this.buildUniformLayout(); } </s> remove constructor() { </s> add constructor(shaderLanguage: ShaderLanguage) { this.shaderLanguage = shaderLanguage; </s> remove private static _PreparePreProcessors(options: ProcessingOptions, engine: ThinEngine, addGLES = true): { [key: string]: string } { </s> add private static _PreparePreProcessors(options: ProcessingOptions, engine: ThinEngine): { [key: string]: string } { </s> remove this._vertexSourceCode = "#define SHADER_NAME vertex:" + vertex + "\n" + migratedVertexCode; this._fragmentSourceCode = "#define SHADER_NAME fragment:" + fragment + "\n" + migratedFragmentCode; </s> add this._vertexSourceCode = (this._shaderLanguage === ShaderLanguage.WGSL ? "//" : "") + "#define SHADER_NAME vertex:" + vertex + "\n" + migratedVertexCode; this._fragmentSourceCode = (this._shaderLanguage === ShaderLanguage.WGSL ? "//" : "") + "#define SHADER_NAME fragment:" + fragment + "\n" + migratedFragmentCode;
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Materials/effect.ts
this._shaderLanguage = ShaderLanguage.GLSL;
<mask> this._samplerList = samplers ? <string[]>samplers.slice() : []; <mask> this._attributesNames = (<string[]>attributesNamesOrOptions); <mask> this._uniformBuffersNamesList = []; <mask> <mask> this.onError = onError; <mask> this.onCompiled = onCompiled; <mask> </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove // Build the uniform layout for the left over uniforms. this.buildUniformLayout(); </s> add if (this.shaderProcessingContext.shaderLanguage === ShaderLanguage.GLSL) { // Build the uniform layout for the left over uniforms. this.buildUniformLayout(); } </s> remove const shaderStore = isInclude ? "IncludesShadersStore" : "ShadersStore"; let effectLocation; </s> add const shaderStore = isInclude ? `IncludesShadersStore${appendDirName}` : `ShadersStore${appendDirName}`; let shaderStoreLocation;
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Materials/effect.ts
this._processingContext = this._engine._getShaderProcessingContext(this._shaderLanguage);
<mask> } else { <mask> fragmentSource = baseName.fragment || baseName; <mask> } <mask> <mask> this._processingContext = this._engine._getShaderProcessingContext(); <mask> <mask> const processorOptions: ProcessingOptions = { <mask> defines: this.defines.split("\n"), <mask> indexParameters: this._indexParameters, <mask> isFragment: false, </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove this._vertexSourceCode = "#define SHADER_NAME vertex:" + vertex + "\n" + migratedVertexCode; this._fragmentSourceCode = "#define SHADER_NAME fragment:" + fragment + "\n" + migratedFragmentCode; </s> add this._vertexSourceCode = (this._shaderLanguage === ShaderLanguage.WGSL ? "//" : "") + "#define SHADER_NAME vertex:" + vertex + "\n" + migratedVertexCode; this._fragmentSourceCode = (this._shaderLanguage === ShaderLanguage.WGSL ? "//" : "") + "#define SHADER_NAME fragment:" + fragment + "\n" + migratedFragmentCode; </s> remove indexParameters: { maxSimultaneousMorphTargets: numInfluencers } </s> add indexParameters: { maxSimultaneousMorphTargets: numInfluencers }, shaderLanguage: this._options.shaderLanguage </s> remove shaderUrl = ShaderStore.ShadersRepository + shader; </s> add shaderUrl = ShaderStore.GetShadersRepository(this._shaderLanguage) + shader; </s> remove effectLocation = "../../Materials/effect"; </s> add shaderStoreLocation = "../../Engines/shaderStore";
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Materials/effect.ts
shadersRepository: ShaderStore.GetShadersRepository(this._shaderLanguage), includesShadersStore: ShaderStore.GetIncludesShadersStore(this._shaderLanguage),
<mask> isFragment: false, <mask> shouldUseHighPrecisionShader: this._engine._shouldUseHighPrecisionShader, <mask> processor: this._engine._shaderProcessor, <mask> supportsUniformBuffers: this._engine.supportsUniformBuffers, <mask> shadersRepository: Effect.ShadersRepository, <mask> includesShadersStore: Effect.IncludesShadersStore, <mask> version: (this._engine.version * 100).toString(), <mask> platformName: this._engine.shaderPlatformName, <mask> processingContext: this._processingContext, <mask> isNDCHalfZRange: this._engine.isNDCHalfZRange, <mask> useReverseDepthBuffer: this._engine.useReverseDepthBuffer, </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove shadersRepository: ShaderStore.ShadersRepository, includesShadersStore: ShaderStore.IncludesShadersStore, </s> add shadersRepository: ShaderStore.GetShadersRepository(this._shaderLanguage), includesShadersStore: ShaderStore.GetIncludesShadersStore(this._shaderLanguage), </s> remove this._processingContext = this._engine._getShaderProcessingContext(); </s> add this._processingContext = this._engine._getShaderProcessingContext(this._shaderLanguage);
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Materials/effect.ts
shaderLanguage: this._shaderLanguage, disableNodeProcessing: this._shaderLanguage === ShaderLanguage.WGSL,
<mask> platformName: this._engine.shaderPlatformName, <mask> processingContext: this._processingContext, <mask> isNDCHalfZRange: this._engine.isNDCHalfZRange, <mask> useReverseDepthBuffer: this._engine.useReverseDepthBuffer, <mask> }; <mask> <mask> let shaderCodes: [string | undefined, string | undefined] = [undefined, undefined]; <mask> let shadersLoaded = () => { <mask> if (shaderCodes[0] && shaderCodes[1]) { </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove shadersRepository: Effect.ShadersRepository, includesShadersStore: Effect.IncludesShadersStore, </s> add shadersRepository: ShaderStore.GetShadersRepository(this._shaderLanguage), includesShadersStore: ShaderStore.GetIncludesShadersStore(this._shaderLanguage), </s> remove shadersRepository: ShaderStore.ShadersRepository, includesShadersStore: ShaderStore.IncludesShadersStore, </s> add shadersRepository: ShaderStore.GetShadersRepository(this._shaderLanguage), includesShadersStore: ShaderStore.GetIncludesShadersStore(this._shaderLanguage), </s> remove private _createPipelineStageDescriptor(vertexShader: Uint32Array, fragmentShader: Uint32Array): IWebGPURenderPipelineStageDescriptor { if (this._tintWASM) { vertexShader = this._tintWASM.convertSpirV2WGSL(vertexShader) as any; fragmentShader = this._tintWASM.convertSpirV2WGSL(fragmentShader) as any; </s> add private _getWGSLShader(source: string, type: string, defines: Nullable<string>, shaderVersion: string): string { if (defines) { defines = "//" + defines.split("\n").join("\n//") + "\n"; } else { defines = ""; } return defines + source; } private _createPipelineStageDescriptor(vertexShader: Uint32Array | string, fragmentShader: Uint32Array | string, shaderLanguage: ShaderLanguage): IWebGPURenderPipelineStageDescriptor { if (this._tintWASM && shaderLanguage === ShaderLanguage.GLSL) { vertexShader = this._tintWASM.convertSpirV2WGSL(vertexShader as Uint32Array) as any; fragmentShader = this._tintWASM.convertSpirV2WGSL(fragmentShader as Uint32Array) as any; </s> remove if (processor) { </s> add if (processor && !options.disableNodeProcessing) {
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Materials/effect.ts
this._vertexSourceCode = (this._shaderLanguage === ShaderLanguage.WGSL ? "//" : "") + "#define SHADER_NAME vertex:" + vertex + "\n" + migratedVertexCode; this._fragmentSourceCode = (this._shaderLanguage === ShaderLanguage.WGSL ? "//" : "") + "#define SHADER_NAME fragment:" + fragment + "\n" + migratedFragmentCode;
<mask> if (baseName) { <mask> var vertex = baseName.vertexElement || baseName.vertex || baseName.spectorName || baseName; <mask> var fragment = baseName.fragmentElement || baseName.fragment || baseName.spectorName || baseName; <mask> <mask> this._vertexSourceCode = "#define SHADER_NAME vertex:" + vertex + "\n" + migratedVertexCode; <mask> this._fragmentSourceCode = "#define SHADER_NAME fragment:" + fragment + "\n" + migratedFragmentCode; <mask> } else { <mask> this._vertexSourceCode = migratedVertexCode; <mask> this._fragmentSourceCode = migratedFragmentCode; <mask> } <mask> this._prepareEffect(); </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove shaderUrl = ShaderStore.ShadersRepository + shader; </s> add shaderUrl = ShaderStore.GetShadersRepository(this._shaderLanguage) + shader; </s> remove this._processingContext = this._engine._getShaderProcessingContext(); </s> add this._processingContext = this._engine._getShaderProcessingContext(this._shaderLanguage); </s> remove private _createPipelineStageDescriptor(vertexShader: Uint32Array, fragmentShader: Uint32Array): IWebGPURenderPipelineStageDescriptor { if (this._tintWASM) { vertexShader = this._tintWASM.convertSpirV2WGSL(vertexShader) as any; fragmentShader = this._tintWASM.convertSpirV2WGSL(fragmentShader) as any; </s> add private _getWGSLShader(source: string, type: string, defines: Nullable<string>, shaderVersion: string): string { if (defines) { defines = "//" + defines.split("\n").join("\n//") + "\n"; } else { defines = ""; } return defines + source; } private _createPipelineStageDescriptor(vertexShader: Uint32Array | string, fragmentShader: Uint32Array | string, shaderLanguage: ShaderLanguage): IWebGPURenderPipelineStageDescriptor { if (this._tintWASM && shaderLanguage === ShaderLanguage.GLSL) { vertexShader = this._tintWASM.convertSpirV2WGSL(vertexShader as Uint32Array) as any; fragmentShader = this._tintWASM.convertSpirV2WGSL(fragmentShader as Uint32Array) as any; </s> remove includeText = includeText + `import "babylonjs/Shaders/ShadersInclude/${entry}"; </s> add includeText = includeText + `import "babylonjs/Shaders${appendDirName}/ShadersInclude/${entry}";
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Materials/effect.ts
public static RegisterShader(name: string, pixelShader?: string, vertexShader?: string, shaderLanguage = ShaderLanguage.GLSL) {
<mask> * @param name the name of the shader <mask> * @param pixelShader optional pixel shader content <mask> * @param vertexShader optional vertex shader content <mask> */ <mask> public static RegisterShader(name: string, pixelShader?: string, vertexShader?: string) { <mask> if (pixelShader) { <mask> Effect.ShadersStore[`${name}PixelShader`] = pixelShader; <mask> } <mask> <mask> if (vertexShader) { </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove Effect.ShadersStore[`${name}PixelShader`] = pixelShader; </s> add EngineShaderStore.GetShadersStore(shaderLanguage)[`${name}PixelShader`] = pixelShader; </s> remove ShaderStore.ShadersStore[`${name}ComputeShader`] = computeShader; </s> add ShaderStore.GetShadersStore(ShaderLanguage.WGSL)[`${name}ComputeShader`] = computeShader; </s> remove * * object: { compute: "custom" }, used with ShaderStore.ShadersStore["customComputeShader"] </s> add * * object: { compute: "custom" }, used with ShaderStore.ShadersStoreWGSL["customComputeShader"] </s> remove /** * Gets or sets the relative url used to load shaders if using the engine in non-minified mode */ public static ShadersRepository = "src/Shaders/"; /** * Store of each shader (The can be looked up using effect.key) */ public static ShadersStore: { [key: string]: string } = {}; /** * Store of each included file for a shader (The can be looked up using effect.key) */ public static IncludesShadersStore: { [key: string]: string } = {}; </s> add /** * Gets or sets the relative url used to load shaders if using the engine in non-minified mode */ public static ShadersRepository = "src/Shaders/"; /** * Store of each shader (The can be looked up using effect.key) */ public static ShadersStore: { [key: string]: string } = {}; /** * Store of each included file for a shader (The can be looked up using effect.key) */ public static IncludesShadersStore: { [key: string]: string } = {}; /** * Gets or sets the relative url used to load shaders (WGSL) if using the engine in non-minified mode */ public static ShadersRepositoryWGSL = "src/ShadersWGSL/"; /** * Store of each shader (WGSL) */ public static ShadersStoreWGSL: { [key: string]: string } = {}; /** * Store of each included file for a shader (WGSL) */ public static IncludesShadersStoreWGSL: { [key: string]: string } = {}; /** * Gets the shaders repository path for a given shader language * @param shaderLanguage the shader language * @returns the path to the shaders repository */ public static GetShadersRepository(shaderLanguage = ShaderLanguage.GLSL): string { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.ShadersRepository : ShaderStore.ShadersRepositoryWGSL; } /** * Gets the shaders store of a given shader language * @param shaderLanguage the shader language * @returns the shaders store */ public static GetShadersStore(shaderLanguage = ShaderLanguage.GLSL): { [key: string]: string } { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.ShadersStore : ShaderStore.ShadersStoreWGSL; } /** * Gets the include shaders store of a given shader language * @param shaderLanguage the shader language * @returns the include shaders store */ public static GetIncludesShadersStore(shaderLanguage = ShaderLanguage.GLSL): { [key: string]: string } { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.IncludesShadersStore : ShaderStore.IncludesShadersStoreWGSL; } </s> remove * * string: try first to find the code in ShaderStore.ShadersStore[shaderPath + "ComputeShader"]. If not, assumes it is a file with name shaderPath.compute.fx in index.html folder. </s> add * * string: try first to find the code in ShaderStore.ShadersStoreWGSL[shaderPath + "ComputeShader"]. If not, assumes it is a file with name shaderPath.compute.fx in index.html folder.
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Materials/effect.ts
EngineShaderStore.GetShadersStore(shaderLanguage)[`${name}PixelShader`] = pixelShader;
<mask> * @param vertexShader optional vertex shader content <mask> */ <mask> public static RegisterShader(name: string, pixelShader?: string, vertexShader?: string) { <mask> if (pixelShader) { <mask> Effect.ShadersStore[`${name}PixelShader`] = pixelShader; <mask> } <mask> <mask> if (vertexShader) { <mask> Effect.ShadersStore[`${name}VertexShader`] = vertexShader; <mask> } </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove public static RegisterShader(name: string, pixelShader?: string, vertexShader?: string) { </s> add public static RegisterShader(name: string, pixelShader?: string, vertexShader?: string, shaderLanguage = ShaderLanguage.GLSL) { </s> remove ShaderStore.ShadersStore[`${name}ComputeShader`] = computeShader; </s> add ShaderStore.GetShadersStore(ShaderLanguage.WGSL)[`${name}ComputeShader`] = computeShader; </s> remove Effect.ShadersStore[`${name}VertexShader`] = vertexShader; </s> add EngineShaderStore.GetShadersStore(shaderLanguage)[`${name}VertexShader`] = vertexShader; </s> remove /** * Gets or sets the relative url used to load shaders if using the engine in non-minified mode */ public static ShadersRepository = "src/Shaders/"; /** * Store of each shader (The can be looked up using effect.key) */ public static ShadersStore: { [key: string]: string } = {}; /** * Store of each included file for a shader (The can be looked up using effect.key) */ public static IncludesShadersStore: { [key: string]: string } = {}; </s> add /** * Gets or sets the relative url used to load shaders if using the engine in non-minified mode */ public static ShadersRepository = "src/Shaders/"; /** * Store of each shader (The can be looked up using effect.key) */ public static ShadersStore: { [key: string]: string } = {}; /** * Store of each included file for a shader (The can be looked up using effect.key) */ public static IncludesShadersStore: { [key: string]: string } = {}; /** * Gets or sets the relative url used to load shaders (WGSL) if using the engine in non-minified mode */ public static ShadersRepositoryWGSL = "src/ShadersWGSL/"; /** * Store of each shader (WGSL) */ public static ShadersStoreWGSL: { [key: string]: string } = {}; /** * Store of each included file for a shader (WGSL) */ public static IncludesShadersStoreWGSL: { [key: string]: string } = {}; /** * Gets the shaders repository path for a given shader language * @param shaderLanguage the shader language * @returns the path to the shaders repository */ public static GetShadersRepository(shaderLanguage = ShaderLanguage.GLSL): string { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.ShadersRepository : ShaderStore.ShadersRepositoryWGSL; } /** * Gets the shaders store of a given shader language * @param shaderLanguage the shader language * @returns the shaders store */ public static GetShadersStore(shaderLanguage = ShaderLanguage.GLSL): { [key: string]: string } { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.ShadersStore : ShaderStore.ShadersStoreWGSL; } /** * Gets the include shaders store of a given shader language * @param shaderLanguage the shader language * @returns the include shaders store */ public static GetIncludesShadersStore(shaderLanguage = ShaderLanguage.GLSL): { [key: string]: string } { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.IncludesShadersStore : ShaderStore.IncludesShadersStoreWGSL; } </s> remove private _createPipelineStageDescriptor(vertexShader: Uint32Array, fragmentShader: Uint32Array): IWebGPURenderPipelineStageDescriptor { if (this._tintWASM) { vertexShader = this._tintWASM.convertSpirV2WGSL(vertexShader) as any; fragmentShader = this._tintWASM.convertSpirV2WGSL(fragmentShader) as any; </s> add private _getWGSLShader(source: string, type: string, defines: Nullable<string>, shaderVersion: string): string { if (defines) { defines = "//" + defines.split("\n").join("\n//") + "\n"; } else { defines = ""; } return defines + source; } private _createPipelineStageDescriptor(vertexShader: Uint32Array | string, fragmentShader: Uint32Array | string, shaderLanguage: ShaderLanguage): IWebGPURenderPipelineStageDescriptor { if (this._tintWASM && shaderLanguage === ShaderLanguage.GLSL) { vertexShader = this._tintWASM.convertSpirV2WGSL(vertexShader as Uint32Array) as any; fragmentShader = this._tintWASM.convertSpirV2WGSL(fragmentShader as Uint32Array) as any;
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Materials/effect.ts
EngineShaderStore.GetShadersStore(shaderLanguage)[`${name}VertexShader`] = vertexShader;
<mask> Effect.ShadersStore[`${name}PixelShader`] = pixelShader; <mask> } <mask> <mask> if (vertexShader) { <mask> Effect.ShadersStore[`${name}VertexShader`] = vertexShader; <mask> } <mask> } <mask> <mask> /** <mask> * Store of each shader (The can be looked up using effect.key) </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove /** * Gets or sets the relative url used to load shaders if using the engine in non-minified mode */ public static ShadersRepository = "src/Shaders/"; /** * Store of each shader (The can be looked up using effect.key) */ public static ShadersStore: { [key: string]: string } = {}; /** * Store of each included file for a shader (The can be looked up using effect.key) */ public static IncludesShadersStore: { [key: string]: string } = {}; </s> add /** * Gets or sets the relative url used to load shaders if using the engine in non-minified mode */ public static ShadersRepository = "src/Shaders/"; /** * Store of each shader (The can be looked up using effect.key) */ public static ShadersStore: { [key: string]: string } = {}; /** * Store of each included file for a shader (The can be looked up using effect.key) */ public static IncludesShadersStore: { [key: string]: string } = {}; /** * Gets or sets the relative url used to load shaders (WGSL) if using the engine in non-minified mode */ public static ShadersRepositoryWGSL = "src/ShadersWGSL/"; /** * Store of each shader (WGSL) */ public static ShadersStoreWGSL: { [key: string]: string } = {}; /** * Store of each included file for a shader (WGSL) */ public static IncludesShadersStoreWGSL: { [key: string]: string } = {}; /** * Gets the shaders repository path for a given shader language * @param shaderLanguage the shader language * @returns the path to the shaders repository */ public static GetShadersRepository(shaderLanguage = ShaderLanguage.GLSL): string { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.ShadersRepository : ShaderStore.ShadersRepositoryWGSL; } /** * Gets the shaders store of a given shader language * @param shaderLanguage the shader language * @returns the shaders store */ public static GetShadersStore(shaderLanguage = ShaderLanguage.GLSL): { [key: string]: string } { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.ShadersStore : ShaderStore.ShadersStoreWGSL; } /** * Gets the include shaders store of a given shader language * @param shaderLanguage the shader language * @returns the include shaders store */ public static GetIncludesShadersStore(shaderLanguage = ShaderLanguage.GLSL): { [key: string]: string } { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.IncludesShadersStore : ShaderStore.IncludesShadersStoreWGSL; } </s> remove Effect.ShadersStore[`${name}PixelShader`] = pixelShader; </s> add EngineShaderStore.GetShadersStore(shaderLanguage)[`${name}PixelShader`] = pixelShader; </s> remove public static RegisterShader(name: string, pixelShader?: string, vertexShader?: string) { </s> add public static RegisterShader(name: string, pixelShader?: string, vertexShader?: string, shaderLanguage = ShaderLanguage.GLSL) { </s> remove webGpuContext.stages = this._compileRawPipelineStageDescriptor(vertexSourceCode, fragmentSourceCode); } else { webGpuContext.stages = this._compilePipelineStageDescriptor(vertexSourceCode, fragmentSourceCode, defines); </s> add webGpuContext.stages = this._compileRawPipelineStageDescriptor(vertexSourceCode, fragmentSourceCode, shaderLanguage); } else { webGpuContext.stages = this._compilePipelineStageDescriptor(vertexSourceCode, fragmentSourceCode, defines, shaderLanguage); </s> remove ShaderStore.ShadersStore[`${name}ComputeShader`] = computeShader; </s> add ShaderStore.GetShadersStore(ShaderLanguage.WGSL)[`${name}ComputeShader`] = computeShader;
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Materials/effect.ts
import { ShaderLanguage } from "../Engines/Processors/shaderProcessingOptions"; import "../ShadersWGSL/ShadersInclude/meshUboDeclaration"; // TODO WEBGPU: remove import "../ShadersWGSL/ShadersInclude/sceneUboDeclaration"; // TODO WEBGPU: remove
<mask> import { EffectFallbacks } from './effectFallbacks'; <mask> import { WebRequest } from '../Misc/webRequest'; <mask> import { Engine } from '../Engines/engine'; <mask> <mask> const onCreatedEffectParameters = { effect: null as unknown as Effect, subMesh: null as unknown as Nullable<SubMesh> }; <mask> <mask> /** <mask> * Defines the options associated with the creation of a shader material. </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove import { ShaderStore as EngineShaderStore } from '../Engines/shaderStore'; </s> add import { ShaderStore as EngineShaderStore, ShaderStore } from '../Engines/shaderStore'; </s> remove import { ShaderProcessingContext } from "../Processors/shaderProcessingOptions"; </s> add import { ShaderLanguage, ShaderProcessingContext } from "../Processors/shaderProcessingOptions"; </s> remove import { ProcessingOptions, ShaderProcessingContext } from '../Engines/Processors/shaderProcessingOptions'; </s> add import { ProcessingOptions, ShaderLanguage, ShaderProcessingContext } from '../Engines/Processors/shaderProcessingOptions'; </s> remove import { ProcessingOptions } from "../Engines/Processors/shaderProcessingOptions"; </s> add import { ProcessingOptions, ShaderLanguage } from "../Engines/Processors/shaderProcessingOptions"; </s> remove import { ProcessingOptions } from './shaderProcessingOptions'; </s> add import { ProcessingOptions, ShaderLanguage } from './shaderProcessingOptions';
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Materials/shaderMaterial.ts
/** * The language the shader is written with (default: GLSL) */ shaderLanguage?: ShaderLanguage;
<mask> * Defines if clip planes have to be turned on: true to turn them on, false to turn them off and null to turn them on/off depending on the scene configuration (scene.clipPlaneX) <mask> */ <mask> useClipPlane: Nullable<boolean>; <mask> } <mask> <mask> /** <mask> * The ShaderMaterial object has the necessary methods to pass data from your scene to the Vertex and Fragment Shaders and returns a material that can be applied to any mesh. <mask> * </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove * * object: { compute: "custom" }, used with ShaderStore.ShadersStore["customComputeShader"] </s> add * * object: { compute: "custom" }, used with ShaderStore.ShadersStoreWGSL["customComputeShader"] </s> remove /** * Gets or sets the relative url used to load shaders if using the engine in non-minified mode */ public static ShadersRepository = "src/Shaders/"; /** * Store of each shader (The can be looked up using effect.key) */ public static ShadersStore: { [key: string]: string } = {}; /** * Store of each included file for a shader (The can be looked up using effect.key) */ public static IncludesShadersStore: { [key: string]: string } = {}; </s> add /** * Gets or sets the relative url used to load shaders if using the engine in non-minified mode */ public static ShadersRepository = "src/Shaders/"; /** * Store of each shader (The can be looked up using effect.key) */ public static ShadersStore: { [key: string]: string } = {}; /** * Store of each included file for a shader (The can be looked up using effect.key) */ public static IncludesShadersStore: { [key: string]: string } = {}; /** * Gets or sets the relative url used to load shaders (WGSL) if using the engine in non-minified mode */ public static ShadersRepositoryWGSL = "src/ShadersWGSL/"; /** * Store of each shader (WGSL) */ public static ShadersStoreWGSL: { [key: string]: string } = {}; /** * Store of each included file for a shader (WGSL) */ public static IncludesShadersStoreWGSL: { [key: string]: string } = {}; /** * Gets the shaders repository path for a given shader language * @param shaderLanguage the shader language * @returns the path to the shaders repository */ public static GetShadersRepository(shaderLanguage = ShaderLanguage.GLSL): string { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.ShadersRepository : ShaderStore.ShadersRepositoryWGSL; } /** * Gets the shaders store of a given shader language * @param shaderLanguage the shader language * @returns the shaders store */ public static GetShadersStore(shaderLanguage = ShaderLanguage.GLSL): { [key: string]: string } { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.ShadersStore : ShaderStore.ShadersStoreWGSL; } /** * Gets the include shaders store of a given shader language * @param shaderLanguage the shader language * @returns the include shaders store */ public static GetIncludesShadersStore(shaderLanguage = ShaderLanguage.GLSL): { [key: string]: string } { return shaderLanguage === ShaderLanguage.GLSL ? ShaderStore.IncludesShadersStore : ShaderStore.IncludesShadersStoreWGSL; } </s> remove * * string: try first to find the code in ShaderStore.ShadersStore[shaderPath + "ComputeShader"]. If not, assumes it is a file with name shaderPath.compute.fx in index.html folder. </s> add * * string: try first to find the code in ShaderStore.ShadersStoreWGSL[shaderPath + "ComputeShader"]. If not, assumes it is a file with name shaderPath.compute.fx in index.html folder.
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Materials/shaderMaterial.ts
indexParameters: { maxSimultaneousMorphTargets: numInfluencers }, shaderLanguage: this._options.shaderLanguage
<mask> defines: join, <mask> fallbacks: fallbacks, <mask> onCompiled: this.onCompiled, <mask> onError: this.onError, <mask> indexParameters: { maxSimultaneousMorphTargets: numInfluencers } <mask> }, engine); <mask> <mask> this._drawWrapper.effect = effect; <mask> <mask> if (this._onEffectCreatedObservable) { </s> Add WGSL as a shader language Former-commit-id: bdb99a4508801a674c80361bddc885dbd0be5730 </s> remove this._processingContext = this._engine._getShaderProcessingContext(); </s> add this._processingContext = this._engine._getShaderProcessingContext(this._shaderLanguage); </s> remove let preprocessors = this._PreparePreProcessors(options, engine, false); </s> add let preprocessors = this._PreparePreProcessors(options, engine); </s> remove private _createPipelineStageDescriptor(vertexShader: Uint32Array, fragmentShader: Uint32Array): IWebGPURenderPipelineStageDescriptor { if (this._tintWASM) { vertexShader = this._tintWASM.convertSpirV2WGSL(vertexShader) as any; fragmentShader = this._tintWASM.convertSpirV2WGSL(fragmentShader) as any; </s> add private _getWGSLShader(source: string, type: string, defines: Nullable<string>, shaderVersion: string): string { if (defines) { defines = "//" + defines.split("\n").join("\n//") + "\n"; } else { defines = ""; } return defines + source; } private _createPipelineStageDescriptor(vertexShader: Uint32Array | string, fragmentShader: Uint32Array | string, shaderLanguage: ShaderLanguage): IWebGPURenderPipelineStageDescriptor { if (this._tintWASM && shaderLanguage === ShaderLanguage.GLSL) { vertexShader = this._tintWASM.convertSpirV2WGSL(vertexShader as Uint32Array) as any; fragmentShader = this._tintWASM.convertSpirV2WGSL(fragmentShader as Uint32Array) as any; </s> remove private _compilePipelineStageDescriptor(vertexCode: string, fragmentCode: string, defines: Nullable<string>): IWebGPURenderPipelineStageDescriptor { </s> add private _compilePipelineStageDescriptor(vertexCode: string, fragmentCode: string, defines: Nullable<string>, shaderLanguage: ShaderLanguage): IWebGPURenderPipelineStageDescriptor {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e97018ecbad16e1e058a6a6f89fdced1688089cd
src/Materials/shaderMaterial.ts
})();
<mask> value: target instanceof BABYLON.Scene ? "Scene" : target.name <mask> }; <mask> }; <mask> return Action; <mask> }()); <mask> BABYLON.Action = Action; <mask> })(BABYLON || (BABYLON = {})); </s> Adding support for 3dsmax2017 + 8 bones influence per vertex for 3dsmax exporter Former-commit-id: 53db3ce9d0b3dd36648b6a235babad6c522609b5 </s> remove }()); </s> add })(); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }()); </s> add })(); </s> remove }()); </s> add })(); </s> remove }()); </s> add })();
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e9c901b5609aa363bf4b582d1c0118bac9c1f18f
src/Actions/babylon.action.js
})();
<mask> ActionEvent.CreateNewFromScene = function (scene, evt) { <mask> return new ActionEvent(null, scene.pointerX, scene.pointerY, scene.meshUnderPointer, evt); <mask> }; <mask> return ActionEvent; <mask> }()); <mask> BABYLON.ActionEvent = ActionEvent; <mask> /** <mask> * Action Manager manages all events to be triggered on a given mesh or the global scene. <mask> * A single scene can have many Action Managers to handle predefined actions on specific meshes. <mask> */ </s> Adding support for 3dsmax2017 + 8 bones influence per vertex for 3dsmax exporter Former-commit-id: 53db3ce9d0b3dd36648b6a235babad6c522609b5 </s> remove }()); </s> add })(); </s> remove }()); </s> add })(); </s> remove * doc : http://doc.babylonjs.com/tutorials/Solid_Particle_System#particle-management </s> add * doc : http://doc.babylonjs.com/overviews/Solid_Particle_System#particle-management </s> remove * doc : http://doc.babylonjs.com/tutorials/Solid_Particle_System#particle-management </s> add * doc : http://doc.babylonjs.com/overviews/Solid_Particle_System#particle-management </s> remove }()); </s> add })();
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e9c901b5609aa363bf4b582d1c0118bac9c1f18f
src/Actions/babylon.actionManager.js
})();
<mask> ActionManager._OnPickOutTrigger = 15; <mask> ActionManager.DragMovementThreshold = 10; // in pixels <mask> ActionManager.LongPressDelay = 500; // in milliseconds <mask> return ActionManager; <mask> }()); <mask> BABYLON.ActionManager = ActionManager; <mask> })(BABYLON || (BABYLON = {})); </s> Adding support for 3dsmax2017 + 8 bones influence per vertex for 3dsmax exporter Former-commit-id: 53db3ce9d0b3dd36648b6a235babad6c522609b5 </s> remove }()); </s> add })(); </s> remove }()); </s> add })(); </s> remove }()); </s> add })(); </s> remove }()); </s> add })(); </s> remove }(BABYLON.PostProcessRenderPipeline)); </s> add })(BABYLON.PostProcessRenderPipeline);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e9c901b5609aa363bf4b582d1c0118bac9c1f18f
src/Actions/babylon.actionManager.js
})();
<mask> properties: serializedCondition.properties <mask> }; <mask> }; <mask> return Condition; <mask> }()); <mask> BABYLON.Condition = Condition; <mask> var ValueCondition = (function (_super) { <mask> __extends(ValueCondition, _super); <mask> function ValueCondition(actionManager, target, propertyPath, value, operator) { <mask> if (operator === void 0) { operator = ValueCondition.IsEqual; } </s> Adding support for 3dsmax2017 + 8 bones influence per vertex for 3dsmax exporter Former-commit-id: 53db3ce9d0b3dd36648b6a235babad6c522609b5 </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }()); </s> add })(); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.FreeCamera)); </s> add })(BABYLON.FreeCamera);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e9c901b5609aa363bf4b582d1c0118bac9c1f18f
src/Actions/babylon.condition.js
})(Condition);
<mask> ValueCondition._IsDifferent = 1; <mask> ValueCondition._IsGreater = 2; <mask> ValueCondition._IsLesser = 3; <mask> return ValueCondition; <mask> }(Condition)); <mask> BABYLON.ValueCondition = ValueCondition; <mask> var PredicateCondition = (function (_super) { <mask> __extends(PredicateCondition, _super); <mask> function PredicateCondition(actionManager, predicate) { <mask> _super.call(this, actionManager); </s> Adding support for 3dsmax2017 + 8 bones influence per vertex for 3dsmax exporter Former-commit-id: 53db3ce9d0b3dd36648b6a235babad6c522609b5 </s> remove }(Condition)); </s> add })(Condition); </s> remove }()); </s> add })(); </s> remove }(BABYLON.AbstractMesh)); </s> add })(BABYLON.AbstractMesh); </s> remove }()); </s> add })(); </s> remove }(EasingFunction)); </s> add })(EasingFunction);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e9c901b5609aa363bf4b582d1c0118bac9c1f18f
src/Actions/babylon.condition.js
})(Condition);
<mask> PredicateCondition.prototype.isValid = function () { <mask> return this.predicate(); <mask> }; <mask> return PredicateCondition; <mask> }(Condition)); <mask> BABYLON.PredicateCondition = PredicateCondition; <mask> var StateCondition = (function (_super) { <mask> __extends(StateCondition, _super); <mask> function StateCondition(actionManager, target, value) { <mask> _super.call(this, actionManager); </s> Adding support for 3dsmax2017 + 8 bones influence per vertex for 3dsmax exporter Former-commit-id: 53db3ce9d0b3dd36648b6a235babad6c522609b5 </s> remove }(Condition)); </s> add })(Condition); </s> remove }(BABYLON.FreeCamera)); </s> add })(BABYLON.FreeCamera); </s> remove }(BABYLON.FreeCamera)); </s> add })(BABYLON.FreeCamera); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e9c901b5609aa363bf4b582d1c0118bac9c1f18f
src/Actions/babylon.condition.js
})(Condition);
<mask> ] <mask> }); <mask> }; <mask> return StateCondition; <mask> }(Condition)); <mask> BABYLON.StateCondition = StateCondition; <mask> })(BABYLON || (BABYLON = {})); </s> Adding support for 3dsmax2017 + 8 bones influence per vertex for 3dsmax exporter Former-commit-id: 53db3ce9d0b3dd36648b6a235babad6c522609b5 </s> remove }()); </s> add })(); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }()); </s> add })(); </s> remove }()); </s> add })(); </s> remove }()); </s> add })();
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e9c901b5609aa363bf4b582d1c0118bac9c1f18f
src/Actions/babylon.condition.js
})(BABYLON.Action);
<mask> ] <mask> }, parent); <mask> }; <mask> return SwitchBooleanAction; <mask> }(BABYLON.Action)); <mask> BABYLON.SwitchBooleanAction = SwitchBooleanAction; <mask> var SetStateAction = (function (_super) { <mask> __extends(SetStateAction, _super); <mask> function SetStateAction(triggerOptions, target, value, condition) { <mask> _super.call(this, triggerOptions, condition); </s> Adding support for 3dsmax2017 + 8 bones influence per vertex for 3dsmax exporter Former-commit-id: 53db3ce9d0b3dd36648b6a235babad6c522609b5 </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e9c901b5609aa363bf4b582d1c0118bac9c1f18f
src/Actions/babylon.directActions.js
})(BABYLON.Action);
<mask> ] <mask> }, parent); <mask> }; <mask> return SetStateAction; <mask> }(BABYLON.Action)); <mask> BABYLON.SetStateAction = SetStateAction; <mask> var SetValueAction = (function (_super) { <mask> __extends(SetValueAction, _super); <mask> function SetValueAction(triggerOptions, target, propertyPath, value, condition) { <mask> _super.call(this, triggerOptions, condition); </s> Adding support for 3dsmax2017 + 8 bones influence per vertex for 3dsmax exporter Former-commit-id: 53db3ce9d0b3dd36648b6a235babad6c522609b5 </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e9c901b5609aa363bf4b582d1c0118bac9c1f18f
src/Actions/babylon.directActions.js
})(BABYLON.Action);
<mask> ] <mask> }, parent); <mask> }; <mask> return SetValueAction; <mask> }(BABYLON.Action)); <mask> BABYLON.SetValueAction = SetValueAction; <mask> var IncrementValueAction = (function (_super) { <mask> __extends(IncrementValueAction, _super); <mask> function IncrementValueAction(triggerOptions, target, propertyPath, value, condition) { <mask> _super.call(this, triggerOptions, condition); </s> Adding support for 3dsmax2017 + 8 bones influence per vertex for 3dsmax exporter Former-commit-id: 53db3ce9d0b3dd36648b6a235babad6c522609b5 </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e9c901b5609aa363bf4b582d1c0118bac9c1f18f
src/Actions/babylon.directActions.js
})(BABYLON.Action);
<mask> ] <mask> }, parent); <mask> }; <mask> return IncrementValueAction; <mask> }(BABYLON.Action)); <mask> BABYLON.IncrementValueAction = IncrementValueAction; <mask> var PlayAnimationAction = (function (_super) { <mask> __extends(PlayAnimationAction, _super); <mask> function PlayAnimationAction(triggerOptions, target, from, to, loop, condition) { <mask> _super.call(this, triggerOptions, condition); </s> Adding support for 3dsmax2017 + 8 bones influence per vertex for 3dsmax exporter Former-commit-id: 53db3ce9d0b3dd36648b6a235babad6c522609b5 </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e9c901b5609aa363bf4b582d1c0118bac9c1f18f
src/Actions/babylon.directActions.js
})(BABYLON.Action);
<mask> ] <mask> }, parent); <mask> }; <mask> return PlayAnimationAction; <mask> }(BABYLON.Action)); <mask> BABYLON.PlayAnimationAction = PlayAnimationAction; <mask> var StopAnimationAction = (function (_super) { <mask> __extends(StopAnimationAction, _super); <mask> function StopAnimationAction(triggerOptions, target, condition) { <mask> _super.call(this, triggerOptions, condition); </s> Adding support for 3dsmax2017 + 8 bones influence per vertex for 3dsmax exporter Former-commit-id: 53db3ce9d0b3dd36648b6a235babad6c522609b5 </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e9c901b5609aa363bf4b582d1c0118bac9c1f18f
src/Actions/babylon.directActions.js
})(BABYLON.Action);
<mask> properties: [BABYLON.Action._GetTargetProperty(this._target)] <mask> }, parent); <mask> }; <mask> return StopAnimationAction; <mask> }(BABYLON.Action)); <mask> BABYLON.StopAnimationAction = StopAnimationAction; <mask> var DoNothingAction = (function (_super) { <mask> __extends(DoNothingAction, _super); <mask> function DoNothingAction(triggerOptions, condition) { <mask> if (triggerOptions === void 0) { triggerOptions = BABYLON.ActionManager.NothingTrigger; } </s> Adding support for 3dsmax2017 + 8 bones influence per vertex for 3dsmax exporter Former-commit-id: 53db3ce9d0b3dd36648b6a235babad6c522609b5 </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }()); </s> add })();
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e9c901b5609aa363bf4b582d1c0118bac9c1f18f
src/Actions/babylon.directActions.js
})(BABYLON.Action);
<mask> properties: [] <mask> }, parent); <mask> }; <mask> return DoNothingAction; <mask> }(BABYLON.Action)); <mask> BABYLON.DoNothingAction = DoNothingAction; <mask> var CombineAction = (function (_super) { <mask> __extends(CombineAction, _super); <mask> function CombineAction(triggerOptions, children, condition) { <mask> _super.call(this, triggerOptions, condition); </s> Adding support for 3dsmax2017 + 8 bones influence per vertex for 3dsmax exporter Former-commit-id: 53db3ce9d0b3dd36648b6a235babad6c522609b5 </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e9c901b5609aa363bf4b582d1c0118bac9c1f18f
src/Actions/babylon.directActions.js
})(BABYLON.Action);
<mask> } <mask> return serializationObject; <mask> }; <mask> return CombineAction; <mask> }(BABYLON.Action)); <mask> BABYLON.CombineAction = CombineAction; <mask> var ExecuteCodeAction = (function (_super) { <mask> __extends(ExecuteCodeAction, _super); <mask> function ExecuteCodeAction(triggerOptions, func, condition) { <mask> _super.call(this, triggerOptions, condition); </s> Adding support for 3dsmax2017 + 8 bones influence per vertex for 3dsmax exporter Former-commit-id: 53db3ce9d0b3dd36648b6a235babad6c522609b5 </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e9c901b5609aa363bf4b582d1c0118bac9c1f18f
src/Actions/babylon.directActions.js
})(BABYLON.Action);
<mask> ExecuteCodeAction.prototype.execute = function (evt) { <mask> this.func(evt); <mask> }; <mask> return ExecuteCodeAction; <mask> }(BABYLON.Action)); <mask> BABYLON.ExecuteCodeAction = ExecuteCodeAction; <mask> var SetParentAction = (function (_super) { <mask> __extends(SetParentAction, _super); <mask> function SetParentAction(triggerOptions, target, parent, condition) { <mask> _super.call(this, triggerOptions, condition); </s> Adding support for 3dsmax2017 + 8 bones influence per vertex for 3dsmax exporter Former-commit-id: 53db3ce9d0b3dd36648b6a235babad6c522609b5 </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e9c901b5609aa363bf4b582d1c0118bac9c1f18f
src/Actions/babylon.directActions.js
})(BABYLON.Action);
<mask> ] <mask> }, parent); <mask> }; <mask> return SetParentAction; <mask> }(BABYLON.Action)); <mask> BABYLON.SetParentAction = SetParentAction; <mask> var PlaySoundAction = (function (_super) { <mask> __extends(PlaySoundAction, _super); <mask> function PlaySoundAction(triggerOptions, sound, condition) { <mask> _super.call(this, triggerOptions, condition); </s> Adding support for 3dsmax2017 + 8 bones influence per vertex for 3dsmax exporter Former-commit-id: 53db3ce9d0b3dd36648b6a235babad6c522609b5 </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e9c901b5609aa363bf4b582d1c0118bac9c1f18f
src/Actions/babylon.directActions.js
})(BABYLON.Action);
<mask> properties: [{ name: "sound", value: this._sound.name }] <mask> }, parent); <mask> }; <mask> return PlaySoundAction; <mask> }(BABYLON.Action)); <mask> BABYLON.PlaySoundAction = PlaySoundAction; <mask> var StopSoundAction = (function (_super) { <mask> __extends(StopSoundAction, _super); <mask> function StopSoundAction(triggerOptions, sound, condition) { <mask> _super.call(this, triggerOptions, condition); </s> Adding support for 3dsmax2017 + 8 bones influence per vertex for 3dsmax exporter Former-commit-id: 53db3ce9d0b3dd36648b6a235babad6c522609b5 </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e9c901b5609aa363bf4b582d1c0118bac9c1f18f
src/Actions/babylon.directActions.js
})(BABYLON.Action);
<mask> properties: [{ name: "sound", value: this._sound.name }] <mask> }, parent); <mask> }; <mask> return StopSoundAction; <mask> }(BABYLON.Action)); <mask> BABYLON.StopSoundAction = StopSoundAction; <mask> })(BABYLON || (BABYLON = {})); </s> Adding support for 3dsmax2017 + 8 bones influence per vertex for 3dsmax exporter Former-commit-id: 53db3ce9d0b3dd36648b6a235babad6c522609b5 </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }()); </s> add })();
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e9c901b5609aa363bf4b582d1c0118bac9c1f18f
src/Actions/babylon.directActions.js
})(BABYLON.Action);
<mask> ] <mask> }, parent); <mask> }; <mask> return InterpolateValueAction; <mask> }(BABYLON.Action)); <mask> BABYLON.InterpolateValueAction = InterpolateValueAction; <mask> })(BABYLON || (BABYLON = {})); </s> Adding support for 3dsmax2017 + 8 bones influence per vertex for 3dsmax exporter Former-commit-id: 53db3ce9d0b3dd36648b6a235babad6c522609b5 </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action); </s> remove }(BABYLON.Action)); </s> add })(BABYLON.Action);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e9c901b5609aa363bf4b582d1c0118bac9c1f18f
src/Actions/babylon.interpolateValueAction.js
})();
<mask> } <mask> return running; <mask> }; <mask> return Animatable; <mask> }()); <mask> BABYLON.Animatable = Animatable; <mask> })(BABYLON || (BABYLON = {})); </s> Adding support for 3dsmax2017 + 8 bones influence per vertex for 3dsmax exporter Former-commit-id: 53db3ce9d0b3dd36648b6a235babad6c522609b5 </s> remove }()); </s> add })(); </s> remove }()); </s> add })(); </s> remove }()); </s> add })(); </s> remove }()); </s> add })(); </s> remove }()); </s> add })();
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e9c901b5609aa363bf4b582d1c0118bac9c1f18f
src/Animations/babylon.animatable.js
})();
<mask> AnimationRange.prototype.clone = function () { <mask> return new AnimationRange(this.name, this.from, this.to); <mask> }; <mask> return AnimationRange; <mask> }()); <mask> BABYLON.AnimationRange = AnimationRange; <mask> /** <mask> * Composed of a frame, and an action function <mask> */ <mask> var AnimationEvent = (function () { </s> Adding support for 3dsmax2017 + 8 bones influence per vertex for 3dsmax exporter Former-commit-id: 53db3ce9d0b3dd36648b6a235babad6c522609b5 </s> remove }()); </s> add })(); </s> remove }()); </s> add })(); </s> remove }()); </s> add })(); </s> remove }()); </s> add })(); </s> remove }()); </s> add })();
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e9c901b5609aa363bf4b582d1c0118bac9c1f18f
src/Animations/babylon.animation.js
})();
<mask> this.onlyOnce = onlyOnce; <mask> this.isDone = false; <mask> } <mask> return AnimationEvent; <mask> }()); <mask> BABYLON.AnimationEvent = AnimationEvent; <mask> var PathCursor = (function () { <mask> function PathCursor(path) { <mask> this.path = path; <mask> this._onchange = new Array(); </s> Adding support for 3dsmax2017 + 8 bones influence per vertex for 3dsmax exporter Former-commit-id: 53db3ce9d0b3dd36648b6a235babad6c522609b5 </s> remove }()); </s> add })(); </s> remove }()); </s> add })(); </s> remove }(BABYLON.Vector2)); </s> add })(BABYLON.Vector2); </s> remove }()); </s> add })(); </s> remove }()); </s> add })();
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e9c901b5609aa363bf4b582d1c0118bac9c1f18f
src/Animations/babylon.animation.js
})();
<mask> this._onchange.push(f); <mask> return this; <mask> }; <mask> return PathCursor; <mask> }()); <mask> BABYLON.PathCursor = PathCursor; <mask> var Animation = (function () { <mask> function Animation(name, targetProperty, framePerSecond, dataType, loopMode, enableBlending) { <mask> this.name = name; <mask> this.targetProperty = targetProperty; </s> Adding support for 3dsmax2017 + 8 bones influence per vertex for 3dsmax exporter Former-commit-id: 53db3ce9d0b3dd36648b6a235babad6c522609b5 </s> remove }()); </s> add })(); </s> remove }()); </s> add })(); </s> remove }(SceneOptimization)); </s> add })(SceneOptimization); </s> remove }(SceneOptimization)); </s> add })(SceneOptimization); </s> remove }()); </s> add })();
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e9c901b5609aa363bf4b582d1c0118bac9c1f18f
src/Animations/babylon.animation.js
})();
<mask> Animation._ANIMATIONLOOPMODE_RELATIVE = 0; <mask> Animation._ANIMATIONLOOPMODE_CYCLE = 1; <mask> Animation._ANIMATIONLOOPMODE_CONSTANT = 2; <mask> return Animation; <mask> }()); <mask> BABYLON.Animation = Animation; <mask> })(BABYLON || (BABYLON = {})); </s> Adding support for 3dsmax2017 + 8 bones influence per vertex for 3dsmax exporter Former-commit-id: 53db3ce9d0b3dd36648b6a235babad6c522609b5 </s> remove }(BABYLON.Texture)); </s> add })(BABYLON.Texture); </s> remove }()); </s> add })(); </s> remove }()); </s> add })(); </s> remove }(BABYLON.AbstractMesh)); </s> add })(BABYLON.AbstractMesh); </s> remove }()); </s> add })();
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e9c901b5609aa363bf4b582d1c0118bac9c1f18f
src/Animations/babylon.animation.js
})();
<mask> EasingFunction._EASINGMODE_EASEIN = 0; <mask> EasingFunction._EASINGMODE_EASEOUT = 1; <mask> EasingFunction._EASINGMODE_EASEINOUT = 2; <mask> return EasingFunction; <mask> }()); <mask> BABYLON.EasingFunction = EasingFunction; <mask> var CircleEase = (function (_super) { <mask> __extends(CircleEase, _super); <mask> function CircleEase() { <mask> _super.apply(this, arguments); </s> Adding support for 3dsmax2017 + 8 bones influence per vertex for 3dsmax exporter Former-commit-id: 53db3ce9d0b3dd36648b6a235babad6c522609b5 </s> remove }(Condition)); </s> add })(Condition); </s> remove }(EasingFunction)); </s> add })(EasingFunction); </s> remove }()); </s> add })(); </s> remove }(SceneOptimization)); </s> add })(SceneOptimization); </s> remove }(SceneOptimization)); </s> add })(SceneOptimization);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/e9c901b5609aa363bf4b582d1c0118bac9c1f18f
src/Animations/babylon.easing.js