Title: [286403] trunk/Source/WebCore
Revision
286403
Author
[email protected]
Date
2021-12-01 16:30:58 -0800 (Wed, 01 Dec 2021)

Log Message

[WebGPU] Add default values to structs in WebCore/Modules/WebGPU
https://bugs.webkit.org/show_bug.cgi?id=233691

Reviewed by Alex Christensen.

Our bindings code expects that the structs backing dictionaries
have default values for their members.

No new tests because there is no behavior change.

* Modules/WebGPU/GPUBindGroupDescriptor.h:
* Modules/WebGPU/GPUBindGroupEntry.h:
* Modules/WebGPU/GPUBindGroupLayoutEntry.h:
* Modules/WebGPU/GPUBlendComponent.h:
* Modules/WebGPU/GPUBufferBinding.h:
* Modules/WebGPU/GPUBufferBindingLayout.h:
* Modules/WebGPU/GPUBufferDescriptor.h:
* Modules/WebGPU/GPUCanvasConfiguration.h:
* Modules/WebGPU/GPUColorDict.h:
* Modules/WebGPU/GPUColorTargetState.h:
* Modules/WebGPU/GPUComputePassTimestampWrite.h:
* Modules/WebGPU/GPUDepthStencilState.h:
* Modules/WebGPU/GPUExtent3DDict.h:
* Modules/WebGPU/GPUExternalTextureDescriptor.h:
* Modules/WebGPU/GPUImageCopyBuffer.h:
* Modules/WebGPU/GPUImageCopyTexture.h:
* Modules/WebGPU/GPUImageCopyTextureTagged.h:
* Modules/WebGPU/GPUImageDataLayout.h:
* Modules/WebGPU/GPUMultisampleState.h:
* Modules/WebGPU/GPUOrigin2DDict.h:
* Modules/WebGPU/GPUOrigin3DDict.h:
* Modules/WebGPU/GPUPipelineDescriptorBase.h:
* Modules/WebGPU/GPUPrimitiveState.h:
* Modules/WebGPU/GPUProgrammableStage.h:
* Modules/WebGPU/GPUQuerySetDescriptor.h:
* Modules/WebGPU/GPURenderBundleEncoderDescriptor.h:
* Modules/WebGPU/GPURenderPassColorAttachment.h:
* Modules/WebGPU/GPURenderPassDepthStencilAttachment.h:
* Modules/WebGPU/GPURenderPassDescriptor.h:
* Modules/WebGPU/GPURenderPassLayout.h:
* Modules/WebGPU/GPURenderPassTimestampWrite.h:
* Modules/WebGPU/GPURequestAdapterOptions.h:
* Modules/WebGPU/GPUSamplerBindingLayout.h:
* Modules/WebGPU/GPUSamplerDescriptor.h:
* Modules/WebGPU/GPUStencilFaceState.h:
* Modules/WebGPU/GPUStorageTextureBindingLayout.h:
* Modules/WebGPU/GPUTextureBindingLayout.h:
* Modules/WebGPU/GPUTextureDescriptor.h:
* Modules/WebGPU/GPUTextureViewDescriptor.h:
* Modules/WebGPU/GPUVertexAttribute.h:
* Modules/WebGPU/GPUVertexBufferLayout.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (286402 => 286403)


