Explorar o código

Merge pull request #9843 from Popov72/webgpu-sync-idl

WebGPU: synchronization with spec + remove Chrome warnings
David Catuhe %!s(int64=5) %!d(string=hai) anos
pai
achega
8053b0d6b2

+ 22 - 26
src/Engines/WebGPU/webgpuCacheRenderPipeline.ts

@@ -814,30 +814,26 @@ export abstract class WebGPUCacheRenderPipeline {
                     visibility = visibility | WebGPUConstants.ShaderStage.Fragment;
                     visibility = visibility | WebGPUConstants.ShaderStage.Fragment;
                 }
                 }
 
 
+                const entry: GPUBindGroupLayoutEntry = {
+                    binding: j,
+                    visibility,
+                };
+                entries.push(entry);
+
                 if (bindingDefinition.isSampler) {
                 if (bindingDefinition.isSampler) {
-                    entries.push({
-                        binding: j,
-                        visibility,
-                        type: bindingDefinition.isComparisonSampler ? WebGPUConstants.BindingType.ComparisonSampler : WebGPUConstants.BindingType.Sampler
-                    });
+                    entry.sampler = {
+                        type: bindingDefinition.isComparisonSampler ? WebGPUConstants.SamplerBindingType.Comparison : WebGPUConstants.SamplerBindingType.Filtering
+                    };
                 } else if (bindingDefinition.isTexture) {
                 } else if (bindingDefinition.isTexture) {
-                    entries.push({
-                        binding: j,
-                        visibility,
-                        type: WebGPUConstants.BindingType.SampledTexture,
+                    entry.texture = {
+                        sampleType: bindingDefinition.sampleType,
                         viewDimension: bindingDefinition.textureDimension,
                         viewDimension: bindingDefinition.textureDimension,
-                        textureComponentType: bindingDefinition.componentType,
-                        // TODO WEBGPU.
-                        // hasDynamicOffset?: boolean;
-                        // storageTextureFormat?: GPUTextureFormat;
-                        // minBufferBindingSize?: number;
-                    });
+                        multisampled: false,
+                    };
                 } else {
                 } else {
-                    entries.push({
-                        binding: j,
-                        visibility,
-                        type: WebGPUConstants.BindingType.UniformBuffer,
-                    });
+                    entry.buffer = {
+                        type: WebGPUConstants.BufferBindingType.Uniform,
+                    };
                 }
                 }
             }
             }
 
 
@@ -854,8 +850,8 @@ export abstract class WebGPUCacheRenderPipeline {
         return this._device.createPipelineLayout({ bindGroupLayouts });
         return this._device.createPipelineLayout({ bindGroupLayouts });
     }
     }
 
 
-    private _getVertexInputDescriptor(effect: Effect, topology: GPUPrimitiveTopology): GPUVertexStateDescriptor {
-        const descriptors: GPUVertexBufferLayoutDescriptor[] = [];
+    private _getVertexInputDescriptor(effect: Effect, topology: GPUPrimitiveTopology): GPUVertexState {
+        const descriptors: GPUVertexBufferLayout[] = [];
         const webgpuPipelineContext = effect._pipelineContext as WebGPUPipelineContext;
         const webgpuPipelineContext = effect._pipelineContext as WebGPUPipelineContext;
         const attributes = webgpuPipelineContext.shaderProcessingContext.attributeNamesFromEffect;
         const attributes = webgpuPipelineContext.shaderProcessingContext.attributeNamesFromEffect;
         const locations = webgpuPipelineContext.shaderProcessingContext.attributeLocationsFromEffect;
         const locations = webgpuPipelineContext.shaderProcessingContext.attributeLocationsFromEffect;
@@ -868,14 +864,14 @@ export abstract class WebGPUCacheRenderPipeline {
                 vertexBuffer = this._emptyVertexBuffer;
                 vertexBuffer = this._emptyVertexBuffer;
             }
             }
 
 
-            const attributeDescriptor: GPUVertexAttributeDescriptor = {
+            const attributeDescriptor: GPUVertexAttribute = {
                 shaderLocation: location,
                 shaderLocation: location,
                 offset: 0, // not available in WebGL
                 offset: 0, // not available in WebGL
                 format: WebGPUCacheRenderPipeline._GetVertexInputDescriptorFormat(vertexBuffer),
                 format: WebGPUCacheRenderPipeline._GetVertexInputDescriptorFormat(vertexBuffer),
             };
             };
 
 
             // TODO WEBGPU. Factorize the one with the same underlying buffer.
             // TODO WEBGPU. Factorize the one with the same underlying buffer.
-            const vertexBufferDescriptor: GPUVertexBufferLayoutDescriptor = {
+            const vertexBufferDescriptor: GPUVertexBufferLayout = {
                 arrayStride: vertexBuffer.byteStride,
                 arrayStride: vertexBuffer.byteStride,
                 stepMode: vertexBuffer.getIsInstanced() ? WebGPUConstants.InputStepMode.Instance : WebGPUConstants.InputStepMode.Vertex,
                 stepMode: vertexBuffer.getIsInstanced() ? WebGPUConstants.InputStepMode.Instance : WebGPUConstants.InputStepMode.Vertex,
                 attributes: [attributeDescriptor]
                 attributes: [attributeDescriptor]
@@ -884,7 +880,7 @@ export abstract class WebGPUCacheRenderPipeline {
             descriptors.push(vertexBufferDescriptor);
             descriptors.push(vertexBufferDescriptor);
         }
         }
 
 
-        const inputStateDescriptor: GPUVertexStateDescriptor = {
+        const inputStateDescriptor: GPUVertexState = {
             vertexBuffers: descriptors
             vertexBuffers: descriptors
         };
         };
 
 
@@ -922,7 +918,7 @@ export abstract class WebGPUCacheRenderPipeline {
             });
             });
         }
         }
 
 
