Renderer: Implement and use debug names

This commit is contained in:
SirLynix
2022-12-02 22:46:43 +01:00
parent 54aafe05a1
commit 77642cf431
74 changed files with 290 additions and 38 deletions

View File

@@ -157,6 +157,8 @@ namespace Nz
textureCreationParams.pixelFormat = textureData.format;
textureData.texture = renderDevice->InstantiateTexture(textureCreationParams);
if (!textureData.name.empty())
textureData.texture->UpdateDebugName(textureData.name);
}
std::vector<std::shared_ptr<Texture>> textures;
@@ -181,6 +183,9 @@ namespace Nz
passData.renderRect.Set(0, 0, int(framebufferWidth), int(framebufferHeight));
passData.framebuffer = renderDevice->InstantiateFramebuffer(framebufferWidth, framebufferHeight, passData.renderPass, textures);
if (!passData.name.empty())
passData.framebuffer->UpdateDebugName(passData.name);
passData.forceCommandBufferRegeneration = true;
}

View File

@@ -113,6 +113,7 @@ namespace Nz
for (auto& texture : m_pending.textures)
{
auto& bakedTexture = bakedTextures.emplace_back();
bakedTexture.name = std::move(texture.name);
bakedTexture.format = texture.format;
bakedTexture.height = texture.height;
bakedTexture.usage = texture.usage;
@@ -161,7 +162,7 @@ namespace Nz
if (currentPass.name.empty())
currentPass.name = pass.GetName();
else
currentPass.name += " + " + pass.GetName();
currentPass.name += " / " + pass.GetName();
auto& subpass = currentPass.passes.emplace_back();
subpass.passIndex = *it;
@@ -957,6 +958,9 @@ namespace Nz
m_pending.texturePool.erase(it);
m_pending.attachmentToTextures.emplace(attachmentIndex, textureId);
if (!attachmentData.name.empty() && data.name != attachmentData.name)
data.name += " / " + attachmentData.name;
return textureId;
}
@@ -964,6 +968,7 @@ namespace Nz
m_pending.attachmentToTextures.emplace(attachmentIndex, textureId);
TextureData& data = m_pending.textures.emplace_back();
data.name = attachmentData.name;
data.format = attachmentData.format;
data.width = attachmentData.width;
data.height = attachmentData.height;