Update mimir
Some checks failed
CMake on multiple platforms / build (Release, cl, cl, windows-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, macos-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, ubuntu-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, gcc, g++, ubuntu-latest) (push) Has been cancelled

Add heap and frame allocators
This commit is contained in:
2026-09-09 22:44:00 -07:00
parent 583ab662ee
commit fc13eec540
3 changed files with 15 additions and 1 deletions

View File

@@ -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);

View File

@@ -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 = {};
};

2
mimir

Submodule mimir updated: edc7669a5c...1c8e5ba5e5