diff --git a/generator/templates/dawn_wire/WireCmd.cpp b/generator/templates/dawn_wire/WireCmd.cpp index 653d79b7c8..46a3d310ca 100644 --- a/generator/templates/dawn_wire/WireCmd.cpp +++ b/generator/templates/dawn_wire/WireCmd.cpp @@ -425,9 +425,16 @@ namespace dawn_wire { ObjectHandle::ObjectHandle(ObjectId id, ObjectGeneration generation) : id(id), generation(generation) { } + ObjectHandle::ObjectHandle(const volatile ObjectHandle& rhs) : id(rhs.id), generation(rhs.generation) { } + ObjectHandle& ObjectHandle::operator=(const volatile ObjectHandle& rhs) { + id = rhs.id; + generation = rhs.generation; + return *this; + } + ObjectHandle& ObjectHandle::AssignFrom(const ObjectHandle& rhs) { id = rhs.id; generation = rhs.generation; diff --git a/generator/templates/dawn_wire/WireCmd.h b/generator/templates/dawn_wire/WireCmd.h index b54f5de5ce..cdc146abc0 100644 --- a/generator/templates/dawn_wire/WireCmd.h +++ b/generator/templates/dawn_wire/WireCmd.h @@ -27,7 +27,9 @@ namespace dawn_wire { ObjectHandle(); ObjectHandle(ObjectId id, ObjectGeneration generation); + ObjectHandle(const volatile ObjectHandle& rhs); + ObjectHandle& operator=(const volatile ObjectHandle& rhs); // MSVC has a bug where it thinks the volatile copy assignment is a duplicate. // Workaround this by forwarding to a different function AssignFrom. diff --git a/src/common/BUILD.gn b/src/common/BUILD.gn index 61cadaa86f..cbf27c562d 100644 --- a/src/common/BUILD.gn +++ b/src/common/BUILD.gn @@ -90,16 +90,19 @@ config("dawn_internal") { # Enable more warnings that were found when using Dawn in other projects if (is_clang) { cflags = [ - "-Wstrict-prototypes", - "-Winconsistent-missing-destructor-override", - "-Wshadow-field", - "-Wmissing-field-initializers", - "-Wcstring-format-directive", - "-Wtautological-unsigned-zero-compare", - "-Wreturn-std-move-in-c++11", "-Wconditional-uninitialized", + "-Wcstring-format-directive", "-Wc++11-narrowing", + "-Wdeprecated-copy", "-Wextra-semi-stmt", + "-Winconsistent-missing-destructor-override", + "-Winvalid-offsetof", + "-Wmissing-field-initializers", + "-Wpessimizing-move", + "-Wreturn-std-move-in-c++11", + "-Wshadow-field", + "-Wstrict-prototypes", + "-Wtautological-unsigned-zero-compare", ] } } diff --git a/src/utils/WGPUHelpers.cpp b/src/utils/WGPUHelpers.cpp index b2bf22347c..ef8d977676 100644 --- a/src/utils/WGPUHelpers.cpp +++ b/src/utils/WGPUHelpers.cpp @@ -176,6 +176,10 @@ namespace utils { } } + ComboRenderPassDescriptor::ComboRenderPassDescriptor(const ComboRenderPassDescriptor& other) { + *this = other; + } + const ComboRenderPassDescriptor& ComboRenderPassDescriptor::operator=( const ComboRenderPassDescriptor& otherRenderPass) { cDepthStencilAttachmentInfo = otherRenderPass.cDepthStencilAttachmentInfo; diff --git a/src/utils/WGPUHelpers.h b/src/utils/WGPUHelpers.h index b8c48fb882..ccebc77f30 100644 --- a/src/utils/WGPUHelpers.h +++ b/src/utils/WGPUHelpers.h @@ -59,6 +59,8 @@ namespace utils { public: ComboRenderPassDescriptor(std::initializer_list colorAttachmentInfo, wgpu::TextureView depthStencil = wgpu::TextureView()); + + ComboRenderPassDescriptor(const ComboRenderPassDescriptor& otherRenderPass); const ComboRenderPassDescriptor& operator=( const ComboRenderPassDescriptor& otherRenderPass);