Revert "[chromium-style] Adding constructors and destructors."

This reverts commit efab8c894e.

Reason for revert: breaks check_static_initializers check in Chromium
https://chromium-review.googlesource.com/c/chromium/src/+/3636809/
due to the line `static Format kUnusedFormat;` in Texture.cpp.

Error: file "Texture.cpp" is not expected to have static initializers in binary "chrome"

# Static initializers in chrome:
# 000101 _Unwind_Resume@plt
# 000101 guard variable for std::__1::ios_base::Init::Init()::init_the_streams
# 000101 std::__1::DoIOSInit::DoIOSInit()
# 000101 std::__1::DoIOSInit::~DoIOSInit()
# 000101 std::__1::ios_base::Init::Init()::init_the_streams
# 000101 __cxa_atexit@plt [registers a dtor to run at exit]
# 000101 __cxa_guard_abort
# 000101 __cxa_guard_acquire
# 000101 __cxa_guard_release
# 000101 __dso_handle
# InstrProfilingRuntime.cpp __llvm_profile_initialize
# Texture.cpp dawn::native::Format::Format()
# Texture.cpp dawn::native::kUnusedFormat
# Texture.cpp __dtor__ZN4dawn6nativeL13kUnusedFormatE
# Texture.cpp atexit
# iostream.cpp: (empty initializer list)
# Found 15 static initializers in 4 files.


Original change's description:
> [chromium-style] Adding constructors and destructors.
>
> This CL adds missing constructors and destructors.
>
> Bug: dawn:1405
> Change-Id: I0a0ea7ca50643d48cfc4a4dcf4ce46ff37ed10ad
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89200
> Reviewed-by: Austin Eng <enga@chromium.org>
> Kokoro: Kokoro <noreply+kokoro@google.com>
> Commit-Queue: Dan Sinclair <dsinclair@chromium.org>

TBR=enga@chromium.org,dsinclair@chromium.org,bclayton@google.com,noreply+kokoro@google.com,dawn-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: I86daffc227c2411e8c2c69cc4683224320f4480c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: dawn:1405
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89702
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
This commit is contained in:
Kai Ninomiya 2022-05-10 23:32:44 +00:00 committed by Dawn LUCI CQ
parent 824e824709
commit 63cea3f8c0
6 changed files with 0 additions and 172 deletions

View File

