VideoBackends / VideoCommon: allow the ability to set debug names for shaders / textures. These names are visible in applications like RenderDoc

This commit is contained in:
iwubcode
2021-08-28 00:30:05 -05:00
parent 9b83cf3e7f
commit 1f2f505373
32 changed files with 276 additions and 133 deletions

View File

@ -2,7 +2,10 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <memory>
#include <string>
#include <string_view>
#include "VideoBackends/D3D/D3DBase.h"
#include "VideoBackends/D3DCommon/Shader.h"
@ -12,7 +15,8 @@ namespace DX11
class DXShader final : public D3DCommon::Shader
{
public:
DXShader(ShaderStage stage, BinaryData bytecode, ID3D11DeviceChild* shader);
DXShader(ShaderStage stage, BinaryData bytecode, ID3D11DeviceChild* shader,
std::string_view name);
~DXShader() override;
ID3D11VertexShader* GetD3DVertexShader() const;
@ -20,10 +24,12 @@ public:
ID3D11PixelShader* GetD3DPixelShader() const;
ID3D11ComputeShader* GetD3DComputeShader() const;
static std::unique_ptr<DXShader> CreateFromBytecode(ShaderStage stage, BinaryData bytecode);
static std::unique_ptr<DXShader> CreateFromBytecode(ShaderStage stage, BinaryData bytecode,
std::string_view name);
private:
ComPtr<ID3D11DeviceChild> m_shader;
std::string m_name;
};
} // namespace DX11