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

@@ -62,4 +62,9 @@ namespace Nz
{
return m_buffer.Unmap();
}
void OpenGLBuffer::UpdateDebugName(std::string_view name)
{
m_buffer.SetDebugName(name);
}
}

View File

@@ -321,6 +321,11 @@ namespace Nz
}
}
void OpenGLCommandBuffer::UpdateDebugName(std::string_view name)
{
// No OpenGL object to name
}
void OpenGLCommandBuffer::ApplyStates(const GL::Context& context, const DrawStates& states)
{
states.pipeline->Apply(context, states.shouldFlipY);

View File

@@ -36,6 +36,11 @@ namespace Nz
return commandBuffer;
}
void OpenGLCommandPool::UpdateDebugName(std::string_view name)
{
// No OpenGL object to name
}
auto OpenGLCommandPool::AllocatePool() -> CommandPool&
{
constexpr UInt32 MaxSet = 128;

View File

@@ -103,4 +103,9 @@ namespace Nz
{
return m_size;
}
void OpenGLFboFramebuffer::UpdateDebugName(std::string_view name)
{
m_framebuffer.SetDebugName(name);
}
}

View File

@@ -7,4 +7,8 @@
namespace Nz
{
void OpenGLRenderPass::UpdateDebugName(std::string_view name)
{
// No OpenGL object to name
}
}

View File

@@ -103,4 +103,9 @@ namespace Nz
m_isViewportFlipped = flipViewport;
}
}
void OpenGLRenderPipeline::UpdateDebugName(std::string_view name)
{
m_program.SetDebugName(name);
}
}

View File

@@ -59,6 +59,11 @@ namespace Nz
return bindingPtr;
}
void OpenGLRenderPipelineLayout::UpdateDebugName(std::string_view name)
{
// No OpenGL object to name
}
auto OpenGLRenderPipelineLayout::AllocatePool() -> DescriptorPool&
{
constexpr UInt32 MaxSet = 128;

View File

@@ -132,6 +132,11 @@ namespace Nz
}
}
void OpenGLShaderBinding::UpdateDebugName(std::string_view name)
{
// No OpenGL object to name
}
void OpenGLShaderBinding::Release()
{
m_owner.Release(*this);

View File

@@ -113,6 +113,9 @@ namespace Nz
if (!shader.Create(m_device, ToOpenGL(shaderEntry.stage)))
throw std::runtime_error("failed to create shader"); //< TODO: Handle error message
if (!m_debugName.empty())
shader.SetDebugName(m_debugName);
std::visit([&](auto&& arg)
{
using T = std::decay_t<decltype(arg)>;
@@ -161,6 +164,11 @@ namespace Nz
return stageFlags;
}
void OpenGLShaderModule::UpdateDebugName(std::string_view name)
{
m_debugName = name;
}
void OpenGLShaderModule::Create(OpenGLDevice& /*device*/, nzsl::ShaderStageTypeFlags shaderStages, const nzsl::Ast::Module& shaderModule, const nzsl::ShaderWriter::States& states)
{
m_states = states;

View File

@@ -145,4 +145,9 @@ namespace Nz
return true;
}
void OpenGLTexture::UpdateDebugName(std::string_view name)
{
m_texture.SetDebugName(name);
}
}

View File

@@ -37,4 +37,10 @@ namespace Nz
if (samplerInfo.anisotropyLevel > 1.f)
sampler.SetParameterf(GL_TEXTURE_MAX_ANISOTROPY_EXT, samplerInfo.anisotropyLevel);
}
void OpenGLTextureSampler::UpdateDebugName(std::string_view name)
{
m_samplerWithMipmaps.SetDebugName(name);
m_samplerWithoutMipmaps.SetDebugName(name);
}
}

View File

@@ -27,4 +27,9 @@ namespace Nz
{
return m_renderWindow.GetSize();
}
void OpenGLWindowFramebuffer::UpdateDebugName(std::string_view name)
{
// No OpenGL object to name
}
}