Add CPU profiler events to texture and buffer creation
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user