2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-21 16:19:12 +00:00

aurora: Use MapAsync for buffer writing

This commit is contained in:
2022-03-15 22:38:55 -04:00
parent 02a7b85b23
commit efd14dcaf2
6 changed files with 139 additions and 67 deletions

View File

@@ -266,15 +266,15 @@ static inline void cache_array(const void* data, Vec*& outPtr, std::optional<aur
Vec* vecPtr = static_cast<Vec*>(data);
outPtr = vecPtr;
if (stride == 1) {
const auto hash = aurora::xxh3_hash(vecPtr->data(), vecPtr->size() * sizeof(typename Vec::value_type), 0);
const auto it = sCachedRanges.find(hash);
if (it != sCachedRanges.end()) {
outRange = it->second;
} else {
const auto range = aurora::gfx::push_static_storage(aurora::ArrayRef{*vecPtr});
sCachedRanges.try_emplace(hash, range);
outRange = range;
}
// const auto hash = aurora::xxh3_hash(vecPtr->data(), vecPtr->size() * sizeof(typename Vec::value_type), 0);
// const auto it = sCachedRanges.find(hash);
// if (it != sCachedRanges.end()) {
// outRange = it->second;
// } else {
// const auto range = aurora::gfx::push_static_storage(aurora::ArrayRef{*vecPtr});
// sCachedRanges.try_emplace(hash, range);
// outRange = range;
// }
} else {
outRange.reset();
}