@ -39,9 +39,6 @@ class AdapterBase;
// An optional parameter of Adapter::CreateDevice() to send additional information when creating // An optional parameter of Adapter::CreateDevice() to send additional information when creating
// a Device. For example, we can use it to enable a workaround, optimization or feature. // a Device. For example, we can use it to enable a workaround, optimization or feature.
struct DAWN_NATIVE_EXPORT DawnDeviceDescriptor { struct DAWN_NATIVE_EXPORT DawnDeviceDescriptor {
DawnDeviceDescriptor();
~DawnDeviceDescriptor();
std::vector<const char*> requiredFeatures; std::vector<const char*> requiredFeatures;
std::vector<const char*> forceEnabledToggles; std::vector<const char*> forceEnabledToggles;
std::vector<const char*> forceDisabledToggles; std::vector<const char*> forceDisabledToggles;

View File

@ -361,76 +361,4 @@ void SkipCommand(CommandIterator* commands, Command type) {
} }
} }
TimestampWrite::TimestampWrite(const Ref<QuerySetBase>& set, uint32_t idx)
: querySet(set), queryIndex(idx) {}
TimestampWrite::TimestampWrite(TimestampWrite&&) = default;
TimestampWrite::~TimestampWrite() = default;
BeginComputePassCmd::BeginComputePassCmd() = default;
BeginComputePassCmd::~BeginComputePassCmd() = default;
BeginOcclusionQueryCmd::BeginOcclusionQueryCmd() = default;
BeginOcclusionQueryCmd::~BeginOcclusionQueryCmd() = default;
RenderPassColorAttachmentInfo::RenderPassColorAttachmentInfo() = default;
RenderPassColorAttachmentInfo::~RenderPassColorAttachmentInfo() = default;
RenderPassDepthStencilAttachmentInfo::RenderPassDepthStencilAttachmentInfo() = default;
RenderPassDepthStencilAttachmentInfo::~RenderPassDepthStencilAttachmentInfo() = default;
BeginRenderPassCmd::BeginRenderPassCmd() = default;
BeginRenderPassCmd::~BeginRenderPassCmd() = default;
BufferCopy::BufferCopy() = default;
BufferCopy::~BufferCopy() = default;
TextureCopy::TextureCopy() = default;
TextureCopy::TextureCopy(const TextureCopy&) = default;
TextureCopy::~TextureCopy() = default;
CopyBufferToBufferCmd::CopyBufferToBufferCmd() = default;
CopyBufferToBufferCmd::~CopyBufferToBufferCmd() = default;
DispatchIndirectCmd::DispatchIndirectCmd() = default;
DispatchIndirectCmd::~DispatchIndirectCmd() = default;
DrawIndirectCmd::DrawIndirectCmd() = default;
DrawIndirectCmd::~DrawIndirectCmd() = default;
EndComputePassCmd::EndComputePassCmd() = default;
EndComputePassCmd::~EndComputePassCmd() = default;
EndOcclusionQueryCmd::EndOcclusionQueryCmd() = default;
EndOcclusionQueryCmd::~EndOcclusionQueryCmd() = default;
EndRenderPassCmd::EndRenderPassCmd() = default;
EndRenderPassCmd::~EndRenderPassCmd() = default;
ClearBufferCmd::ClearBufferCmd() = default;
ClearBufferCmd::~ClearBufferCmd() = default;
ResolveQuerySetCmd::ResolveQuerySetCmd() = default;
ResolveQuerySetCmd::~ResolveQuerySetCmd() = default;
SetComputePipelineCmd::SetComputePipelineCmd() = default;
SetComputePipelineCmd::~SetComputePipelineCmd() = default;
SetRenderPipelineCmd::SetRenderPipelineCmd() = default;
SetRenderPipelineCmd::~SetRenderPipelineCmd() = default;
SetBindGroupCmd::SetBindGroupCmd() = default;
SetBindGroupCmd::~SetBindGroupCmd() = default;
SetIndexBufferCmd::SetIndexBufferCmd() = default;
SetIndexBufferCmd::~SetIndexBufferCmd() = default;
SetVertexBufferCmd::SetVertexBufferCmd() = default;
SetVertexBufferCmd::~SetVertexBufferCmd() = default;
WriteBufferCmd::WriteBufferCmd() = default;
WriteBufferCmd::~WriteBufferCmd() = default;
WriteTimestampCmd::WriteTimestampCmd() = default;
WriteTimestampCmd::~WriteTimestampCmd() = default;
} // namespace dawn::native } // namespace dawn::native

View File

