Skip to content

Commit

Permalink
Solve the bug: filament error: first argument in call to 'memcpy' is …
Browse files Browse the repository at this point in the history
…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));
  • Loading branch information
jiapei100 authored and pixelflinger committed Dec 18, 2024
1 parent 8724995 commit 32abd9e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion filament/src/ds/DescriptorSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 32abd9e

Please sign in to comment.