summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineOpenGL
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2021-03-09 22:32:13 +0000
committerassiduous <assiduous@diligentgraphics.com>2021-03-19 00:38:18 +0000
commitcea4cd0a156a86af70c10dbdfbdc812bcd5d5946 (patch)
treeee9ff7994246cde361032784de62b118250753c0 /Graphics/GraphicsEngineOpenGL
parentReworked samplers handling in OpenGL (diff)
downloadDiligentCore-cea4cd0a156a86af70c10dbdfbdc812bcd5d5946.tar.gz
DiligentCore-cea4cd0a156a86af70c10dbdfbdc812bcd5d5946.zip
Removed unused ShaderVariableManagerGL::dvpVerifyBindings
Diffstat (limited to 'Graphics/GraphicsEngineOpenGL')
-rw-r--r--Graphics/GraphicsEngineOpenGL/include/ShaderVariableManagerGL.hpp4
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/PipelineResourceSignatureGLImpl.cpp4
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/PipelineStateGLImpl.cpp2
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/ShaderVariableManagerGL.cpp87
4 files changed, 3 insertions, 94 deletions
diff --git a/Graphics/GraphicsEngineOpenGL/include/ShaderVariableManagerGL.hpp b/Graphics/GraphicsEngineOpenGL/include/ShaderVariableManagerGL.hpp
index 95719cd3..282aadd3 100644
--- a/Graphics/GraphicsEngineOpenGL/include/ShaderVariableManagerGL.hpp
+++ b/Graphics/GraphicsEngineOpenGL/include/ShaderVariableManagerGL.hpp
@@ -289,10 +289,6 @@ public:
// while Layout is alive
void BindResources(IResourceMapping* pResourceMapping, Uint32 Flags);
-#ifdef DILIGENT_DEVELOPMENT
- bool dvpVerifyBindings(const ShaderResourceCacheGL& ResourceCache) const;
-#endif
-
IShaderResourceVariable* GetVariable(const Char* Name) const;
IShaderResourceVariable* GetVariable(Uint32 Index) const;
diff --git a/Graphics/GraphicsEngineOpenGL/src/PipelineResourceSignatureGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/PipelineResourceSignatureGLImpl.cpp
index 4b2e1375..01865da4 100644
--- a/Graphics/GraphicsEngineOpenGL/src/PipelineResourceSignatureGLImpl.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/PipelineResourceSignatureGLImpl.cpp
@@ -614,8 +614,8 @@ bool PipelineResourceSignatureGLImpl::DvpValidateCommittedResource(const ShaderR
case BINDING_RANGE_IMAGE:
for (Uint32 ArrInd = 0; ArrInd < ResDesc.ArraySize; ++ArrInd)
{
- const bool IsImgView = (ResDesc.ResourceType == SHADER_RESOURCE_TYPE_TEXTURE_SRV || ResDesc.ResourceType == SHADER_RESOURCE_TYPE_TEXTURE_UAV);
- if (!ResourceCache.IsImageBound(ResAttr.CacheOffset + ArrInd, IsImgView))
+ const bool IsTexView = (ResDesc.ResourceType == SHADER_RESOURCE_TYPE_TEXTURE_SRV || ResDesc.ResourceType == SHADER_RESOURCE_TYPE_TEXTURE_UAV);
+ if (!ResourceCache.IsImageBound(ResAttr.CacheOffset + ArrInd, IsTexView))
{
LOG_ERROR_MESSAGE("No resource is bound to variable '", GetShaderResourcePrintName(GLAttribs, ArrInd),
"' in shader '", ShaderName, "' of PSO '", PSOName, "'");
diff --git a/Graphics/GraphicsEngineOpenGL/src/PipelineStateGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/PipelineStateGLImpl.cpp
index b9a0931d..a07d68a5 100644
--- a/Graphics/GraphicsEngineOpenGL/src/PipelineStateGLImpl.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/PipelineStateGLImpl.cpp
@@ -453,7 +453,7 @@ void PipelineStateGLImpl::ValidateShaderResources(std::shared_ptr<const ShaderRe
const auto& ResDesc = pSignature->GetResourceDesc(ResAttribution.ResourceIndex);
// Shader reflection does not contain read-only flag, so image and storage buffer can be UAV or SRV.
- // Texture SRV is same as input attachment.
+ // Texture SRV is the same as input attachment.
const auto Type = (AltResourceType == ResDesc.ResourceType ? AltResourceType : Attribs.ResourceType);
ValidatePipelineResourceCompatibility(ResDesc, Type, Flags, Attribs.ArraySize, ShaderName, pSignature->GetDesc().Name);
diff --git a/Graphics/GraphicsEngineOpenGL/src/ShaderVariableManagerGL.cpp b/Graphics/GraphicsEngineOpenGL/src/ShaderVariableManagerGL.cpp
index 53decd87..8d9a0e91 100644
--- a/Graphics/GraphicsEngineOpenGL/src/ShaderVariableManagerGL.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/ShaderVariableManagerGL.cpp
@@ -611,91 +611,4 @@ const ShaderVariableManagerGL::ResourceAttribs& ShaderVariableManagerGL::GetAttr
return m_pSignature->GetResourceAttribs(Index);
}
-
-#ifdef DILIGENT_DEVELOPMENT
-// TODO: remove
-bool ShaderVariableManagerGL::dvpVerifyBindings(const ShaderResourceCacheGL& ResourceCache) const
-{
-# define LOG_MISSING_BINDING(VarType, BindInfo, ArrIndex) LOG_ERROR_MESSAGE("No resource is bound to ", VarType, " variable '", GetShaderResourcePrintName(Desc, ArrIndex), "'")
-
- bool BindingsOK = true;
- HandleConstResources(
- [&](const UniformBuffBindInfo& ub) //
- {
- const auto& Desc = ub.GetDesc();
- const auto& Attr = ub.GetAttribs();
- VERIFY_EXPR(Desc.ResourceType == SHADER_RESOURCE_TYPE_CONSTANT_BUFFER);
- for (Uint32 ArrInd = 0; ArrInd < Desc.ArraySize; ++ArrInd)
- {
- if (!ResourceCache.IsUBBound(Attr.CacheOffset + ArrInd))
- {
- LOG_MISSING_BINDING("constant buffer", ub, ArrInd);
- BindingsOK = false;
- }
- }
- },
-
- [&](const TextureBindInfo& tex) //
- {
- const auto& Desc = tex.GetDesc();
- const auto& Attr = tex.GetAttribs();
- const bool IsTexView = (Desc.ResourceType == SHADER_RESOURCE_TYPE_TEXTURE_SRV || Desc.ResourceType == SHADER_RESOURCE_TYPE_INPUT_ATTACHMENT);
- VERIFY_EXPR(IsTexView || Desc.ResourceType == SHADER_RESOURCE_TYPE_BUFFER_SRV);
- for (Uint32 ArrInd = 0; ArrInd < Desc.ArraySize; ++ArrInd)
- {
- if (!ResourceCache.IsTextureBound(Attr.CacheOffset + ArrInd, IsTexView))
- {
- LOG_MISSING_BINDING("texture", tex, ArrInd);
- BindingsOK = false;
- }
- else
- {
- const auto& CachedTex = ResourceCache.GetConstTexture(Attr.CacheOffset + ArrInd);
- if (Attr.IsImmutableSamplerAssigned() && CachedTex.pSampler == nullptr)
- {
- LOG_ERROR_MESSAGE("Immutable sampler is not initialized for texture '", Desc.Name, "'");
- BindingsOK = false;
- }
- }
- }
- },
-
- [&](const ImageBindInfo& img) //
- {
- const auto& Desc = img.GetDesc();
- const auto& Attr = img.GetAttribs();
- const bool IsTexView = (Desc.ResourceType == SHADER_RESOURCE_TYPE_TEXTURE_SRV || Desc.ResourceType == SHADER_RESOURCE_TYPE_TEXTURE_UAV);
- VERIFY_EXPR(IsTexView || Desc.ResourceType == SHADER_RESOURCE_TYPE_BUFFER_UAV);
- for (Uint32 ArrInd = 0; ArrInd < Desc.ArraySize; ++ArrInd)
- {
- if (!ResourceCache.IsImageBound(Attr.CacheOffset + ArrInd, IsTexView))
- {
- LOG_MISSING_BINDING("texture UAV", img, ArrInd);
- BindingsOK = false;
- }
- }
- },
-
- [&](const StorageBufferBindInfo& ssbo) //
- {
- const auto& Desc = ssbo.GetDesc();
- const auto& Attr = ssbo.GetAttribs();
- VERIFY_EXPR(Desc.ResourceType == SHADER_RESOURCE_TYPE_BUFFER_UAV ||
- Desc.ResourceType == SHADER_RESOURCE_TYPE_BUFFER_SRV);
- for (Uint32 ArrInd = 0; ArrInd < Desc.ArraySize; ++ArrInd)
- {
- if (!ResourceCache.IsSSBOBound(Attr.CacheOffset + ArrInd))
- {
- LOG_MISSING_BINDING("buffer", ssbo, ArrInd);
- BindingsOK = false;
- }
- }
- });
-# undef LOG_MISSING_BINDING
-
- return BindingsOK;
-}
-
-#endif // DILIGENT_DEVELOPMENT
-
} // namespace Diligent