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

@@ -32,6 +32,8 @@ namespace Nz
void* Map(UInt64 offset, UInt64 size) override;
bool Unmap() override;
void UpdateDebugName(std::string_view name) override;
OpenGLBuffer& operator=(const OpenGLBuffer&) = delete;
OpenGLBuffer& operator=(OpenGLBuffer&&) = delete;

View File

@@ -62,6 +62,8 @@ namespace Nz
inline void SetScissor(const Recti& scissorRegion);
inline void SetViewport(const Recti& viewportRegion);
void UpdateDebugName(std::string_view name) override;
OpenGLCommandBuffer& operator=(const OpenGLCommandBuffer&) = delete;
OpenGLCommandBuffer& operator=(OpenGLCommandBuffer&&) = delete;

View File

@@ -27,6 +27,8 @@ namespace Nz
CommandBufferPtr BuildCommandBuffer(const std::function<void(CommandBufferBuilder& builder)>& callback) override;
void UpdateDebugName(std::string_view name) override;
OpenGLCommandPool& operator=(const OpenGLCommandPool&) = delete;
OpenGLCommandPool& operator=(OpenGLCommandPool&&) = delete;

View File

@@ -35,6 +35,8 @@ namespace Nz
const Vector2ui& GetSize() const override;
void UpdateDebugName(std::string_view name) override;
OpenGLFboFramebuffer& operator=(const OpenGLFboFramebuffer&) = delete;
OpenGLFboFramebuffer& operator=(OpenGLFboFramebuffer&&) = delete;

View File

@@ -22,6 +22,8 @@ namespace Nz
OpenGLRenderPass(OpenGLRenderPass&&) noexcept = default;
~OpenGLRenderPass() = default;
void UpdateDebugName(std::string_view name) override;
OpenGLRenderPass& operator=(const OpenGLRenderPass&) = delete;
OpenGLRenderPass& operator=(OpenGLRenderPass&&) noexcept = default;
};

View File

@@ -26,6 +26,8 @@ namespace Nz
inline const RenderPipelineInfo& GetPipelineInfo() const override;
void UpdateDebugName(std::string_view name) override;
private:
RenderPipelineInfo m_pipelineInfo;
GL::Program m_program;

View File

@@ -36,6 +36,8 @@ namespace Nz
inline const nzsl::GlslWriter::BindingMapping& GetBindingMapping() const;
inline const RenderPipelineLayoutInfo& GetLayoutInfo() const;
void UpdateDebugName(std::string_view name) override;
OpenGLRenderPipelineLayout& operator=(const OpenGLRenderPipelineLayout&) = delete;
OpenGLRenderPipelineLayout& operator=(OpenGLRenderPipelineLayout&&) = delete;

View File

@@ -32,6 +32,8 @@ namespace Nz
void Update(const Binding* bindings, std::size_t bindingCount) override;
void UpdateDebugName(std::string_view name) override;
OpenGLShaderBinding& operator=(const OpenGLShaderBinding&) = delete;
OpenGLShaderBinding& operator=(OpenGLShaderBinding&&) = delete;

View File

@@ -15,6 +15,7 @@
#include <Nazara/Renderer/ShaderModule.hpp>
#include <NZSL/GlslWriter.hpp>
#include <NZSL/Ast/Module.hpp>
#include <string>
#include <vector>
namespace Nz
@@ -31,6 +32,8 @@ namespace Nz
inline const std::vector<ExplicitBinding>& GetExplicitBindings() const;
void UpdateDebugName(std::string_view name) override;
struct ExplicitBinding
{
std::string name;
@@ -61,6 +64,7 @@ namespace Nz
OpenGLDevice& m_device;
nzsl::ShaderWriter::States m_states;
std::string m_debugName;
std::vector<ExplicitBinding> m_explicitBindings;
std::vector<Shader> m_shaders;
};

View File

@@ -34,6 +34,8 @@ namespace Nz
using Texture::Update;
bool Update(const void* ptr, const Boxui& box, unsigned int srcWidth = 0, unsigned int srcHeight = 0, UInt8 level = 0) override;
void UpdateDebugName(std::string_view name) override;
OpenGLTexture& operator=(const OpenGLTexture&) = delete;
OpenGLTexture& operator=(OpenGLTexture&&) = delete;

View File

@@ -24,6 +24,8 @@ namespace Nz
inline const GL::Sampler& GetSampler(bool mipmaps) const;
void UpdateDebugName(std::string_view name) override;
OpenGLTextureSampler& operator=(const OpenGLTextureSampler&) = delete;
OpenGLTextureSampler& operator=(OpenGLTextureSampler&&) = delete;

View File

@@ -28,6 +28,8 @@ namespace Nz
const Vector2ui& GetSize() const override;
void UpdateDebugName(std::string_view name) override;
OpenGLWindowFramebuffer& operator=(const OpenGLWindowFramebuffer&) = delete;
OpenGLWindowFramebuffer& operator=(OpenGLWindowFramebuffer&&) = delete;