@ -70,33 +70,20 @@ enum class Command {
}; };
struct TimestampWrite { struct TimestampWrite {
TimestampWrite(const Ref<QuerySetBase>& set, uint32_t idx);
TimestampWrite(TimestampWrite&&);
~TimestampWrite();
Ref<QuerySetBase> querySet; Ref<QuerySetBase> querySet;
uint32_t queryIndex; uint32_t queryIndex;
}; };
struct BeginComputePassCmd { struct BeginComputePassCmd {
BeginComputePassCmd();
~BeginComputePassCmd();
std::vector<TimestampWrite> timestampWrites; std::vector<TimestampWrite> timestampWrites;
}; };
struct BeginOcclusionQueryCmd { struct BeginOcclusionQueryCmd {
BeginOcclusionQueryCmd();
~BeginOcclusionQueryCmd();
Ref<QuerySetBase> querySet; Ref<QuerySetBase> querySet;
uint32_t queryIndex; uint32_t queryIndex;
}; };
struct RenderPassColorAttachmentInfo { struct RenderPassColorAttachmentInfo {
RenderPassColorAttachmentInfo();
~RenderPassColorAttachmentInfo();
Ref<TextureViewBase> view; Ref<TextureViewBase> view;
Ref<TextureViewBase> resolveTarget; Ref<TextureViewBase> resolveTarget;
wgpu::LoadOp loadOp; wgpu::LoadOp loadOp;
@ -105,9 +92,6 @@ struct RenderPassColorAttachmentInfo {
}; };
struct RenderPassDepthStencilAttachmentInfo { struct RenderPassDepthStencilAttachmentInfo {
RenderPassDepthStencilAttachmentInfo();
~RenderPassDepthStencilAttachmentInfo();
Ref<TextureViewBase> view; Ref<TextureViewBase> view;
wgpu::LoadOp depthLoadOp; wgpu::LoadOp depthLoadOp;
wgpu::StoreOp depthStoreOp; wgpu::StoreOp depthStoreOp;
@ -120,9 +104,6 @@ struct RenderPassDepthStencilAttachmentInfo {
}; };
struct BeginRenderPassCmd { struct BeginRenderPassCmd {
BeginRenderPassCmd();
~BeginRenderPassCmd();
Ref<AttachmentState> attachmentState; Ref<AttachmentState> attachmentState;
ityp::array<ColorAttachmentIndex, RenderPassColorAttachmentInfo, kMaxColorAttachments> ityp::array<ColorAttachmentIndex, RenderPassColorAttachmentInfo, kMaxColorAttachments>
colorAttachments; colorAttachments;
@ -137,9 +118,6 @@ struct BeginRenderPassCmd {
}; };
struct BufferCopy { struct BufferCopy {
BufferCopy();
~BufferCopy();
Ref<BufferBase> buffer; Ref<BufferBase> buffer;
uint64_t offset; uint64_t offset;
uint32_t bytesPerRow; uint32_t bytesPerRow;
@ -147,10 +125,6 @@ struct BufferCopy {
}; };
struct TextureCopy { struct TextureCopy {
TextureCopy();
TextureCopy(const TextureCopy&);
~TextureCopy();
Ref<TextureBase> texture; Ref<TextureBase> texture;
uint32_t mipLevel; uint32_t mipLevel;
Origin3D origin; // Texels / array layer Origin3D origin; // Texels / array layer
@ -158,9 +132,6 @@ struct TextureCopy {
}; };
struct CopyBufferToBufferCmd { struct CopyBufferToBufferCmd {
CopyBufferToBufferCmd();
~CopyBufferToBufferCmd();
Ref<BufferBase> source; Ref<BufferBase> source;
uint64_t sourceOffset; uint64_t sourceOffset;
Ref<BufferBase> destination; Ref<BufferBase> destination;
@ -193,9 +164,6 @@ struct DispatchCmd {
}; };
struct DispatchIndirectCmd { struct DispatchIndirectCmd {
DispatchIndirectCmd();
~DispatchIndirectCmd();
Ref<BufferBase> indirectBuffer; Ref<BufferBase> indirectBuffer;
uint64_t indirectOffset; uint64_t indirectOffset;
}; };
@ -216,9 +184,6 @@ struct DrawIndexedCmd {
}; };
struct DrawIndirectCmd { struct DrawIndirectCmd {
DrawIndirectCmd();
~DrawIndirectCmd();
Ref<BufferBase> indirectBuffer; Ref<BufferBase> indirectBuffer;
uint64_t indirectOffset; uint64_t indirectOffset;
}; };
@ -226,24 +191,15 @@ struct DrawIndirectCmd {
struct DrawIndexedIndirectCmd : DrawIndirectCmd {}; struct DrawIndexedIndirectCmd : DrawIndirectCmd {};
struct EndComputePassCmd { struct EndComputePassCmd {
EndComputePassCmd();
~EndComputePassCmd();
std::vector<TimestampWrite> timestampWrites; std::vector<TimestampWrite> timestampWrites;
}; };
struct EndOcclusionQueryCmd { struct EndOcclusionQueryCmd {
EndOcclusionQueryCmd();
~EndOcclusionQueryCmd();
Ref<QuerySetBase> querySet; Ref<QuerySetBase> querySet;
uint32_t queryIndex; uint32_t queryIndex;
}; };
struct EndRenderPassCmd { struct EndRenderPassCmd {
EndRenderPassCmd();
~EndRenderPassCmd();
std::vector<TimestampWrite> timestampWrites; std::vector<TimestampWrite> timestampWrites;
}; };
@ -252,9 +208,6 @@ struct ExecuteBundlesCmd {
}; };
struct ClearBufferCmd { struct ClearBufferCmd {
ClearBufferCmd();
~ClearBufferCmd();
Ref<BufferBase> buffer; Ref<BufferBase> buffer;
uint64_t offset; uint64_t offset;
uint64_t size; uint64_t size;
@ -271,9 +224,6 @@ struct PushDebugGroupCmd {
}; };
struct ResolveQuerySetCmd { struct ResolveQuerySetCmd {
ResolveQuerySetCmd();
~ResolveQuerySetCmd();
Ref<QuerySetBase> querySet; Ref<QuerySetBase> querySet;
uint32_t firstQuery; uint32_t firstQuery;
uint32_t queryCount; uint32_t queryCount;
@ -282,16 +232,10 @@ struct ResolveQuerySetCmd {
}; };
struct SetComputePipelineCmd { struct SetComputePipelineCmd {
SetComputePipelineCmd();
~SetComputePipelineCmd();
Ref<ComputePipelineBase> pipeline; Ref<ComputePipelineBase> pipeline;
}; };
struct SetRenderPipelineCmd { struct SetRenderPipelineCmd {
SetRenderPipelineCmd();
~SetRenderPipelineCmd();
Ref<RenderPipelineBase> pipeline; Ref<RenderPipelineBase> pipeline;
}; };
@ -312,18 +256,12 @@ struct SetBlendConstantCmd {
}; };
struct SetBindGroupCmd { struct SetBindGroupCmd {
SetBindGroupCmd();
~SetBindGroupCmd();
BindGroupIndex index; BindGroupIndex index;
Ref<BindGroupBase> group; Ref<BindGroupBase> group;
uint32_t dynamicOffsetCount; uint32_t dynamicOffsetCount;
}; };
struct SetIndexBufferCmd { struct SetIndexBufferCmd {
SetIndexBufferCmd();
~SetIndexBufferCmd();
Ref<BufferBase> buffer; Ref<BufferBase> buffer;
wgpu::IndexFormat format; wgpu::IndexFormat format;
uint64_t offset; uint64_t offset;
@ -331,9 +269,6 @@ struct SetIndexBufferCmd {
}; };
struct SetVertexBufferCmd { struct SetVertexBufferCmd {
SetVertexBufferCmd();
~SetVertexBufferCmd();
VertexBufferSlot slot; VertexBufferSlot slot;
Ref<BufferBase> buffer; Ref<BufferBase> buffer;
uint64_t offset; uint64_t offset;
@ -341,18 +276,12 @@ struct SetVertexBufferCmd {
}; };
struct WriteBufferCmd { struct WriteBufferCmd {
WriteBufferCmd();
~WriteBufferCmd();
Ref<BufferBase> buffer; Ref<BufferBase> buffer;
uint64_t offset; uint64_t offset;
uint64_t size; uint64_t size;
}; };
struct WriteTimestampCmd { struct WriteTimestampCmd {
WriteTimestampCmd();
~WriteTimestampCmd();
Ref<QuerySetBase> querySet; Ref<QuerySetBase> querySet;
uint32_t queryIndex; uint32_t queryIndex;
}; };

View File

@ -70,12 +70,6 @@ std::vector<const char*> GetTogglesUsed(WGPUDevice device) {
return FromAPI(device)->GetTogglesUsed(); return FromAPI(device)->GetTogglesUsed();
} }
// DawnDeviceDescriptor
DawnDeviceDescriptor::DawnDeviceDescriptor() = default;
DawnDeviceDescriptor::~DawnDeviceDescriptor() = default;
// Adapter // Adapter
Adapter::Adapter() = default; Adapter::Adapter() = default;

View File

@ -79,18 +79,6 @@ SampleTypeBit SampleTypeToSampleTypeBit(wgpu::TextureSampleType sampleType) {
return static_cast<SampleTypeBit>(1 << (static_cast<uint32_t>(sampleType) - 1)); return static_cast<SampleTypeBit>(1 << (static_cast<uint32_t>(sampleType) - 1));
} }
Format::Format() = default;
Format::Format(const Format&) = default;
Format::Format(Format&&) = default;
Format::~Format() = default;
Format& Format::operator=(const Format&) = default;
Format& Format::operator=(Format&&) = default;
bool Format::IsColor() const { bool Format::IsColor() const {
return aspects == Aspect::Color; return aspects == Aspect::Color;
} }

View File

@ -88,14 +88,6 @@ using FormatTable = ityp::array<FormatIndex, Format, kKnownFormatCount>;
// A wgpu::TextureFormat along with all the information about it necessary for validation. // A wgpu::TextureFormat along with all the information about it necessary for validation.
struct Format { struct Format {
Format();
Format(const Format&);
Format(Format&&);
~Format();
Format& operator=(const Format&);
Format& operator=(Format&&);
wgpu::TextureFormat format; wgpu::TextureFormat format;
// TODO(crbug.com/dawn/1332): These members could be stored in a Format capability matrix. // TODO(crbug.com/dawn/1332): These members could be stored in a Format capability matrix.