Add pooled render targets naming for easier GPU memory usage debugging

This commit is contained in:
Wojciech Figat
2022-12-09 11:26:35 +01:00
parent d544c43744
commit b33ce8d264
25 changed files with 69 additions and 4 deletions

View File

@@ -118,6 +118,7 @@ void EyeAdaptationPass::Render(RenderContext& renderContext, GPUTexture* colorBu
previousLuminanceMap = nullptr;
}
GPUTexture* currentLuminanceMap = RenderTargetPool::Get(GPUTextureDescription::New2D(1, 1, PixelFormat::R16_Float));
RENDER_TARGET_POOL_SET_NAME(currentLuminanceMap, "EyeAdaptation.LuminanceMap");
switch (mode)
{
@@ -139,7 +140,8 @@ void EyeAdaptationPass::Render(RenderContext& renderContext, GPUTexture* colorBu
{
const Int2 luminanceMapSize(colorBuffer->Width() / 2, colorBuffer->Height() / 2);
GPUTexture* luminanceMap = RenderTargetPool::Get(GPUTextureDescription::New2D(luminanceMapSize.X, luminanceMapSize.Y, 0, PixelFormat::R16_Float, GPUTextureFlags::ShaderResource | GPUTextureFlags::RenderTarget | GPUTextureFlags::PerMipViews));
RENDER_TARGET_POOL_SET_NAME(luminanceMap, "EyeAdaptation.LuminanceMap");
// Calculate the luminance for the scene color
context->BindSR(0, *colorBuffer);
context->SetRenderTarget(luminanceMap->View(0, 0));