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

@ -5,6 +5,7 @@
#include <cstddef>
#include <memory>
#include <string>
#include <string_view>
#include <vector>
@ -17,22 +18,24 @@ namespace Vulkan
class VKShader final : public AbstractShader
{
public:
VKShader(ShaderStage stage, std::vector<u32> spv, VkShaderModule mod);
VKShader(std::vector<u32> spv, VkPipeline compute_pipeline);
VKShader(ShaderStage stage, std::vector<u32> spv, VkShaderModule mod, std::string_view name);
VKShader(std::vector<u32> spv, VkPipeline compute_pipeline, std::string_view name);
~VKShader() override;
VkShaderModule GetShaderModule() const { return m_module; }
VkPipeline GetComputePipeline() const { return m_compute_pipeline; }
BinaryData GetBinary() const override;
static std::unique_ptr<VKShader> CreateFromSource(ShaderStage stage, std::string_view source);
static std::unique_ptr<VKShader> CreateFromSource(ShaderStage stage, std::string_view source,
std::string_view name);
static std::unique_ptr<VKShader> CreateFromBinary(ShaderStage stage, const void* data,
size_t length);
size_t length, std::string_view name);
private:
std::vector<u32> m_spv;
VkShaderModule m_module;
VkPipeline m_compute_pipeline;
std::string m_name;
};
} // namespace Vulkan