-        const stencilFrontBack: GPUStencilStateFaceDescriptor = {
+        const stencilFrontBack: GPUStencilStateFace = {
             compare: WebGPUCacheRenderPipeline._GetCompareFunction(this._stencilFrontCompare),
             compare: WebGPUCacheRenderPipeline._GetCompareFunction(this._stencilFrontCompare),
             depthFailOp: WebGPUCacheRenderPipeline._GetStencilOpFunction(this._stencilFrontDepthFailOp),
             depthFailOp: WebGPUCacheRenderPipeline._GetStencilOpFunction(this._stencilFrontDepthFailOp),
             failOp: WebGPUCacheRenderPipeline._GetStencilOpFunction(this._stencilFrontFailOp),
             failOp: WebGPUCacheRenderPipeline._GetStencilOpFunction(this._stencilFrontFailOp),

+ 216 - 153
src/Engines/WebGPU/webgpuConstants.ts

@@ -1,5 +1,11 @@
 /** @hidden */
 /** @hidden */
-export enum ExtensionName {
+export enum PowerPreference {
+    LowPower = "low-power",
+    HighPerformance = "high-performance"
+}
+
+/** @hidden */
+export enum FeatureName {
     DepthClamping = "depth-clamping",
     DepthClamping = "depth-clamping",
     Depth24UnormStencil8 = "depth24unorm-stencil8",
     Depth24UnormStencil8 = "depth24unorm-stencil8",
     Depth32FloatStencil8 = "depth32float-stencil8",
     Depth32FloatStencil8 = "depth32float-stencil8",
@@ -7,118 +13,60 @@ export enum ExtensionName {
     TextureCompressionBC = "texture-compression-bc",
     TextureCompressionBC = "texture-compression-bc",
     TimestampQuery = "timestamp-query"
     TimestampQuery = "timestamp-query"
 }
 }
+
 /** @hidden */
 /** @hidden */
-export enum AddressMode {
-    ClampToEdge = "clamp-to-edge",
-    Repeat = "repeat",
-    MirrorRepeat = "mirror-repeat"
-}
-/** @hidden */
-export enum BindingType {
-    UniformBuffer = "uniform-buffer",
-    StorageBuffer = "storage-buffer",
-    ReadonlyStorageBuffer = "readonly-storage-buffer",
-    Sampler = "sampler",
-    ComparisonSampler = "comparison-sampler",
-    SampledTexture = "sampled-texture",
-    ReadonlyStorageTexture = "readonly-storage-texture",
-    WriteonlyStorageTexture = "writeonly-storage-texture"
-}
-/** @hidden */
-export enum BlendFactor {
-    Zero = "zero",
-    One = "one",
-    SrcColor = "src-color",
-    OneMinusSrcColor = "one-minus-src-color",
-    SrcAlpha = "src-alpha",
-    OneMinusSrcAlpha = "one-minus-src-alpha",
-    DstColor = "dst-color",
-    OneMinusDstColor = "one-minus-dst-color",
-    DstAlpha = "dst-alpha",
-    OneMinusDstAlpha = "one-minus-dst-alpha",
-    SrcAlphaSaturated = "src-alpha-saturated",
-    BlendColor = "blend-color",
-    OneMinusBlendColor = "one-minus-blend-color"
-}
-/** @hidden */
-export enum BlendOperation {
-    Add = "add",
-    Subtract = "subtract",
-    ReverseSubtract = "reverse-subtract",
-    Min = "min",
-    Max = "max"
-}
-/** @hidden */
-export enum CompareFunction {
-    Never = "never",
-    Less = "less",
-    Equal = "equal",
-    LessEqual = "less-equal",
-    Greater = "greater",
-    NotEqual = "not-equal",
-    GreaterEqual = "greater-equal",
-    Always = "always"
-}
-/** @hidden */
-export enum CullMode {
-    None = "none",
-    Front = "front",
-    Back = "back"
-}
-/** @hidden */
-export enum FilterMode {
-    Nearest = "nearest",
-    Linear = "linear"
-}
-/** @hidden */
-export enum FrontFace {
-    CCW = "ccw",
-    CW = "cw"
-}
-/** @hidden */
-export enum IndexFormat {
-    Uint16 = "uint16",
-    Uint32 = "uint32"
-}
-/** @hidden */
-export enum InputStepMode {
-    Vertex = "vertex",
-    Instance = "instance"
-}
-/** @hidden */
-export enum LoadOp {
-    Load = "load"
+export enum BufferUsage {
+    MapRead = 1,
+    MapWrite = 2,
+    CopySrc = 4,
+    CopyDst = 8,
+    Index = 16,
+    Vertex = 32,
+    Uniform = 64,
+    Storage = 128,
+    Indirect = 256,
+    QueryResolve = 512
 }
 }
+
 /** @hidden */
 /** @hidden */
-export enum PrimitiveTopology {
-    PointList = "point-list",
-    LineList = "line-list",
-    LineStrip = "line-strip",
-    TriangleList = "triangle-list",
-    TriangleStrip = "triangle-strip"
+export enum MapMode {
+    Read = 1,
+    Write = 2
 }
 }
+
 /** @hidden */
 /** @hidden */
-export enum StencilOperation {
-    Keep = "keep",
-    Zero = "zero",
-    Replace = "replace",
-    Invert = "invert",
-    IncrementClamp = "increment-clamp",
-    DecrementClamp = "decrement-clamp",
-    IncrementWrap = "increment-wrap",
-    DecrementWrap = "decrement-wrap"
+export enum TextureDimension {
+    E1d = "1d",
+    E2d = "2d",
+    E3d = "3d"
 }
 }
+
 /** @hidden */
 /** @hidden */
-export enum StoreOp {
-    Store = "store",
-    Clear = "clear"
+export enum TextureUsage {
+    CopySrc = 1,
+    CopyDst = 2,
+    Sampled = 4,
+    Storage = 8,
+    OutputAttachment = 16
 }
 }
+
 /** @hidden */
 /** @hidden */
-export enum TextureDimension {
+export enum TextureViewDimension {
     E1d = "1d",
     E1d = "1d",
     E2d = "2d",
     E2d = "2d",
+    E2dArray = "2d-array",
+    Cube = "cube",
+    CubeArray = "cube-array",
     E3d = "3d"
     E3d = "3d"
 }
 }
+
+/** @hidden */
+export enum TextureAspect {
+    All = "all",
+    StencilOnly = "stencil-only",
+    DepthOnly = "depth-only"
+}
+
 /** @hidden */
 /** @hidden */
 export enum TextureFormat {
 export enum TextureFormat {
     // 8-bit formats
     // 8-bit formats
@@ -198,23 +146,150 @@ export enum TextureFormat {
     // "depth32float-stencil8" feature
     // "depth32float-stencil8" feature
     Depth32FloatStencil8 = "depth32float-stencil8"
     Depth32FloatStencil8 = "depth32float-stencil8"
 }
 }
+
+/** @hidden */
+export enum AddressMode {
+    ClampToEdge = "clamp-to-edge",
+    Repeat = "repeat",
+    MirrorRepeat = "mirror-repeat"
+}
+
+/** @hidden */
+export enum FilterMode {
+    Nearest = "nearest",
+    Linear = "linear"
+}
+
+/** @hidden */
+export enum CompareFunction {
+    Never = "never",
+    Less = "less",
+    Equal = "equal",
+    LessEqual = "less-equal",
+    Greater = "greater",
+    NotEqual = "not-equal",
+    GreaterEqual = "greater-equal",
+    Always = "always"
+}
+
+/** @hidden */
+export enum ShaderStage {
+    Vertex = 1,
+    Fragment = 2,
+    Compute = 4
+}
+
 /** @hidden */
 /** @hidden */
-export enum TextureComponentType {
+export enum BufferBindingType {
+    Uniform = "uniform",
+    Storage = "storage",
+    ReadOnlyStorage = "read-only-storage"
+}
+
+/** @hidden */
+export enum SamplerBindingType {
+    Filtering = "filtering",
+    NonFiltering = "non-filtering",
+    Comparison = "comparison"
+}
+
+/** @hidden */
+export enum TextureSampleType {
     Float = "float",
     Float = "float",
+    UnfilterableFloat = "unfilterable-float",
+    Depth = "depth",
     Sint = "sint",
     Sint = "sint",
-    Uint = "uint",
-    // Texture is used with comparison sampling only.
-    DepthComparison = "depth-comparison"
+    Uint = "uint"
 }
 }
+
 /** @hidden */
 /** @hidden */
-export enum TextureViewDimension {
-    E1d = "1d",
-    E2d = "2d",
-    E2dArray = "2d-array",
-    Cube = "cube",
-    CubeArray = "cube-array",
-    E3d = "3d"
+export enum StorageTextureAccess {
+    ReadOnly = "read-only",
+    WriteOnly = "write-only"
 }
 }
+
+/** @hidden */
+export enum CompilationMessageType {
+    Error = "error",
+    Warning = "warning",
+    Info = "info"
+}
+
+/** @hidden */
+export enum PrimitiveTopology {
+    PointList = "point-list",
+    LineList = "line-list",
+    LineStrip = "line-strip",
+    TriangleList = "triangle-list",
+    TriangleStrip = "triangle-strip"
+}
+
+/** @hidden */
+export enum FrontFace {
+    CCW = "ccw",
+    CW = "cw"
+}
+
+/** @hidden */
+export enum CullMode {
+    None = "none",
+    Front = "front",
+    Back = "back"
+}
+
+/** @hidden */
+export enum ColorWrite {
+    Red = 1,
+    Green = 2,
+    Blue = 4,
+    Alpha = 8,
+    All = 15
+}
+
+/** @hidden */
+export enum BlendFactor {
+    Zero = "zero",
+    One = "one",
+    SrcColor = "src-color",
+    OneMinusSrcColor = "one-minus-src-color",
+    SrcAlpha = "src-alpha",
+    OneMinusSrcAlpha = "one-minus-src-alpha",
+    DstColor = "dst-color",
+    OneMinusDstColor = "one-minus-dst-color",
+    DstAlpha = "dst-alpha",
+    OneMinusDstAlpha = "one-minus-dst-alpha",
+    SrcAlphaSaturated = "src-alpha-saturated",
+    BlendColor = "blend-color",
+    OneMinusBlendColor = "one-minus-blend-color"
+}
+
+/** @hidden */
+export enum BlendOperation {
+    Add = "add",
+    Subtract = "subtract",
+    ReverseSubtract = "reverse-subtract",
+    Min = "min",
+    Max = "max"
+}
+
+/** @hidden */
+export enum StencilOperation {
+    Keep = "keep",
+    Zero = "zero",
+    Replace = "replace",
+    Invert = "invert",
+    IncrementClamp = "increment-clamp",
+    DecrementClamp = "decrement-clamp",
+    IncrementWrap = "increment-wrap",
+    DecrementWrap = "decrement-wrap"
+}
+
+/** @hidden */
+export enum IndexFormat {
+    Uint16 = "uint16",
+    Uint32 = "uint32"
+}
+
 /** @hidden */
 /** @hidden */
 export enum VertexFormat {
 export enum VertexFormat {
     Uchar2 = "uchar2",
     Uchar2 = "uchar2",
@@ -248,59 +323,47 @@ export enum VertexFormat {
     Int3 = "int3",
     Int3 = "int3",
     Int4 = "int4"
     Int4 = "int4"
 }
 }
+
 /** @hidden */
 /** @hidden */
-export enum TextureAspect {
-    All = "all",
-    StencilOnly = "stencil-only",
-    DepthOnly = "depth-only"
-}
-/** @hidden */
-export enum CompilationMessageType {
-    Error = "error",
-    Warning = "warning",
-    Info = "info"
+export enum InputStepMode {
+    Vertex = "vertex",
+    Instance = "instance"
 }
 }
+
 /** @hidden */
 /** @hidden */
-export enum QueryType {
-    Occlusion = "occlusion"
+export enum LoadOp {
+    Load = "load"
 }
 }
+
 /** @hidden */
 /** @hidden */
-export enum BufferUsage {
-    MapRead = 1,
-    MapWrite = 2,
-    CopySrc = 4,
-    CopyDst = 8,
-    Index = 16,
-    Vertex = 32,
-    Uniform = 64,
-    Storage = 128,
-    Indirect = 256,
-    QueryResolve = 512
+export enum StoreOp {
+    Store = "store",
+    Clear = "clear"
 }
 }
+
 /** @hidden */
 /** @hidden */
-export enum ColorWrite {
-    Red = 1,
-    Green = 2,
-    Blue = 4,
-    Alpha = 8,
-    All = 15
+export enum QueryType {
+    Occlusion = "occlusion",
+    PipelineStatistics = "pipeline-statistics",
+    Timestamp = "timestamp"
 }
 }
+
 /** @hidden */
 /** @hidden */
-export enum ShaderStage {
-    Vertex = 1,
-    Fragment = 2,
-    Compute = 4
+export enum PipelineStatisticName {
+    VertexShaderInvocations = "vertex-shader-invocations",
+    ClipperInvocations = "clipper-invocations",
+    ClipperPrimitivesOut = "clipper-primitives-out",
+    FragmentShaderInvocations = "fragment-shader-invocations",
+    ComputeShaderInvocations = "compute-shader-invocations"
 }
 }
+
 /** @hidden */
 /** @hidden */
-export enum TextureUsage {
-    CopySrc = 1,
-    CopyDst = 2,
-    Sampled = 4,
-    Storage = 8,
-    OutputAttachment = 16
+export enum DeviceLostReason {
+    Destroyed = "destroyed"
 }
 }
+
 /** @hidden */
 /** @hidden */
-export enum MapMode {
-    Read = 1,
-    Write = 2
+export enum ErrorFilter {
+    OutOfMemory = "out-of-memory",
+    Validation = "validation"
 }
 }

+ 2 - 2
src/Engines/WebGPU/webgpuPipelineContext.ts

@@ -46,8 +46,8 @@ export interface IWebGPUPipelineContextVertexInputsCache {
 
 
 /** @hidden */
 /** @hidden */
 export interface IWebGPURenderPipelineStageDescriptor {
 export interface IWebGPURenderPipelineStageDescriptor {
-    vertexStage: GPUProgrammableStageDescriptor;
-    fragmentStage?: GPUProgrammableStageDescriptor;
+    vertexStage: GPUProgrammableStage;
+    fragmentStage?: GPUProgrammableStage;
 }
 }
 
 
 /** @hidden */
 /** @hidden */

+ 1 - 1
src/Engines/WebGPU/webgpuShaderProcessingContext.ts

@@ -35,7 +35,7 @@ export interface WebGPUBindingDescription {
     isComparisonSampler?: boolean;
     isComparisonSampler?: boolean;
 
 
     isTexture: boolean;
     isTexture: boolean;
-    componentType?: GPUTextureComponentType;
+    sampleType?: GPUTextureSampleType;
     textureDimension?: GPUTextureViewDimension;
     textureDimension?: GPUTextureViewDimension;
 }
 }
 
 

+ 3 - 3
src/Engines/WebGPU/webgpuShaderProcessors.ts

@@ -243,9 +243,9 @@ export class WebGPUShaderProcessor implements IShaderProcessor {
                         webgpuProcessingContext.orderedUBOsAndSamplers[textureSetIndex][textureBindingIndex] = {
                         webgpuProcessingContext.orderedUBOsAndSamplers[textureSetIndex][textureBindingIndex] = {
                             isSampler: false,
                             isSampler: false,
                             isTexture: true,
                             isTexture: true,
-                            componentType: isComparisonSampler ? WebGPUConstants.TextureComponentType.DepthComparison :
-                                        componentType === 'u' ? WebGPUConstants.TextureComponentType.Uint :
-                                        componentType === 'i' ? WebGPUConstants.TextureComponentType.Sint : WebGPUConstants.TextureComponentType.Float,
+                            sampleType: isComparisonSampler ? WebGPUConstants.TextureSampleType.Depth :
+                                        componentType === 'u' ? WebGPUConstants.TextureSampleType.Uint :
+                                        componentType === 'i' ? WebGPUConstants.TextureSampleType.Sint : WebGPUConstants.TextureSampleType.Float,
                             textureDimension,
                             textureDimension,
                             usedInVertex: false,
                             usedInVertex: false,
                             usedInFragment: false,
                             usedInFragment: false,

+ 9 - 11
src/Engines/webgpuEngine.ts

@@ -509,11 +509,11 @@ export class WebGPUEngine extends Engine {
             maxVertexUniformVectors: 1024,
             maxVertexUniformVectors: 1024,
             standardDerivatives: true,
             standardDerivatives: true,
             astc: null,
             astc: null,
-            s3tc: (this._deviceEnabledExtensions.indexOf(WebGPUConstants.ExtensionName.TextureCompressionBC) >= 0 ? true : undefined) as any,
+            s3tc: (this._deviceEnabledExtensions.indexOf(WebGPUConstants.FeatureName.TextureCompressionBC) >= 0 ? true : undefined) as any,
             pvrtc: null,
             pvrtc: null,
             etc1: null,
             etc1: null,
             etc2: null,
             etc2: null,
-            bptc: this._deviceEnabledExtensions.indexOf(WebGPUConstants.ExtensionName.TextureCompressionBC) >= 0 ? true : undefined,
+            bptc: this._deviceEnabledExtensions.indexOf(WebGPUConstants.FeatureName.TextureCompressionBC) >= 0 ? true : undefined,
             maxAnisotropy: 16, // TODO WEBGPU: Retrieve this smartly
             maxAnisotropy: 16, // TODO WEBGPU: Retrieve this smartly
             uintIndices: true,
             uintIndices: true,
             fragmentDepthSupported: true,
             fragmentDepthSupported: true,
@@ -576,9 +576,7 @@ export class WebGPUEngine extends Engine {
         this._mainRenderPassWrapper.colorAttachmentGPUTextures = [new WebGPUHardwareTexture()];
         this._mainRenderPassWrapper.colorAttachmentGPUTextures = [new WebGPUHardwareTexture()];
         this._mainRenderPassWrapper.colorAttachmentGPUTextures[0].format = this._colorFormat;
         this._mainRenderPassWrapper.colorAttachmentGPUTextures[0].format = this._colorFormat;
         if (this.dbgGenerateLogs) {
         if (this.dbgGenerateLogs) {
-            this._context.getSwapChainPreferredFormat(this._device).then((format) => {
-                console.log("Swap chain preferred format:", format);
-            });
+            console.log("Swap chain preferred format:", this._context.getSwapChainPreferredFormat(this._adapter));
         }
         }
     }
     }
 
 
@@ -590,7 +588,7 @@ export class WebGPUEngine extends Engine {
             depth: 1
             depth: 1
         };
         };
 
 
-        let mainColorAttachments: GPURenderPassColorAttachmentDescriptor[];
+        let mainColorAttachments: GPURenderPassColorAttachment[];
 
 
         if (this._options.antialiasing) {
         if (this._options.antialiasing) {
             const mainTextureDescriptor: GPUTextureDescriptor = {
             const mainTextureDescriptor: GPUTextureDescriptor = {
@@ -637,7 +635,7 @@ export class WebGPUEngine extends Engine {
             this._depthTexture.destroy();
             this._depthTexture.destroy();
         }
         }
         this._depthTexture = this._device.createTexture(depthTextureDescriptor);
         this._depthTexture = this._device.createTexture(depthTextureDescriptor);
-        const mainDepthAttachment: GPURenderPassDepthStencilAttachmentDescriptor = {
+        const mainDepthAttachment: GPURenderPassDepthStencilAttachment = {
             attachment: this._depthTexture.createView(),
             attachment: this._depthTexture.createView(),
 
 
             depthLoadValue: this._clearDepthValue,
             depthLoadValue: this._clearDepthValue,
@@ -2834,7 +2832,7 @@ export class WebGPUEngine extends Engine {
         const depthTextureView = gpuDepthStencilTexture?.createView(this._rttRenderPassWrapper.depthAttachmentViewDescriptor!);
         const depthTextureView = gpuDepthStencilTexture?.createView(this._rttRenderPassWrapper.depthAttachmentViewDescriptor!);
         const depthMSAATextureView = gpuDepthStencilMSAATexture?.createView(this._rttRenderPassWrapper.depthAttachmentViewDescriptor!);
         const depthMSAATextureView = gpuDepthStencilMSAATexture?.createView(this._rttRenderPassWrapper.depthAttachmentViewDescriptor!);
 
 
-        const colorAttachments: GPURenderPassColorAttachmentDescriptor[] = [];
+        const colorAttachments: GPURenderPassColorAttachment[] = [];
 
 
         if (internalTexture._attachments && internalTexture._textureArray) {
         if (internalTexture._attachments && internalTexture._textureArray) {
             // multi render targets
             // multi render targets
@@ -2950,7 +2948,7 @@ export class WebGPUEngine extends Engine {
             const depthClearValue = scissorIsActive ? WebGPUConstants.LoadOp.Load : clearDepth ? (this.useReverseDepthBuffer ? this._clearReverseDepthValue : this._clearDepthValue) : WebGPUConstants.LoadOp.Load;
             const depthClearValue = scissorIsActive ? WebGPUConstants.LoadOp.Load : clearDepth ? (this.useReverseDepthBuffer ? this._clearReverseDepthValue : this._clearDepthValue) : WebGPUConstants.LoadOp.Load;
             const stencilClearValue = scissorIsActive ? WebGPUConstants.LoadOp.Load : clearStencil ? this._clearStencilValue : WebGPUConstants.LoadOp.Load;
             const stencilClearValue = scissorIsActive ? WebGPUConstants.LoadOp.Load : clearStencil ? this._clearStencilValue : WebGPUConstants.LoadOp.Load;
 
 
-            (this._mainRenderPassWrapper.renderPassDescriptor!.colorAttachments as GPURenderPassColorAttachmentDescriptor[])[0].loadValue = colorClearValue;
+            this._mainRenderPassWrapper.renderPassDescriptor!.colorAttachments[0].loadValue = colorClearValue;
             this._mainRenderPassWrapper.renderPassDescriptor!.depthStencilAttachment!.depthLoadValue = depthClearValue;
             this._mainRenderPassWrapper.renderPassDescriptor!.depthStencilAttachment!.depthLoadValue = depthClearValue;
             this._mainRenderPassWrapper.renderPassDescriptor!.depthStencilAttachment!.stencilLoadValue = stencilClearValue;
             this._mainRenderPassWrapper.renderPassDescriptor!.depthStencilAttachment!.stencilLoadValue = stencilClearValue;
         }
         }
@@ -2960,10 +2958,10 @@ export class WebGPUEngine extends Engine {
 
 
         // Resolve in case of MSAA
         // Resolve in case of MSAA
         if (this._options.antialiasing) {
         if (this._options.antialiasing) {
-            (this._mainRenderPassWrapper.renderPassDescriptor!.colorAttachments as GPURenderPassColorAttachmentDescriptor[])[0].resolveTarget = this._swapChainTexture.createView();
+            this._mainRenderPassWrapper.renderPassDescriptor!.colorAttachments[0].resolveTarget = this._swapChainTexture.createView();
         }
         }
         else {
         else {
-            (this._mainRenderPassWrapper.renderPassDescriptor!.colorAttachments as GPURenderPassColorAttachmentDescriptor[])[0].attachment = this._swapChainTexture.createView();
+            this._mainRenderPassWrapper.renderPassDescriptor!.colorAttachments[0].attachment = this._swapChainTexture.createView();
         }
         }
 
 
         if (this.dbgVerboseLogsForFirstFrames) {
         if (this.dbgVerboseLogsForFirstFrames) {

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 778 - 623
src/LibDeclarations/webgpu.d.ts