--- trunk/Source/WebCore/ChangeLog	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/ChangeLog	2021-12-02 00:30:58 UTC (rev 286403)
@@ -1,3 +1,57 @@
+2021-12-01  Myles C. Maxfield  <[email protected]>
+
+        [WebGPU] Add default values to structs in WebCore/Modules/WebGPU
+        https://bugs.webkit.org/show_bug.cgi?id=233691
+
+        Reviewed by Alex Christensen.
+
+        Our bindings code expects that the structs backing dictionaries
+        have default values for their members.
+
+        No new tests because there is no behavior change.
+
+        * Modules/WebGPU/GPUBindGroupDescriptor.h:
+        * Modules/WebGPU/GPUBindGroupEntry.h:
+        * Modules/WebGPU/GPUBindGroupLayoutEntry.h:
+        * Modules/WebGPU/GPUBlendComponent.h:
+        * Modules/WebGPU/GPUBufferBinding.h:
+        * Modules/WebGPU/GPUBufferBindingLayout.h:
+        * Modules/WebGPU/GPUBufferDescriptor.h:
+        * Modules/WebGPU/GPUCanvasConfiguration.h:
+        * Modules/WebGPU/GPUColorDict.h:
+        * Modules/WebGPU/GPUColorTargetState.h:
+        * Modules/WebGPU/GPUComputePassTimestampWrite.h:
+        * Modules/WebGPU/GPUDepthStencilState.h:
+        * Modules/WebGPU/GPUExtent3DDict.h:
+        * Modules/WebGPU/GPUExternalTextureDescriptor.h:
+        * Modules/WebGPU/GPUImageCopyBuffer.h:
+        * Modules/WebGPU/GPUImageCopyTexture.h:
+        * Modules/WebGPU/GPUImageCopyTextureTagged.h:
+        * Modules/WebGPU/GPUImageDataLayout.h:
+        * Modules/WebGPU/GPUMultisampleState.h:
+        * Modules/WebGPU/GPUOrigin2DDict.h:
+        * Modules/WebGPU/GPUOrigin3DDict.h:
+        * Modules/WebGPU/GPUPipelineDescriptorBase.h:
+        * Modules/WebGPU/GPUPrimitiveState.h:
+        * Modules/WebGPU/GPUProgrammableStage.h:
+        * Modules/WebGPU/GPUQuerySetDescriptor.h:
+        * Modules/WebGPU/GPURenderBundleEncoderDescriptor.h:
+        * Modules/WebGPU/GPURenderPassColorAttachment.h:
+        * Modules/WebGPU/GPURenderPassDepthStencilAttachment.h:
+        * Modules/WebGPU/GPURenderPassDescriptor.h:
+        * Modules/WebGPU/GPURenderPassLayout.h:
+        * Modules/WebGPU/GPURenderPassTimestampWrite.h:
+        * Modules/WebGPU/GPURequestAdapterOptions.h:
+        * Modules/WebGPU/GPUSamplerBindingLayout.h:
+        * Modules/WebGPU/GPUSamplerDescriptor.h:
+        * Modules/WebGPU/GPUStencilFaceState.h:
+        * Modules/WebGPU/GPUStorageTextureBindingLayout.h:
+        * Modules/WebGPU/GPUTextureBindingLayout.h:
+        * Modules/WebGPU/GPUTextureDescriptor.h:
+        * Modules/WebGPU/GPUTextureViewDescriptor.h:
+        * Modules/WebGPU/GPUVertexAttribute.h:
+        * Modules/WebGPU/GPUVertexBufferLayout.h:
+
 2021-12-01  Alex Christensen  <[email protected]>
 
         Use Span instead of pointer/length in CompiledContentExtension

Modified: trunk/Source/WebCore/Modules/WebGPU/GPUBindGroupDescriptor.h (286402 => 286403)


--- trunk/Source/WebCore/Modules/WebGPU/GPUBindGroupDescriptor.h	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/Modules/WebGPU/GPUBindGroupDescriptor.h	2021-12-02 00:30:58 UTC (rev 286403)
@@ -46,7 +46,7 @@
         };
     }
 
-    GPUBindGroupLayout* layout;
+    GPUBindGroupLayout* layout { nullptr };
     Vector<GPUBindGroupEntry> entries;
 };
 

Modified: trunk/Source/WebCore/Modules/WebGPU/GPUBindGroupEntry.h (286402 => 286403)


--- trunk/Source/WebCore/Modules/WebGPU/GPUBindGroupEntry.h	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/Modules/WebGPU/GPUBindGroupEntry.h	2021-12-02 00:30:58 UTC (rev 286403)
@@ -63,7 +63,7 @@
         };
     }
 
-    GPUIndex32 binding;
+    GPUIndex32 binding { 0 };
     GPUBindingResource resource;
 };
 

Modified: trunk/Source/WebCore/Modules/WebGPU/GPUBindGroupLayoutEntry.h (286402 => 286403)


--- trunk/Source/WebCore/Modules/WebGPU/GPUBindGroupLayoutEntry.h	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/Modules/WebGPU/GPUBindGroupLayoutEntry.h	2021-12-02 00:30:58 UTC (rev 286403)
@@ -51,8 +51,8 @@
         };
     }
 
-    GPUIndex32 binding;
-    GPUShaderStageFlags visibility;
+    GPUIndex32 binding { 0 };
+    GPUShaderStageFlags visibility { 0 };
 
     std::optional<GPUBufferBindingLayout> buffer;
     std::optional<GPUSamplerBindingLayout> sampler;

Modified: trunk/Source/WebCore/Modules/WebGPU/GPUBlendComponent.h (286402 => 286403)


--- trunk/Source/WebCore/Modules/WebGPU/GPUBlendComponent.h	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/Modules/WebGPU/GPUBlendComponent.h	2021-12-02 00:30:58 UTC (rev 286403)
@@ -41,9 +41,9 @@
         };
     }
 
-    GPUBlendOperation operation;
-    GPUBlendFactor srcFactor;
-    GPUBlendFactor dstFactor;
+    GPUBlendOperation operation { GPUBlendOperation::Add };
+    GPUBlendFactor srcFactor { GPUBlendFactor::One };
+    GPUBlendFactor dstFactor { GPUBlendFactor::Zero };
 };
 
 }

Modified: trunk/Source/WebCore/Modules/WebGPU/GPUBufferBinding.h (286402 => 286403)


