Sfoglia il codice sorgente

Fix deformed rendering when using mirror textures

Popov72 4 anni fa
parent
commit
e5ed403a37
1 ha cambiato i file con 6 aggiunte e 0 eliminazioni
  1. 6 0
      src/Engines/webgpuEngine.ts

+ 6 - 0
src/Engines/webgpuEngine.ts

@@ -3143,10 +3143,16 @@ export class WebGPUEngine extends Engine {
         // TODO WEBGPU remove the assert debugging code
         assert(this._currentRenderTarget === null || (this._currentRenderTarget !== null && texture === this._currentRenderTarget), "unBindFramebuffer - the texture we want to unbind is not the same than the currentRenderTarget! texture=" + texture + ", this._currentRenderTarget=" + this._currentRenderTarget);
 
+        const saveCRT = this._currentRenderTarget;
+
+        this._currentRenderTarget = null; // to be iso with thinEngine, this._currentRenderTarget must be null when onBeforeUnbind is called
+
         if (onBeforeUnbind) {
             onBeforeUnbind();
         }
 
+        this._currentRenderTarget = saveCRT;
+
         if (this._currentRenderPass && this._currentRenderPass !== this._mainRenderPassWrapper.renderPass) {
             this._endRenderTargetRenderPass();
         }