Renderer: Implement and use debug names
This commit is contained in:
@@ -62,4 +62,9 @@ namespace Nz
|
||||
{
|
||||
return m_buffer.Unmap();
|
||||
}
|
||||
|
||||
void OpenGLBuffer::UpdateDebugName(std::string_view name)
|
||||
{
|
||||
m_buffer.SetDebugName(name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -103,4 +103,9 @@ namespace Nz
|
||||
{
|
||||
return m_size;
|
||||
}
|
||||
|
||||
void OpenGLFboFramebuffer::UpdateDebugName(std::string_view name)
|
||||
{
|
||||
m_framebuffer.SetDebugName(name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,4 +7,8 @@
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
void OpenGLRenderPass::UpdateDebugName(std::string_view name)
|
||||
{
|
||||
// No OpenGL object to name
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,4 +103,9 @@ namespace Nz
|
||||
m_isViewportFlipped = flipViewport;
|
||||
}
|
||||
}
|
||||
|
||||
void OpenGLRenderPipeline::UpdateDebugName(std::string_view name)
|
||||
{
|
||||
m_program.SetDebugName(name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -145,4 +145,9 @@ namespace Nz
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void OpenGLTexture::UpdateDebugName(std::string_view name)
|
||||
{
|
||||
m_texture.SetDebugName(name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,4 +27,9 @@ namespace Nz
|
||||
{
|
||||
return m_renderWindow.GetSize();
|
||||
}
|
||||
|
||||
void OpenGLWindowFramebuffer::UpdateDebugName(std::string_view name)
|
||||
{
|
||||
// No OpenGL object to name
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user