--- trunk/Source/WebCore/Modules/WebGPU/GPUBufferBinding.h	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/Modules/WebGPU/GPUBufferBinding.h	2021-12-02 00:30:58 UTC (rev 286403)
@@ -44,8 +44,8 @@
         };
     }
 
-    GPUBuffer* buffer;
-    GPUSize64 offset;
+    GPUBuffer* buffer { nullptr };
+    GPUSize64 offset { 0 };
     std::optional<GPUSize64> size;
 };
 

Modified: trunk/Source/WebCore/Modules/WebGPU/GPUBufferBindingLayout.h (286402 => 286403)


--- trunk/Source/WebCore/Modules/WebGPU/GPUBufferBindingLayout.h	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/Modules/WebGPU/GPUBufferBindingLayout.h	2021-12-02 00:30:58 UTC (rev 286403)
@@ -41,9 +41,9 @@
         };
     }
 
-    GPUBufferBindingType type;
-    bool hasDynamicOffset;
-    GPUSize64 minBindingSize;
+    GPUBufferBindingType type { GPUBufferBindingType::Uniform };
+    bool hasDynamicOffset { false };
+    GPUSize64 minBindingSize { 0 };
 };
 
 }

Modified: trunk/Source/WebCore/Modules/WebGPU/GPUBufferDescriptor.h (286402 => 286403)


--- trunk/Source/WebCore/Modules/WebGPU/GPUBufferDescriptor.h	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/Modules/WebGPU/GPUBufferDescriptor.h	2021-12-02 00:30:58 UTC (rev 286403)
@@ -43,9 +43,9 @@
         };
     }
 
-    GPUSize64 size;
-    GPUBufferUsageFlags usage;
-    bool mappedAtCreation;
+    GPUSize64 size { 0 };
+    GPUBufferUsageFlags usage { 0 };
+    bool mappedAtCreation { false };
 };
 
 }

Modified: trunk/Source/WebCore/Modules/WebGPU/GPUCanvasConfiguration.h (286402 => 286403)


--- trunk/Source/WebCore/Modules/WebGPU/GPUCanvasConfiguration.h	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/Modules/WebGPU/GPUCanvasConfiguration.h	2021-12-02 00:30:58 UTC (rev 286403)
@@ -52,11 +52,11 @@
         };
     }
 
-    GPUDevice* device;
-    GPUTextureFormat format;
-    GPUTextureUsageFlags usage; // GPUTextureUsage.RENDER_ATTACHMENT
-    GPUPredefinedColorSpace colorSpace;
-    GPUCanvasCompositingAlphaMode compositingAlphaMode;
+    GPUDevice* device { nullptr };
+    GPUTextureFormat format { GPUTextureFormat::R8unorm };
+    GPUTextureUsageFlags usage { GPUTextureUsage::RENDER_ATTACHMENT };
+    GPUPredefinedColorSpace colorSpace { GPUPredefinedColorSpace::SRGB };
+    GPUCanvasCompositingAlphaMode compositingAlphaMode { GPUCanvasCompositingAlphaMode::Opaque };
     std::optional<GPUExtent3D> size;
 };
 

Modified: trunk/Source/WebCore/Modules/WebGPU/GPUColorDict.h (286402 => 286403)


--- trunk/Source/WebCore/Modules/WebGPU/GPUColorDict.h	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/Modules/WebGPU/GPUColorDict.h	2021-12-02 00:30:58 UTC (rev 286403)
@@ -43,10 +43,10 @@
         };
     }
 
-    double r;
-    double g;
-    double b;
-    double a;
+    double r { 0 };
+    double g { 0 };
+    double b { 0 };
+    double a { 0 };
 };
 
 using GPUColor = std::variant<Vector<double>, GPUColorDict>;

Modified: trunk/Source/WebCore/Modules/WebGPU/GPUColorTargetState.h (286402 => 286403)


--- trunk/Source/WebCore/Modules/WebGPU/GPUColorTargetState.h	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/Modules/WebGPU/GPUColorTargetState.h	2021-12-02 00:30:58 UTC (rev 286403)
@@ -43,10 +43,10 @@
         };
     }
 
-    GPUTextureFormat format;
+    GPUTextureFormat format { GPUTextureFormat::R8unorm };
 
     std::optional<GPUBlendState> blend;
-    GPUColorWriteFlags writeMask;
+    GPUColorWriteFlags writeMask { GPUColorWrite::ALL };
 };
 
 }

Modified: trunk/Source/WebCore/Modules/WebGPU/GPUComputePassTimestampWrite.h (286402 => 286403)


--- trunk/Source/WebCore/Modules/WebGPU/GPUComputePassTimestampWrite.h	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/Modules/WebGPU/GPUComputePassTimestampWrite.h	2021-12-02 00:30:58 UTC (rev 286403)
@@ -45,9 +45,9 @@
         };
     }
 
