summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3DBase
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2021-02-16 03:07:28 +0000
committerassiduous <assiduous@diligentgraphics.com>2021-03-19 00:31:38 +0000
commit28c3ade2e429349d3d1b24147c1b363518111cc2 (patch)
treea456943fdf8064584a9b78e83e3597464b8638dd /Graphics/GraphicsEngineD3DBase
parentRemoved duplicates of FindAssignedSampler and FindImmutableSampler functions (diff)
downloadDiligentCore-28c3ade2e429349d3d1b24147c1b363518111cc2.tar.gz
DiligentCore-28c3ade2e429349d3d1b24147c1b363518111cc2.zip
ShaderResources: removed obsolete functions
Diffstat (limited to 'Graphics/GraphicsEngineD3DBase')
-rw-r--r--Graphics/GraphicsEngineD3DBase/include/ShaderResources.hpp11
-rw-r--r--Graphics/GraphicsEngineD3DBase/src/ShaderResources.cpp118
2 files changed, 0 insertions, 129 deletions
diff --git a/Graphics/GraphicsEngineD3DBase/include/ShaderResources.hpp b/Graphics/GraphicsEngineD3DBase/include/ShaderResources.hpp
index 4a6930c8..dcd0289b 100644
--- a/Graphics/GraphicsEngineD3DBase/include/ShaderResources.hpp
+++ b/Graphics/GraphicsEngineD3DBase/include/ShaderResources.hpp
@@ -380,17 +380,6 @@ public:
size_t GetHash() const;
- SHADER_RESOURCE_VARIABLE_TYPE FindVariableType(const D3DShaderResourceAttribs& ResourceAttribs,
- const PipelineResourceLayoutDesc& ResourceLayout) const;
-
- Int32 FindImmutableSampler(const D3DShaderResourceAttribs& ResourceAttribs,
- const PipelineResourceLayoutDesc& ResourceLayoutDesc,
- bool LogImmutableSamplerArrayError) const;
-
- D3DShaderResourceCounters CountResources(const PipelineResourceLayoutDesc& ResourceLayout,
- const SHADER_RESOURCE_VARIABLE_TYPE* AllowedVarTypes,
- Uint32 NumAllowedTypes,
- bool CountImmutableSamplers) const noexcept;
#ifdef DILIGENT_DEVELOPMENT
static void DvpVerifyResourceLayout(const PipelineResourceLayoutDesc& ResourceLayout,
const ShaderResources* const pShaderResources[],
diff --git a/Graphics/GraphicsEngineD3DBase/src/ShaderResources.cpp b/Graphics/GraphicsEngineD3DBase/src/ShaderResources.cpp
index 4694a44f..0142bea1 100644
--- a/Graphics/GraphicsEngineD3DBase/src/ShaderResources.cpp
+++ b/Graphics/GraphicsEngineD3DBase/src/ShaderResources.cpp
@@ -106,124 +106,6 @@ void ShaderResources::AllocateMemory(IMemoryAllocator& Allocator,
}
}
-SHADER_RESOURCE_VARIABLE_TYPE ShaderResources::FindVariableType(const D3DShaderResourceAttribs& ResourceAttribs,
- const PipelineResourceLayoutDesc& ResourceLayout) const
-{
- if (ResourceAttribs.GetInputType() == D3D_SIT_SAMPLER)
- {
- // Only use CombinedSamplerSuffix when looking for the sampler variable type
- return GetShaderVariableType(
- m_ShaderType, ResourceLayout.DefaultVariableType, ResourceLayout.Variables, ResourceLayout.NumVariables,
- [&](const char* VarName) //
- {
- return StreqSuff(ResourceAttribs.Name, VarName, m_SamplerSuffix);
- } //
- );
- }
- else
- {
- return GetShaderVariableType(m_ShaderType, ResourceAttribs.Name, ResourceLayout);
- }
-}
-
-Int32 ShaderResources::FindImmutableSampler(const D3DShaderResourceAttribs& ResourceAttribs,
- const PipelineResourceLayoutDesc& ResourceLayoutDesc,
- bool LogImmutableSamplerArrayError) const
-{
- VERIFY(ResourceAttribs.GetInputType() == D3D_SIT_SAMPLER, "Sampler is expected");
-
- auto ImtblSamplerInd =
- Diligent::FindImmutableSampler(ResourceLayoutDesc.ImmutableSamplers,
- ResourceLayoutDesc.NumImmutableSamplers,
- m_ShaderType,
- ResourceAttribs.Name,
- m_SamplerSuffix);
-
- if (ImtblSamplerInd >= 0 && ResourceAttribs.BindCount > 1)
- {
- Uint32 ShaderMajorVersion = 0;
- Uint32 ShaderMinorVersion = 0;
- GetShaderModel(ShaderMajorVersion, ShaderMinorVersion);
- if (ShaderMajorVersion >= 6 || ShaderMajorVersion >= 5 && ShaderMinorVersion >= 1)
- {
- if (LogImmutableSamplerArrayError)
- {
- LOG_ERROR_MESSAGE("Immutable sampler '", ResourceAttribs.Name, '[', ResourceAttribs.BindCount,
- "]' will be ignored because static sampler arrays are not allowed in shader model 5.1 and above. "
- "Compile the shader using shader model 5.0 or use non-array sampler variable.");
- }
- ImtblSamplerInd = -1;
- }
- }
-
- return ImtblSamplerInd;
-}
-
-
-D3DShaderResourceCounters ShaderResources::CountResources(const PipelineResourceLayoutDesc& ResourceLayout,
- const SHADER_RESOURCE_VARIABLE_TYPE* AllowedVarTypes,
- Uint32 NumAllowedTypes,
- bool CountImmutableSamplers) const noexcept
-{
- auto AllowedTypeBits = GetAllowedTypeBits(AllowedVarTypes, NumAllowedTypes);
-
- D3DShaderResourceCounters Counters;
- ProcessResources(
- [&](const D3DShaderResourceAttribs& CB, Uint32) //
- {
- auto VarType = FindVariableType(CB, ResourceLayout);
- if (IsAllowedType(VarType, AllowedTypeBits))
- ++Counters.NumCBs;
- },
- [&](const D3DShaderResourceAttribs& Sam, Uint32) //
- {
- auto VarType = FindVariableType(Sam, ResourceLayout);
- if (IsAllowedType(VarType, AllowedTypeBits))
- {
- if (!CountImmutableSamplers)
- {
- constexpr bool LogImtblSamplerArrayError = false;
- if (FindImmutableSampler(Sam, ResourceLayout, LogImtblSamplerArrayError) >= 0)
- return; // Skip immutable sampler if requested
- }
- ++Counters.NumSamplers;
- }
- },
- [&](const D3DShaderResourceAttribs& TexSRV, Uint32) //
- {
- auto VarType = FindVariableType(TexSRV, ResourceLayout);
- if (IsAllowedType(VarType, AllowedTypeBits))
- ++Counters.NumTexSRVs;
- },
- [&](const D3DShaderResourceAttribs& TexUAV, Uint32) //
- {
- auto VarType = FindVariableType(TexUAV, ResourceLayout);
- if (IsAllowedType(VarType, AllowedTypeBits))
- ++Counters.NumTexUAVs;
- },
- [&](const D3DShaderResourceAttribs& BufSRV, Uint32) //
- {
- auto VarType = FindVariableType(BufSRV, ResourceLayout);
- if (IsAllowedType(VarType, AllowedTypeBits))
- ++Counters.NumBufSRVs;
- },
- [&](const D3DShaderResourceAttribs& BufUAV, Uint32) //
- {
- auto VarType = FindVariableType(BufUAV, ResourceLayout);
- if (IsAllowedType(VarType, AllowedTypeBits))
- ++Counters.NumBufUAVs;
- },
- [&](const D3DShaderResourceAttribs& AccelStruct, Uint32) //
- {
- auto VarType = FindVariableType(AccelStruct, ResourceLayout);
- if (IsAllowedType(VarType, AllowedTypeBits))
- ++Counters.NumAccelStructs;
- } //
- );
-
- return Counters;
-}
-
#ifdef DILIGENT_DEVELOPMENT
void ShaderResources::DvpVerifyResourceLayout(const PipelineResourceLayoutDesc& ResourceLayout,
const ShaderResources* const pShaderResources[],