From 32abd9ea9079dfe9f429d95a6080551f08a2141f Mon Sep 17 00:00:00 2001 From: Pei Jia Date: Tue, 17 Dec 2024 20:53:50 -0800 Subject: [PATCH] Solve the bug: filament error: first argument in call to 'memcpy' is a pointer to non-trivially copyable type 'value_type' (aka 'filament::DescriptorSet::Desc') [-Werror,-Wnontrivial-memcall] 152 | memcpy(set.mDescriptors.data(), mDescriptors.data(), mDescriptors.size() * sizeof(Desc)); --- filament/src/ds/DescriptorSet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filament/src/ds/DescriptorSet.cpp b/filament/src/ds/DescriptorSet.cpp index 9d41b20a33f6..caa433ad46ca 100644 --- a/filament/src/ds/DescriptorSet.cpp +++ b/filament/src/ds/DescriptorSet.cpp @@ -149,7 +149,7 @@ void DescriptorSet::setSampler( DescriptorSet DescriptorSet::duplicate(DescriptorSetLayout const& layout) const noexcept { DescriptorSet set{layout}; - memcpy(set.mDescriptors.data(), mDescriptors.data(), mDescriptors.size() * sizeof(Desc)); + set.mDescriptors = mDescriptors; // Use the vector's assignment operator set.mDirty = mDirty; set.mValid = mValid; return set;