Type-erased single-element write.
Implementations copy from in into their storage at coords if type matches their native type, otherwise no-op. in points to a caller-owned buffer of exactly sizeof(native type) bytes.
Implements MayaFlux::Kakshya::NDDataContainer.
Definition at line 942 of file TextureContainer.cpp.
946{
947 if (coords.empty() ||
m_data.empty())
948 return;
949
950 const size_t layer = (
m_data.size() > 1) ?
static_cast<size_t>(coords[0]) : 0;
951 if (layer >=
m_data.size() || coords.size() < (
m_data.size() > 1 ? 4U : 3U))
952 return;
953
954 const size_t co = (
m_data.size() > 1) ? 1 : 0;
955 const size_t idx = (coords[co] *
m_width + coords[co + 1]) *
m_channels + coords[co + 2];
956
958 std::visit([&](auto& vec) {
959 using T =
typename std::decay_t<
decltype(vec)>::value_type;
960 if (
type !=
typeid(T) || idx >= vec.size())
961 return;
962 vec[idx] = *
static_cast<const T*
>(in);
963 },
965}
vk::PhysicalDeviceType type
Memory::SeqlockArray m_slot_locks
std::vector< DataVariant > m_data
References type.