From cbf6f3c8a7e1d4a370d4c9ca2840a143cfbea216 Mon Sep 17 00:00:00 2001 From: assiduous Date: Tue, 27 Oct 2020 20:58:28 -0700 Subject: ShaderResourceLayout{D3D12,Vk}: implemented GetShaderName --- .../include/ShaderResourceVariableBase.hpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'Graphics/GraphicsEngine') diff --git a/Graphics/GraphicsEngine/include/ShaderResourceVariableBase.hpp b/Graphics/GraphicsEngine/include/ShaderResourceVariableBase.hpp index 1130fbff..9fef2399 100644 --- a/Graphics/GraphicsEngine/include/ShaderResourceVariableBase.hpp +++ b/Graphics/GraphicsEngine/include/ShaderResourceVariableBase.hpp @@ -381,6 +381,28 @@ inline void VerifyAndCorrectSetArrayArguments(const char* Name, Uint32 ArraySize } } +template +std::string GetShaderGroupName(const ShaderVectorType& Shaders) +{ + std::string Name; + if (Shaders.size() == 1) + { + Name = Shaders[0]->GetDesc().Name; + } + else + { + Name = "{"; + for (size_t s = 0; s < Shaders.size(); ++s) + { + if (s > 0) + Name += ", "; + Name += Shaders[s]->GetDesc().Name; + } + Name += "}"; + } + return Name; +} + struct DefaultShaderVariableIDComparator { bool operator()(const INTERFACE_ID& IID) const -- cgit v1.2.3