diff options
| author | azhirnov <zh1dron@gmail.com> | 2021-01-30 13:21:53 +0000 |
|---|---|---|
| committer | assiduous <assiduous@diligentgraphics.com> | 2021-02-04 04:58:27 +0000 |
| commit | 3948fc345b99465f2d792114d06d0e374465ce3d (patch) | |
| tree | 7e6846c123c4680498457a561b8e5f1c92bc9aa7 /Graphics/GraphicsEngine | |
| parent | Some refactoring of DXBCUtils (diff) | |
| download | DiligentCore-3948fc345b99465f2d792114d06d0e374465ce3d.tar.gz DiligentCore-3948fc345b99465f2d792114d06d0e374465ce3d.zip | |
update for vulkan PRS
Diffstat (limited to 'Graphics/GraphicsEngine')
| -rw-r--r-- | Graphics/GraphicsEngine/include/PipelineResourceSignatureBase.hpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Graphics/GraphicsEngine/include/PipelineResourceSignatureBase.hpp b/Graphics/GraphicsEngine/include/PipelineResourceSignatureBase.hpp index f1634fed..ceb70688 100644 --- a/Graphics/GraphicsEngine/include/PipelineResourceSignatureBase.hpp +++ b/Graphics/GraphicsEngine/include/PipelineResourceSignatureBase.hpp @@ -39,6 +39,7 @@ #include "DeviceObjectBase.hpp" #include "RenderDeviceBase.hpp" #include "FixedLinearAllocator.hpp" +#include "BasicMath.hpp" namespace Diligent { @@ -100,6 +101,27 @@ public: return std::pair<Uint32, Uint32>{m_ResourceOffsets[VarType], m_ResourceOffsets[VarType + 1]}; } + // Returns the number of shader stages that have resources. + Uint32 GetNumActiveShaderStages() const { return m_NumShaderStages; } + + // Returns the type of the active shader stage with the given index. + SHADER_TYPE GetActiveShaderStageType(Uint32 StageIndex) const + { + VERIFY_EXPR(StageIndex < m_NumShaderStages); + + SHADER_TYPE Stages = m_ShaderStages; + for (Uint32 Index = 0; Stages != SHADER_TYPE_UNKNOWN; ++Index) + { + auto StageBit = ExtractLSB(Stages); + + if (Index == StageIndex) + return StageBit; + } + + UNEXPECTED("Index is out of range"); + return SHADER_TYPE_UNKNOWN; + } + protected: void ReserveSpaceForDescription(FixedLinearAllocator& Allocator, const PipelineResourceSignatureDesc& Desc) const noexcept(false) { @@ -252,10 +274,16 @@ protected: protected: size_t m_Hash = 0; + // Shader stages that have resources. + SHADER_TYPE m_ShaderStages = SHADER_TYPE_UNKNOWN; + std::array<Uint16, SHADER_RESOURCE_VARIABLE_TYPE_NUM_TYPES + 1> m_ResourceOffsets = {}; PIPELINE_TYPE m_PipelineType = PIPELINE_TYPE_INVALID; + // The number of shader stages that have resources. + Uint8 m_NumShaderStages = 0; // AZ TODO: remove ? + #ifdef DILIGENT_DEBUG bool m_IsDestructed = false; #endif |
