Add pooled render targets naming for easier GPU memory usage debugging
This commit is contained in:
@@ -95,6 +95,7 @@ GPUTexture* RenderBuffers::RequestHalfResDepth(GPUContext* context)
|
||||
auto tempDesc = GPUTextureDescription::New2D(halfDepthWidth, halfDepthHeight, halfDepthFormat);
|
||||
tempDesc.Flags = GPUTextureFlags::ShaderResource | GPUTextureFlags::DepthStencil;
|
||||
HalfResDepth = RenderTargetPool::Get(tempDesc);
|
||||
RENDER_TARGET_POOL_SET_NAME(HalfResDepth, "HalfResDepth");
|
||||
}
|
||||
else if (HalfResDepth->Width() != halfDepthWidth || HalfResDepth->Height() != halfDepthHeight || HalfResDepth->Format() != halfDepthFormat)
|
||||
{
|
||||
@@ -103,6 +104,7 @@ GPUTexture* RenderBuffers::RequestHalfResDepth(GPUContext* context)
|
||||
auto tempDesc = GPUTextureDescription::New2D(halfDepthWidth, halfDepthHeight, halfDepthFormat);
|
||||
tempDesc.Flags = GPUTextureFlags::ShaderResource | GPUTextureFlags::DepthStencil;
|
||||
HalfResDepth = RenderTargetPool::Get(tempDesc);
|
||||
RENDER_TARGET_POOL_SET_NAME(HalfResDepth, "HalfResDepth");
|
||||
}
|
||||
|
||||
// Generate depth
|
||||
|
||||
@@ -30,3 +30,10 @@ public:
|
||||
/// <param name="rt">The reference to temporary target to release.</param>
|
||||
API_FUNCTION() static void Release(GPUTexture* rt);
|
||||
};
|
||||
|
||||
// Utility to set name to the pooled render target (compiled-put in Release builds)
|
||||
#if GPU_ENABLE_RESOURCE_NAMING
|
||||
#define RENDER_TARGET_POOL_SET_NAME(rt, name) rt->SetName(TEXT(name));
|
||||
#else
|
||||
#define RENDER_TARGET_POOL_SET_NAME(rt, name)
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user