diff --git a/src/VkBootstrap.cpp b/src/VkBootstrap.cpp index 1ca06ae..5b166d9 100644 --- a/src/VkBootstrap.cpp +++ b/src/VkBootstrap.cpp @@ -37,7 +37,7 @@ namespace vkb { namespace detail { GenericFeaturesPNextNode::GenericFeaturesPNextNode() { - memset(this, UINT8_MAX, sizeof(GenericFeaturesPNextNode)); + memset(fields, UINT8_MAX, sizeof(VkBool32) * field_capacity); } bool GenericFeaturesPNextNode::match( diff --git a/src/VkBootstrap.h b/src/VkBootstrap.h index 20fefbc..654ba9c 100644 --- a/src/VkBootstrap.h +++ b/src/VkBootstrap.h @@ -120,10 +120,12 @@ template class Result { struct GenericFeaturesPNextNode { + static const uint32_t field_capacity = 256; + GenericFeaturesPNextNode(); template GenericFeaturesPNextNode(T const& features) noexcept { - memset(this, UINT8_MAX, sizeof(GenericFeaturesPNextNode)); + memset(fields, UINT8_MAX, sizeof(VkBool32) * field_capacity); memcpy(this, &features, sizeof(T)); } @@ -131,7 +133,6 @@ struct GenericFeaturesPNextNode { VkStructureType sType = static_cast(0); void* pNext = nullptr; - static const uint32_t field_capacity = 256; VkBool32 fields[field_capacity]; };