Add CPU profiler events to texture and buffer creation

This commit is contained in:
Wojtek Figat
2026-01-28 21:46:42 +01:00
parent 6c84b7a259
commit 1e9918b9cc
2 changed files with 4 additions and 0 deletions

View File

@@ -189,6 +189,7 @@ bool GPUBuffer::IsDynamic() const
bool GPUBuffer::Init(const GPUBufferDescription& desc)
{
PROFILE_CPU();
PROFILE_MEM(GraphicsBuffers);
// Validate description
@@ -246,6 +247,7 @@ bool GPUBuffer::Init(const GPUBufferDescription& desc)
}
#if COMPILE_WITH_PROFILER
ZoneValue(_memoryUsage / 1024); // Memory size in kB
auto group = ProfilerMemory::Groups::GraphicsBuffers;
if (EnumHasAnyFlags(_desc.Flags, GPUBufferFlags::VertexBuffer))
group = ProfilerMemory::Groups::GraphicsVertexBuffers;

View File

@@ -354,6 +354,7 @@ int32 GPUTexture::ComputeRowPitch(int32 mipLevel, int32 rowAlign) const
bool GPUTexture::Init(const GPUTextureDescription& desc)
{
PROFILE_CPU();
PROFILE_MEM(GraphicsTextures);
// Validate description
@@ -505,6 +506,7 @@ bool GPUTexture::Init(const GPUTextureDescription& desc)
}
#if COMPILE_WITH_PROFILER
ZoneValue(_memoryUsage / 1024); // Memory size in kB
auto group = ProfilerMemory::Groups::GraphicsTextures;
if (_desc.IsRenderTarget())
group = ProfilerMemory::Groups::GraphicsRenderTargets;