-    GPUQuerySet* querySet;
-    GPUSize32 queryIndex;
-    GPUComputePassTimestampLocation location;
+    GPUQuerySet* querySet { nullptr };
+    GPUSize32 queryIndex { 0 };
+    GPUComputePassTimestampLocation location { GPUComputePassTimestampLocation::Beginning };
 };
 
 using GPUComputePassTimestampWrites = Vector<GPUComputePassTimestampWrite>;

Modified: trunk/Source/WebCore/Modules/WebGPU/GPUDepthStencilState.h (286402 => 286403)


--- trunk/Source/WebCore/Modules/WebGPU/GPUDepthStencilState.h	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/Modules/WebGPU/GPUDepthStencilState.h	2021-12-02 00:30:58 UTC (rev 286403)
@@ -51,10 +51,10 @@
         };
     }
 
-    GPUTextureFormat format;
+    GPUTextureFormat format { GPUTextureFormat::R8unorm };
 
-    bool depthWriteEnabled;
-    GPUCompareFunction depthCompare;
+    bool depthWriteEnabled { false };
+    GPUCompareFunction depthCompare { GPUCompareFunction::Always };
 
     GPUStencilFaceState stencilFront;
     GPUStencilFaceState stencilBack;
@@ -62,9 +62,9 @@
     std::optional<GPUStencilValue> stencilReadMask;
     std::optional<GPUStencilValue> stencilWriteMask;
 
-    GPUDepthBias depthBias;
-    float depthBiasSlopeScale;
-    float depthBiasClamp;
+    GPUDepthBias depthBias { 0 };
+    float depthBiasSlopeScale { 0 };
+    float depthBiasClamp { 0 };
 };
 
 }

Modified: trunk/Source/WebCore/Modules/WebGPU/GPUExtent3DDict.h (286402 => 286403)


--- trunk/Source/WebCore/Modules/WebGPU/GPUExtent3DDict.h	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/Modules/WebGPU/GPUExtent3DDict.h	2021-12-02 00:30:58 UTC (rev 286403)
@@ -42,9 +42,9 @@
         };
     }
 
-    GPUIntegerCoordinate width;
-    GPUIntegerCoordinate height;
-    GPUIntegerCoordinate depthOrArrayLayers;
+    GPUIntegerCoordinate width { 0 };
+    GPUIntegerCoordinate height { 0 };
+    GPUIntegerCoordinate depthOrArrayLayers { 0 };
 };
 
 using GPUExtent3D = std::variant<Vector<GPUIntegerCoordinate>, GPUExtent3DDict>;

Modified: trunk/Source/WebCore/Modules/WebGPU/GPUExternalTextureDescriptor.h (286402 => 286403)


--- trunk/Source/WebCore/Modules/WebGPU/GPUExternalTextureDescriptor.h	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/Modules/WebGPU/GPUExternalTextureDescriptor.h	2021-12-02 00:30:58 UTC (rev 286403)
@@ -45,8 +45,8 @@
         };
     }
 
-    HTMLVideoElement* source;
-    GPUPredefinedColorSpace colorSpace;
+    HTMLVideoElement* source { nullptr };
+    GPUPredefinedColorSpace colorSpace { GPUPredefinedColorSpace::SRGB };
 };
 
 }

Modified: trunk/Source/WebCore/Modules/WebGPU/GPUImageCopyBuffer.h (286402 => 286403)


--- trunk/Source/WebCore/Modules/WebGPU/GPUImageCopyBuffer.h	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/Modules/WebGPU/GPUImageCopyBuffer.h	2021-12-02 00:30:58 UTC (rev 286403)
@@ -46,7 +46,7 @@
         };
     }
 
-    GPUBuffer* buffer;
+    GPUBuffer* buffer { nullptr };
 };
 
 }

Modified: trunk/Source/WebCore/Modules/WebGPU/GPUImageCopyTexture.h (286402 => 286403)


--- trunk/Source/WebCore/Modules/WebGPU/GPUImageCopyTexture.h	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/Modules/WebGPU/GPUImageCopyTexture.h	2021-12-02 00:30:58 UTC (rev 286403)
@@ -47,10 +47,10 @@
         };
     }
 
-    GPUTexture* texture;
-    GPUIntegerCoordinate mipLevel;
+    GPUTexture* texture { nullptr };
+    GPUIntegerCoordinate mipLevel { 0 };
     std::optional<GPUOrigin3D> origin;
-    GPUTextureAspect aspect;
+    GPUTextureAspect aspect { GPUTextureAspect::All };
 };
 
 }

Modified: trunk/Source/WebCore/Modules/WebGPU/GPUImageCopyTextureTagged.h (286402 => 286403)


--- trunk/Source/WebCore/Modules/WebGPU/GPUImageCopyTextureTagged.h	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/Modules/WebGPU/GPUImageCopyTextureTagged.h	2021-12-02 00:30:58 UTC (rev 286403)
@@ -47,8 +47,8 @@
         };
     }
 
