summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngine
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2020-12-19 04:11:07 +0000
committerassiduous <assiduous@diligentgraphics.com>2020-12-19 04:11:07 +0000
commit2777e133867530e717f189eb4206e332165f8321 (patch)
tree965459f1d4689ecbdc84c9c5d2e27131b7fa8030 /Graphics/GraphicsEngine
parentUpdated API to 240080 + fixed SBTBase (diff)
downloadDiligentCore-2777e133867530e717f189eb4206e332165f8321.tar.gz
DiligentCore-2777e133867530e717f189eb4206e332165f8321.zip
Some updates in D3D12 backend (DXIL patching, PSO initialization)
Diffstat (limited to 'Graphics/GraphicsEngine')
-rw-r--r--Graphics/GraphicsEngine/include/PipelineStateBase.hpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/Graphics/GraphicsEngine/include/PipelineStateBase.hpp b/Graphics/GraphicsEngine/include/PipelineStateBase.hpp
index 201a3c72..d094d91b 100644
--- a/Graphics/GraphicsEngine/include/PipelineStateBase.hpp
+++ b/Graphics/GraphicsEngine/include/PipelineStateBase.hpp
@@ -479,6 +479,7 @@ protected:
continue;
}
+ VERIFY(m_ShaderStageTypes[m_NumShaderStages] == SHADER_TYPE_UNKNOWN, "This shader stage is already initialized.");
m_ShaderStageTypes[m_NumShaderStages++] = iter->Type;
++iter;
}
@@ -541,8 +542,7 @@ protected:
// Correct description and compute offsets and tight strides
std::array<Uint32, MAX_BUFFER_SLOTS> Strides, TightStrides = {};
// Set all strides to an invalid value because an application may want to use 0 stride
- for (auto& Stride : Strides)
- Stride = LAYOUT_ELEMENT_AUTO_STRIDE;
+ Strides.fill(LAYOUT_ELEMENT_AUTO_STRIDE);
for (Uint32 i = 0; i < InputLayout.NumElements; ++i)
{
@@ -632,7 +632,7 @@ protected:
CopyResourceLayout(CreateInfo.PSODesc.ResourceLayout, this->m_Desc.ResourceLayout, MemPool);
size_t RTDataSize = sizeof(RayTracingPipelineData);
- // Reserve space for shader handles
+ // Allocate space for shader handles
const auto ShaderHandleSize = this->m_pDevice->GetProperties().ShaderGroupHandleSize;
const auto ShaderDataSize = ShaderHandleSize * (CreateInfo.GeneralShaderCount + CreateInfo.TriangleHitShaderCount + CreateInfo.ProceduralHitShaderCount);
RTDataSize += ShaderDataSize;
@@ -678,8 +678,8 @@ private:
{
if (SrcLayout.Variables != nullptr)
{
- auto* Variables = MemPool.ConstructArray<ShaderResourceVariableDesc>(SrcLayout.NumVariables);
- DstLayout.Variables = Variables;
+ auto* const Variables = MemPool.ConstructArray<ShaderResourceVariableDesc>(SrcLayout.NumVariables);
+ DstLayout.Variables = Variables;
for (Uint32 i = 0; i < SrcLayout.NumVariables; ++i)
{
const auto& SrcVar = SrcLayout.Variables[i];
@@ -690,8 +690,8 @@ private:
if (SrcLayout.ImmutableSamplers != nullptr)
{
- auto* ImmutableSamplers = MemPool.ConstructArray<ImmutableSamplerDesc>(SrcLayout.NumImmutableSamplers);
- DstLayout.ImmutableSamplers = ImmutableSamplers;
+ auto* const ImmutableSamplers = MemPool.ConstructArray<ImmutableSamplerDesc>(SrcLayout.NumImmutableSamplers);
+ DstLayout.ImmutableSamplers = ImmutableSamplers;
for (Uint32 i = 0; i < SrcLayout.NumImmutableSamplers; ++i)
{
const auto& SrcSmplr = SrcLayout.ImmutableSamplers[i];