Fixing some VectorArena to use external arena and reduce the number of alloc.
Made the passing of name to arena more flexible
This commit is contained in:
@@ -198,8 +198,8 @@ void JulietApplication::Init()
|
||||
if ((Running = GameCode.IsValid))
|
||||
{
|
||||
GameInitParams params;
|
||||
params.GameArena = ArenaAllocate({} JULIET_DEBUG_ONLY(, "Game Arena"));
|
||||
params.ScratchArena = ArenaAllocate({} JULIET_DEBUG_ONLY(, "Scratch Arena"));
|
||||
params.GameArena = GameArena = ArenaAllocate({} JULIET_DEBUG_ONLY(, "Game Arena"));
|
||||
params.ScratchArena = GameScratchArena = ArenaAllocate({} JULIET_DEBUG_ONLY(, "Scratch Arena"));
|
||||
Game.Init(¶ms);
|
||||
}
|
||||
}
|
||||
@@ -356,6 +356,8 @@ void JulietApplication::Update()
|
||||
Debug::DebugDrawMemoryArena();
|
||||
#endif
|
||||
}
|
||||
|
||||
ArenaClear(GameScratchArena);
|
||||
}
|
||||
|
||||
void JulietApplication::OnPreRender(CommandList* cmd)
|
||||
|
||||
@@ -26,11 +26,11 @@ class JulietApplication : public Juliet::IApplication
|
||||
Juliet::GraphicsDevice* GetGraphicsDevice() override { return GraphicsDevice; }
|
||||
|
||||
// Render Lifecycle
|
||||
void OnPreRender(Juliet::CommandList* cmd) override;
|
||||
void OnRender(Juliet::RenderPass* pass, Juliet::CommandList* cmd) override;
|
||||
Juliet::ColorTargetInfo GetColorTargetInfo(Juliet::Texture* swapchainTexture) override;
|
||||
Juliet::DepthStencilTargetInfo* GetDepthTargetInfo() override;
|
||||
Juliet::Camera GetDebugCamera() override;
|
||||
void OnPreRender(Juliet::CommandList* cmd) override;
|
||||
void OnRender(Juliet::RenderPass* pass, Juliet::CommandList* cmd) override;
|
||||
Juliet::ColorTargetInfo GetColorTargetInfo(Juliet::Texture* swapchainTexture) override;
|
||||
Juliet::DepthStencilTargetInfo* GetDepthTargetInfo() override;
|
||||
Juliet::Camera GetDebugCamera() override;
|
||||
|
||||
public:
|
||||
void SetAutoCloseFrameCount(int count) { AutoCloseFrameCount = count; }
|
||||
@@ -45,7 +45,10 @@ class JulietApplication : public Juliet::IApplication
|
||||
Juliet::GraphicsTransferBuffer* TransferBuffer = {};
|
||||
Juliet::Texture* DepthBuffer = {};
|
||||
|
||||
bool Running = false;
|
||||
Juliet::Arena* GameArena = nullptr;
|
||||
Juliet::Arena* GameScratchArena = nullptr;
|
||||
|
||||
bool Running = false;
|
||||
int AutoCloseFrameCount = -1;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user