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
<mask> public level = 1; <mask> <mask> @serialize() <mask> public coordinatesIndex = 0; <mask> <mask> @serialize("coordinatesMode") <mask> private _coordinatesMode = Texture.EXPLICIT_MODE; <mask> public set coordinatesMode(value: number) { <mask> if...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/2e868fb784437e8d32371e78ea1c720fe16891df
src/Materials/Textures/babylon.baseTexture.ts
/**
<mask> public get coordinatesMode(): number { <mask> return this._coordinatesMode; <mask> } <mask> <mask> /* <mask> * How a texture is mapped. <mask> * <mask> * | Value | Type | Description | <mask> * | ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/2e868fb784437e8d32371e78ea1c720fe16891df
src/Materials/Textures/babylon.baseTexture.ts
@serialize("coordinatesMode") private _coordinatesMode = Texture.EXPLICIT_MODE; public set coordinatesMode(value: number) { if (this._coordinatesMode === value) { return; } this._coordinatesMode = value; if (this._scene) { ...
<mask> * | 7 | EQUIRECTANGULAR_MODE | | <mask> * | 8 | FIXED_EQUIRECTANGULAR_MODE | | <mask> * | 9 | FIXED_EQUIRECTANGULAR_MIRRORED_MODE | | <mask> */ <mask> <mask> @serialize() <mask> public ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/2e868fb784437e8d32371e78ea1c720fe16891df
src/Materials/Textures/babylon.baseTexture.ts
/**
<mask> <mask> @serialize() <mask> public wrapU = Texture.WRAP_ADDRESSMODE; <mask> <mask> /* <mask> * | Value | Type | Description | <mask> * | ----- | ------------------ | ----------- | <mask> * | 0 | CLAMP_ADDRESSMODE | |...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/2e868fb784437e8d32371e78ea1c720fe16891df
src/Materials/Textures/babylon.baseTexture.ts
@serialize() public wrapU = Texture.WRAP_ADDRESSMODE;
<mask> * | 1 | WRAP_ADDRESSMODE | | <mask> * | 2 | MIRROR_ADDRESSMODE | | <mask> */ <mask> <mask> @serialize() <mask> public wrapV = Texture.WRAP_ADDRESSMODE; <mask> <mask> @serialize() </s> update doc part I've made a mystake...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/2e868fb784437e8d32371e78ea1c720fe16891df
src/Materials/Textures/babylon.baseTexture.ts
if (typeof chunksCount === "undefined") { chunksCount = 32; }
<mask> configurable: true <mask> }); <mask> <mask> GroundMesh.prototype.optimize = function (chunksCount) { <mask> this.subdivide(this._subdivisions); <mask> this.createOrUpdateSubmeshesOctree(chunksCount); <mask> }; <mask> </s> Fix for pointer posi...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/2ffa5dbf7bdf106d46c20f6cd324672348fab848
Babylon/Mesh/babylon.groundMesh.js
this.createOrUpdateSubmeshesOctree(chunksCount);
<mask> }); <mask> <mask> GroundMesh.prototype.optimize = function (chunksCount) { <mask> this.subdivide(this._subdivisions); <mask> this.createOrUpdateSubmeshesOctree(32); <mask> }; <mask> <mask> GroundMesh.prototype.getHeightAtCoordinates = function (x,...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/2ffa5dbf7bdf106d46c20f6cd324672348fab848
Babylon/Mesh/babylon.groundMesh.js
public optimize(chunksCount: number = 32): void {
<mask> public get subdivisions(): number { <mask> return this._subdivisions; <mask> } <mask> <mask> public optimize(chunksCount: number): void { <mask> this.subdivide(this._subdivisions); <mask> this.createOrUpdateSubmeshesOctree(32); <mask> }...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/2ffa5dbf7bdf106d46c20f6cd324672348fab848
Babylon/Mesh/babylon.groundMesh.ts
this.createOrUpdateSubmeshesOctree(chunksCount);
<mask> } <mask> <mask> public optimize(chunksCount: number): void { <mask> this.subdivide(this._subdivisions); <mask> this.createOrUpdateSubmeshesOctree(32); <mask> } <mask> <mask> public getHeightAtCoordinates(x: number, z: number): number { <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/2ffa5dbf7bdf106d46c20f6cd324672348fab848
Babylon/Mesh/babylon.groundMesh.ts
Scene.prototype._updatePointerPosition = function (evt) { var canvas = this._engine.getRenderingCanvas(); var rect = canvas.getBoundingClientRect(); this._pointerX = evt.clientX - rect.left; this._pointerY = evt.clientY - rect.top; };
<mask> Scene.prototype.getRenderId = function () { <mask> return this._renderId; <mask> }; <mask> <mask> // Pointers handling <mask> Scene.prototype.attachControl = function () { <mask> var _this = this; <mask> this._onPointerMove = function (...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/2ffa5dbf7bdf106d46c20f6cd324672348fab848
Babylon/babylon.scene.js
_this._updatePointerPosition(evt);
<mask> var _this = this; <mask> this._onPointerMove = function (evt) { <mask> var canvas = _this._engine.getRenderingCanvas(); <mask> <mask> _this._pointerX = evt.offsetX || evt.layerX; <mask> _this._pointerY = evt.offsetY || evt.layerY; <m...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/2ffa5dbf7bdf106d46c20f6cd324672348fab848
Babylon/babylon.scene.js
return mesh.actionManager && mesh.isPickable && mesh.isVisible && mesh.isReady();
<mask> <mask> _this._pointerX = evt.offsetX || evt.layerX; <mask> _this._pointerY = evt.offsetY || evt.layerY; <mask> var pickResult = _this.pick(_this._pointerX, _this._pointerY, function (mesh) { <mask> return mesh.actionManager && mesh.isPicka...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/2ffa5dbf7bdf106d46c20f6cd324672348fab848
Babylon/babylon.scene.js
var predicate = null; if (!_this.onPointerDown) { predicate = function (mesh) { return mesh.actionManager && mesh.isPickable && mesh.isVisible && mesh.isReady(); }; } _this._updatePo...
<mask> } <mask> }; <mask> <mask> this._onPointerDown = function (evt) { <mask> var pickResult = _this.pick(evt.offsetX || evt.layerX, evt.offsetY || evt.layerY); <mask> <mask> if (pickResult.hit) { <mask> if (pickResul...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/2ffa5dbf7bdf106d46c20f6cd324672348fab848
Babylon/babylon.scene.js
private _updatePointerPosition(evt: PointerEvent): void { var canvas = this._engine.getRenderingCanvas(); var rect = canvas.getBoundingClientRect(); this._pointerX = evt.clientX - rect.left; this._pointerY = evt.clientY - rect.top; }
<mask> public getRenderId(): number { <mask> return this._renderId; <mask> } <mask> <mask> // Pointers handling <mask> public attachControl() { <mask> this._onPointerMove = (evt: PointerEvent) => { <mask> var canvas = this._engine.getRende...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/2ffa5dbf7bdf106d46c20f6cd324672348fab848
Babylon/babylon.scene.ts
this._updatePointerPosition(evt); var pickResult = this.pick(this._pointerX, this._pointerY, (mesh: AbstractMesh): boolean => mesh.actionManager && mesh.isPickable && mesh.isVisible && mesh.isReady());
<mask> public attachControl() { <mask> this._onPointerMove = (evt: PointerEvent) => { <mask> var canvas = this._engine.getRenderingCanvas(); <mask> <mask> this._pointerX = evt.offsetX || evt.layerX; <mask> this._pointerY = evt.offsetY || evt.lay...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/2ffa5dbf7bdf106d46c20f6cd324672348fab848
Babylon/babylon.scene.ts
var predicate = null; if (!this.onPointerDown) { predicate = (mesh: AbstractMesh): boolean => { return mesh.actionManager && mesh.isPickable && mesh.isVisible && mesh.isReady(); }; } this._u...
<mask> } <mask> }; <mask> <mask> this._onPointerDown = (evt: PointerEvent) => { <mask> var pickResult = this.pick(evt.offsetX || evt.layerX, evt.offsetY || evt.layerY); <mask> <mask> if (pickResult.hit) { <mask> if (pi...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/2ffa5dbf7bdf106d46c20f6cd324672348fab848
Babylon/babylon.scene.ts
public pick(x: number, y: number, predicate?: (mesh: AbstractMesh) => boolean, fastCheck?: boolean, camera?: Camera): PickingInfo {
<mask> <mask> return pickingInfo || new BABYLON.PickingInfo(); <mask> } <mask> <mask> public pick(x: number, y: number, predicate?: (mesh: Mesh) => boolean, fastCheck?: boolean, camera?: Camera): PickingInfo { <mask> /// <summary>Launch a ray to try to pick a mesh in the ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/2ffa5dbf7bdf106d46c20f6cd324672348fab848
Babylon/babylon.scene.ts
this.registerInput("view", NodeMaterialBlockConnectionPointTypes.Matrix, true);
<mask> this.registerInput("glossPower", NodeMaterialBlockConnectionPointTypes.Float, true, NodeMaterialBlockTargets.Fragment); <mask> this.registerInput("diffuseColor", NodeMaterialBlockConnectionPointTypes.Color3, true, NodeMaterialBlockTargets.Fragment); <mask> this.registerInput("specularC...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/300667d5ba16ed4a7d0acb78f9fbfedd8ce6760a
src/Materials/Node/Blocks/Dual/lightBlock.ts
/** * Gets the view matrix component */ public get view(): NodeMaterialConnectionPoint { return this._inputs[7]; }
<mask> return this._inputs[6]; <mask> } <mask> <mask> /** <mask> * Gets the diffuse output component <mask> */ <mask> public get diffuseOutput(): NodeMaterialConnectionPoint { <mask> return this._outputs[0]; </s> Fix using CSM for shadow mesh receivers using node material...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/300667d5ba16ed4a7d0acb78f9fbfedd8ce6760a
src/Materials/Node/Blocks/Dual/lightBlock.ts
if (this.view.isConnected) { state.compilationString += `mat4 view = ${this.view.associatedVariableName};\r\n`; }
<mask> } else { <mask> state.compilationString += `vec4 worldPos = ${worldPos.associatedVariableName};\r\n`; <mask> state.compilationString += state._emitCodeFromInclude("shadowsVertex", comments, { <mask> repeatKey: "maxSimultaneousLights" <mask> }); <m...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/300667d5ba16ed4a7d0acb78f9fbfedd8ce6760a
src/Materials/Node/Blocks/Dual/lightBlock.ts
this.registerInput("view", NodeMaterialBlockConnectionPointTypes.Matrix, true);
<mask> new NodeMaterialConnectionPointCustomObject("subsurface", this, NodeMaterialConnectionPointDirection.Input, SubSurfaceBlock, "SubSurfaceBlock")); <mask> this.registerInput("anisotropy", NodeMaterialBlockConnectionPointTypes.Object, true, NodeMaterialBlockTargets.Fragment, <mask> ...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/300667d5ba16ed4a7d0acb78f9fbfedd8ce6760a
src/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.ts
/** * Gets the view matrix parameter */ public get view(): NodeMaterialConnectionPoint { return this._inputs[14]; }
<mask> public get anisotropy(): NodeMaterialConnectionPoint { <mask> return this._inputs[13]; <mask> } <mask> <mask> /** <mask> * Gets the ambient output component <mask> */ <mask> public get ambient(): NodeMaterialConnectionPoint { <mask> return this._outputs[0]; </...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/300667d5ba16ed4a7d0acb78f9fbfedd8ce6760a
src/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.ts
if (this.view.isConnected) { state.compilationString += `mat4 view = ${this.view.associatedVariableName};\r\n`; }
<mask> } else { <mask> state.compilationString += `vec4 worldPos = ${worldPos.associatedVariableName};\r\n`; <mask> state.compilationString += state._emitCodeFromInclude("shadowsVertex", comments, { <mask> repeatKey: "maxSimultaneousLights" <mask> }); <m...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/300667d5ba16ed4a7d0acb78f9fbfedd8ce6760a
src/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.ts
this.variableNames["view"] = 0;
<mask> this.variableNames["specularBase"] = 0; <mask> this.variableNames["worldPos"] = 0; <mask> this.variableNames["shadow"] = 0; <mask> <mask> // Exclude known varyings <mask> this.variableNames["vTBN"] = 0; <mask> </s> Fix using CSM for shadow mesh receivers using no...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/300667d5ba16ed4a7d0acb78f9fbfedd8ce6760a
src/Materials/Node/nodeMaterialBuildStateSharedData.ts
import * as WebGPUConstants from './webgpuConstants';
<mask> import { HardwareTextureWrapper } from '../../Materials/Textures/hardwareTextureWrapper'; <mask> import { Nullable } from '../../types'; <mask> <mask> /** @hidden */ <mask> export class WebGPUHardwareTexture implements HardwareTextureWrapper { <mask> <mask> private _webgpuTexture: Nullable<GPUTextur...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/WebGPU/webgpuHardwareTexture.ts
public format: GPUTextureFormat = WebGPUConstants.TextureFormat.RGBA8Unorm;
<mask> return this._webgpuSampler; <mask> } <mask> <mask> constructor(existingTexture: Nullable<GPUTexture> = null) { <mask> this._webgpuTexture = existingTexture; <mask> this._webgpuTextureView = null; <mask> this._webgpuSampler = null; </s> Handle compressed textures (...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/WebGPU/webgpuHardwareTexture.ts
}
<mask> public release() { <mask> this._webgpuTexture?.destroy(); <mask> this.reset(); <mask> } <mask> }; </s> Handle compressed textures (no mipmap support yet) Former-commit-id: a4c1730beb052c6785473dc6380847c742134269 </s> remove public updateTexture(imageBitmap: ImageBitmap, gpuTe...
[ "keep", "keep", "keep", "keep", "replace" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/WebGPU/webgpuHardwareTexture.ts
<mask> // SOFTWARE. <mask> import * as WebGPUConstants from './webgpuConstants'; <mask> import { Scalar } from '../../Maths/math.scalar'; <mask> import { WebGPUBufferManager } from './webgpuBufferManager'; <mask> import { Nullable } from '../../types'; <mask> <mask> export class WebGPUTextureHelper { <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/WebGPU/webgpuTextureHelper.ts
public isImageBitmap(imageBitmap: ImageBitmap | { width: number, height: number }): imageBitmap is ImageBitmap {
<mask> }] <mask> }); <mask> } <mask> <mask> private _isImageBitmap(imageBitmap: ImageBitmap | { width: number, height: number }): imageBitmap is ImageBitmap { <mask> return (imageBitmap as ImageBitmap).close !== undefined; <mask> } <mask> <mask> private _isImageBit...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/WebGPU/webgpuTextureHelper.ts
public isImageBitmapArray(imageBitmap: ImageBitmap[] | { width: number, height: number }): imageBitmap is ImageBitmap[] {
<mask> private _isImageBitmap(imageBitmap: ImageBitmap | { width: number, height: number }): imageBitmap is ImageBitmap { <mask> return (imageBitmap as ImageBitmap).close !== undefined; <mask> } <mask> <mask> private _isImageBitmapArray(imageBitmap: ImageBitmap[] | { width: number, height: num...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/WebGPU/webgpuTextureHelper.ts
public createTexture(imageBitmap: ImageBitmap | { width: number, height: number }, hasMipmaps = false, generateMipmaps = false, invertY = false, premultiplyAlpha = false, format: GPUTextureFormat = WebGPUConstants.TextureFormat.RGBA8Unorm, sampleCount = 1, commandEncoder?: GPUCommandEncoder): GPUTexture
<mask> private _isImageBitmapArray(imageBitmap: ImageBitmap[] | { width: number, height: number }): imageBitmap is ImageBitmap[] { <mask> return Array.isArray(imageBitmap as ImageBitmap[]) && (imageBitmap as ImageBitmap[])[0].close !== undefined; <mask> } <mask> <mask> public createTexture(ima...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/WebGPU/webgpuTextureHelper.ts
const mipLevelCount = hasMipmaps ? WebGPUTextureHelper.computeNumMipmapLevels(imageBitmap.width, imageBitmap.height) : 1; const additionalUsages = hasMipmaps ? WebGPUConstants.TextureUsage.CopySrc /*| WebGPUConstants.TextureUsage.OutputAttachment*/ : 0;
<mask> height: imageBitmap.height, <mask> depth: 1, <mask> }; <mask> <mask> const mipLevelCount = generateMipmaps ? WebGPUTextureHelper.computeNumMipmapLevels(imageBitmap.width, imageBitmap.height) : 1; <mask> const additionalUsages = generateMipmaps ? WebGPUConsta...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/WebGPU/webgpuTextureHelper.ts
if (this.isImageBitmap(imageBitmap)) { this.updateTexture(imageBitmap, gpuTexture, imageBitmap.width, imageBitmap.height, format, 0, 0, invertY, premultiplyAlpha, 0, 0, commandEncoder);
<mask> sampleCount, <mask> mipLevelCount <mask> }); <mask> <mask> if (this._isImageBitmap(imageBitmap)) { <mask> let promise: Promise<ImageBitmap>; <mask> <mask> if (invertY || premultiplyAlpha) { <mask> promise = createImageBitm...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/WebGPU/webgpuTextureHelper.ts
if (hasMipmaps && generateMipmaps) { this.generateMipmaps(gpuTexture, mipLevelCount, 0, commandEncoder);
<mask> <mask> if (this._isImageBitmap(imageBitmap)) { <mask> let promise: Promise<ImageBitmap>; <mask> <mask> if (invertY || premultiplyAlpha) { <mask> promise = createImageBitmap(imageBitmap, { imageOrientation: invertY ? "flipY" : "none", premultiplyAlpha: premu...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/WebGPU/webgpuTextureHelper.ts
<mask> promise = createImageBitmap(imageBitmap, { imageOrientation: invertY ? "flipY" : "none", premultiplyAlpha: premultiplyAlpha ? "premultiply" : "none" }); <mask> } else { <mask> promise = Promise.resolve(imageBitmap); <mask> } <mask> <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "re...
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/WebGPU/webgpuTextureHelper.ts
return gpuTexture;
<mask> }); <mask> })]; <mask> } <mask> <mask> return [gpuTexture, null]; <mask> } <mask> <mask> public createCubeTexture(imageBitmaps: ImageBitmap[] | { width: number, height: number }, generateMipmaps = false, invertY = false, premultiplyAlpha = false, form...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/WebGPU/webgpuTextureHelper.ts
public createCubeTexture(imageBitmaps: ImageBitmap[] | { width: number, height: number }, hasMipmaps = false, generateMipmaps = false, invertY = false, premultiplyAlpha = false, format: GPUTextureFormat = WebGPUConstants.TextureFormat.RGBA8Unorm, sampleCount = 1, commandEncoder?: GPUCommandEncoder): GPUTex...
<mask> <mask> return [gpuTexture, null]; <mask> } <mask> <mask> public createCubeTexture(imageBitmaps: ImageBitmap[] | { width: number, height: number }, generateMipmaps = false, invertY = false, premultiplyAlpha = false, format: GPUTextureFormat = WebGPUConstants.TextureFormat.RGBA8Unorm, <mask...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/WebGPU/webgpuTextureHelper.ts
const width = this.isImageBitmapArray(imageBitmaps) ? imageBitmaps[0].width : imageBitmaps.width; const height = this.isImageBitmapArray(imageBitmaps) ? imageBitmaps[0].height : imageBitmaps.height;
<mask> <mask> public createCubeTexture(imageBitmaps: ImageBitmap[] | { width: number, height: number }, generateMipmaps = false, invertY = false, premultiplyAlpha = false, format: GPUTextureFormat = WebGPUConstants.TextureFormat.RGBA8Unorm, <mask> sampleCount = 1, commandEncoder?: GPUCommandEncoder): [G...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/WebGPU/webgpuTextureHelper.ts
const mipLevelCount = hasMipmaps ? WebGPUTextureHelper.computeNumMipmapLevels(width, height) : 1; const additionalUsages = hasMipmaps ? WebGPUConstants.TextureUsage.CopySrc | WebGPUConstants.TextureUsage.OutputAttachment : 0;
<mask> { <mask> const width = this._isImageBitmapArray(imageBitmaps) ? imageBitmaps[0].width : imageBitmaps.width; <mask> const height = this._isImageBitmapArray(imageBitmaps) ? imageBitmaps[0].height : imageBitmaps.height; <mask> <mask> const mipLevelCount = generateMipmaps ? WebGPUTe...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/WebGPU/webgpuTextureHelper.ts
if (this.isImageBitmapArray(imageBitmaps)) { this.updateCubeTextures(imageBitmaps, gpuTexture, width, height, format, invertY, premultiplyAlpha, 0, 0, commandEncoder);
<mask> sampleCount, <mask> mipLevelCount <mask> }); <mask> <mask> if (this._isImageBitmapArray(imageBitmaps)) { <mask> const textureSizeFace = { <mask> width, <mask> height, <mask> depth: 1, <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "k...
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/WebGPU/webgpuTextureHelper.ts
if (hasMipmaps && generateMipmaps) { this.generateCubeMipmaps(gpuTexture, mipLevelCount, commandEncoder);
<mask> }; <mask> <mask> const faces = [0, 3, 1, 4, 2, 5]; <mask> <mask> const promises: Promise<void>[] = []; <mask> <mask> for (let f = 0; f < faces.length; ++f) { <mask> let imageBitmap = imageBitmaps[faces[f]]; <mask> <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "re...
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/WebGPU/webgpuTextureHelper.ts
<mask> resolve(); <mask> }); <mask> })); <mask> } <mask> <mask> return [gpuTexture, new Promise((resolve) => { <mask> Promise.all(promises).then(() => { <mask> if (generateMipmaps) { <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep"...
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/WebGPU/webgpuTextureHelper.ts
return gpuTexture;
<mask> }); <mask> })]; <mask> } <mask> <mask> return [gpuTexture, null]; <mask> } <mask> <mask> public generateCubeMipmaps(gpuTexture: GPUTexture, mipLevelCount: number, commandEncoder?: GPUCommandEncoder): void { <mask> for (let f = 0; f < 6; ++f) ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/WebGPU/webgpuTextureHelper.ts
private _getBlockInformationFromFormat(format: GPUTextureFormat): { width: number, height: number, length: number } { switch (format) { case WebGPUConstants.TextureFormat.BC7RGBAUNORM: case WebGPUConstants.TextureFormat.BC7RGBAUNORMSRGB: return { width: 4, height:...
<mask> commandEncoder = null as any; <mask> } <mask> } <mask> <mask> public updateTexture(imageBitmap: ImageBitmap, gpuTexture: GPUTexture, width: number, height: number, faceIndex: number = 0, mipLevel: number = 0, invertY = false, premultiplyAlpha = false, offsetX = 0, offsetY = 0, ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/WebGPU/webgpuTextureHelper.ts
const blockInformation = this._getBlockInformationFromFormat(format); const textureCopyView: GPUTextureCopyView = {
<mask> <mask> public updateTexture(imageBitmap: ImageBitmap, gpuTexture: GPUTexture, width: number, height: number, faceIndex: number = 0, mipLevel: number = 0, invertY = false, premultiplyAlpha = false, offsetX = 0, offsetY = 0, <mask> commandEncoder?: GPUCommandEncoder): void <mask> { <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/WebGPU/webgpuTextureHelper.ts
width: Math.ceil(width / blockInformation.width) * blockInformation.width, height: Math.ceil(height / blockInformation.height) * blockInformation.height,
<mask> mipLevel: mipLevel <mask> }; <mask> <mask> const textureExtent = { <mask> width, <mask> height, <mask> depth: 1 <mask> }; <mask> <mask> if (invertY || premultiplyAlpha) { <mask> createImageBitmap(imageBitmap,...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/WebGPU/webgpuTextureHelper.ts
if ((imageBitmap as Uint8Array).byteLength !== undefined) { imageBitmap = imageBitmap as Uint8Array; const aligned = Math.ceil(width * 4 / 256) * 256 === width * 4; if (aligned) { const buffer = this._bufferManager.createRawBuffer(imageBitmap.byteLengt...
<mask> height, <mask> depth: 1 <mask> }; <mask> <mask> if (invertY || premultiplyAlpha) { <mask> createImageBitmap(imageBitmap, { imageOrientation: invertY ? "flipY" : "none", premultiplyAlpha: premultiplyAlpha ? "premultiply" : "none" }).then((imageBitmap) => ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/WebGPU/webgpuTextureHelper.ts
imageBitmap = imageBitmap as ImageBitmap; if (invertY || premultiplyAlpha) { createImageBitmap(imageBitmap, { imageOrientation: invertY ? "flipY" : "none", premultiplyAlpha: premultiplyAlpha ? "premultiply" : "none" }).then((imageBitmap) => { this._device...
<mask> createImageBitmap(imageBitmap, { imageOrientation: invertY ? "flipY" : "none", premultiplyAlpha: premultiplyAlpha ? "premultiply" : "none" }).then((imageBitmap) => { <mask> this._device.defaultQueue.copyImageBitmapToTexture({ imageBitmap }, textureView, textureExtent); <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/WebGPU/webgpuTextureHelper.ts
/** Compressed BC7 */ public static readonly TEXTUREFORMAT_COMPRESSED_RGBA_BPTC_UNORM = 36492; /** Compressed BC6 unsigned float */ public static readonly TEXTUREFORMAT_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT = 36495; /** Compressed BC6 signed float */ public static readonly TEXTUREFORMAT_COMPRE...
<mask> public static readonly TEXTUREFORMAT_RGBA_INTEGER = 11; <mask> <mask> /** UNSIGNED_BYTE */ <mask> public static readonly TEXTURETYPE_UNSIGNED_BYTE = 0; <mask> /** UNSIGNED_BYTE (2nd reference) */ <mask> public static readonly TEXTURETYPE_UNSIGNED_INT = 0; </s> Handle compressed textur...
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/constants.ts
import { Nullable, DataArray, IndicesArray, FloatArray, Immutable } from "../types";
<mask> import { Logger } from "../Misc/logger"; <mask> import { Nullable, DataArray, IndicesArray, FloatArray } from "../types"; <mask> import { Color4 } from "../Maths/math"; <mask> import { Engine } from "../Engines/engine"; <mask> import { InstancingAttributeInfo } from "../Engines/instancingAttributeInfo"; <m...
[ "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
<mask> import { Tools } from "../Misc/tools"; <mask> import { WebGPUTextureHelper } from './WebGPU/webgpuTextureHelper'; <mask> import { ISceneLike, ThinEngine } from './thinEngine'; <mask> import { Scene } from '../scene'; <mask> import { Scalar } from '../Maths/math.scalar'; <mask> import { WebGPUBufferManager ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
private _adapterSupportedExtensions: GPUExtensionName[];
<mask> private _glslang: any = null; <mask> private _adapter: GPUAdapter; <mask> private _device: GPUDevice; <mask> private _deviceEnabledExtensions: GPUExtensionName[]; <mask> private _context: GPUCanvasContext; <mask> private _swapChain: GPUSwapChain; <mask> private _swapChainTextur...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
private _deviceEnabledExtensions: GPUExtensionName[];
<mask> private _adapterSupportedExtensions: GPUExtensionName[]; <mask> private _device: GPUDevice; <mask> private _context: GPUCanvasContext; <mask> private _swapChain: GPUSwapChain; <mask> private _swapChainTexture: GPUTexture; <mask> private _mainPassSampleCount: number; <mask> priv...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
/** Gets the supported extensions by the WebGPU adapter */ public get supportedExtensions(): Immutable<GPUExtensionName[]> { return this._adapterSupportedExtensions; } /** Gets the currently enabled extensions on the WebGPU device */ public get enabledExtensions(): Immutable<GPUExtens...
<mask> public get supportsUniformBuffers(): boolean { <mask> return true; <mask> } <mask> <mask> /** <mask> * Create a new instance of the gpu engine. <mask> * @param canvas Defines the canvas to use to display the result <mask> * @param options Defines the options passed to ...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
.then((device: GPUDevice | null) => { this._device = device!; this._deviceEnabledExtensions = this._device.extensions.slice(0); })
<mask> .then((adapter: GPUAdapter | null) => { <mask> this._adapter = adapter!; <mask> return this._adapter.requestDevice(this._options.deviceDescriptor); <mask> }) <mask> .then((device: GPUDevice | null) => this._device = device!) <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
s3tc: (this._deviceEnabledExtensions.indexOf(WebGPUConstants.ExtensionName.TextureCompressionBC) >= 0 ? true : undefined) as any,
<mask> maxFragmentUniformVectors: 1024, <mask> maxVertexUniformVectors: 1024, <mask> standardDerivatives: true, <mask> astc: null, <mask> pvrtc: null, <mask> etc1: null, <mask> etc2: null, <mask> bptc: this._deviceEn...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
bptc: this._deviceEnabledExtensions.indexOf(WebGPUConstants.ExtensionName.TextureCompressionBC) >= 0 ? true : undefined,
<mask> astc: null, <mask> pvrtc: null, <mask> etc1: null, <mask> etc2: null, <mask> bptc: null, <mask> maxAnisotropy: 0, // TODO: Retrieve this smartly. Currently set to D3D11 maximum allowable value. <mask> uintIndices: false, ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
return Constants.TEXTUREFORMAT_RGBA;
<mask> } <mask> <mask> /** @hidden */ <mask> public _getRGBABufferInternalSizedFormat(type: number, format?: number): number { <mask> return format ?? Constants.TEXTUREFORMAT_RGBA; <mask> } <mask> <mask> private _getWebGPUTextureFormat(type: number, format: number): GPUTextureForma...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
switch (format) { case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_BPTC_UNORM: return WebGPUConstants.TextureFormat.BC7RGBAUNORM; case Constants.TEXTUREFORMAT_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT: return WebGPUConstants.TextureFormat.BC6HRGBUFLOAT; ...
<mask> } <mask> <mask> private _getWebGPUTextureFormat(type: number, format: number): GPUTextureFormat { <mask> switch (type) { <mask> case Constants.TEXTURETYPE_BYTE: <mask> switch (format) { <mask> case Constants.TEXTUREFORMAT_RED: <mask> ...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
texture.format = format ?? -1;
<mask> texture.baseWidth = imageBitmap.width; <mask> texture.baseHeight = imageBitmap.height; <mask> texture.width = imageBitmap.width; <mask> texture.height = imageBitmap.height; <mask> if (format) { <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
if (!texture._hardwareTexture?.underlyingResource) { // the texture could have been created before reaching this point so don't recreate it if already existing const gpuTextureWrapper = this._createGPUTextureForInternalTexture(texture, imageBitmap.width, imageBitmap.height);...
<mask> if (format) { <mask> texture.format = format; <mask> } <mask> <mask> // TODO WEBGPU: handle format if <> 0. Note that it seems "rgb" formats don't exist in WebGPU... <mask> //let internalFormat = format...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
if (this._textureHelper.isImageBitmap(imageBitmap)) { this._textureHelper.updateTexture(imageBitmap, gpuTextureWrapper.underlyingResource!, imageBitmap.width, imageBitmap.height, gpuTextureWrapper.format, 0, 0, invertY, false, 0, 0, this._uploadEncoder); ...
<mask> // TODO WEBGPU: handle format if <> 0. Note that it seems "rgb" formats don't exist in WebGPU... <mask> //let internalFormat = format ? this._getInternalFormat(format) : ((extension === ".jpg") ? gl.RGB : gl.RGBA); <mask> const [gpuTexture] = this._t...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
texture.format = format ?? -1;
<mask> <mask> // TODO WEBGPU. Cube Texture Sampling Mode. <mask> texture.samplingMode = noMipmap ? Constants.TEXTURE_BILINEAR_SAMPLINGMODE : Constants.TEXTURE_TRILINEAR_SAMPLINGMODE; <mask> <mask> const gpuTextureWrapper = this._createGPUTextureForInternalTexture(t...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
const gpuTextureWrapper = this._createGPUTextureForInternalTexture(texture, width, height);
<mask> <mask> // TODO WEBGPU. Cube Texture Sampling Mode. <mask> texture.samplingMode = noMipmap ? Constants.TEXTURE_BILINEAR_SAMPLINGMODE : Constants.TEXTURE_TRILINEAR_SAMPLINGMODE; <mask> <mask> // TODO WEBGPU. handle format if <> 0 <mask> //cons...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
this._textureHelper.updateCubeTextures(imageBitmaps, gpuTextureWrapper.underlyingResource!, width, height, gpuTextureWrapper.format, false, false, 0, 0, this._uploadEncoder);
<mask> (texture._hardwareTexture as WebGPUHardwareTexture).createView({ <mask> dimension: WebGPUConstants.TextureViewDimension.Cube <mask> }); <mask> <mask> texture.width = width; <mask> texture.height = height; <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
private _createGPUTextureForInternalTexture(texture: InternalTexture, width?: number, height?: number): WebGPUHardwareTexture {
<mask> <mask> this._bindTextureDirectly(0, texture); <mask> } <mask> <mask> private _createGPUTextureForInternalTexture(texture: InternalTexture, width?: number, height?: number): GPUTexture { <mask> if (!texture._hardwareTexture) { <mask> texture._hardwareTexture = this._cr...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
const gpuTextureWrapper = texture._hardwareTexture as WebGPUHardwareTexture; gpuTextureWrapper.format = this._getWebGPUTextureFormat(texture.type, texture.format);
<mask> } <mask> <mask> if (texture.isCube) { <mask> const gpuTexture = this._textureHelper.createCubeTexture({ width, height }, texture.generateMipMaps, texture.generateMipMaps, texture.invertY, false, gpuTextureWrapper.format, texture.samples || 1, this._uploadEncoder); <mask> <mask...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
const gpuTexture = this._textureHelper.createCubeTexture({ width, height }, texture.generateMipMaps, texture.generateMipMaps, texture.invertY, false, gpuTextureWrapper.format, texture.samples || 1, this._uploadEncoder);
<mask> height = texture.height; <mask> } <mask> <mask> if (texture.isCube) { <mask> const [gpuTexture] = this._textureHelper.createCubeTexture({ width, height }, texture.generateMipMaps, texture.invertY, false, this._getWebGPUTextureFormat(texture.type, texture.format), 1, ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
gpuTextureWrapper.set(gpuTexture); gpuTextureWrapper.createView({
<mask> <mask> if (texture.isCube) { <mask> const [gpuTexture] = this._textureHelper.createCubeTexture({ width, height }, texture.generateMipMaps, texture.invertY, false, this._getWebGPUTextureFormat(texture.type, texture.format), 1, this._uploadEncoder); <mask> <mask> texture._har...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
mipLevelCount: texture.generateMipMaps ? WebGPUTextureHelper.computeNumMipmapLevels(width!, height!) : 1,
<mask> <mask> texture._hardwareTexture!.set(gpuTexture); <mask> (texture._hardwareTexture as WebGPUHardwareTexture).createView({ <mask> dimension: WebGPUConstants.TextureViewDimension.Cube, <mask> mipLevelCount: Math.round(Scalar.Log2(Math.max(width!, height...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
const gpuTexture = this._textureHelper.createTexture({ width, height }, texture.generateMipMaps, texture.generateMipMaps, texture.invertY, false, gpuTextureWrapper.format, texture.samples || 1, this._uploadEncoder);
<mask> baseMipLevel: 0, <mask> aspect: WebGPUConstants.TextureAspect.All <mask> }); <mask> } else { <mask> const [gpuTexture] = this._textureHelper.createTexture({ width, height }, texture.generateMipMaps, texture.invertY, false, this._getWebGPUTextur...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
gpuTextureWrapper.set(gpuTexture); gpuTextureWrapper.createView();
<mask> }); <mask> } else { <mask> const [gpuTexture] = this._textureHelper.createTexture({ width, height }, texture.generateMipMaps, texture.invertY, false, this._getWebGPUTextureFormat(texture.type, texture.format), 1, this._uploadEncoder); <mask> <mask> texture._hardw...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
return gpuTextureWrapper;
<mask> <mask> texture.width = texture.baseWidth = width; <mask> texture.height = texture.baseHeight = height; <mask> <mask> return texture._hardwareTexture!.underlyingResource; <mask> } <mask> <mask> private _generateMipmaps(texture: InternalTexture, gpuTexture: GPUTexture) { ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
let gpuTextureWrapper = texture._hardwareTexture as WebGPUHardwareTexture;
<mask> } <mask> <mask> const width = canvas.width, height = canvas.height; <mask> <mask> let gpuTexture = texture._hardwareTexture?.underlyingResource; <mask> <mask> if (!gpuTexture) { <mask> gpuTexture = this._createGPUTextureForInternalTexture(texture, width, hei...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
if (!texture._hardwareTexture?.underlyingResource) { gpuTextureWrapper = this._createGPUTextureForInternalTexture(texture, width, height);
<mask> const width = canvas.width, height = canvas.height; <mask> <mask> let gpuTexture = texture._hardwareTexture?.underlyingResource; <mask> <mask> if (!gpuTexture) { <mask> gpuTexture = this._createGPUTextureForInternalTexture(texture, width, height); <mask> } <m...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
this._textureHelper.updateTextureTest(canvas as HTMLCanvasElement, gpuTextureWrapper.underlyingResource!, width, height, 0, 0, invertY, premulAlpha, swap, 0/*, this._uploadEncoder*/);
<mask> texture.isReady = true; <mask> });*/ <mask> //} <mask> <mask> this._textureHelper.updateTextureTest(canvas as HTMLCanvasElement, gpuTexture, width, height, 0, 0, invertY, premulAlpha, swap, 0/*, this._uploadEncoder*/); <mask> texture....
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
this._textureHelper.updateTexture(bitmap, gpuTextureWrapper.underlyingResource!, width, height, gpuTextureWrapper.format, 0, 0, invertY, premulAlpha, 0, 0, this._uploadEncoder);
<mask> return; <mask> } <mask> <mask> createImageBitmap(canvas).then((bitmap) => { <mask> this._textureHelper.updateTexture(bitmap, gpuTexture, width, height, 0, 0, invertY, premulAlpha, 0, 0, this._uploadEncoder); <mask> if (texture.generateMipMaps) { <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
this._generateMipmaps(texture, gpuTextureWrapper.underlyingResource!);
<mask> <mask> createImageBitmap(canvas).then((bitmap) => { <mask> this._textureHelper.updateTexture(bitmap, gpuTexture, width, height, 0, 0, invertY, premulAlpha, 0, 0, this._uploadEncoder); <mask> if (texture.generateMipMaps) { <mask> this._generateMipmaps(texture,...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
let gpuTextureWrapper = texture._hardwareTexture as WebGPUHardwareTexture;
<mask> }); <mask> } <mask> <mask> public updateTextureData(texture: InternalTexture, imageData: ArrayBufferView, xOffset: number, yOffset: number, width: number, height: number, faceIndex: number = 0, lod: number = 0): void { <mask> let gpuTexture = texture._hardwareTexture?.underlyingReso...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
if (!texture._hardwareTexture?.underlyingResource) { gpuTextureWrapper = this._createGPUTextureForInternalTexture(texture);
<mask> <mask> public updateTextureData(texture: InternalTexture, imageData: ArrayBufferView, xOffset: number, yOffset: number, width: number, height: number, faceIndex: number = 0, lod: number = 0): void { <mask> let gpuTexture = texture._hardwareTexture?.underlyingResource; <mask> <mask> if ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
// TODO WEBGPU directly pass the Uint8ClampedArray? invertY needs to be handled by updateTexture...
<mask> } <mask> <mask> const imgData = new ImageData(new Uint8ClampedArray(imageData.buffer), width, height); <mask> <mask> // TODO WEBGPU directly pass the Uint8ClampedArray <mask> createImageBitmap(imgData).then((bitmap) => { <mask> this._textureHelper.updateTextur...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
this._textureHelper.updateTexture(bitmap, gpuTextureWrapper?.underlyingResource!, width, height, gpuTextureWrapper.format, faceIndex, lod, texture.invertY, false, xOffset, yOffset, this._uploadEncoder);
<mask> const imgData = new ImageData(new Uint8ClampedArray(imageData.buffer), width, height); <mask> <mask> // TODO WEBGPU directly pass the Uint8ClampedArray <mask> createImageBitmap(imgData).then((bitmap) => { <mask> this._textureHelper.updateTexture(bitmap, gpuTexture, width...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
let gpuTextureWrapper = texture._hardwareTexture as WebGPUHardwareTexture;
<mask> if (this._videoTextureSupported === undefined) { <mask> this._videoTextureSupported = true; <mask> } <mask> <mask> let gpuTexture = texture._hardwareTexture?.underlyingResource; <mask> <mask> if (!gpuTexture) { <mask> gpuTexture = this._createGPUT...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
if (!texture._hardwareTexture?.underlyingResource) { gpuTextureWrapper = this._createGPUTextureForInternalTexture(texture);
<mask> } <mask> <mask> let gpuTexture = texture._hardwareTexture?.underlyingResource; <mask> <mask> if (!gpuTexture) { <mask> gpuTexture = this._createGPUTextureForInternalTexture(texture); <mask> } <mask> <mask> createImageBitmap(video).then((bitmap) => {...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
this._textureHelper.updateTexture(bitmap, gpuTextureWrapper.underlyingResource!, texture.width, texture.height, gpuTextureWrapper.format, 0, 0, !invertY, false, 0, 0, this._uploadEncoder);
<mask> gpuTexture = this._createGPUTextureForInternalTexture(texture); <mask> } <mask> <mask> createImageBitmap(video).then((bitmap) => { <mask> this._textureHelper.updateTexture(bitmap, gpuTexture, texture.width, texture.height, 0, 0, !invertY, false, 0, 0, this._uploadEnc...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
this._generateMipmaps(texture, gpuTextureWrapper.underlyingResource!);
<mask> <mask> createImageBitmap(video).then((bitmap) => { <mask> this._textureHelper.updateTexture(bitmap, gpuTexture, texture.width, texture.height, 0, 0, !invertY, false, 0, 0, this._uploadEncoder); <mask> if (texture.generateMipMaps) { <mask> this._generateMipmap...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
let gpuTextureWrapper = texture._hardwareTexture as WebGPUHardwareTexture; if (!texture._hardwareTexture?.underlyingResource) { texture.format = internalFormat; gpuTextureWrapper = this._createGPUTextureForInternalTexture(texture, width, height); } this._...
<mask> } <mask> <mask> /** @hidden */ <mask> public _uploadCompressedDataToTextureDirectly(texture: InternalTexture, internalFormat: number, width: number, height: number, data: ArrayBufferView, faceIndex: number = 0, lod: number = 0) { <mask> console.warn("_uploadCompressedDataToTextureDirect...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
let gpuTextureWrapper = texture._hardwareTexture as WebGPUHardwareTexture;
<mask> <mask> const width = useTextureWidthAndHeight ? texture.width : Math.pow(2, Math.max(lodMaxWidth - lod, 0)); <mask> const height = useTextureWidthAndHeight ? texture.height : Math.pow(2, Math.max(lodMaxHeight - lod, 0)); <mask> <mask> let gpuTexture = texture._hardwareTexture?.unde...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
if (!texture._hardwareTexture?.underlyingResource) { gpuTextureWrapper = this._createGPUTextureForInternalTexture(texture, width, height);
<mask> const height = useTextureWidthAndHeight ? texture.height : Math.pow(2, Math.max(lodMaxHeight - lod, 0)); <mask> <mask> let gpuTexture = texture._hardwareTexture?.underlyingResource; <mask> <mask> if (!gpuTexture) { <mask> gpuTexture = this._createGPUTextureForInternalT...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
const imgData = new ImageData(new Uint8ClampedArray(imageData.buffer, 0, imageData.byteLength), width, height);
<mask> if (!gpuTexture) { <mask> gpuTexture = this._createGPUTextureForInternalTexture(texture, width, height); <mask> } <mask> <mask> const imgData = new ImageData(new Uint8ClampedArray(imageData.buffer, 0, width * height * 4), width, height); <mask> <mask> // TODO ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
// TODO WEBGPU don't convert to image bitmap and directly pass the Uint8ClampedArray? updateTexture needs to handle invertY...
<mask> } <mask> <mask> const imgData = new ImageData(new Uint8ClampedArray(imageData.buffer, 0, width * height * 4), width, height); <mask> <mask> // TODO WEBGPU don't convert to image bitmap and directly pass the Uint8ClampedArray <mask> createImageBitmap(imgData).then((bitmap) ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
this._textureHelper.updateTexture(bitmap, gpuTextureWrapper.underlyingResource!, width, height, gpuTextureWrapper.format, faceIndex, lod, texture.invertY, false, 0, 0, this._uploadEncoder);
<mask> const imgData = new ImageData(new Uint8ClampedArray(imageData.buffer, 0, width * height * 4), width, height); <mask> <mask> // TODO WEBGPU don't convert to image bitmap and directly pass the Uint8ClampedArray <mask> createImageBitmap(imgData).then((bitmap) => { <mask> th...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
let gpuTextureWrapper = texture._hardwareTexture as WebGPUHardwareTexture;
<mask> } <mask> <mask> /** @hidden */ <mask> public _uploadImageToTexture(texture: InternalTexture, image: HTMLImageElement | ImageBitmap, faceIndex: number = 0, lod: number = 0) { <mask> let gpuTexture = texture._hardwareTexture?.underlyingResource; <mask> <mask> if (!gpuTexture) {...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
if (!texture._hardwareTexture?.underlyingResource) { gpuTextureWrapper = this._createGPUTextureForInternalTexture(texture);
<mask> /** @hidden */ <mask> public _uploadImageToTexture(texture: InternalTexture, image: HTMLImageElement | ImageBitmap, faceIndex: number = 0, lod: number = 0) { <mask> let gpuTexture = texture._hardwareTexture?.underlyingResource; <mask> <mask> if (!gpuTexture) { <mask> gp...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
this._textureHelper.updateTexture(bitmap, gpuTextureWrapper.underlyingResource!, width, height, gpuTextureWrapper.format, faceIndex, lod, texture.invertY, false, 0, 0, this._uploadEncoder);
<mask> <mask> const width = Math.ceil(texture.width / (1 << lod)); <mask> const height = Math.ceil(texture.height / (1 << lod)); <mask> <mask> this._textureHelper.updateTexture(bitmap, gpuTexture, width, height, faceIndex, lod, texture.invertY, false, 0, 0, this._uploadEncoder); <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Engines/webgpuEngine.ts
var ext = !!engine.getCaps().s3tc;
<mask> var sphericalPolynomialFaces: Nullable<Array<ArrayBufferView>> = null; <mask> if (info.sphericalPolynomial) { <mask> sphericalPolynomialFaces = new Array<ArrayBufferView>(); <mask> } <mask> var ext = engine.getCaps().s3tc; <mask> <mask> var header = new...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Misc/dds.ts
internalCompressedFormat = Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT1;
<mask> fourCC = header[off_pfFourCC]; <mask> switch (fourCC) { <mask> case FOURCC_DXT1: <mask> blockBytes = 8; <mask> internalCompressedFormat = (<WEBGL_compressed_texture_s3tc>ext).COMPRESSED_RGBA_S3TC_DXT1_EXT; <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Misc/dds.ts
internalCompressedFormat = Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT3;
<mask> internalCompressedFormat = (<WEBGL_compressed_texture_s3tc>ext).COMPRESSED_RGBA_S3TC_DXT1_EXT; <mask> break; <mask> case FOURCC_DXT3: <mask> blockBytes = 16; <mask> internalCompressedFormat = (<WEBGL_compressed_t...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Misc/dds.ts
internalCompressedFormat = Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT5;
<mask> internalCompressedFormat = (<WEBGL_compressed_texture_s3tc>ext).COMPRESSED_RGBA_S3TC_DXT3_EXT; <mask> break; <mask> case FOURCC_DXT5: <mask> blockBytes = 16; <mask> internalCompressedFormat = (<WEBGL_compressed_t...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/31c9dba7d6c84c4fc5759c91846543adf29d6448
src/Misc/dds.ts
* @param trigger defines the trigger to be tested * @param parameterPredicate defines an optional predicate to filter triggers by parameter * @return whether the trigger is handled
<mask> } <mask> <mask> /** <mask> * Does this action manager handles actions of a given trigger <mask> * @param {number} trigger - the trigger to be tested <mask> * @return {boolean} whether the trigger is handeled <mask> */ <mask> public hasSpecific...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/325c51c9d56d695163e74596d44885292d2a1ee4
src/Actions/babylon.actionManager.ts