-    GPUPredefinedColorSpace colorSpace;
-    bool premultipliedAlpha;
+    GPUPredefinedColorSpace colorSpace { GPUPredefinedColorSpace::SRGB };
+    bool premultipliedAlpha { false };
 };
 
 }

Modified: trunk/Source/WebCore/Modules/WebGPU/GPUImageDataLayout.h (286402 => 286403)


--- trunk/Source/WebCore/Modules/WebGPU/GPUImageDataLayout.h	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/Modules/WebGPU/GPUImageDataLayout.h	2021-12-02 00:30:58 UTC (rev 286403)
@@ -41,7 +41,7 @@
         };
     }
 
-    GPUSize64 offset;
+    GPUSize64 offset { 0 };
     std::optional<GPUSize32> bytesPerRow;
     std::optional<GPUSize32> rowsPerImage;
 };

Modified: trunk/Source/WebCore/Modules/WebGPU/GPUMultisampleState.h (286402 => 286403)


--- trunk/Source/WebCore/Modules/WebGPU/GPUMultisampleState.h	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/Modules/WebGPU/GPUMultisampleState.h	2021-12-02 00:30:58 UTC (rev 286403)
@@ -40,9 +40,9 @@
         };
     }
 
-    GPUSize32 count;
-    GPUSampleMask mask;
-    bool alphaToCoverageEnabled;
+    GPUSize32 count { 1 };
+    GPUSampleMask mask { 0xFFFFFFFF };
+    bool alphaToCoverageEnabled { false };
 };
 
 }

Modified: trunk/Source/WebCore/Modules/WebGPU/GPUOrigin2DDict.h (286402 => 286403)


--- trunk/Source/WebCore/Modules/WebGPU/GPUOrigin2DDict.h	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/Modules/WebGPU/GPUOrigin2DDict.h	2021-12-02 00:30:58 UTC (rev 286403)
@@ -41,8 +41,8 @@
         };
     }
 
-    GPUIntegerCoordinate x;
-    GPUIntegerCoordinate y;
+    GPUIntegerCoordinate x { 0 };
+    GPUIntegerCoordinate y { 0 };
 };
 
 using GPUOrigin2D = std::variant<Vector<GPUIntegerCoordinate>, GPUOrigin2DDict>;

Modified: trunk/Source/WebCore/Modules/WebGPU/GPUOrigin3DDict.h (286402 => 286403)


--- trunk/Source/WebCore/Modules/WebGPU/GPUOrigin3DDict.h	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/Modules/WebGPU/GPUOrigin3DDict.h	2021-12-02 00:30:58 UTC (rev 286403)
@@ -42,9 +42,9 @@
         };
     }
 
-    GPUIntegerCoordinate x;
-    GPUIntegerCoordinate y;
-    GPUIntegerCoordinate z;
+    GPUIntegerCoordinate x { 0 };
+    GPUIntegerCoordinate y { 0 };
+    GPUIntegerCoordinate z { 0 };
 };
 
 using GPUOrigin3D = std::variant<Vector<GPUIntegerCoordinate>, GPUOrigin3DDict>;

Modified: trunk/Source/WebCore/Modules/WebGPU/GPUPipelineDescriptorBase.h (286402 => 286403)


--- trunk/Source/WebCore/Modules/WebGPU/GPUPipelineDescriptorBase.h	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/Modules/WebGPU/GPUPipelineDescriptorBase.h	2021-12-02 00:30:58 UTC (rev 286403)
@@ -40,7 +40,7 @@
         };
     }
 
-    GPUPipelineLayout* layout;
+    GPUPipelineLayout* layout { nullptr };
 };
 
 }

Modified: trunk/Source/WebCore/Modules/WebGPU/GPUPrimitiveState.h (286402 => 286403)


--- trunk/Source/WebCore/Modules/WebGPU/GPUPrimitiveState.h	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/Modules/WebGPU/GPUPrimitiveState.h	2021-12-02 00:30:58 UTC (rev 286403)
@@ -47,13 +47,13 @@
         };
     }
 
-    GPUPrimitiveTopology topology;
+    GPUPrimitiveTopology topology { GPUPrimitiveTopology::TriangleList };
     std::optional<GPUIndexFormat> stripIndexFormat;
-    GPUFrontFace frontFace;
-    GPUCullMode cullMode;
+    GPUFrontFace frontFace { GPUFrontFace::Ccw };
+    GPUCullMode cullMode { GPUCullMode::None };
 
     // Requires "depth-clip-control" feature.
-    bool unclippedDepth;
+    bool unclippedDepth { false };
 };
 
 }

Modified: trunk/Source/WebCore/Modules/WebGPU/GPUProgrammableStage.h (286402 => 286403)


