From fc13eec5407eea4901db41fec62baaaef817cf0b Mon Sep 17 00:00:00 2001 From: Kearwood Gilbert Date: Wed, 9 Sep 2026 22:44:00 -0700 Subject: [PATCH] Update mimir Add heap and frame allocators --- kraken/KRContext.cpp | 12 ++++++++++++ kraken/KRContext.h | 2 ++ mimir | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/kraken/KRContext.cpp b/kraken/KRContext.cpp index 6d9ccb0..20ab279 100755 --- a/kraken/KRContext.cpp +++ b/kraken/KRContext.cpp @@ -114,6 +114,10 @@ KRContext::KRContext(const KrInitializeInfo* initializeInfo) m_streamingEnabled = true; mimir::init(); + m_heap.init(); + for (int i = 0; i < KRENGINE_MAX_FRAMES_IN_FLIGHT; i++) { + m_frameAllocators[i].init(); + } m_presentationThread->start(); m_streamerThread->start(); @@ -563,6 +567,14 @@ KrResult KRContext::saveResource(const KrSaveResourceInfo* saveResourceInfo) void KRContext::startFrame(float deltaTime) { + m_frameAllocators[m_current_frame % KRENGINE_MAX_FRAMES_IN_FLIGHT].reset(); + + for (int i = 0; i < 100; i++) { + size_t s = 67ULL << 8; + std::byte* a = m_frameAllocators[m_current_frame % KRENGINE_MAX_FRAMES_IN_FLIGHT].alloc(s); + memset(a, 0, s); + } + m_pTextureManager->startFrame(deltaTime); m_pAnimationManager->startFrame(deltaTime); m_pSoundManager->startFrame(deltaTime); diff --git a/kraken/KRContext.h b/kraken/KRContext.h index 072069b..f6f0b4d 100755 --- a/kraken/KRContext.h +++ b/kraken/KRContext.h @@ -50,6 +50,7 @@ #include "KRDevice.h" #include "KRSurface.h" #include "arena.h" +#include "heap.h" class KRAudioManager; class KRPresentationThread; @@ -228,4 +229,5 @@ private: virtual bool getShaderValue(const KRCamera* camera, ShaderValue value, float* output) const; mimir::Arena m_frameAllocators[KRENGINE_MAX_FRAMES_IN_FLIGHT] = {}; + mimir::Heap m_heap = {}; }; diff --git a/mimir b/mimir index edc7669..1c8e5ba 160000 --- a/mimir +++ b/mimir @@ -1 +1 @@ -Subproject commit edc7669a5cdbb2cd387e25dc9bd1e59979ae1762 +Subproject commit 1c8e5ba5e58deef3cab4940e9e327d8cf49a4d09