Diligent Engine  v.2.4.g
PipelineStateBase.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2019-2021 Diligent Graphics LLC
3  * Copyright 2015-2019 Egor Yusov
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  * In no event and under no legal theory, whether in tort (including negligence),
18  * contract, or otherwise, unless required by applicable law (such as deliberate
19  * and grossly negligent acts) or agreed to in writing, shall any Contributor be
20  * liable for any damages, including any direct, indirect, special, incidental,
21  * or consequential damages of any character arising as a result of this License or
22  * out of the use or inability to use the software (including but not limited to damages
23  * for loss of goodwill, work stoppage, computer failure or malfunction, or any and
24  * all other commercial damages or losses), even if such Contributor has been advised
25  * of the possibility of such damages.
26  */
27 
28 #pragma once
29 
32 
33 #include <array>
34 #include <unordered_map>
35 #include <unordered_set>
36 #include <cstring>
37 
38 #include "PrivateConstants.h"
39 #include "PipelineState.h"
40 #include "DeviceObjectBase.hpp"
41 #include "STDAllocator.hpp"
42 #include "EngineMemory.h"
43 #include "GraphicsAccessories.hpp"
44 #include "FixedLinearAllocator.hpp"
45 #include "HashUtils.hpp"
47 
48 namespace Diligent
49 {
50 
51 // Validates graphics pipeline create attributes and throws an exception in case of an error.
53  const DeviceFeatures& Features) noexcept(false);
54 
55 // Validates compute pipeline create attributes and throws an exception in case of an error.
57  const DeviceFeatures& Features) noexcept(false);
58 
59 // Validates ray-tracing pipeline create attributes and throws an exception in case of an error.
60 void ValidateRayTracingPipelineCreateInfo(IRenderDevice* pDevice,
61  Uint32 MaxRecursion,
62  const RayTracingPipelineStateCreateInfo& CreateInfo,
63  const DeviceFeatures& Features) noexcept(false);
64 
69  PIPELINE_RESOURCE_FLAGS ResourceFlags,
70  Uint32 ArraySize,
71  const char* ShaderName,
72  const char* SignatureName) noexcept(false);
73 
74 
76 void CopyRTShaderGroupNames(std::unordered_map<HashMapStringKey, Uint32, HashMapStringKey::Hasher>& NameToGroupIndex,
77  const RayTracingPipelineStateCreateInfo& CreateInfo,
78  FixedLinearAllocator& MemPool) noexcept;
79 
80 void CorrectGraphicsPipelineDesc(GraphicsPipelineDesc& GraphicsPipeline) noexcept;
81 
82 
83 static constexpr Uint32 InvalidPipelineResourceLayoutVariableIndex = ~0u;
91  const char* Name,
92  SHADER_TYPE ShaderStage,
93  const char* CombinedSamplerSuffix);
94 
96 
98 template <typename EngineImplTraits>
99 class PipelineStateBase : public DeviceObjectBase<typename EngineImplTraits::PipelineStateInterface, typename EngineImplTraits::RenderDeviceImplType, PipelineStateDesc>
100 {
101 private:
102  // Base interface this class inherits (IPipelineStateD3D12, IPipelineStateVk, etc.)
103  using BaseInterface = typename EngineImplTraits::PipelineStateInterface;
104 
105  // Render device implementation type (RenderDeviceD3D12Impl, RenderDeviceVkImpl, etc.).
106  using RenderDeviceImplType = typename EngineImplTraits::RenderDeviceImplType;
107 
108  // Pipeline state implementation type (PipelineStateD3D12Impl, PipelineStateVkImpl, etc.).
109  using PipelineStateImplType = typename EngineImplTraits::PipelineStateImplType;
110 
111  // Pipeline resource signature implementation type (PipelineResourceSignatureD3D12Impl, PipelineResourceSignatureVkImpl, etc.).
112  using PipelineResourceSignatureImplType = typename EngineImplTraits::PipelineResourceSignatureImplType;
113 
115 
122  RenderDeviceImplType* pDevice,
123  const PipelineStateCreateInfo& CreateInfo,
124  bool bIsDeviceInternal = false) :
125  TDeviceObjectBase{pRefCounters, pDevice, CreateInfo.PSODesc, bIsDeviceInternal},
126  m_UsingImplicitSignature{CreateInfo.ppResourceSignatures == nullptr || CreateInfo.ResourceSignaturesCount == 0}
127  {
128  Uint64 DeviceQueuesMask = pDevice->GetCommandQueueMask();
129  DEV_CHECK_ERR((this->m_Desc.CommandQueueMask & DeviceQueuesMask) != 0,
130  "No bits in the command queue mask (0x", std::hex, this->m_Desc.CommandQueueMask,
131  ") correspond to one of ", pDevice->GetCommandQueueCount(), " available device command queues.");
132  this->m_Desc.CommandQueueMask &= DeviceQueuesMask;
133  }
134 
135 public:
137 
144  RenderDeviceImplType* pDevice,
145  const GraphicsPipelineStateCreateInfo& GraphicsPipelineCI,
146  bool bIsDeviceInternal = false) :
147  PipelineStateBase{pRefCounters, pDevice, static_cast<const PipelineStateCreateInfo&>(GraphicsPipelineCI), bIsDeviceInternal}
148  {
149  try
150  {
151  ValidateGraphicsPipelineCreateInfo(GraphicsPipelineCI, pDevice->GetDeviceCaps().Features);
152  }
153  catch (...)
154  {
155  Destruct();
156  throw;
157  }
158  }
159 
161 
168  RenderDeviceImplType* pDevice,
169  const ComputePipelineStateCreateInfo& ComputePipelineCI,
170  bool bIsDeviceInternal = false) :
171  PipelineStateBase{pRefCounters, pDevice, static_cast<const PipelineStateCreateInfo&>(ComputePipelineCI), bIsDeviceInternal}
172  {
173  try
174  {
175  ValidateComputePipelineCreateInfo(ComputePipelineCI, pDevice->GetDeviceCaps().Features);
176  }
177  catch (...)
178  {
179  Destruct();
180  throw;
181  }
182  }
183 
185 
192  RenderDeviceImplType* pDevice,
193  const RayTracingPipelineStateCreateInfo& RayTracingPipelineCI,
194  bool bIsDeviceInternal = false) :
195  PipelineStateBase{pRefCounters, pDevice, static_cast<const PipelineStateCreateInfo&>(RayTracingPipelineCI), bIsDeviceInternal}
196  {
197  try
198  {
199  ValidateRayTracingPipelineCreateInfo(pDevice, pDevice->GetProperties().MaxRayTracingRecursionDepth,
200  RayTracingPipelineCI, pDevice->GetDeviceCaps().Features);
201  }
202  catch (...)
203  {
204  Destruct();
205  throw;
206  }
207  }
208 
209 
211  {
212  /*
220  auto &PipelineStateRegistry = static_cast<TRenderDeviceBase*>(this->GetDevice())->GetBSRegistry();
221  auto &RasterizerStateRegistry = static_cast<TRenderDeviceBase*>(this->GetDevice())->GetRSRegistry();
222  auto &DSSRegistry = static_cast<TRenderDeviceBase*>(this->GetDevice())->GetDSSRegistry();
223  // StateObjectsRegistry::ReportDeletedObject() does not lock the registry, but only
224  // atomically increments the outstanding deleted objects counter.
225  PipelineStateRegistry.ReportDeletedObject();
226  RasterizerStateRegistry.ReportDeletedObject();
227  DSSRegistry.ReportDeletedObject();
228  */
229  VERIFY(m_IsDestructed, "This object must be explicitly destructed with Destruct()");
230  }
231 
232  void Destruct()
233  {
234  VERIFY(!m_IsDestructed, "This object has already been destructed");
235 
236  if (this->m_Desc.IsAnyGraphicsPipeline() && m_pGraphicsPipelineData != nullptr)
237  {
238  m_pGraphicsPipelineData->~GraphicsPipelineData();
239  }
240  else if (this->m_Desc.IsRayTracingPipeline() && m_pRayTracingPipelineData != nullptr)
241  {
242  m_pRayTracingPipelineData->~RayTracingPipelineData();
243  }
244 
245  if (m_Signatures != nullptr)
246  {
247  for (Uint32 i = 0; i < m_SignatureCount; ++i)
249  m_Signatures = nullptr;
250  }
251 
253  {
255  m_pPipelineDataRawMem = nullptr;
256  }
257 #if DILIGENT_DEBUG
258  m_IsDestructed = true;
259 #endif
260  }
261 
262  IMPLEMENT_QUERY_INTERFACE_IN_PLACE(IID_PipelineState, TDeviceObjectBase)
263 
264  Uint32 GetBufferStride(Uint32 BufferSlot) const
265  {
267  return BufferSlot < m_pGraphicsPipelineData->BufferSlotsUsed ? m_pGraphicsPipelineData->pStrides[BufferSlot] : 0;
268  }
269 
271  {
274  }
275 
277  {
280  }
281 
283  {
286  }
287 
289  {
293  }
294 
296  {
300  }
301 
302  inline void CopyShaderHandle(const char* Name, void* pData, size_t DataSize) const
303  {
306 
307  const auto ShaderHandleSize = m_pRayTracingPipelineData->ShaderHandleSize;
308  VERIFY(ShaderHandleSize <= DataSize, "DataSize (", DataSize, ") must be at least as large as the shader handle size (", ShaderHandleSize, ").");
309 
310  if (Name == nullptr || Name[0] == '\0')
311  {
312  // set shader binding to zero to skip shader execution
313  std::memset(pData, 0, ShaderHandleSize);
314  return;
315  }
316 
317  auto iter = m_pRayTracingPipelineData->NameToGroupIndex.find(Name);
318  if (iter != m_pRayTracingPipelineData->NameToGroupIndex.end())
319  {
320  VERIFY_EXPR(ShaderHandleSize * (iter->second + 1) <= m_pRayTracingPipelineData->ShaderDataSize);
321  std::memcpy(pData, &m_pRayTracingPipelineData->ShaderHandles[ShaderHandleSize * iter->second], ShaderHandleSize);
322  return;
323  }
324  UNEXPECTED("Can't find shader group '", Name, "'.");
325  }
326 
328  bool InitStaticResources) override final
329  {
330  *ppShaderResourceBinding = nullptr;
331 
333  {
334  LOG_ERROR_MESSAGE("IPipelineState::CreateShaderResourceBinding is not allowed for pipelines that use explicit "
335  "resource signatures. Use IPipelineResourceSignature::CreateShaderResourceBinding instead.");
336  return;
337  }
338 
339  return this->GetResourceSignature(0)->CreateShaderResourceBinding(ppShaderResourceBinding, InitStaticResources);
340  }
341 
343  const Char* Name) override final
344  {
346  {
347  LOG_ERROR_MESSAGE("IPipelineState::CreateShaderResourceBinding is not allowed for pipelines that use explicit "
348  "resource signatures. Use IPipelineResourceSignature::GetStaticVariableByName instead.");
349  return nullptr;
350  }
351 
352  if ((m_ActiveShaderStages & ShaderType) == 0)
353  {
354  LOG_WARNING_MESSAGE("Unable to find static variable '", Name, "' in shader stage ", GetShaderTypeLiteralName(ShaderType),
355  " as the stage is inactive in PSO '", this->m_Desc.Name, "'.");
356  return nullptr;
357  }
358 
359  return this->GetResourceSignature(0)->GetStaticVariableByName(ShaderType, Name);
360  }
361 
363  Uint32 Index) override final
364  {
366  {
367  LOG_ERROR_MESSAGE("IPipelineState::GetStaticVariableByIndex is not allowed for pipelines that use explicit "
368  "resource signatures. Use IPipelineResourceSignature::GetStaticVariableByIndex instead.");
369  return nullptr;
370  }
371 
372  if ((m_ActiveShaderStages & ShaderType) == 0)
373  {
374  LOG_WARNING_MESSAGE("Unable to get static variable at index ", Index, " in shader stage ", GetShaderTypeLiteralName(ShaderType),
375  " as the stage is inactive in PSO '", this->m_Desc.Name, "'.");
376  return nullptr;
377  }
378 
379  return this->GetResourceSignature(0)->GetStaticVariableByIndex(ShaderType, Index);
380  }
381 
383  {
385  {
386  LOG_ERROR_MESSAGE("IPipelineState::GetStaticVariableCount is not allowed for pipelines that use explicit "
387  "resource signatures. Use IPipelineResourceSignature::GetStaticVariableCount instead.");
388  return 0;
389  }
390 
391  if ((m_ActiveShaderStages & ShaderType) == 0)
392  {
393  LOG_WARNING_MESSAGE("Unable to get the number of static variables in shader stage ", GetShaderTypeLiteralName(ShaderType),
394  " as the stage is inactive in PSO '", this->m_Desc.Name, "'.");
395  return 0;
396  }
397 
398  return this->GetResourceSignature(0)->GetStaticVariableCount(ShaderType);
399  }
400 
401  virtual void DILIGENT_CALL_TYPE BindStaticResources(Uint32 ShaderFlags, IResourceMapping* pResourceMapping, Uint32 Flags) override final
402  {
404  {
405  LOG_ERROR_MESSAGE("IPipelineState::BindStaticResources is not allowed for pipelines that use explicit "
406  "resource signatures. Use IPipelineResourceSignature::BindStaticResources instead.");
407  return;
408  }
409 
410  return this->GetResourceSignature(0)->BindStaticResources(ShaderFlags, pResourceMapping, Flags);
411  }
412 
414  {
416  {
417  LOG_ERROR_MESSAGE("IPipelineState::InitializeStaticSRBResources is not allowed for pipelines that use explicit "
418  "resource signatures. Use IPipelineResourceSignature::InitializeStaticSRBResources instead.");
419  return;
420  }
421 
422  return this->GetResourceSignature(0)->InitializeStaticSRBResources(pSRB);
423  }
424 
426  virtual Uint32 DILIGENT_CALL_TYPE GetResourceSignatureCount() const override final
427  {
428  return m_SignatureCount;
429  }
430 
432  virtual PipelineResourceSignatureImplType* DILIGENT_CALL_TYPE GetResourceSignature(Uint32 Index) const override final
433  {
434  VERIFY_EXPR(Index < m_SignatureCount);
435  return m_Signatures[Index];
436  }
437 
439  virtual bool DILIGENT_CALL_TYPE IsCompatibleWith(const IPipelineState* pPSO) const override // May be overriden
440  {
441  DEV_CHECK_ERR(pPSO != nullptr, "pPSO must not be null");
442 
443  if (pPSO == this)
444  return true;
445 
446  const auto& lhs = *static_cast<const PipelineStateImplType*>(this);
447  const auto& rhs = *ValidatedCast<const PipelineStateImplType>(pPSO);
448 
449  const auto SignCount = lhs.GetResourceSignatureCount();
450  if (SignCount != rhs.GetResourceSignatureCount())
451  return false;
452 
453  for (Uint32 s = 0; s < SignCount; ++s)
454  {
455  const auto* pLhsSign = GetResourceSignature(s);
456  const auto* pRhsSign = rhs.GetResourceSignature(s);
457  if (!PipelineResourceSignatureImplType::SignaturesCompatible(pLhsSign, pRhsSign))
458  return false;
459  }
460 
461  return true;
462  }
463 
465  {
466  return m_ActiveShaderStages;
467  }
468 
469 protected:
470  using TNameToGroupIndexMap = std::unordered_map<HashMapStringKey, Uint32, HashMapStringKey::Hasher>;
471 
473  FixedLinearAllocator& MemPool) noexcept
474  {
475  MemPool.AddSpace<GraphicsPipelineData>();
476  ReserveResourceLayout(CreateInfo.PSODesc.ResourceLayout, MemPool);
477  ReserveResourceSignatures(CreateInfo, MemPool);
478 
479  const auto& InputLayout = CreateInfo.GraphicsPipeline.InputLayout;
480  Uint32 BufferSlotsUsed = 0;
481  MemPool.AddSpace<LayoutElement>(InputLayout.NumElements);
482  for (Uint32 i = 0; i < InputLayout.NumElements; ++i)
483  {
484  auto& LayoutElem = InputLayout.LayoutElements[i];
485  MemPool.AddSpaceForString(LayoutElem.HLSLSemantic);
486  BufferSlotsUsed = std::max(BufferSlotsUsed, LayoutElem.BufferSlot + 1);
487  }
488 
489  MemPool.AddSpace<Uint32>(BufferSlotsUsed);
490 
491  static_assert(std::is_trivially_destructible<decltype(*InputLayout.LayoutElements)>::value, "Add destructor for this object to Destruct()");
492  }
493 
495  FixedLinearAllocator& MemPool) noexcept
496  {
497  ReserveResourceLayout(CreateInfo.PSODesc.ResourceLayout, MemPool);
498  ReserveResourceSignatures(CreateInfo, MemPool);
499  }
500 
502  FixedLinearAllocator& MemPool) noexcept
503  {
504  size_t RTDataSize = sizeof(RayTracingPipelineData);
505  // Reserve space for shader handles
506  const auto ShaderHandleSize = this->m_pDevice->GetProperties().ShaderGroupHandleSize;
507  RTDataSize += ShaderHandleSize * (CreateInfo.GeneralShaderCount + CreateInfo.TriangleHitShaderCount + CreateInfo.ProceduralHitShaderCount);
508  // Extra bytes were reserved to avoid compiler errors on zero-sized arrays
509  RTDataSize -= sizeof(RayTracingPipelineData::ShaderHandles);
510  MemPool.AddSpace(RTDataSize, alignof(RayTracingPipelineData));
511 
512  for (Uint32 i = 0; i < CreateInfo.GeneralShaderCount; ++i)
513  {
514  MemPool.AddSpaceForString(CreateInfo.pGeneralShaders[i].Name);
515  }
516  for (Uint32 i = 0; i < CreateInfo.TriangleHitShaderCount; ++i)
517  {
518  MemPool.AddSpaceForString(CreateInfo.pTriangleHitShaders[i].Name);
519  }
520  for (Uint32 i = 0; i < CreateInfo.ProceduralHitShaderCount; ++i)
521  {
522  MemPool.AddSpaceForString(CreateInfo.pProceduralHitShaders[i].Name);
523  }
524 
525  ReserveResourceLayout(CreateInfo.PSODesc.ResourceLayout, MemPool);
526  ReserveResourceSignatures(CreateInfo, MemPool);
527  }
528 
529 
530  template <typename ShaderImplType, typename TShaderStages>
532  TShaderStages& ShaderStages)
533  {
535 
536  ShaderStages.clear();
537  auto AddShaderStage = [&](IShader* pShader) {
538  if (pShader != nullptr)
539  {
540  ShaderStages.emplace_back(ValidatedCast<ShaderImplType>(pShader));
541  const auto ShaderType = pShader->GetDesc().ShaderType;
543  "Shader stage ", GetShaderTypeLiteralName(ShaderType), " has already been initialized in PSO '", this->m_Desc.Name, "'.");
545 #ifdef DILIGENT_DEBUG
546  for (Uint32 i = 0; i + 1 < ShaderStages.size(); ++i)
547  VERIFY_EXPR(GetShaderStageType(ShaderStages[i]) != ShaderType);
548 #endif
549  }
550  };
551 
552  switch (CreateInfo.PSODesc.PipelineType)
553  {
555  {
556  AddShaderStage(CreateInfo.pVS);
557  AddShaderStage(CreateInfo.pHS);
558  AddShaderStage(CreateInfo.pDS);
559  AddShaderStage(CreateInfo.pGS);
560  AddShaderStage(CreateInfo.pPS);
561  VERIFY(CreateInfo.pVS != nullptr, "Vertex shader must not be null");
562  break;
563  }
564 
565  case PIPELINE_TYPE_MESH:
566  {
567  AddShaderStage(CreateInfo.pAS);
568  AddShaderStage(CreateInfo.pMS);
569  AddShaderStage(CreateInfo.pPS);
570  VERIFY(CreateInfo.pMS != nullptr, "Mesh shader must not be null");
571  break;
572  }
573 
574  default:
575  UNEXPECTED("unknown pipeline type");
576  }
577 
578  VERIFY_EXPR(!ShaderStages.empty());
579  }
580 
581  template <typename ShaderImplType, typename TShaderStages>
583  TShaderStages& ShaderStages)
584  {
586 
587  ShaderStages.clear();
588 
590  VERIFY_EXPR(CreateInfo.pCS != nullptr);
592 
593  ShaderStages.emplace_back(ValidatedCast<ShaderImplType>(CreateInfo.pCS));
595 
596  VERIFY_EXPR(!ShaderStages.empty());
597  }
598 
599  template <typename ShaderImplType, typename TShaderStages>
601  TShaderStages& ShaderStages)
602  {
604 
605  std::unordered_set<IShader*> UniqueShaders;
606 
607  auto AddShader = [&ShaderStages, &UniqueShaders, this](IShader* pShader) {
608  if (pShader != nullptr && UniqueShaders.insert(pShader).second)
609  {
610  const auto ShaderType = pShader->GetDesc().ShaderType;
612  auto& Stage = ShaderStages[StageInd];
614  Stage.Append(ValidatedCast<ShaderImplType>(pShader));
615  }
616  };
617 
618  ShaderStages.clear();
619  ShaderStages.resize(MAX_SHADERS_IN_PIPELINE);
620 
621  for (Uint32 i = 0; i < CreateInfo.GeneralShaderCount; ++i)
622  {
623  AddShader(CreateInfo.pGeneralShaders[i].pShader);
624  }
625  for (Uint32 i = 0; i < CreateInfo.TriangleHitShaderCount; ++i)
626  {
627  AddShader(CreateInfo.pTriangleHitShaders[i].pClosestHitShader);
628  AddShader(CreateInfo.pTriangleHitShaders[i].pAnyHitShader);
629  }
630  for (Uint32 i = 0; i < CreateInfo.ProceduralHitShaderCount; ++i)
631  {
632  AddShader(CreateInfo.pProceduralHitShaders[i].pIntersectionShader);
633  AddShader(CreateInfo.pProceduralHitShaders[i].pClosestHitShader);
634  AddShader(CreateInfo.pProceduralHitShaders[i].pAnyHitShader);
635  }
636 
638  LOG_ERROR_AND_THROW("At least one shader with type SHADER_TYPE_RAY_GEN must be provided.");
639 
640  // Remove empty stages
641  for (auto iter = ShaderStages.begin(); iter != ShaderStages.end();)
642  {
643  if (iter->Count() == 0)
644  {
645  iter = ShaderStages.erase(iter);
646  continue;
647  }
648 
649  ++iter;
650  }
651 
652  VERIFY_EXPR(!ShaderStages.empty());
653  }
654 
655 
657  FixedLinearAllocator& MemPool)
658  {
659  this->m_pGraphicsPipelineData = MemPool.Construct<GraphicsPipelineData>();
660  void* Ptr = MemPool.ReleaseOwnership();
662 
663  auto& GraphicsPipeline = this->m_pGraphicsPipelineData->Desc;
664  auto& pRenderPass = this->m_pGraphicsPipelineData->pRenderPass;
665  auto& BufferSlotsUsed = this->m_pGraphicsPipelineData->BufferSlotsUsed;
666  auto& pStrides = this->m_pGraphicsPipelineData->pStrides;
667 
668  GraphicsPipeline = CreateInfo.GraphicsPipeline;
669  CorrectGraphicsPipelineDesc(GraphicsPipeline);
670 
671  CopyResourceLayout(CreateInfo.PSODesc.ResourceLayout, this->m_Desc.ResourceLayout, MemPool);
672  CopyResourceSignatures(CreateInfo, MemPool);
673 
674  pRenderPass = GraphicsPipeline.pRenderPass;
675  if (pRenderPass)
676  {
677  const auto& RPDesc = pRenderPass->GetDesc();
678  VERIFY_EXPR(GraphicsPipeline.SubpassIndex < RPDesc.SubpassCount);
679  const auto& Subpass = RPDesc.pSubpasses[GraphicsPipeline.SubpassIndex];
680 
681  GraphicsPipeline.NumRenderTargets = static_cast<Uint8>(Subpass.RenderTargetAttachmentCount);
682  for (Uint32 rt = 0; rt < Subpass.RenderTargetAttachmentCount; ++rt)
683  {
684  const auto& RTAttachmentRef = Subpass.pRenderTargetAttachments[rt];
685  if (RTAttachmentRef.AttachmentIndex != ATTACHMENT_UNUSED)
686  {
687  VERIFY_EXPR(RTAttachmentRef.AttachmentIndex < RPDesc.AttachmentCount);
688  GraphicsPipeline.RTVFormats[rt] = RPDesc.pAttachments[RTAttachmentRef.AttachmentIndex].Format;
689  }
690  }
691 
692  if (Subpass.pDepthStencilAttachment != nullptr)
693  {
694  const auto& DSAttachmentRef = *Subpass.pDepthStencilAttachment;
695  if (DSAttachmentRef.AttachmentIndex != ATTACHMENT_UNUSED)
696  {
697  VERIFY_EXPR(DSAttachmentRef.AttachmentIndex < RPDesc.AttachmentCount);
698  GraphicsPipeline.DSVFormat = RPDesc.pAttachments[DSAttachmentRef.AttachmentIndex].Format;
699  }
700  }
701  }
702 
703  const auto& InputLayout = GraphicsPipeline.InputLayout;
704  LayoutElement* pLayoutElements = MemPool.ConstructArray<LayoutElement>(InputLayout.NumElements);
705  for (size_t Elem = 0; Elem < InputLayout.NumElements; ++Elem)
706  {
707  const auto& SrcElem = InputLayout.LayoutElements[Elem];
708  pLayoutElements[Elem] = SrcElem;
709  VERIFY_EXPR(SrcElem.HLSLSemantic != nullptr);
710  pLayoutElements[Elem].HLSLSemantic = MemPool.CopyString(SrcElem.HLSLSemantic);
711  }
712  GraphicsPipeline.InputLayout.LayoutElements = pLayoutElements;
713 
714 
715  // Correct description and compute offsets and tight strides
716  std::array<Uint32, MAX_BUFFER_SLOTS> Strides, TightStrides = {};
717  // Set all strides to an invalid value because an application may want to use 0 stride
718  Strides.fill(LAYOUT_ELEMENT_AUTO_STRIDE);
719 
720  for (Uint32 i = 0; i < InputLayout.NumElements; ++i)
721  {
722  auto& LayoutElem = pLayoutElements[i];
723 
724  if (LayoutElem.ValueType == VT_FLOAT32 || LayoutElem.ValueType == VT_FLOAT16)
725  LayoutElem.IsNormalized = false; // Floating point values cannot be normalized
726 
727  auto BuffSlot = LayoutElem.BufferSlot;
728  if (BuffSlot >= Strides.size())
729  {
730  UNEXPECTED("Buffer slot (", BuffSlot, ") exceeds the maximum allowed value (", Strides.size() - 1, ")");
731  continue;
732  }
733  BufferSlotsUsed = std::max(BufferSlotsUsed, static_cast<Uint8>(BuffSlot + 1));
734 
735  auto& CurrAutoStride = TightStrides[BuffSlot];
736  // If offset is not explicitly specified, use current auto stride value
737  if (LayoutElem.RelativeOffset == LAYOUT_ELEMENT_AUTO_OFFSET)
738  {
739  LayoutElem.RelativeOffset = CurrAutoStride;
740  }
741 
742  // If stride is explicitly specified, use it for the current buffer slot
743  if (LayoutElem.Stride != LAYOUT_ELEMENT_AUTO_STRIDE)
744  {
745  // Verify that the value is consistent with the previously specified stride, if any
746  if (Strides[BuffSlot] != LAYOUT_ELEMENT_AUTO_STRIDE && Strides[BuffSlot] != LayoutElem.Stride)
747  {
748  LOG_ERROR_MESSAGE("Inconsistent strides are specified for buffer slot ", BuffSlot,
749  ". Input element at index ", LayoutElem.InputIndex, " explicitly specifies stride ",
750  LayoutElem.Stride, ", while current value is ", Strides[BuffSlot],
751  ". Specify consistent strides or use LAYOUT_ELEMENT_AUTO_STRIDE to allow "
752  "the engine compute strides automatically.");
753  }
754  Strides[BuffSlot] = LayoutElem.Stride;
755  }
756 
757  CurrAutoStride = std::max(CurrAutoStride, LayoutElem.RelativeOffset + LayoutElem.NumComponents * GetValueSize(LayoutElem.ValueType));
758  }
759 
760  for (Uint32 i = 0; i < InputLayout.NumElements; ++i)
761  {
762  auto& LayoutElem = pLayoutElements[i];
763 
764  auto BuffSlot = LayoutElem.BufferSlot;
765  // If no input elements explicitly specified stride for this buffer slot, use automatic stride
766  if (Strides[BuffSlot] == LAYOUT_ELEMENT_AUTO_STRIDE)
767  {
768  Strides[BuffSlot] = TightStrides[BuffSlot];
769  }
770  else
771  {
772  if (Strides[BuffSlot] < TightStrides[BuffSlot])
773  {
774  LOG_ERROR_MESSAGE("Stride ", Strides[BuffSlot], " explicitly specified for slot ", BuffSlot,
775  " is smaller than the minimum stride ", TightStrides[BuffSlot],
776  " required to accomodate all input elements.");
777  }
778  }
779  if (LayoutElem.Stride == LAYOUT_ELEMENT_AUTO_STRIDE)
780  LayoutElem.Stride = Strides[BuffSlot];
781  }
782 
783  pStrides = MemPool.ConstructArray<Uint32>(BufferSlotsUsed);
784 
785  // Set strides for all unused slots to 0
786  for (Uint32 i = 0; i < BufferSlotsUsed; ++i)
787  {
788  auto Stride = Strides[i];
789  pStrides[i] = Stride != LAYOUT_ELEMENT_AUTO_STRIDE ? Stride : 0;
790  }
791  }
792 
794  FixedLinearAllocator& MemPool)
795  {
797 
798  CopyResourceLayout(CreateInfo.PSODesc.ResourceLayout, this->m_Desc.ResourceLayout, MemPool);
799  CopyResourceSignatures(CreateInfo, MemPool);
800  }
801 
803  FixedLinearAllocator& MemPool) noexcept
804  {
805  size_t RTDataSize = sizeof(RayTracingPipelineData);
806  // Allocate space for shader handles
807  const auto ShaderHandleSize = this->m_pDevice->GetProperties().ShaderGroupHandleSize;
808  const auto ShaderDataSize = ShaderHandleSize * (CreateInfo.GeneralShaderCount + CreateInfo.TriangleHitShaderCount + CreateInfo.ProceduralHitShaderCount);
809  RTDataSize += ShaderDataSize;
810  // Extra bytes were reserved to avoid compiler errors on zero-sized arrays
811  RTDataSize -= sizeof(RayTracingPipelineData::ShaderHandles);
812 
813  this->m_pRayTracingPipelineData = static_cast<RayTracingPipelineData*>(MemPool.Allocate(RTDataSize, alignof(RayTracingPipelineData)));
814  new (this->m_pRayTracingPipelineData) RayTracingPipelineData{};
815  this->m_pRayTracingPipelineData->ShaderHandleSize = ShaderHandleSize;
816  this->m_pRayTracingPipelineData->Desc = CreateInfo.RayTracingPipeline;
817  this->m_pRayTracingPipelineData->ShaderDataSize = ShaderDataSize;
818 
819  void* Ptr = MemPool.ReleaseOwnership();
821 
823  CopyRTShaderGroupNames(NameToGroupIndex, CreateInfo, MemPool);
824 
825  CopyResourceLayout(CreateInfo.PSODesc.ResourceLayout, this->m_Desc.ResourceLayout, MemPool);
826  CopyResourceSignatures(CreateInfo, MemPool);
827  }
828 
829 
830  // Resource attribution properties
832  {
833  static constexpr Uint32 InvalidSignatureIndex = ~0u;
834  static constexpr Uint32 InvalidResourceIndex = PipelineResourceSignatureImplType::InvalidResourceIndex;
835  static constexpr Uint32 InvalidSamplerIndex = InvalidImmutableSamplerIndex;
836 
837  const PipelineResourceSignatureImplType* pSignature = nullptr;
838 
842 
843  ResourceAttribution() noexcept {}
844  ResourceAttribution(const PipelineResourceSignatureImplType* _pSignature,
845  Uint32 _SignatureIndex,
846  Uint32 _ResourceIndex,
847  Uint32 _ImmutableSamplerIndex = InvalidResourceIndex) noexcept :
848  pSignature{_pSignature},
849  SignatureIndex{_SignatureIndex},
850  ResourceIndex{_ResourceIndex},
851  ImmutableSamplerIndex{_ImmutableSamplerIndex}
852  {
853  VERIFY_EXPR(pSignature == nullptr || pSignature->GetDesc().BindingIndex == SignatureIndex);
855  }
856 
857  explicit operator bool() const
858  {
859  return ((SignatureIndex != InvalidSignatureIndex) &&
861  }
862 
863  bool IsImmutableSampler() const
864  {
865  return operator bool() && ImmutableSamplerIndex != InvalidSamplerIndex;
866  }
867  };
868 
869  ResourceAttribution GetResourceAttribution(const char* Name, SHADER_TYPE Stage) const
870  {
871  const auto* const pThis = static_cast<const PipelineStateImplType*>(this);
872 
873  const auto SignCount = pThis->GetResourceSignatureCount();
874  for (Uint32 sign = 0; sign < SignCount; ++sign)
875  {
876  const PipelineResourceSignatureImplType* const pSignature = pThis->GetResourceSignature(sign);
877  if (pSignature == nullptr)
878  continue;
879 
880  const auto ResIndex = pSignature->FindResource(Stage, Name);
882  return ResourceAttribution{pSignature, sign, ResIndex};
883  else
884  {
885  const auto ImtblSamIndex = pSignature->FindImmutableSampler(Stage, Name);
886  if (ImtblSamIndex != ResourceAttribution::InvalidSamplerIndex)
887  return ResourceAttribution{pSignature, sign, ResourceAttribution::InvalidResourceIndex, ImtblSamIndex};
888  }
889  }
890  return ResourceAttribution{};
891  }
892 
893 private:
894  static void ReserveResourceLayout(const PipelineResourceLayoutDesc& SrcLayout, FixedLinearAllocator& MemPool) noexcept
895  {
896  if (SrcLayout.Variables != nullptr)
897  {
898  MemPool.AddSpace<ShaderResourceVariableDesc>(SrcLayout.NumVariables);
899  for (Uint32 i = 0; i < SrcLayout.NumVariables; ++i)
900  {
901  VERIFY(SrcLayout.Variables[i].Name != nullptr, "Variable name can't be null");
902  MemPool.AddSpaceForString(SrcLayout.Variables[i].Name);
903  }
904  }
905 
906  if (SrcLayout.ImmutableSamplers != nullptr)
907  {
908  MemPool.AddSpace<ImmutableSamplerDesc>(SrcLayout.NumImmutableSamplers);
909  for (Uint32 i = 0; i < SrcLayout.NumImmutableSamplers; ++i)
910  {
911  VERIFY(SrcLayout.ImmutableSamplers[i].SamplerOrTextureName != nullptr, "Immutable sampler or texture name can't be null");
912  MemPool.AddSpaceForString(SrcLayout.ImmutableSamplers[i].SamplerOrTextureName);
913  }
914  }
915 
916  static_assert(std::is_trivially_destructible<decltype(*SrcLayout.Variables)>::value, "Add destructor for this object to Destruct()");
917  static_assert(std::is_trivially_destructible<decltype(*SrcLayout.ImmutableSamplers)>::value, "Add destructor for this object to Destruct()");
918  }
919 
920  static void CopyResourceLayout(const PipelineResourceLayoutDesc& SrcLayout, PipelineResourceLayoutDesc& DstLayout, FixedLinearAllocator& MemPool)
921  {
922  if (SrcLayout.Variables != nullptr)
923  {
924  auto* const Variables = MemPool.ConstructArray<ShaderResourceVariableDesc>(SrcLayout.NumVariables);
925  DstLayout.Variables = Variables;
926  for (Uint32 i = 0; i < SrcLayout.NumVariables; ++i)
927  {
928  const auto& SrcVar = SrcLayout.Variables[i];
929  Variables[i] = SrcVar;
930  Variables[i].Name = MemPool.CopyString(SrcVar.Name);
931  }
932  }
933 
934  if (SrcLayout.ImmutableSamplers != nullptr)
935  {
936  auto* const ImmutableSamplers = MemPool.ConstructArray<ImmutableSamplerDesc>(SrcLayout.NumImmutableSamplers);
937  DstLayout.ImmutableSamplers = ImmutableSamplers;
938  for (Uint32 i = 0; i < SrcLayout.NumImmutableSamplers; ++i)
939  {
940  const auto& SrcSmplr = SrcLayout.ImmutableSamplers[i];
941 #ifdef DILIGENT_DEVELOPMENT
942  {
943  const auto& BorderColor = SrcSmplr.Desc.BorderColor;
944  if (!((BorderColor[0] == 0 && BorderColor[1] == 0 && BorderColor[2] == 0 && BorderColor[3] == 0) ||
945  (BorderColor[0] == 0 && BorderColor[1] == 0 && BorderColor[2] == 0 && BorderColor[3] == 1) ||
946  (BorderColor[0] == 1 && BorderColor[1] == 1 && BorderColor[2] == 1 && BorderColor[3] == 1)))
947  {
948  LOG_WARNING_MESSAGE("Immutable sampler for variable \"", SrcSmplr.SamplerOrTextureName, "\" specifies border color (",
949  BorderColor[0], ", ", BorderColor[1], ", ", BorderColor[2], ", ", BorderColor[3],
950  "). D3D12 static samplers only allow transparent black (0,0,0,0), opaque black (0,0,0,1) or opaque white (1,1,1,1) as border colors");
951  }
952  }
953 #endif
954 
955  ImmutableSamplers[i] = SrcSmplr;
956  ImmutableSamplers[i].SamplerOrTextureName = MemPool.CopyString(SrcSmplr.SamplerOrTextureName);
957  }
958  }
959  }
960 
961  void ReserveResourceSignatures(const PipelineStateCreateInfo& CreateInfo, FixedLinearAllocator& MemPool)
962  {
964  {
965  VERIFY_EXPR(CreateInfo.ResourceSignaturesCount == 0 || CreateInfo.ppResourceSignatures == nullptr);
966  m_SignatureCount = 1;
967  }
968  else
969  {
970  VERIFY_EXPR(CreateInfo.ResourceSignaturesCount > 0 && CreateInfo.ppResourceSignatures != nullptr);
971  Uint32 MaxSignatureBindingIndex = 0;
972  for (Uint32 i = 0; i < CreateInfo.ResourceSignaturesCount; ++i)
973  {
974  const auto* pSignature = ValidatedCast<PipelineResourceSignatureImplType>(CreateInfo.ppResourceSignatures[i]);
975  VERIFY(pSignature != nullptr, "Pipeline resource signature at index ", i, " is null. This error should've been caught by ValidatePipelineResourceSignatures.");
976 
977  Uint32 Index = pSignature->GetDesc().BindingIndex;
978  VERIFY(Index < MAX_RESOURCE_SIGNATURES,
979  "Pipeline resource signature specifies binding index ", Uint32{Index}, " that exceeds the limit (", MAX_RESOURCE_SIGNATURES - 1,
980  "). This error should've been caught by ValidatePipelineResourceSignatureDesc.");
981 
982  MaxSignatureBindingIndex = std::max(MaxSignatureBindingIndex, Uint32{Index});
983  }
984  VERIFY_EXPR(MaxSignatureBindingIndex < MAX_RESOURCE_SIGNATURES);
985  m_SignatureCount = static_cast<decltype(m_SignatureCount)>(MaxSignatureBindingIndex + 1);
986  VERIFY_EXPR(m_SignatureCount == MaxSignatureBindingIndex + 1);
987  }
988 
989  MemPool.AddSpace<SignatureAutoPtrType>(m_SignatureCount);
990  }
991 
992  void CopyResourceSignatures(const PipelineStateCreateInfo& CreateInfo, FixedLinearAllocator& MemPool)
993  {
994  m_Signatures = MemPool.ConstructArray<SignatureAutoPtrType>(m_SignatureCount);
996  {
997  VERIFY_EXPR(CreateInfo.ResourceSignaturesCount != 0 && CreateInfo.ppResourceSignatures != nullptr);
998  for (Uint32 i = 0; i < CreateInfo.ResourceSignaturesCount; ++i)
999  {
1000  auto* pSignature = ValidatedCast<PipelineResourceSignatureImplType>(CreateInfo.ppResourceSignatures[i]);
1001  VERIFY_EXPR(pSignature != nullptr);
1002 
1003  const Uint32 Index = pSignature->GetDesc().BindingIndex;
1004 
1005 #ifdef DILIGENT_DEBUG
1006  VERIFY_EXPR(Index < m_SignatureCount);
1007 
1008  VERIFY(m_Signatures[Index] == nullptr,
1009  "Pipeline resource signature '", pSignature->GetDesc().Name, "' at index ", Uint32{Index},
1010  " conflicts with another resource signature '", m_Signatures[Index]->GetDesc().Name,
1011  "' that uses the same index. This error should've been caught by ValidatePipelineResourceSignatures.");
1012 
1013  for (Uint32 s = 0, StageCount = pSignature->GetNumActiveShaderStages(); s < StageCount; ++s)
1014  {
1015  const auto ShaderType = pSignature->GetActiveShaderStageType(s);
1016  VERIFY(IsConsistentShaderType(ShaderType, CreateInfo.PSODesc.PipelineType),
1017  "Pipeline resource signature '", pSignature->GetDesc().Name, "' at index ", Uint32{Index},
1018  " has shader stage '", GetShaderTypeLiteralName(ShaderType), "' that is not compatible with pipeline type '",
1019  GetPipelineTypeString(CreateInfo.PSODesc.PipelineType), "'.");
1020  }
1021 #endif
1022 
1023  m_Signatures[Index] = pSignature;
1024  }
1025  }
1026  }
1027 
1028 protected:
1031 
1034 
1040 
1043  SignatureAutoPtrType* m_Signatures = nullptr; // [m_SignatureCount]
1044 
1046  {
1048 
1050 
1051  Uint32* pStrides = nullptr;
1053  };
1054 
1056  {
1058 
1059  // Mapping from the shader group name to its index in the pipeline.
1060  // It is used to find the shader handle in ShaderHandles array.
1062 
1065 
1066  // Array of shader handles for every group in the pipeline.
1067  // The handles will be copied to the SBT using NameToGroupIndex to find
1068  // handles by group name.
1069  // The actual array size will be determined at run time and will be stored
1070  // in ShaderDataSize.
1071  Uint8 ShaderHandles[sizeof(void*)] = {};
1072  };
1073  static_assert(offsetof(RayTracingPipelineData, ShaderHandles) % sizeof(void*) == 0, "ShaderHandles member is expected to be sizeof(void*)-aligned");
1074 
1075  union
1076  {
1077  GraphicsPipelineData* m_pGraphicsPipelineData;
1078  RayTracingPipelineData* m_pRayTracingPipelineData;
1079  void* m_pPipelineDataRawMem = nullptr;
1080  };
1081 
1082 #ifdef DILIGENT_DEBUG
1083  bool m_IsDestructed = false;
1084 #endif
1085 };
1086 
1087 } // namespace Diligent
Diligent::ValidateComputePipelineCreateInfo
void ValidateComputePipelineCreateInfo(const ComputePipelineStateCreateInfo &CreateInfo, const DeviceFeatures &Features) noexcept(false)
Definition: PipelineStateBase.cpp:454
Diligent::FixedLinearAllocator
Implementation of a linear allocator on a fixed-size memory page.
Definition: FixedLinearAllocator.hpp:45
Diligent::PipelineStateDesc::PipelineType
PIPELINE_TYPE PipelineType
Pipeline type.
Definition: PipelineState.h:320
Diligent::PipelineStateBase::SignatureAutoPtrType
RefCntAutoPtr< PipelineResourceSignatureImplType > SignatureAutoPtrType
Resource signatures arranged by their binding indices.
Definition: PipelineStateBase.hpp:1042
Diligent::LayoutElement
Description of a single element of the input layout.
Definition: InputLayout.h:63
Diligent::PipelineStateDesc::IsRayTracingPipeline
bool IsRayTracingPipeline() const
Definition: PipelineState.h:338
Diligent::RayTracingPipelineStateCreateInfo::ProceduralHitShaderCount
Uint32 ProceduralHitShaderCount
The number of procedural shader groups.
Definition: PipelineState.h:466
Diligent::PipelineStateBase::ResourceAttribution::ResourceAttribution
ResourceAttribution() noexcept
Definition: PipelineStateBase.hpp:843
Diligent::IReferenceCounters
Base interface for a reference counter object that stores the number of strong and weak references an...
Definition: ReferenceCounters.h:44
Diligent::ShaderResourceVariableDesc::Name
const Char * Name
Shader variable name.
Definition: PipelineState.h:84
Diligent::SHADER_TYPE_RAY_GEN
@ SHADER_TYPE_RAY_GEN
Ray generation shader.
Definition: GraphicsTypes.h:76
LOG_ERROR_MESSAGE
#define LOG_ERROR_MESSAGE(...)
Definition: Errors.hpp:122
Diligent::PipelineStateBase::GetRenderPassPtr
RefCntAutoPtr< IRenderPass > & GetRenderPassPtr()
Definition: PipelineStateBase.hpp:282
Diligent::ImmutableSamplerDesc::Desc
struct SamplerDesc Desc
Sampler description.
Definition: PipelineResourceSignature.h:61
GraphicsAccessories.hpp
Diligent::PipelineStateBase::ReserveSpaceForPipelineDesc
void ReserveSpaceForPipelineDesc(const GraphicsPipelineStateCreateInfo &CreateInfo, FixedLinearAllocator &MemPool) noexcept
Definition: PipelineStateBase.hpp:472
Diligent::PipelineStateBase::ResourceAttribution::InvalidResourceIndex
static constexpr Uint32 InvalidResourceIndex
Definition: PipelineStateBase.hpp:834
Diligent::IShaderResourceVariable
Shader resource variable.
Definition: ShaderResourceVariable.h:117
Diligent::GraphicsPipelineStateCreateInfo
Graphics pipeline state creation attributes.
Definition: PipelineState.h:397
Diligent::Char
char Char
Definition: BasicTypes.h:64
Diligent::DeviceObjectBase< EngineImplTraits::PipelineStateInterface, EngineImplTraits::RenderDeviceImplType, PipelineStateDesc >::m_pDevice
EngineImplTraits::RenderDeviceImplType *const m_pDevice
Pointer to the device.
Definition: DeviceObjectBase.hpp:179
Diligent::IShaderResourceBinding
Shader resource binding interface.
Definition: ShaderResourceBinding.h:58
Diligent::PipelineStateBase::RayTracingPipelineData::NameToGroupIndex
TNameToGroupIndexMap NameToGroupIndex
Definition: PipelineStateBase.hpp:1061
Diligent::GraphicsPipelineStateCreateInfo::pMS
IShader * pMS
Mesh shader to be used with the pipeline.
Definition: PipelineState.h:421
Diligent::PipelineStateBase::m_ActiveShaderStages
SHADER_TYPE m_ActiveShaderStages
Shader stages that are active in this PSO.
Definition: PipelineStateBase.hpp:1030
Diligent::LayoutElement::BufferSlot
Uint32 BufferSlot
Buffer slot index that this element is read from.
Definition: InputLayout.h:76
Diligent::PipelineStateBase::ReserveSpaceForPipelineDesc
void ReserveSpaceForPipelineDesc(const ComputePipelineStateCreateInfo &CreateInfo, FixedLinearAllocator &MemPool) noexcept
Definition: PipelineStateBase.hpp:494
Diligent::LayoutElement::HLSLSemantic
const char * HLSLSemantic
HLSL semantic. Default value ("ATTRIB") allows HLSL shaders to be converted to GLSL and used in OpenG...
Definition: InputLayout.h:69
Diligent::DeviceFeatures
struct DeviceFeatures DeviceFeatures
Definition: GraphicsTypes.h:1750
Diligent::RayTracingPipelineStateCreateInfo
Ray tracing pipeline state description.
Definition: PipelineState.h:443
Diligent::IShader::GetDesc
virtual const ShaderDesc &METHOD() GetDesc() const override=0
Returns the shader description.
LOG_ERROR_AND_THROW
#define LOG_ERROR_AND_THROW(...)
Definition: Errors.hpp:101
DeviceObjectBase.hpp
Diligent::PipelineStateBase::RayTracingPipelineData::Desc
RayTracingPipelineDesc Desc
Definition: PipelineStateBase.hpp:1057
Diligent::SHADER_TYPE
SHADER_TYPE
Describes the shader type.
Definition: GraphicsTypes.h:65
Diligent::PipelineStateBase::GetBufferStride
Uint32 GetBufferStride(Uint32 BufferSlot) const
Definition: PipelineStateBase.hpp:264
Diligent::SHADER_RESOURCE_TYPE
SHADER_RESOURCE_TYPE
Describes shader resource type.
Definition: Shader.h:356
Diligent::IPipelineState
Pipeline state interface.
Definition: PipelineState.h:505
Diligent::SamplerDesc::BorderColor
Float32 BorderColor[4]
Border color to use if TEXTURE_ADDRESS_BORDER is specified for AddressU, AddressV,...
Definition: Sampler.h:100
Diligent::ComputePipelineStateCreateInfo::pCS
IShader * pCS
Compute shader to be used with the pipeline.
Definition: PipelineState.h:430
Diligent::RayTracingProceduralHitShaderGroup::pClosestHitShader
IShader * pClosestHitShader
Closest hit shader. Can be null. The shader type must be SHADER_TYPE_RAY_CLOSEST_HIT.
Definition: PipelineState.h:256
Diligent::GraphicsPipelineStateCreateInfo
struct GraphicsPipelineStateCreateInfo GraphicsPipelineStateCreateInfo
Definition: PipelineState.h:423
Flags
Uint32 Flags
Definition: DXBCUtils.cpp:71
Diligent::RayTracingPipelineDesc
This structure describes the ray tracing pipeline state and is part of the RayTracingPipelineStateCre...
Definition: PipelineState.h:280
STDAllocator.hpp
Diligent::PipelineStateBase::m_pPipelineDataRawMem
void * m_pPipelineDataRawMem
Definition: PipelineStateBase.hpp:1079
Diligent::IShader
Shader interface.
Definition: Shader.h:428
Diligent::Uint64
uint64_t Uint64
64-bit unsigned integer
Definition: BasicTypes.h:50
Diligent::ComputePipelineStateCreateInfo
struct ComputePipelineStateCreateInfo ComputePipelineStateCreateInfo
Definition: PipelineState.h:439
Diligent::RayTracingProceduralHitShaderGroup::pIntersectionShader
IShader * pIntersectionShader
Intersection shader. The shader type must be SHADER_TYPE_RAY_INTERSECTION.
Definition: PipelineState.h:252
Diligent::PIPELINE_TYPE_RAY_TRACING
@ PIPELINE_TYPE_RAY_TRACING
Ray tracing pipeline, which is used by IDeviceContext::TraceRays().
Definition: PipelineState.h:308
Diligent::PipelineStateBase::GetStaticVariableByIndex
virtual IShaderResourceVariable * GetStaticVariableByIndex(SHADER_TYPE ShaderType, Uint32 Index) override final
Definition: PipelineStateBase.hpp:362
UNEXPECTED
#define UNEXPECTED(...)
Definition: DebugUtilities.hpp:77
Diligent::CorrectGraphicsPipelineDesc
void CorrectGraphicsPipelineDesc(GraphicsPipelineDesc &GraphicsPipeline) noexcept
Definition: PipelineStateBase.cpp:642
Diligent::PipelineStateCreateInfo::ppResourceSignatures
IPipelineResourceSignature ** ppResourceSignatures
An array of ResourceSignaturesCount shader resource signatures that define the layout of shader resou...
Definition: PipelineState.h:388
Diligent::FixedLinearAllocator::ReleaseOwnership
NODISCARD void * ReleaseOwnership() noexcept
Definition: FixedLinearAllocator.hpp:95
Diligent::RayTracingPipelineStateCreateInfo::pTriangleHitShaders
const RayTracingTriangleHitShaderGroup * pTriangleHitShaders
A pointer to an array of TriangleHitShaderCount RayTracingTriangleHitShaderGroup structures that cont...
Definition: PipelineState.h:456
Diligent::SHADER_TYPE_COMPUTE
@ SHADER_TYPE_COMPUTE
Compute shader.
Definition: GraphicsTypes.h:73
Diligent::DeviceObjectBase< EngineImplTraits::PipelineStateInterface, EngineImplTraits::RenderDeviceImplType, PipelineStateDesc >::m_Desc
PipelineStateDesc m_Desc
Object description.
Definition: DeviceObjectBase.hpp:182
PrivateConstants.h
Diligent::PipelineStateBase::InitializePipelineDesc
void InitializePipelineDesc(const GraphicsPipelineStateCreateInfo &CreateInfo, FixedLinearAllocator &MemPool)
Definition: PipelineStateBase.hpp:656
Diligent::PipelineStateBase::GetResourceSignature
virtual PipelineResourceSignatureImplType * GetResourceSignature(Uint32 Index) const override final
Implementation of IPipelineState::GetResourceSignature().
Definition: PipelineStateBase.hpp:432
Diligent::FixedLinearAllocator::ConstructArray
NODISCARD T * ConstructArray(size_t count, const Args &... args)
Definition: FixedLinearAllocator.hpp:224
DEV_CHECK_ERR
#define DEV_CHECK_ERR(...)
Definition: DebugUtilities.hpp:90
Diligent::ShaderResourceVariableDesc
struct ShaderResourceVariableDesc ShaderResourceVariableDesc
Definition: PipelineState.h:99
Diligent::PipelineStateBase::GetResourceAttribution
ResourceAttribution GetResourceAttribution(const char *Name, SHADER_TYPE Stage) const
Definition: PipelineStateBase.hpp:869
Diligent::RayTracingTriangleHitShaderGroup::pClosestHitShader
IShader * pClosestHitShader
Closest hit shader. The shader type must be SHADER_TYPE_RAY_CLOSEST_HIT.
Definition: PipelineState.h:223
Diligent::PipelineStateDesc::ResourceLayout
PipelineResourceLayoutDesc ResourceLayout
Pipeline layout description.
Definition: PipelineState.h:333
Diligent::PipelineStateBase::GetRenderPassPtr
RefCntAutoPtr< IRenderPass > const & GetRenderPassPtr() const
Definition: PipelineStateBase.hpp:276
Diligent::PipelineStateBase::InitializePipelineDesc
void InitializePipelineDesc(const RayTracingPipelineStateCreateInfo &CreateInfo, FixedLinearAllocator &MemPool) noexcept
Definition: PipelineStateBase.hpp:802
Diligent::GetValueSize
Uint32 GetValueSize(VALUE_TYPE Val)
Returns the size of the specified value type.
Definition: GraphicsAccessories.hpp:149
Diligent::PipelineStateBase::ResourceAttribution::ResourceAttribution
ResourceAttribution(const PipelineResourceSignatureImplType *_pSignature, Uint32 _SignatureIndex, Uint32 _ResourceIndex, Uint32 _ImmutableSamplerIndex=InvalidResourceIndex) noexcept
Definition: PipelineStateBase.hpp:844
Diligent::GetShaderStageType
__forceinline SHADER_TYPE GetShaderStageType(const ShaderD3D11Impl *pShader)
Definition: PipelineStateD3D11Impl.cpp:43
Diligent::PipelineStateBase::CreateShaderResourceBinding
virtual void CreateShaderResourceBinding(IShaderResourceBinding **ppShaderResourceBinding, bool InitStaticResources) override final
Definition: PipelineStateBase.hpp:327
Diligent::ShaderDesc::ShaderType
SHADER_TYPE ShaderType
Shader type. See Diligent::SHADER_TYPE.
Definition: Shader.h:113
Diligent::PipelineStateBase::GetGraphicsPipelineDesc
virtual const GraphicsPipelineDesc & GetGraphicsPipelineDesc() const override final
Definition: PipelineStateBase.hpp:288
Diligent::PipelineStateBase::m_pRayTracingPipelineData
RayTracingPipelineData * m_pRayTracingPipelineData
Definition: PipelineStateBase.hpp:1078
Diligent::GraphicsPipelineDesc
Graphics pipeline state description.
Definition: PipelineState.h:131
Diligent::FixedLinearAllocator::CopyString
NODISCARD Char * CopyString(const char *Str)
Definition: FixedLinearAllocator.hpp:251
Diligent::PipelineStateBase::CopyShaderHandle
void CopyShaderHandle(const char *Name, void *pData, size_t DataSize) const
Definition: PipelineStateBase.hpp:302
Diligent::GraphicsPipelineStateCreateInfo::pHS
IShader * pHS
Hull shader to be used with the pipeline.
Definition: PipelineState.h:412
EngineMemory.h
Diligent::RayTracingPipelineStateCreateInfo::TriangleHitShaderCount
Uint32 TriangleHitShaderCount
The number of triangle hit shader groups.
Definition: PipelineState.h:459
Diligent::PipelineStateBase::GetStaticVariableCount
virtual Uint32 GetStaticVariableCount(SHADER_TYPE ShaderType) const override final
Definition: PipelineStateBase.hpp:382
Diligent::PipelineStateBase::GraphicsPipelineData::Desc
GraphicsPipelineDesc Desc
Definition: PipelineStateBase.hpp:1047
Diligent::DescriptorType::Count
@ Count
Diligent::VT_FLOAT16
@ VT_FLOAT16
Half-precision 16-bit floating point.
Definition: GraphicsTypes.h:58
Diligent::PipelineStateBase::InitializeStaticSRBResources
virtual void InitializeStaticSRBResources(IShaderResourceBinding *pSRB) const override final
Definition: PipelineStateBase.hpp:413
Diligent::ValidateGraphicsPipelineCreateInfo
void ValidateGraphicsPipelineCreateInfo(const GraphicsPipelineStateCreateInfo &CreateInfo, const DeviceFeatures &Features) noexcept(false)
Definition: PipelineStateBase.cpp:373
Diligent::GetRawAllocator
IMemoryAllocator & GetRawAllocator()
Returns raw memory allocator.
Definition: EngineMemory.cpp:51
Diligent::PipelineStateBase::PipelineStateBase
PipelineStateBase(IReferenceCounters *pRefCounters, RenderDeviceImplType *pDevice, const ComputePipelineStateCreateInfo &ComputePipelineCI, bool bIsDeviceInternal=false)
Initializes the object as compute pipeline.
Definition: PipelineStateBase.hpp:167
Diligent::RayTracingTriangleHitShaderGroup::pAnyHitShader
IShader * pAnyHitShader
Any-hit shader. Can be null. The shader type must be SHADER_TYPE_RAY_ANY_HIT.
Definition: PipelineState.h:227
Diligent::IsConsistentShaderType
bool IsConsistentShaderType(SHADER_TYPE ShaderType, PIPELINE_TYPE PipelineType)
Definition: GraphicsAccessories.cpp:1388
Diligent::PIPELINE_TYPE_MESH
@ PIPELINE_TYPE_MESH
Mesh pipeline, which is used by IDeviceContext::DrawMesh(), IDeviceContext::DrawMeshIndirect().
Definition: PipelineState.h:305
IMPLEMENT_QUERY_INTERFACE_IN_PLACE
#define IMPLEMENT_QUERY_INTERFACE_IN_PLACE(InterfaceID, ParentClassName)
Definition: ObjectBase.hpp:59
Diligent::PipelineStateCreateInfo
Pipeline state creation attributes.
Definition: PipelineState.h:370
Diligent::ShaderResourceVariableDesc
Describes shader variable.
Definition: PipelineState.h:76
Diligent::PipelineStateBase::BindStaticResources
virtual void BindStaticResources(Uint32 ShaderFlags, IResourceMapping *pResourceMapping, Uint32 Flags) override final
Definition: PipelineStateBase.hpp:401
FixedLinearAllocator.hpp
Diligent::GetShaderTypePipelineIndex
Int32 GetShaderTypePipelineIndex(SHADER_TYPE ShaderType, PIPELINE_TYPE PipelineType)
Definition: GraphicsAccessories.cpp:1422
Diligent::RefCntAutoPtr
Template class that implements reference counting.
Definition: RefCntAutoPtr.hpp:73
Diligent::PipelineStateBase::RayTracingPipelineData::ShaderHandleSize
Uint32 ShaderHandleSize
Definition: PipelineStateBase.hpp:1063
Diligent::PipelineStateBase::m_Signatures
SignatureAutoPtrType * m_Signatures
Definition: PipelineStateBase.hpp:1043
DILIGENT_CALL_TYPE
#define DILIGENT_CALL_TYPE
Definition: CommonDefinitions.h:45
Diligent::GraphicsPipelineStateCreateInfo::pAS
IShader * pAS
Amplification shader to be used with the pipeline.
Definition: PipelineState.h:418
Diligent::PipelineStateBase::PipelineStateBase
PipelineStateBase(IReferenceCounters *pRefCounters, RenderDeviceImplType *pDevice, const RayTracingPipelineStateCreateInfo &RayTracingPipelineCI, bool bIsDeviceInternal=false)
Initializes the object as ray tracing pipeline.
Definition: PipelineStateBase.hpp:191
Type
const D3D12_PIPELINE_STATE_SUBOBJECT_TYPE Type
Definition: PipelineStateD3D12Impl.cpp:69
Diligent::ComputePipelineStateCreateInfo
Compute pipeline state description.
Definition: PipelineState.h:427
Diligent::PipelineStateBase::ExtractShaders
void ExtractShaders(const GraphicsPipelineStateCreateInfo &CreateInfo, TShaderStages &ShaderStages)
Definition: PipelineStateBase.hpp:531
Diligent::PIPELINE_TYPE_COMPUTE
@ PIPELINE_TYPE_COMPUTE
Compute pipeline, which is used by IDeviceContext::DispatchCompute(), IDeviceContext::DispatchCompute...
Definition: PipelineState.h:302
Diligent::PipelineStateBase::GetRayTracingPipelineDesc
virtual const RayTracingPipelineDesc & GetRayTracingPipelineDesc() const override final
Definition: PipelineStateBase.hpp:295
Diligent::GraphicsPipelineStateCreateInfo::pDS
IShader * pDS
Domain shader to be used with the pipeline.
Definition: PipelineState.h:409
Diligent::Uint32
uint32_t Uint32
32-bit unsigned integer
Definition: BasicTypes.h:51
Diligent::PipelineStateBase::GraphicsPipelineData::BufferSlotsUsed
Uint8 BufferSlotsUsed
Definition: PipelineStateBase.hpp:1052
Diligent::PipelineStateBase::m_pGraphicsPipelineData
GraphicsPipelineData * m_pGraphicsPipelineData
Definition: PipelineStateBase.hpp:1077
Diligent::SHADER_TYPE_UNKNOWN
@ SHADER_TYPE_UNKNOWN
Unknown shader type.
Definition: GraphicsTypes.h:67
Diligent::PipelineStateBase::m_SignatureCount
Uint8 m_SignatureCount
The number of signatures in m_Signatures array. Note that this is not necessarily the same as the num...
Definition: PipelineStateBase.hpp:1039
Diligent::PipelineStateBase::PipelineStateBase
PipelineStateBase(IReferenceCounters *pRefCounters, RenderDeviceImplType *pDevice, const GraphicsPipelineStateCreateInfo &GraphicsPipelineCI, bool bIsDeviceInternal=false)
Initializes the object as graphics pipeline.
Definition: PipelineStateBase.hpp:143
Diligent::RayTracingPipelineStateCreateInfo::pProceduralHitShaders
const RayTracingProceduralHitShaderGroup * pProceduralHitShaders
A pointer to an array of ProceduralHitShaderCount RayTracingProceduralHitShaderGroup structures that ...
Definition: PipelineState.h:463
Diligent::PipelineResourceLayoutDesc
struct PipelineResourceLayoutDesc PipelineResourceLayoutDesc
Definition: PipelineState.h:125
Diligent::GraphicsPipelineStateCreateInfo::pPS
IShader * pPS
Pixel shader to be used with the pipeline.
Definition: PipelineState.h:406
Diligent::PipelineStateCreateInfo::PSODesc
PipelineStateDesc PSODesc
Pipeline state description.
Definition: PipelineState.h:373
PipelineState.h
Diligent::PipelineStateBase::~PipelineStateBase
~PipelineStateBase()
Definition: PipelineStateBase.hpp:210
Diligent::CopyRTShaderGroupNames
void CopyRTShaderGroupNames(std::unordered_map< HashMapStringKey, Uint32, HashMapStringKey::Hasher > &NameToGroupIndex, const RayTracingPipelineStateCreateInfo &CreateInfo, FixedLinearAllocator &MemPool) noexcept
Copies ray tracing shader group names and also initializes the mapping from the group name to its ind...
Definition: PipelineStateBase.cpp:557
Diligent::FixedLinearAllocator::Construct
NODISCARD T * Construct(Args &&... args)
Definition: FixedLinearAllocator.hpp:216
Diligent::GraphicsPipelineDesc
struct GraphicsPipelineDesc GraphicsPipelineDesc
Definition: PipelineState.h:190
PipelineResourceSignatureBase.hpp
Diligent::PipelineStateBase::GetResourceSignatureCount
virtual Uint32 GetResourceSignatureCount() const override final
Implementation of IPipelineState::GetResourceSignatureCount().
Definition: PipelineStateBase.hpp:426
Diligent::PipelineStateBase::RayTracingPipelineData::ShaderHandles
Uint8 ShaderHandles[sizeof(void *)]
Definition: PipelineStateBase.hpp:1071
Diligent::LayoutElement::IsNormalized
Bool IsNormalized
For signed and unsigned integer value types (VT_INT8, VT_INT16, VT_INT32, VT_UINT8,...
Definition: InputLayout.h:89
Diligent::FindPipelineResourceLayoutVariable
Uint32 FindPipelineResourceLayoutVariable(const PipelineResourceLayoutDesc &LayoutDesc, const char *Name, SHADER_TYPE ShaderStage, const char *CombinedSamplerSuffix)
Finds a pipeline resource layout variable with the name 'Name' in shader stage 'ShaderStage' in the l...
Definition: PipelineStateBase.cpp:648
Diligent::PipelineStateDesc::IsAnyGraphicsPipeline
bool IsAnyGraphicsPipeline() const
Definition: PipelineState.h:336
Diligent::PipelineStateBase::ResourceAttribution::ResourceIndex
Uint32 ResourceIndex
Definition: PipelineStateBase.hpp:840
Diligent::PipelineStateBase::GetActiveShaderStages
SHADER_TYPE GetActiveShaderStages() const
Definition: PipelineStateBase.hpp:464
Diligent::PipelineStateBase::ResourceAttribution::pSignature
const PipelineResourceSignatureImplType * pSignature
Definition: PipelineStateBase.hpp:837
Diligent::PipelineStateBase::InitializePipelineDesc
void InitializePipelineDesc(const ComputePipelineStateCreateInfo &CreateInfo, FixedLinearAllocator &MemPool)
Definition: PipelineStateBase.hpp:793
Diligent::PipelineStateCreateInfo::ResourceSignaturesCount
Uint32 ResourceSignaturesCount
The number of elements in ppResourceSignatures array.
Definition: PipelineState.h:391
Diligent::PipelineStateBase::GetNumBufferSlotsUsed
Uint32 GetNumBufferSlotsUsed() const
Definition: PipelineStateBase.hpp:270
Diligent::PipelineStateBase::m_UsingImplicitSignature
const bool m_UsingImplicitSignature
True if the pipeline was created using implicit root signature.
Definition: PipelineStateBase.hpp:1033
Diligent::PipelineStateCreateInfo
struct PipelineStateCreateInfo PipelineStateCreateInfo
Definition: PipelineState.h:393
LOG_WARNING_MESSAGE
#define LOG_WARNING_MESSAGE(...)
Definition: Errors.hpp:123
Diligent::PIPELINE_RESOURCE_FLAGS
PIPELINE_RESOURCE_FLAGS
Flags that define pipeline resource properties.
Definition: PipelineResourceSignature.h:79
Diligent::PipelineStateBase::GraphicsPipelineData
Definition: PipelineStateBase.hpp:1045
Diligent::RayTracingGeneralShaderGroup::pShader
IShader * pShader
Shader type must be SHADER_TYPE_RAY_GEN, SHADER_TYPE_RAY_MISS or SHADER_TYPE_CALLABLE.
Definition: PipelineState.h:200
Diligent::PipelineStateBase< EngineGLImplTraits >::TNameToGroupIndexMap
std::unordered_map< HashMapStringKey, Uint32, HashMapStringKey::Hasher > TNameToGroupIndexMap
Definition: PipelineStateBase.hpp:470
Diligent::PipelineStateBase::ResourceAttribution::ImmutableSamplerIndex
Uint32 ImmutableSamplerIndex
Definition: PipelineStateBase.hpp:841
HashUtils.hpp
Diligent::PipelineStateBase::RayTracingPipelineData::ShaderDataSize
Uint32 ShaderDataSize
Definition: PipelineStateBase.hpp:1064
Diligent::RayTracingPipelineStateCreateInfo::GeneralShaderCount
Uint32 GeneralShaderCount
The number of general shader groups.
Definition: PipelineState.h:452
Diligent::PipelineStateBase::ResourceAttribution::InvalidSamplerIndex
static constexpr Uint32 InvalidSamplerIndex
Definition: PipelineStateBase.hpp:835
Diligent::ImmutableSamplerDesc
struct ImmutableSamplerDesc ImmutableSamplerDesc
Definition: PipelineResourceSignature.h:75
Diligent::RayTracingProceduralHitShaderGroup::pAnyHitShader
IShader * pAnyHitShader
Any-hit shader. Can be null. The shader type must be SHADER_TYPE_RAY_ANY_HIT.
Definition: PipelineState.h:260
std::max
Diligent::Vector2< T > max(const Diligent::Vector2< T > &Left, const Diligent::Vector2< T > &Right)
Definition: BasicMath.hpp:2261
Diligent::PipelineStateBase::ResourceAttribution::InvalidSignatureIndex
static constexpr Uint32 InvalidSignatureIndex
Definition: PipelineStateBase.hpp:833
Diligent::Uint8
uint8_t Uint8
8-bit unsigned integer
Definition: BasicTypes.h:53
Diligent::GetPipelineTypeString
const char * GetPipelineTypeString(PIPELINE_TYPE PipelineType)
Definition: GraphicsAccessories.cpp:1145
Diligent::PipelineResourceDesc
struct PipelineResourceDesc PipelineResourceDesc
Definition: PipelineResourceSignature.h:162
Diligent::PipelineStateBase::IsCompatibleWith
virtual bool IsCompatibleWith(const IPipelineState *pPSO) const override
Implementation of IPipelineState::IsCompatibleWith().
Definition: PipelineStateBase.hpp:439
Diligent::ValidateRayTracingPipelineCreateInfo
void ValidateRayTracingPipelineCreateInfo(IRenderDevice *pDevice, Uint32 MaxRecursion, const RayTracingPipelineStateCreateInfo &CreateInfo, const DeviceFeatures &Features) noexcept(false)
Definition: PipelineStateBase.cpp:470
VERIFY_EXPR
#define VERIFY_EXPR(...)
Definition: DebugUtilities.hpp:79
Diligent::GetShaderTypeLiteralName
const Char * GetShaderTypeLiteralName(SHADER_TYPE ShaderType)
Returns the literal name of a shader type. For instance, for a pixel shader, "SHADER_TYPE_PIXEL" will...
Definition: GraphicsAccessories.cpp:476
Diligent::RayTracingPipelineStateCreateInfo
struct RayTracingPipelineStateCreateInfo RayTracingPipelineStateCreateInfo
Definition: PipelineState.h:488
VERIFY
#define VERIFY(...)
Definition: DebugUtilities.hpp:76
Diligent::PipelineStateBase
Template class implementing base functionality of the pipeline state object.
Definition: PipelineStateBase.hpp:99
Diligent::VT_FLOAT32
@ VT_FLOAT32
Full-precision 32-bit floating point.
Definition: GraphicsTypes.h:59
Diligent::ValidatePipelineResourceCompatibility
void ValidatePipelineResourceCompatibility(const PipelineResourceDesc &ResDesc, SHADER_RESOURCE_TYPE Type, PIPELINE_RESOURCE_FLAGS ResourceFlags, Uint32 ArraySize, const char *ShaderName, const char *SignatureName) noexcept(false)
Validates that pipeline resource description 'ResDesc' is compatible with the actual resource attribu...
Definition: PipelineStateBase.cpp:588
Diligent::GraphicsPipelineStateCreateInfo::pVS
IShader * pVS
Vertex shader to be used with the pipeline.
Definition: PipelineState.h:403
Diligent::PipelineStateDesc::CommandQueueMask
Uint64 CommandQueueMask
Defines which command queues this pipeline state can be used with.
Definition: PipelineState.h:330
Diligent::GraphicsPipelineStateCreateInfo::pGS
IShader * pGS
Geometry shader to be used with the pipeline.
Definition: PipelineState.h:415
Diligent::PipelineStateBase::GraphicsPipelineData::pStrides
Uint32 * pStrides
Definition: PipelineStateBase.hpp:1051
Diligent::PipelineStateBase::ReserveSpaceForPipelineDesc
void ReserveSpaceForPipelineDesc(const RayTracingPipelineStateCreateInfo &CreateInfo, FixedLinearAllocator &MemPool) noexcept
Definition: PipelineStateBase.hpp:501
Diligent::PipelineStateBase::GetStaticVariableByName
virtual IShaderResourceVariable * GetStaticVariableByName(SHADER_TYPE ShaderType, const Char *Name) override final
Definition: PipelineStateBase.hpp:342
ShaderType
Uint16 ShaderType
Definition: DXBCUtils.cpp:70
Diligent::PipelineStateBase::ResourceAttribution
Definition: PipelineStateBase.hpp:831
Diligent::PipelineStateBase::RayTracingPipelineData
Definition: PipelineStateBase.hpp:1055
Diligent::GraphicsPipelineStateCreateInfo::GraphicsPipeline
GraphicsPipelineDesc GraphicsPipeline
Graphics pipeline state description.
Definition: PipelineState.h:400
Diligent::PipelineStateBase::GraphicsPipelineData::pRenderPass
RefCntAutoPtr< IRenderPass > pRenderPass
Strong reference to the render pass object.
Definition: PipelineStateBase.hpp:1049
Diligent::PipelineStateDesc::IsComputePipeline
bool IsComputePipeline() const
Definition: PipelineState.h:337
Diligent::IMemoryAllocator::Free
virtual void Free(void *Ptr)=0
Releases memory.
Diligent::PipelineStateBase::ExtractShaders
void ExtractShaders(const RayTracingPipelineStateCreateInfo &CreateInfo, TShaderStages &ShaderStages)
Definition: PipelineStateBase.hpp:600
ATTACHMENT_UNUSED
#define ATTACHMENT_UNUSED
Definition: RenderPass.h:143
Diligent::PipelineResourceLayoutDesc
Pipeline layout description.
Definition: PipelineState.h:103
Diligent::PIPELINE_TYPE_GRAPHICS
@ PIPELINE_TYPE_GRAPHICS
Graphics pipeline, which is used by IDeviceContext::Draw(), IDeviceContext::DrawIndexed(),...
Definition: PipelineState.h:299
Diligent::RayTracingPipelineStateCreateInfo::pGeneralShaders
const RayTracingGeneralShaderGroup * pGeneralShaders
A pointer to an array of GeneralShaderCount RayTracingGeneralShaderGroup structures that contain shad...
Definition: PipelineState.h:449
Diligent::DeviceObjectAttribs::Name
const Char * Name
Object name.
Definition: GraphicsTypes.h:1199
Diligent::PipelineStateBase::ResourceAttribution::IsImmutableSampler
bool IsImmutableSampler() const
Definition: PipelineStateBase.hpp:863
Diligent::PipelineStateBase::ResourceAttribution::SignatureIndex
Uint32 SignatureIndex
Definition: PipelineStateBase.hpp:839
Diligent::DeviceObjectBase
Template class implementing base functionality of the device object.
Definition: DeviceObjectBase.hpp:45
Diligent::PipelineStateBase::Destruct
void Destruct()
Definition: PipelineStateBase.hpp:232
Diligent
The library uses Direct3D-style math:
Definition: AdvancedMath.hpp:37
Diligent::PipelineStateBase::ExtractShaders
void ExtractShaders(const ComputePipelineStateCreateInfo &CreateInfo, TShaderStages &ShaderStages)
Definition: PipelineStateBase.hpp:582
Diligent::IResourceMapping
Resouce mapping.
Definition: ResourceMapping.h:107