--- trunk/Source/WebCore/Modules/WebGPU/GPUProgrammableStage.h	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/Modules/WebGPU/GPUProgrammableStage.h	2021-12-02 00:30:58 UTC (rev 286403)
@@ -46,7 +46,7 @@
         };
     }
 
-    GPUShaderModule* module;
+    GPUShaderModule* module { nullptr };
     String entryPoint;
     Vector<KeyValuePair<String, GPUPipelineConstantValue>> constants;
 };

Modified: trunk/Source/WebCore/Modules/WebGPU/GPUQuerySetDescriptor.h (286402 => 286403)


--- trunk/Source/WebCore/Modules/WebGPU/GPUQuerySetDescriptor.h	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/Modules/WebGPU/GPUQuerySetDescriptor.h	2021-12-02 00:30:58 UTC (rev 286403)
@@ -48,8 +48,8 @@
         };
     }
 
-    GPUQueryType type;
-    GPUSize32 count;
+    GPUQueryType type { GPUQueryType::Occlusion };
+    GPUSize32 count { 0 };
     Vector<GPUPipelineStatisticName> pipelineStatistics;
 };
 

Modified: trunk/Source/WebCore/Modules/WebGPU/GPURenderBundleEncoderDescriptor.h (286402 => 286403)


--- trunk/Source/WebCore/Modules/WebGPU/GPURenderBundleEncoderDescriptor.h	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/Modules/WebGPU/GPURenderBundleEncoderDescriptor.h	2021-12-02 00:30:58 UTC (rev 286403)
@@ -47,8 +47,8 @@
         };
     }
 
-    bool depthReadOnly;
-    bool stencilReadOnly;
+    bool depthReadOnly { false };
+    bool stencilReadOnly { false };
 };
 
 }

Modified: trunk/Source/WebCore/Modules/WebGPU/GPURenderPassColorAttachment.h (286402 => 286403)


--- trunk/Source/WebCore/Modules/WebGPU/GPURenderPassColorAttachment.h	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/Modules/WebGPU/GPURenderPassColorAttachment.h	2021-12-02 00:30:58 UTC (rev 286403)
@@ -54,11 +54,11 @@
         };
     }
 
-    GPUTextureView* view;
-    GPUTextureView* resolveTarget;
+    GPUTextureView* view { nullptr };
+    GPUTextureView* resolveTarget { nullptr };
 
     std::variant<GPULoadOp, Vector<double>, GPUColorDict> loadValue;
-    GPUStoreOp storeOp;
+    GPUStoreOp storeOp { GPUStoreOp::Store };
 };
 
 }

Modified: trunk/Source/WebCore/Modules/WebGPU/GPURenderPassDepthStencilAttachment.h (286402 => 286403)


--- trunk/Source/WebCore/Modules/WebGPU/GPURenderPassDepthStencilAttachment.h	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/Modules/WebGPU/GPURenderPassDepthStencilAttachment.h	2021-12-02 00:30:58 UTC (rev 286403)
@@ -58,15 +58,15 @@
         };
     }
 
-    GPUTextureView* view;
+    GPUTextureView* view { nullptr };
 
     std::variant<GPULoadOp, float> depthLoadValue;
-    GPUStoreOp depthStoreOp;
-    bool depthReadOnly;
+    GPUStoreOp depthStoreOp { GPUStoreOp::Store };
+    bool depthReadOnly { false };
 
     std::variant<GPULoadOp, GPUStencilValue> stencilLoadValue;
-    GPUStoreOp stencilStoreOp;
-    bool stencilReadOnly;
+    GPUStoreOp stencilStoreOp { GPUStoreOp::Store };
+    bool stencilReadOnly { false };
 };
 
 }

Modified: trunk/Source/WebCore/Modules/WebGPU/GPURenderPassDescriptor.h (286402 => 286403)


--- trunk/Source/WebCore/Modules/WebGPU/GPURenderPassDescriptor.h	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/Modules/WebGPU/GPURenderPassDescriptor.h	2021-12-02 00:30:58 UTC (rev 286403)
@@ -53,7 +53,7 @@
 
     Vector<GPURenderPassColorAttachment> colorAttachments;
     std::optional<GPURenderPassDepthStencilAttachment> depthStencilAttachment;
-    GPUQuerySet* occlusionQuerySet;
+    GPUQuerySet* occlusionQuerySet { nullptr };
     GPURenderPassTimestampWrites timestampWrites;
 };
 

Modified: trunk/Source/WebCore/Modules/WebGPU/GPURenderPassLayout.h (286402 => 286403)


--- trunk/Source/WebCore/Modules/WebGPU/GPURenderPassLayout.h	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/Modules/WebGPU/GPURenderPassLayout.h	2021-12-02 00:30:58 UTC (rev 286403)
@@ -49,7 +49,7 @@
 
     Vector<GPUTextureFormat> colorFormats;
     std::optional<GPUTextureFormat> depthStencilFormat;
