Selaa lähdekoodia

Add some missing function overrides

Popov72 4 vuotta sitten
vanhempi
commit
4510d3c84a
1 muutettua tiedostoa jossa 20 lisäystä ja 9 poistoa
  1. 20 9
      src/Engines/webgpuEngine.ts

+ 20 - 9
src/Engines/webgpuEngine.ts

@@ -1060,6 +1060,10 @@ export class WebGPUEngine extends Engine {
     //                              Textures
     //------------------------------------------------------------------------------
 
+    public get needPOTTextures(): boolean {
+        return false;
+    }
+
     private _getMainDepthTextureFormat(): GPUTextureFormat {
         return this.isStencilEnable ? WebGPUConstants.TextureFormat.Depth24PlusStencil8 : WebGPUConstants.TextureFormat.Depth32Float;
     }
@@ -2329,11 +2333,7 @@ export class WebGPUEngine extends Engine {
     public endFrame() {
         this._endMainRenderPass();
 
-        this._commandBuffers[0] = this._uploadEncoder.finish();
-        this._commandBuffers[1] = this._renderTargetEncoder.finish();
-        this._commandBuffers[2] = this._renderEncoder.finish();
-
-        this._device.defaultQueue.submit(this._commandBuffers);
+        this.flushFramebuffer();
 
         if (dbgVerboseLogsForFirstFrames) {
             if (!(this as any)._count || (this as any)._count < dbgVerboseLogsNumFrames) {
@@ -2360,10 +2360,6 @@ export class WebGPUEngine extends Engine {
 
         this._bufferManager.destroyDeferredBuffers();
 
-        this._uploadEncoder = this._device.createCommandEncoder(this._uploadEncoderDescriptor);
-        this._renderEncoder = this._device.createCommandEncoder(this._renderEncoderDescriptor);
-        this._renderTargetEncoder = this._device.createCommandEncoder(this._renderTargetEncoderDescriptor);
-
         if (ThinEngine.Features._collectUbosUpdatedInFrame) {
             if (dbgVerboseLogsForFirstFrames) {
                 if (!(this as any)._count || (this as any)._count < dbgVerboseLogsNumFrames) {
@@ -2602,6 +2598,18 @@ export class WebGPUEngine extends Engine {
         this._setColorFormat(this._options.swapChainFormat!);
     }
 
+    public flushFramebuffer(): void {
+        this._commandBuffers[0] = this._uploadEncoder.finish();
+        this._commandBuffers[1] = this._renderTargetEncoder.finish();
+        this._commandBuffers[2] = this._renderEncoder.finish();
+
+        this._device.defaultQueue.submit(this._commandBuffers);
+
+        this._uploadEncoder = this._device.createCommandEncoder(this._uploadEncoderDescriptor);
+        this._renderEncoder = this._device.createCommandEncoder(this._renderEncoderDescriptor);
+        this._renderTargetEncoder = this._device.createCommandEncoder(this._renderTargetEncoderDescriptor);
+    }
+
     public restoreDefaultFramebuffer(): void {
         if (this._currentRenderTarget) {
             this.unBindFramebuffer(this._currentRenderTarget);
@@ -3565,6 +3573,9 @@ export class WebGPUEngine extends Engine {
         return true;
     }
 
+    public applyStates() {
+    }
+
     //------------------------------------------------------------------------------
     //                              Render Bundle
     //------------------------------------------------------------------------------