Browse Source

Remove unused code/comments

Popov72 4 years ago
parent
commit
36df52322e

+ 0 - 9
src/Engines/WebGPU/webgpuTextureHelper.ts

@@ -1068,15 +1068,6 @@ export class WebGPUTextureHelper {
             }
             irradianceTexture?.dispose();
             depthStencilTexture?.dispose();
-
-            // TODO WEBGPU remove debug code
-            if (texture) {
-                if ((texture as any)._swapped) {
-                    delete (texture as any)._swapped;
-                } else {
-                    (texture as any)._released = true;
-                }
-            }
         }
 
         this._deferredReleaseTextures.length = 0;

+ 0 - 18
src/Engines/webgpuEngine.ts

@@ -1437,7 +1437,6 @@ export class WebGPUEngine extends Engine {
                 webgpuPipelineContext.textures[name]!.texture = internalTexture!;
             }
             else {
-                // TODO WEBGPU. 121 mapping samplers <-> availableSamplers
                 const availableSampler = webgpuPipelineContext.shaderProcessingContext.availableSamplers[baseName];
                 if (availableSampler) {
                     webgpuPipelineContext.samplers[baseName] = {
@@ -1548,11 +1547,6 @@ export class WebGPUEngine extends Engine {
                 this._setAnisotropicLevel(0, internalTexture, texture.anisotropicFilteringLevel);
             }
 
-            if (dbgSanityChecks && internalTexture && (internalTexture as any)._released) {
-                console.error("using a released texture in engine.setTexture!", internalTexture);
-                debugger;
-            }
-
             this._setInternalTexture(name, internalTexture, baseName, textureIndex);
         } else {
             if (dbgVerboseLogsForFirstFrames) {
@@ -1635,10 +1629,6 @@ export class WebGPUEngine extends Engine {
             gpuTextureWrapper = this._textureHelper.createGPUTextureForInternalTexture(texture, width, height);
         }
 
-        if (dbgSanityChecks && (texture as any)._released) {
-            console.error("Using a released texture in updateDynamicTexture!", texture, gpuTextureWrapper);
-        }
-
         createImageBitmap(canvas).then((bitmap) => {
             this._textureHelper.updateTexture(bitmap, gpuTextureWrapper.underlyingResource!, width, height, texture.depth, gpuTextureWrapper.format, 0, 0, invertY, premulAlpha, 0, 0, this._uploadEncoder);
             if (texture.generateMipMaps) {
@@ -3019,7 +3009,6 @@ export class WebGPUEngine extends Engine {
                     visibility = visibility | WebGPUConstants.ShaderStage.Fragment;
                 }
 
-                // TODO WEBGPU. Optimize shared samplers visibility for vertex/framgent.
                 if (bindingDefinition.isSampler) {
                     entries.push({
                         binding: j,
@@ -3159,7 +3148,6 @@ export class WebGPUEngine extends Engine {
                     continue;
                 }
 
-                // TODO WEBGPU. Authorize shared samplers and Vertex Textures.
                 if (bindingDefinition.isSampler) {
                     const bindingInfo = webgpuPipelineContext.samplers[bindingDefinition.name];
                     if (bindingInfo) {
@@ -3189,12 +3177,6 @@ export class WebGPUEngine extends Engine {
                             continue;
                         }
 
-                        // TODO WEBGPU remove this code
-                        if ((bindingInfo.texture as any)._released) {
-                            console.error("Trying to bind a released texture!", bindingInfo.texture, bindingInfo);
-                            continue;
-                        }
-
                         entries.push({
                             binding: bindingInfo.textureBinding,
                             resource: hardwareTexture.view!,

+ 0 - 4
src/Materials/Textures/internalTexture.ts

@@ -466,10 +466,6 @@ export class InternalTexture {
         target._hardwareTexture = this._hardwareTexture;
         target._isRGBD = this._isRGBD;
 
-        // TODO WEBGPU debug code, remove this
-        (target as any)._released = false;
-        (target as any)._swapped = true;
-
         if (this._framebuffer) {
             target._framebuffer = this._framebuffer;
         }