-    GPUSize32 sampleCount;
+    GPUSize32 sampleCount { 1 };
 };
 
 }

Modified: trunk/Source/WebCore/Modules/WebGPU/GPURenderPassTimestampWrite.h (286402 => 286403)


--- trunk/Source/WebCore/Modules/WebGPU/GPURenderPassTimestampWrite.h	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/Modules/WebGPU/GPURenderPassTimestampWrite.h	2021-12-02 00:30:58 UTC (rev 286403)
@@ -45,9 +45,9 @@
         };
     }
 
-    GPUQuerySet* querySet;
-    GPUSize32 queryIndex;
-    GPURenderPassTimestampLocation location;
+    GPUQuerySet* querySet { nullptr };
+    GPUSize32 queryIndex { 0 };
+    GPURenderPassTimestampLocation location { GPURenderPassTimestampLocation::Beginning };
 };
 
 using GPURenderPassTimestampWrites = Vector<GPURenderPassTimestampWrite>;

Modified: trunk/Source/WebCore/Modules/WebGPU/GPURequestAdapterOptions.h (286402 => 286403)


--- trunk/Source/WebCore/Modules/WebGPU/GPURequestAdapterOptions.h	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/Modules/WebGPU/GPURequestAdapterOptions.h	2021-12-02 00:30:58 UTC (rev 286403)
@@ -41,7 +41,7 @@
     }
 
     std::optional<GPUPowerPreference> powerPreference;
-    bool forceFallbackAdapter;
+    bool forceFallbackAdapter { false };
 };
 
 }

Modified: trunk/Source/WebCore/Modules/WebGPU/GPUSamplerBindingLayout.h (286402 => 286403)


--- trunk/Source/WebCore/Modules/WebGPU/GPUSamplerBindingLayout.h	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/Modules/WebGPU/GPUSamplerBindingLayout.h	2021-12-02 00:30:58 UTC (rev 286403)
@@ -38,7 +38,7 @@
         };
     }
 
-    GPUSamplerBindingType type;
+    GPUSamplerBindingType type { GPUSamplerBindingType::Filtering };
 };
 
 }

Modified: trunk/Source/WebCore/Modules/WebGPU/GPUSamplerDescriptor.h (286402 => 286403)


--- trunk/Source/WebCore/Modules/WebGPU/GPUSamplerDescriptor.h	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/Modules/WebGPU/GPUSamplerDescriptor.h	2021-12-02 00:30:58 UTC (rev 286403)
@@ -53,16 +53,16 @@
         };
     }
 
-    GPUAddressMode addressModeU;
-    GPUAddressMode addressModeV;
-    GPUAddressMode addressModeW;
-    GPUFilterMode magFilter;
-    GPUFilterMode minFilter;
-    GPUFilterMode mipmapFilter;
-    float lodMinClamp;
-    float lodMaxClamp;
+    GPUAddressMode addressModeU { GPUAddressMode::ClampToEdge };
+    GPUAddressMode addressModeV { GPUAddressMode::ClampToEdge };
+    GPUAddressMode addressModeW { GPUAddressMode::ClampToEdge };
+    GPUFilterMode magFilter { GPUFilterMode::Nearest };
+    GPUFilterMode minFilter { GPUFilterMode::Nearest };
+    GPUFilterMode mipmapFilter { GPUFilterMode::Nearest };
+    float lodMinClamp { 0 };
+    float lodMaxClamp { 32 };
     std::optional<GPUCompareFunction> compare;
-    uint16_t maxAnisotropy;
+    uint16_t maxAnisotropy { 1 };
 };
 
 }

Modified: trunk/Source/WebCore/Modules/WebGPU/GPUStencilFaceState.h (286402 => 286403)


--- trunk/Source/WebCore/Modules/WebGPU/GPUStencilFaceState.h	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/Modules/WebGPU/GPUStencilFaceState.h	2021-12-02 00:30:58 UTC (rev 286403)
@@ -42,10 +42,10 @@
         };
     }
 
-    GPUCompareFunction compare;
-    GPUStencilOperation failOp;
-    GPUStencilOperation depthFailOp;
-    GPUStencilOperation passOp;
+    GPUCompareFunction compare { GPUCompareFunction::Always };
+    GPUStencilOperation failOp { GPUStencilOperation::Keep };
+    GPUStencilOperation depthFailOp { GPUStencilOperation::Keep };
+    GPUStencilOperation passOp { GPUStencilOperation::Keep };
 };
 
 }

Modified: trunk/Source/WebCore/Modules/WebGPU/GPUStorageTextureBindingLayout.h (286402 => 286403)


