diff options
| author | assiduous <assiduous@diligentgraphics.com> | 2021-03-07 21:21:43 +0000 |
|---|---|---|
| committer | assiduous <assiduous@diligentgraphics.com> | 2021-03-19 00:38:17 +0000 |
| commit | 68bb8ce116ce83bc94d2af87563e8dc1c9fab0b4 (patch) | |
| tree | 0a015869da0e3b1c3c45276be8aca3aabeaa76b0 /Graphics/GraphicsEngineOpenGL | |
| parent | Fixed ShaderResourceLayoutTest for non-separable programs (diff) | |
| download | DiligentCore-68bb8ce116ce83bc94d2af87563e8dc1c9fab0b4.tar.gz DiligentCore-68bb8ce116ce83bc94d2af87563e8dc1c9fab0b4.zip | |
Replaced duplicate CacheContentType enums with the common ResourceCacheContentType
Diffstat (limited to 'Graphics/GraphicsEngineOpenGL')
3 files changed, 8 insertions, 13 deletions
diff --git a/Graphics/GraphicsEngineOpenGL/include/ShaderResourceCacheGL.hpp b/Graphics/GraphicsEngineOpenGL/include/ShaderResourceCacheGL.hpp index 38b7e6ec..61972aeb 100644 --- a/Graphics/GraphicsEngineOpenGL/include/ShaderResourceCacheGL.hpp +++ b/Graphics/GraphicsEngineOpenGL/include/ShaderResourceCacheGL.hpp @@ -33,6 +33,7 @@ #include "BufferGLImpl.hpp" #include "TextureBaseGL.hpp" #include "SamplerGLImpl.hpp" +#include "ShaderResourceCacheCommon.hpp" namespace Diligent { @@ -48,13 +49,7 @@ namespace Diligent class ShaderResourceCacheGL { public: - enum class CacheContentType : Uint8 - { - Signature = 0, // The cache is used by the pipeline resource signature to hold static resources. - SRB = 1 // The cache is used by SRB to hold resources of all types (static, mutable, dynamic). - }; - - explicit ShaderResourceCacheGL(CacheContentType ContentType) noexcept : + explicit ShaderResourceCacheGL(ResourceCacheContentType ContentType) noexcept : m_ContentType{ContentType} {} @@ -246,7 +241,7 @@ public: return m_MemoryEndOffset != InvalidResourceOffset; } - CacheContentType GetContentType() const { return m_ContentType; } + ResourceCacheContentType GetContentType() const { return m_ContentType; } #ifdef DILIGENT_DEVELOPMENT void SetStaticResourcesInitialized() @@ -295,7 +290,7 @@ private: IMemoryAllocator* m_pAllocator = nullptr; // Indicates what types of resources are stored in the cache - const CacheContentType m_ContentType; + const ResourceCacheContentType m_ContentType; #ifdef DILIGENT_DEVELOPMENT bool m_bStaticResourcesInitialized = false; diff --git a/Graphics/GraphicsEngineOpenGL/src/PipelineResourceSignatureGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/PipelineResourceSignatureGLImpl.cpp index 1373c446..67c2c5bf 100644 --- a/Graphics/GraphicsEngineOpenGL/src/PipelineResourceSignatureGLImpl.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/PipelineResourceSignatureGLImpl.cpp @@ -113,7 +113,7 @@ PipelineResourceSignatureGLImpl::PipelineResourceSignatureGLImpl(IReferenceCount const auto NumStaticResStages = GetNumStaticResStages(); if (NumStaticResStages > 0) { - m_pStaticResCache = MemPool.Construct<ShaderResourceCacheGL>(ShaderResourceCacheGL::CacheContentType::Signature); + m_pStaticResCache = MemPool.Construct<ShaderResourceCacheGL>(ResourceCacheContentType::Signature); m_StaticVarsMgrs = MemPool.ConstructArray<ShaderVariableManagerGL>(NumStaticResStages, std::ref(*this), std::ref(*m_pStaticResCache)); } @@ -469,8 +469,8 @@ void PipelineResourceSignatureGLImpl::CopyStaticResources(ShaderResourceCacheGL& const auto& SrcResourceCache = *m_pStaticResCache; const auto ResIdxRange = GetResourceIndexRange(SHADER_RESOURCE_VARIABLE_TYPE_STATIC); - VERIFY_EXPR(SrcResourceCache.GetContentType() == ShaderResourceCacheGL::CacheContentType::Signature); - VERIFY_EXPR(DstResourceCache.GetContentType() == ShaderResourceCacheGL::CacheContentType::SRB); + VERIFY_EXPR(SrcResourceCache.GetContentType() == ResourceCacheContentType::Signature); + VERIFY_EXPR(DstResourceCache.GetContentType() == ResourceCacheContentType::SRB); for (Uint32 r = ResIdxRange.first; r < ResIdxRange.second; ++r) { diff --git a/Graphics/GraphicsEngineOpenGL/src/ShaderResourceBindingGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/ShaderResourceBindingGLImpl.cpp index 515331de..2538d66b 100644 --- a/Graphics/GraphicsEngineOpenGL/src/ShaderResourceBindingGLImpl.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/ShaderResourceBindingGLImpl.cpp @@ -42,7 +42,7 @@ ShaderResourceBindingGLImpl::ShaderResourceBindingGLImpl(IReferenceCounters* pRefCounters, pPRS }, - m_ShaderResourceCache{ShaderResourceCacheGL::CacheContentType::SRB} + m_ShaderResourceCache{ResourceCacheContentType::SRB} // clang-format on { try |