--- trunk/Source/WebCore/Modules/WebGPU/GPUStorageTextureBindingLayout.h	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/Modules/WebGPU/GPUStorageTextureBindingLayout.h	2021-12-02 00:30:58 UTC (rev 286403)
@@ -42,9 +42,9 @@
         };
     }
 
-    GPUStorageTextureAccess access;
-    GPUTextureFormat format;
-    GPUTextureViewDimension viewDimension;
+    GPUStorageTextureAccess access { GPUStorageTextureAccess::WriteOnly };
+    GPUTextureFormat format { GPUTextureFormat::R8unorm };
+    GPUTextureViewDimension viewDimension { GPUTextureViewDimension::_2d };
 };
 
 }

Modified: trunk/Source/WebCore/Modules/WebGPU/GPUTextureBindingLayout.h (286402 => 286403)


--- trunk/Source/WebCore/Modules/WebGPU/GPUTextureBindingLayout.h	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/Modules/WebGPU/GPUTextureBindingLayout.h	2021-12-02 00:30:58 UTC (rev 286403)
@@ -41,9 +41,9 @@
         };
     }
 
-    GPUTextureSampleType sampleType;
-    GPUTextureViewDimension viewDimension;
-    bool multisampled;
+    GPUTextureSampleType sampleType { GPUTextureSampleType::Float };
+    GPUTextureViewDimension viewDimension { GPUTextureViewDimension::_2d };
+    bool multisampled { false };
 };
 
 }

Modified: trunk/Source/WebCore/Modules/WebGPU/GPUTextureDescriptor.h (286402 => 286403)


--- trunk/Source/WebCore/Modules/WebGPU/GPUTextureDescriptor.h	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/Modules/WebGPU/GPUTextureDescriptor.h	2021-12-02 00:30:58 UTC (rev 286403)
@@ -50,11 +50,11 @@
     }
 
     GPUExtent3D size;
-    GPUIntegerCoordinate mipLevelCount;
-    GPUSize32 sampleCount;
-    GPUTextureDimension dimension;
-    GPUTextureFormat format;
-    GPUTextureUsageFlags usage;
+    GPUIntegerCoordinate mipLevelCount { 1 };
+    GPUSize32 sampleCount { 1 };
+    GPUTextureDimension dimension { GPUTextureDimension::_2d };
+    GPUTextureFormat format { GPUTextureFormat::R8unorm };
+    GPUTextureUsageFlags usage { 0 };
 };
 
 }

Modified: trunk/Source/WebCore/Modules/WebGPU/GPUTextureViewDescriptor.h (286402 => 286403)


--- trunk/Source/WebCore/Modules/WebGPU/GPUTextureViewDescriptor.h	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/Modules/WebGPU/GPUTextureViewDescriptor.h	2021-12-02 00:30:58 UTC (rev 286403)
@@ -52,10 +52,10 @@
 
     std::optional<GPUTextureFormat> format;
     std::optional<GPUTextureViewDimension> dimension;
-    GPUTextureAspect aspect;
-    GPUIntegerCoordinate baseMipLevel;
+    GPUTextureAspect aspect { GPUTextureAspect::All };
+    GPUIntegerCoordinate baseMipLevel { 0 };
     std::optional<GPUIntegerCoordinate> mipLevelCount;
-    GPUIntegerCoordinate baseArrayLayer;
+    GPUIntegerCoordinate baseArrayLayer { 0 };
     std::optional<GPUIntegerCoordinate> arrayLayerCount;
 };
 

Modified: trunk/Source/WebCore/Modules/WebGPU/GPUVertexAttribute.h (286402 => 286403)


--- trunk/Source/WebCore/Modules/WebGPU/GPUVertexAttribute.h	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/Modules/WebGPU/GPUVertexAttribute.h	2021-12-02 00:30:58 UTC (rev 286403)
@@ -41,10 +41,10 @@
         };
     }
 
-    GPUVertexFormat format;
-    GPUSize64 offset;
+    GPUVertexFormat format { GPUVertexFormat::Uint8x2 };
+    GPUSize64 offset { 0 };
 
-    GPUIndex32 shaderLocation;
+    GPUIndex32 shaderLocation { 0 };
 };
 
 }

Modified: trunk/Source/WebCore/Modules/WebGPU/GPUVertexBufferLayout.h (286402 => 286403)


--- trunk/Source/WebCore/Modules/WebGPU/GPUVertexBufferLayout.h	2021-12-02 00:29:17 UTC (rev 286402)
+++ trunk/Source/WebCore/Modules/WebGPU/GPUVertexBufferLayout.h	2021-12-02 00:30:58 UTC (rev 286403)
@@ -45,8 +45,8 @@
         };
     }
 
-    GPUSize64 arrayStride;
-    GPUVertexStepMode stepMode;
+    GPUSize64 arrayStride { 0 };
+    GPUVertexStepMode stepMode { GPUVertexStepMode::Vertex };
     Vector<GPUVertexAttribute> attributes;
 };
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to