Diligent Engine  v.2.4.g
RenderDeviceBase.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 "RenderDevice.h"
34 #include "DeviceObjectBase.hpp"
35 #include "Defines.h"
36 #include "ResourceMappingImpl.hpp"
37 #include "StateObjectsRegistry.hpp"
38 #include "HashUtils.hpp"
39 #include "ObjectBase.hpp"
40 #include "DeviceContext.h"
41 #include "SwapChain.h"
42 #include "GraphicsAccessories.hpp"
44 #include "EngineMemory.h"
45 #include "STDAllocator.hpp"
46 
47 namespace std
48 {
50 template <>
51 struct hash<Diligent::SamplerDesc>
52 {
53  size_t operator()(const Diligent::SamplerDesc& SamDesc) const
54  {
55  // Sampler name is ignored in comparison operator
56  // and should not be hashed
57  return Diligent::ComputeHash( // SamDesc.Name,
58  static_cast<int>(SamDesc.MinFilter),
59  static_cast<int>(SamDesc.MagFilter),
60  static_cast<int>(SamDesc.MipFilter),
61  static_cast<int>(SamDesc.AddressU),
62  static_cast<int>(SamDesc.AddressV),
63  static_cast<int>(SamDesc.AddressW),
64  SamDesc.MipLODBias,
65  SamDesc.MaxAnisotropy,
66  static_cast<int>(SamDesc.ComparisonFunc),
67  SamDesc.BorderColor[0],
68  SamDesc.BorderColor[1],
69  SamDesc.BorderColor[2],
70  SamDesc.BorderColor[3],
71  SamDesc.MinLOD, SamDesc.MaxLOD);
72  }
73 };
74 
76 template <>
77 struct hash<Diligent::StencilOpDesc>
78 {
79  size_t operator()(const Diligent::StencilOpDesc& StOpDesc) const
80  {
81  return Diligent::ComputeHash(static_cast<int>(StOpDesc.StencilFailOp),
82  static_cast<int>(StOpDesc.StencilDepthFailOp),
83  static_cast<int>(StOpDesc.StencilPassOp),
84  static_cast<int>(StOpDesc.StencilFunc));
85  }
86 };
87 
89 template <>
91 {
92  size_t operator()(const Diligent::DepthStencilStateDesc& DepthStencilDesc) const
93  {
94  return Diligent::ComputeHash(DepthStencilDesc.DepthEnable,
95  DepthStencilDesc.DepthWriteEnable,
96  static_cast<int>(DepthStencilDesc.DepthFunc),
97  DepthStencilDesc.StencilEnable,
98  DepthStencilDesc.StencilReadMask,
99  DepthStencilDesc.StencilWriteMask,
100  DepthStencilDesc.FrontFace,
101  DepthStencilDesc.BackFace);
102  }
103 };
104 
106 template <>
108 {
109  size_t operator()(const Diligent::RasterizerStateDesc& RasterizerDesc) const
110  {
111  return Diligent::ComputeHash(static_cast<int>(RasterizerDesc.FillMode),
112  static_cast<int>(RasterizerDesc.CullMode),
113  RasterizerDesc.FrontCounterClockwise,
114  RasterizerDesc.DepthBias,
115  RasterizerDesc.DepthBiasClamp,
116  RasterizerDesc.SlopeScaledDepthBias,
117  RasterizerDesc.DepthClipEnable,
118  RasterizerDesc.ScissorEnable,
119  RasterizerDesc.AntialiasedLineEnable);
120  }
121 };
122 
124 template <>
126 {
127  size_t operator()(const Diligent::BlendStateDesc& BSDesc) const
128  {
129  std::size_t Seed = 0;
130  for (size_t i = 0; i < Diligent::MAX_RENDER_TARGETS; ++i)
131  {
132  const auto& rt = BSDesc.RenderTargets[i];
134  rt.BlendEnable,
135  static_cast<int>(rt.SrcBlend),
136  static_cast<int>(rt.DestBlend),
137  static_cast<int>(rt.BlendOp),
138  static_cast<int>(rt.SrcBlendAlpha),
139  static_cast<int>(rt.DestBlendAlpha),
140  static_cast<int>(rt.BlendOpAlpha),
141  rt.RenderTargetWriteMask);
142  }
144  BSDesc.AlphaToCoverageEnable,
145  BSDesc.IndependentBlendEnable);
146  return Seed;
147  }
148 };
149 
150 
152 template <>
154 {
155  size_t operator()(const Diligent::TextureViewDesc& TexViewDesc) const
156  {
157  std::size_t Seed = 0;
159  static_cast<Diligent::Int32>(TexViewDesc.ViewType),
160  static_cast<Diligent::Int32>(TexViewDesc.TextureDim),
161  static_cast<Diligent::Int32>(TexViewDesc.Format),
162  TexViewDesc.MostDetailedMip,
163  TexViewDesc.NumMipLevels,
164  TexViewDesc.FirstArraySlice,
165  TexViewDesc.NumArraySlices,
166  static_cast<Diligent::Uint32>(TexViewDesc.AccessFlags),
167  static_cast<Diligent::Uint32>(TexViewDesc.Flags));
168  return Seed;
169  }
170 };
171 } // namespace std
172 
173 namespace Diligent
174 {
175 
177 
184 template <typename EngineImplTraits>
185 class RenderDeviceBase : public ObjectBase<typename EngineImplTraits::RenderDeviceInterface>
186 {
187 public:
188  using BaseInterface = typename EngineImplTraits::RenderDeviceInterface;
190 
191  using RenderDeviceImplType = typename EngineImplTraits::RenderDeviceImplType;
192  using PipelineStateImplType = typename EngineImplTraits::PipelineStateImplType;
193  using ShaderResourceBindingImplType = typename EngineImplTraits::ShaderResourceBindingImplType;
194  using BufferImplType = typename EngineImplTraits::BufferImplType;
195  using BufferViewImplType = typename EngineImplTraits::BufferViewImplType;
196  using TextureImplType = typename EngineImplTraits::TextureImplType;
197  using TextureViewImplType = typename EngineImplTraits::TextureViewImplType;
198  using ShaderImplType = typename EngineImplTraits::ShaderImplType;
199  using SamplerImplType = typename EngineImplTraits::SamplerImplType;
200  using FenceImplType = typename EngineImplTraits::FenceImplType;
201  using QueryImplType = typename EngineImplTraits::QueryImplType;
202  using RenderPassImplType = typename EngineImplTraits::RenderPassImplType;
203  using FramebufferImplType = typename EngineImplTraits::FramebufferImplType;
204  using BottomLevelASImplType = typename EngineImplTraits::BottomLevelASImplType;
205  using TopLevelASImplType = typename EngineImplTraits::TopLevelASImplType;
206  using ShaderBindingTableImplType = typename EngineImplTraits::ShaderBindingTableImplType;
207  using PipelineResourceSignatureImplType = typename EngineImplTraits::PipelineResourceSignatureImplType;
208 
217  IMemoryAllocator& RawMemAllocator,
218  IEngineFactory* pEngineFactory,
219  Uint32 NumDeferredContexts) :
220  // clang-format off
221  TObjectBase {pRefCounters},
222  m_pEngineFactory {pEngineFactory},
223  m_SamplersRegistry {RawMemAllocator, "sampler"},
224  m_TextureFormatsInfo (TEX_FORMAT_NUM_FORMATS, TextureFormatInfoExt(), STD_ALLOCATOR_RAW_MEM(TextureFormatInfoExt, RawMemAllocator, "Allocator for vector<TextureFormatInfoExt>")),
225  m_TexFmtInfoInitFlags (TEX_FORMAT_NUM_FORMATS, false, STD_ALLOCATOR_RAW_MEM(bool, RawMemAllocator, "Allocator for vector<bool>")),
226  m_wpDeferredContexts (NumDeferredContexts, RefCntWeakPtr<IDeviceContext>(), STD_ALLOCATOR_RAW_MEM(RefCntWeakPtr<IDeviceContext>, RawMemAllocator, "Allocator for vector< RefCntWeakPtr<IDeviceContext> >")),
227  m_RawMemAllocator {RawMemAllocator},
228  m_TexObjAllocator {RawMemAllocator, sizeof(TextureImplType), 64},
229  m_TexViewObjAllocator {RawMemAllocator, sizeof(TextureViewImplType), 64},
230  m_BufObjAllocator {RawMemAllocator, sizeof(BufferImplType), 128},
231  m_BuffViewObjAllocator {RawMemAllocator, sizeof(BufferViewImplType), 128},
232  m_ShaderObjAllocator {RawMemAllocator, sizeof(ShaderImplType), 32},
233  m_SamplerObjAllocator {RawMemAllocator, sizeof(SamplerImplType), 32},
234  m_PSOAllocator {RawMemAllocator, sizeof(PipelineStateImplType), 128},
235  m_SRBAllocator {RawMemAllocator, sizeof(ShaderResourceBindingImplType), 1024},
236  m_ResMappingAllocator {RawMemAllocator, sizeof(ResourceMappingImpl), 16},
237  m_FenceAllocator {RawMemAllocator, sizeof(FenceImplType), 16},
238  m_QueryAllocator {RawMemAllocator, sizeof(QueryImplType), 16},
239  m_RenderPassAllocator {RawMemAllocator, sizeof(RenderPassImplType), 16},
240  m_FramebufferAllocator {RawMemAllocator, sizeof(FramebufferImplType), 16},
241  m_BLASAllocator {RawMemAllocator, sizeof(BottomLevelASImplType), 16},
242  m_TLASAllocator {RawMemAllocator, sizeof(TopLevelASImplType), 16},
243  m_SBTAllocator {RawMemAllocator, sizeof(ShaderBindingTableImplType), 16},
244  m_PipeResSignAllocator {RawMemAllocator, sizeof(PipelineResourceSignatureImplType), 128},
246  // clang-format on
247  {
248  // Initialize texture format info
249  for (Uint32 Fmt = TEX_FORMAT_UNKNOWN; Fmt < TEX_FORMAT_NUM_FORMATS; ++Fmt)
250  static_cast<TextureFormatAttribs&>(m_TextureFormatsInfo[Fmt]) = GetTextureFormatAttribs(static_cast<TEXTURE_FORMAT>(Fmt));
251 
252  // https://msdn.microsoft.com/en-us/library/windows/desktop/ff471325(v=vs.85).aspx
253  TEXTURE_FORMAT FilterableFormats[] =
254  {
255  TEX_FORMAT_RGBA32_FLOAT, // OpenGL ES3.1 does not require this format to be filterable
259  TEX_FORMAT_RG32_FLOAT, // OpenGL ES3.1 does not require this format to be filterable
261  //TEX_FORMAT_R10G10B10A2_UNORM,
269  TEX_FORMAT_R32_FLOAT, // OpenGL ES3.1 does not require this format to be filterable
293  for (Uint32 fmt = 0; fmt < _countof(FilterableFormats); ++fmt)
294  m_TextureFormatsInfo[FilterableFormats[fmt]].Filterable = true;
295  }
296 
298  {
299  }
300 
302 
303  // It is important to have final implementation of Release() method to avoid
304  // virtual calls
305  inline virtual ReferenceCounterValueType DILIGENT_CALL_TYPE Release() override final
306  {
307  return TObjectBase::Release();
308  }
309 
311  virtual void DILIGENT_CALL_TYPE CreateResourceMapping(const ResourceMappingDesc& MappingDesc, IResourceMapping** ppMapping) override final
312  {
313  DEV_CHECK_ERR(ppMapping != nullptr, "Null pointer provided");
314  if (ppMapping == nullptr)
315  return;
316  DEV_CHECK_ERR(*ppMapping == nullptr, "Overwriting reference to existing object may cause memory leaks");
317 
318  auto* pResourceMapping{NEW_RC_OBJ(m_ResMappingAllocator, "ResourceMappingImpl instance", ResourceMappingImpl)(GetRawAllocator())};
319  pResourceMapping->QueryInterface(IID_ResourceMapping, reinterpret_cast<IObject**>(ppMapping));
320  if (MappingDesc.pEntries)
321  {
322  for (auto* pEntry = MappingDesc.pEntries; pEntry->Name && pEntry->pObject; ++pEntry)
323  {
324  (*ppMapping)->AddResourceArray(pEntry->Name, pEntry->ArrayIndex, &pEntry->pObject, 1, true);
325  }
326  }
327  }
328 
329 
331  virtual const DeviceCaps& DILIGENT_CALL_TYPE GetDeviceCaps() const override final
332  {
333  return m_DeviceCaps;
334  }
335 
337  virtual const DeviceProperties& DILIGENT_CALL_TYPE GetDeviceProperties() const override final
338  {
339  return m_DeviceProperties;
340  }
341 
344  {
345  VERIFY(TexFormat >= TEX_FORMAT_UNKNOWN && TexFormat < TEX_FORMAT_NUM_FORMATS, "Texture format out of range");
346  const auto& TexFmtInfo = m_TextureFormatsInfo[TexFormat];
347  VERIFY(TexFmtInfo.Format == TexFormat, "Sanity check failed");
348  return TexFmtInfo;
349  }
350 
353  {
354  VERIFY(TexFormat >= TEX_FORMAT_UNKNOWN && TexFormat < TEX_FORMAT_NUM_FORMATS, "Texture format out of range");
355  const auto& TexFmtInfo = m_TextureFormatsInfo[TexFormat];
356  VERIFY(TexFmtInfo.Format == TexFormat, "Sanity check failed");
357  if (!m_TexFmtInfoInitFlags[TexFormat])
358  {
359  if (TexFmtInfo.Supported)
360  TestTextureFormat(TexFormat);
361  m_TexFmtInfoInitFlags[TexFormat] = true;
362  }
363  return TexFmtInfo;
364  }
365 
366  virtual IEngineFactory* DILIGENT_CALL_TYPE GetEngineFactory() const override final
367  {
368  return m_pEngineFactory.RawPtr<IEngineFactory>();
369  }
370 
372 
374  void SetImmediateContext(IDeviceContext* pImmediateContext)
375  {
376  VERIFY(m_wpImmediateContext.Lock() == nullptr, "Immediate context has already been set");
377  m_wpImmediateContext = pImmediateContext;
378  }
379 
381  void SetDeferredContext(size_t Ctx, IDeviceContext* pDeferredCtx)
382  {
383  VERIFY(m_wpDeferredContexts[Ctx].Lock() == nullptr, "Deferred context has already been set");
384  m_wpDeferredContexts[Ctx] = pDeferredCtx;
385  }
386 
388  size_t GetNumDeferredContexts() const
389  {
390  return m_wpDeferredContexts.size();
391  }
392 
395 
399 
400 protected:
401  virtual void TestTextureFormat(TEXTURE_FORMAT TexFormat) = 0;
402 
404 
413  template <typename ObjectType, typename ObjectDescType, typename ObjectConstructorType>
414  void CreateDeviceObject(const Char* ObjectTypeName,
415  const ObjectDescType& Desc,
416  ObjectType** ppObject,
417  ObjectConstructorType ConstructObject)
418  {
419  DEV_CHECK_ERR(ppObject != nullptr, "Null pointer provided");
420  if (!ppObject)
421  return;
422 
423  DEV_CHECK_ERR(*ppObject == nullptr, "Overwriting reference to existing object may cause memory leaks");
424  // Do not release *ppObject here!
425  // Should this happen, RefCntAutoPtr<> will take care of this!
426  //if( *ppObject )
427  //{
428  // (*ppObject)->Release();
429  // *ppObject = nullptr;
430  //}
431 
432  *ppObject = nullptr;
433 
434  try
435  {
436  ConstructObject();
437  }
438  catch (...)
439  {
440  VERIFY(*ppObject == nullptr, "Object was created despite error");
441  if (*ppObject)
442  {
443  (*ppObject)->Release();
444  *ppObject = nullptr;
445  }
446  const auto ObjectDescString = GetObjectDescString(Desc);
447  if (!ObjectDescString.empty())
448  {
449  LOG_ERROR("Failed to create ", ObjectTypeName, " object '", (Desc.Name ? Desc.Name : ""), "'\n", ObjectDescString);
450  }
451  else
452  {
453  LOG_ERROR("Failed to create ", ObjectTypeName, " object '", (Desc.Name ? Desc.Name : ""), "'");
454  }
455  }
456  }
457 
458  template <typename PSOCreateInfoType, typename... ExtraArgsType>
459  void CreatePipelineStateImpl(IPipelineState** ppPipelineState, const PSOCreateInfoType& PSOCreateInfo, const ExtraArgsType&... ExtraArgs)
460  {
461  CreateDeviceObject("Pipeline State", PSOCreateInfo.PSODesc, ppPipelineState,
462  [&]() //
463  {
464  auto* pPipelineStateImpl{NEW_RC_OBJ(m_PSOAllocator, "Pipeline State instance", PipelineStateImplType)(static_cast<RenderDeviceImplType*>(this), PSOCreateInfo, ExtraArgs...)};
465  pPipelineStateImpl->QueryInterface(IID_PipelineState, reinterpret_cast<IObject**>(ppPipelineState));
466  });
467  }
468 
469  template <typename... ExtraArgsType>
470  void CreateBufferImpl(IBuffer** ppBuffer, const BufferDesc& BuffDesc, const ExtraArgsType&... ExtraArgs)
471  {
472  CreateDeviceObject("Buffer", BuffDesc, ppBuffer,
473  [&]() //
474  {
475  auto* pBufferImpl{NEW_RC_OBJ(m_BufObjAllocator, "Buffer instance", BufferImplType)(m_BuffViewObjAllocator, static_cast<RenderDeviceImplType*>(this), BuffDesc, ExtraArgs...)};
476  pBufferImpl->QueryInterface(IID_Buffer, reinterpret_cast<IObject**>(ppBuffer));
477  pBufferImpl->CreateDefaultViews();
478  });
479  }
480 
481  template <typename... ExtraArgsType>
482  void CreateTextureImpl(ITexture** ppTexture, const TextureDesc& TexDesc, const ExtraArgsType&... ExtraArgs)
483  {
484  CreateDeviceObject("Texture", TexDesc, ppTexture,
485  [&]() //
486  {
487  auto* pTextureImpl{NEW_RC_OBJ(m_TexObjAllocator, "Texture instance", TextureImplType)(m_TexViewObjAllocator, static_cast<RenderDeviceImplType*>(this), TexDesc, ExtraArgs...)};
488  pTextureImpl->QueryInterface(IID_Texture, reinterpret_cast<IObject**>(ppTexture));
489  pTextureImpl->CreateDefaultViews();
490  });
491  }
492 
493  template <typename... ExtraArgsType>
494  void CreateShaderImpl(IShader** ppShader, const ShaderCreateInfo& ShaderCI, const ExtraArgsType&... ExtraArgs)
495  {
496  CreateDeviceObject("Shader", ShaderCI.Desc, ppShader,
497  [&]() //
498  {
499  auto* pShaderImpl{NEW_RC_OBJ(m_ShaderObjAllocator, "Shader instance", ShaderImplType)(static_cast<RenderDeviceImplType*>(this), ShaderCI, ExtraArgs...)};
500  pShaderImpl->QueryInterface(IID_Shader, reinterpret_cast<IObject**>(ppShader));
501  });
502  }
503 
504  template <typename... ExtraArgsType>
505  void CreateSamplerImpl(ISampler** ppSampler, const SamplerDesc& SamplerDesc, const ExtraArgsType&... ExtraArgs)
506  {
507  CreateDeviceObject("Sampler", SamplerDesc, ppSampler,
508  [&]() //
509  {
510  m_SamplersRegistry.Find(SamplerDesc, reinterpret_cast<IDeviceObject**>(ppSampler));
511  if (*ppSampler == nullptr)
512  {
513  auto* pSamplerImpl{NEW_RC_OBJ(m_SamplerObjAllocator, "Sampler instance", SamplerImplType)(static_cast<RenderDeviceImplType*>(this), SamplerDesc, ExtraArgs...)};
514  pSamplerImpl->QueryInterface(IID_Sampler, reinterpret_cast<IObject**>(ppSampler));
515  m_SamplersRegistry.Add(SamplerDesc, *ppSampler);
516  }
517  });
518  }
519 
520  void CreateFenceImpl(IFence** ppFence, const FenceDesc& Desc)
521  {
522  CreateDeviceObject("Fence", Desc, ppFence,
523  [&]() //
524  {
525  auto* pFenceImpl{NEW_RC_OBJ(m_FenceAllocator, "Fence instance", FenceImplType)(static_cast<RenderDeviceImplType*>(this), Desc)};
526  pFenceImpl->QueryInterface(IID_Fence, reinterpret_cast<IObject**>(ppFence));
527  });
528  }
529 
530  void CreateQueryImpl(IQuery** ppQuery, const QueryDesc& Desc)
531  {
532  CreateDeviceObject("Query", Desc, ppQuery,
533  [&]() //
534  {
535  auto* pQueryImpl{NEW_RC_OBJ(m_QueryAllocator, "Query instance", QueryImplType)(static_cast<RenderDeviceImplType*>(this), Desc)};
536  pQueryImpl->QueryInterface(IID_Query, reinterpret_cast<IObject**>(ppQuery));
537  });
538  }
539 
540  template <typename... ExtraArgsType>
541  void CreateRenderPassImpl(IRenderPass** ppRenderPass, const RenderPassDesc& Desc, const ExtraArgsType&... ExtraArgs)
542  {
543  CreateDeviceObject("RenderPass", Desc, ppRenderPass,
544  [&]() //
545  {
546  auto* pRenderPassImpl{NEW_RC_OBJ(m_RenderPassAllocator, "Render instance", RenderPassImplType)(static_cast<RenderDeviceImplType*>(this), Desc, ExtraArgs...)};
547  pRenderPassImpl->QueryInterface(IID_RenderPass, reinterpret_cast<IObject**>(ppRenderPass));
548  });
549  }
550 
551  template <typename... ExtraArgsType>
552  void CreateFramebufferImpl(IFramebuffer** ppFramebuffer, const FramebufferDesc& Desc, const ExtraArgsType&... ExtraArgs)
553  {
554  CreateDeviceObject("Framebuffer", Desc, ppFramebuffer,
555  [&]() //
556  {
557  auto* pFramebufferImpl{NEW_RC_OBJ(m_FramebufferAllocator, "Framebuffer instance", FramebufferImplType)(static_cast<RenderDeviceImplType*>(this), Desc, ExtraArgs...)};
558  pFramebufferImpl->QueryInterface(IID_Framebuffer, reinterpret_cast<IObject**>(ppFramebuffer));
559  });
560  }
561 
562  template <typename... ExtraArgsType>
563  void CreateBLASImpl(IBottomLevelAS** ppBLAS, const BottomLevelASDesc& Desc, const ExtraArgsType&... ExtraArgs)
564  {
565  CreateDeviceObject("BottomLevelAS", Desc, ppBLAS,
566  [&]() //
567  {
568  auto* pBottomLevelASImpl(NEW_RC_OBJ(m_BLASAllocator, "BottomLevelAS instance", BottomLevelASImplType)(static_cast<RenderDeviceImplType*>(this), Desc, ExtraArgs...));
569  pBottomLevelASImpl->QueryInterface(IID_BottomLevelAS, reinterpret_cast<IObject**>(ppBLAS));
570  });
571  }
572 
573  template <typename... ExtraArgsType>
574  void CreateTLASImpl(ITopLevelAS** ppTLAS, const TopLevelASDesc& Desc, const ExtraArgsType&... ExtraArgs)
575  {
576  CreateDeviceObject("TopLevelAS", Desc, ppTLAS,
577  [&]() //
578  {
579  auto* pTopLevelASImpl(NEW_RC_OBJ(m_TLASAllocator, "TopLevelAS instance", TopLevelASImplType)(static_cast<RenderDeviceImplType*>(this), Desc, ExtraArgs...));
580  pTopLevelASImpl->QueryInterface(IID_TopLevelAS, reinterpret_cast<IObject**>(ppTLAS));
581  });
582  }
583 
585  {
586  CreateDeviceObject("ShaderBindingTable", Desc, ppSBT,
587  [&]() //
588  {
589  auto* pSBTImpl(NEW_RC_OBJ(m_SBTAllocator, "ShaderBindingTable instance", ShaderBindingTableImplType)(static_cast<RenderDeviceImplType*>(this), Desc));
590  pSBTImpl->QueryInterface(IID_ShaderBindingTable, reinterpret_cast<IObject**>(ppSBT));
591  });
592  }
593 
594  template <typename... ExtraArgsType>
595  void CreatePipelineResourceSignatureImpl(IPipelineResourceSignature** ppSignature, const PipelineResourceSignatureDesc& Desc, const ExtraArgsType&... ExtraArgs)
596  {
597  CreateDeviceObject("PipelineResourceSignature", Desc, ppSignature,
598  [&]() //
599  {
600  auto* pPRSImpl(NEW_RC_OBJ(m_PipeResSignAllocator, "PipelineResourceSignature instance", PipelineResourceSignatureImplType)(static_cast<RenderDeviceImplType*>(this), Desc, ExtraArgs...));
601  pPRSImpl->QueryInterface(IID_PipelineResourceSignature, reinterpret_cast<IObject**>(ppSignature));
602  });
603  }
604 
605 
606 protected:
608 
611 
612  // All state object registries hold raw pointers.
613  // This is safe because every object unregisters itself
614  // when it is deleted.
616  std::vector<TextureFormatInfoExt, STDAllocatorRawMem<TextureFormatInfoExt>> m_TextureFormatsInfo;
617  std::vector<bool, STDAllocatorRawMem<bool>> m_TexFmtInfoInitFlags;
618 
622 
624  std::vector<RefCntWeakPtr<IDeviceContext>, STDAllocatorRawMem<RefCntWeakPtr<IDeviceContext>>> m_wpDeferredContexts;
625 
644 };
645 
646 } // namespace Diligent
Diligent::RenderDeviceBase< EngineGLImplTraits >::QueryImplType
typename EngineGLImplTraits ::QueryImplType QueryImplType
Definition: RenderDeviceBase.hpp:201
Diligent::RenderDeviceBase::CreateFenceImpl
void CreateFenceImpl(IFence **ppFence, const FenceDesc &Desc)
Definition: RenderDeviceBase.hpp:520
Diligent::RenderDeviceBase::CreatePipelineStateImpl
void CreatePipelineStateImpl(IPipelineState **ppPipelineState, const PSOCreateInfoType &PSOCreateInfo, const ExtraArgsType &... ExtraArgs)
Definition: RenderDeviceBase.hpp:459
Diligent::TextureViewDesc::Format
TEXTURE_FORMAT Format
View format. If default value Diligent::TEX_FORMAT_UNKNOWN is provided, the view format will match th...
Definition: TextureView.h:94
ObjectBase.hpp
Diligent::RenderDeviceBase::GetTextureFormatInfoExt
virtual const TextureFormatInfoExt & GetTextureFormatInfoExt(TEXTURE_FORMAT TexFormat) override final
Implementation of IRenderDevice::GetTextureFormatInfoExt().
Definition: RenderDeviceBase.hpp:352
Diligent::RenderDeviceBase::m_RenderPassAllocator
FixedBlockMemoryAllocator m_RenderPassAllocator
Allocator for render pass objects.
Definition: RenderDeviceBase.hpp:638
Diligent::TextureFormatInfoExt
struct TextureFormatInfoExt TextureFormatInfoExt
Definition: GraphicsTypes.h:2618
Diligent::RenderDeviceBase::CreateTextureImpl
void CreateTextureImpl(ITexture **ppTexture, const TextureDesc &TexDesc, const ExtraArgsType &... ExtraArgs)
Definition: RenderDeviceBase.hpp:482
Diligent::IReferenceCounters
Base interface for a reference counter object that stores the number of strong and weak references an...
Definition: ReferenceCounters.h:44
Diligent::RenderDeviceBase::GetNumDeferredContexts
size_t GetNumDeferredContexts() const
Returns number of deferred contexts.
Definition: RenderDeviceBase.hpp:388
GraphicsAccessories.hpp
Diligent::RenderDeviceBase< EngineGLImplTraits >::TopLevelASImplType
typename EngineGLImplTraits ::TopLevelASImplType TopLevelASImplType
Definition: RenderDeviceBase.hpp:205
Diligent::Char
char Char
Definition: BasicTypes.h:64
StateObjectsRegistry.hpp
Diligent::SamplerDesc
Sampler description.
Definition: Sampler.h:58
Diligent::TEX_FORMAT_RG16_FLOAT
@ TEX_FORMAT_RG16_FLOAT
Two-component 32-bit half-precision floating-point format with 16-bit channels. D3D counterpart: DX...
Definition: GraphicsTypes.h:477
Diligent::TEX_FORMAT_R32_FLOAT
@ TEX_FORMAT_R32_FLOAT
Single-component 32-bit floating-point format. D3D counterpart: DXGI_FORMAT_R32_FLOAT....
Definition: GraphicsTypes.h:509
Diligent::SamplerDesc::MagFilter
FILTER_TYPE MagFilter
Texture magnification filter, see Diligent::FILTER_TYPE for details. Default value: Diligent::FILTER_...
Definition: Sampler.h:66
Diligent::RenderDeviceBase< EngineGLImplTraits >::ShaderBindingTableImplType
typename EngineGLImplTraits ::ShaderBindingTableImplType ShaderBindingTableImplType
Definition: RenderDeviceBase.hpp:206
Diligent::GetObjectDescString
String GetObjectDescString(const TObjectDescType &)
Helper template function that converts object description into a string.
Definition: GraphicsAccessories.hpp:355
Diligent::TextureFormatInfoExt
Extended texture format information.
Definition: GraphicsTypes.h:2595
Diligent::ISampler
Texture sampler interface.
Definition: Sampler.h:192
Diligent::IPipelineResourceSignature
Pipeline resource signature interface.
Definition: PipelineResourceSignature.h:226
Diligent::BlendStateDesc::IndependentBlendEnable
Bool IndependentBlendEnable
Specifies whether to enable independent blending in simultaneous render targets. If set to False,...
Definition: BlendState.h:382
Diligent::TEX_FORMAT_R24_UNORM_X8_TYPELESS
@ TEX_FORMAT_R24_UNORM_X8_TYPELESS
Two-component 32-bit format with 24 bits for unsigned-normalized-integer data and 8 bits of unreferen...
Definition: GraphicsTypes.h:529
DeviceObjectBase.hpp
Diligent::TextureViewDesc::MostDetailedMip
Uint32 MostDetailedMip
Most detailed mip level to use.
Definition: TextureView.h:97
Diligent::PipelineResourceSignatureDesc
Pipeline resource signature description.
Definition: PipelineResourceSignature.h:166
Diligent::RenderDeviceBase< EngineGLImplTraits >::FramebufferImplType
typename EngineGLImplTraits ::FramebufferImplType FramebufferImplType
Definition: RenderDeviceBase.hpp:203
Diligent::IShaderBindingTable
Shader binding table interface.
Definition: ShaderBindingTable.h:93
Diligent::RenderDeviceBase< EngineGLImplTraits >::FenceImplType
typename EngineGLImplTraits ::FenceImplType FenceImplType
Definition: RenderDeviceBase.hpp:200
Diligent::RenderDeviceBase::m_wpDeferredContexts
std::vector< RefCntWeakPtr< IDeviceContext >, STDAllocatorRawMem< RefCntWeakPtr< IDeviceContext > > > m_wpDeferredContexts
Weak references to deferred contexts.
Definition: RenderDeviceBase.hpp:624
Diligent::TEX_FORMAT_RGBA16_SNORM
@ TEX_FORMAT_RGBA16_SNORM
Four-component 64-bit signed-normalized-integer format with 16-bit channels. D3D counterpart: DXGI_...
Definition: GraphicsTypes.h:392
Diligent::TopLevelASDesc
Top-level AS description.
Definition: TopLevelAS.h:49
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::RenderDeviceBase::GetImmediateContext
RefCntAutoPtr< IDeviceContext > GetImmediateContext()
Definition: RenderDeviceBase.hpp:393
Diligent::QueryDesc
Query description.
Definition: Query.h:150
ResourceMappingImpl.hpp
Diligent::RenderDeviceBase::m_SRBAllocator
FixedBlockMemoryAllocator m_SRBAllocator
Allocator for shader resource binding objects.
Definition: RenderDeviceBase.hpp:634
Diligent::RenderDeviceBase::GetSRBAllocator
FixedBlockMemoryAllocator & GetSRBAllocator()
Definition: RenderDeviceBase.hpp:398
STDAllocator.hpp
Diligent::RefCntWeakPtr
Implementation of weak pointers.
Definition: RefCntAutoPtr.hpp:40
Diligent::RenderDeviceBase::m_DeviceCaps
DeviceCaps m_DeviceCaps
Definition: RenderDeviceBase.hpp:609
Diligent::StencilOpDesc
struct StencilOpDesc StencilOpDesc
Definition: DepthStencilState.h:148
Diligent::TEX_FORMAT_BC1_UNORM
@ TEX_FORMAT_BC1_UNORM
Four-component unsigned-normalized-integer block-compression format with 5 bits for R,...
Definition: GraphicsTypes.h:647
Diligent::RenderDeviceBase::TestTextureFormat
virtual void TestTextureFormat(TEXTURE_FORMAT TexFormat)=0
Diligent::IShader
Shader interface.
Definition: Shader.h:428
Diligent::TEX_FORMAT_RG16_SNORM
@ TEX_FORMAT_RG16_SNORM
Two-component 32-bit signed-normalized-integer format with 16-bit channels. D3D counterpart: DXGI_F...
Definition: GraphicsTypes.h:493
Diligent::IObject
Base interface for all dynamic objects in the engine.
Definition: Object.h:41
Diligent::RenderDeviceBase::GetTexViewObjAllocator
FixedBlockMemoryAllocator & GetTexViewObjAllocator()
Definition: RenderDeviceBase.hpp:396
Diligent::TextureViewDesc::NumMipLevels
Uint32 NumMipLevels
Total number of mip levels for the view of the texture. Render target and depth stencil views can add...
Definition: TextureView.h:104
Diligent::RenderDeviceBase::m_ShaderObjAllocator
FixedBlockMemoryAllocator m_ShaderObjAllocator
Allocator for shader objects.
Definition: RenderDeviceBase.hpp:631
Diligent::BlendStateDesc::AlphaToCoverageEnable
Bool AlphaToCoverageEnable
Specifies whether to use alpha-to-coverage as a multisampling technique when setting a pixel to a ren...
Definition: BlendState.h:378
Diligent::RenderDeviceBase::m_DeviceProperties
DeviceProperties m_DeviceProperties
Definition: RenderDeviceBase.hpp:610
Diligent::RenderDeviceBase< EngineGLImplTraits >::RenderPassImplType
typename EngineGLImplTraits ::RenderPassImplType RenderPassImplType
Definition: RenderDeviceBase.hpp:202
Diligent::SamplerDesc::ComparisonFunc
COMPARISON_FUNCTION ComparisonFunc
A function that compares sampled data against existing sampled data when comparsion filter is used....
Definition: Sampler.h:96
Diligent::ITopLevelAS
Top-level AS interface.
Definition: TopLevelAS.h:151
Defines.h
Diligent::DepthStencilStateDesc::StencilEnable
Bool StencilEnable
Enable stencil opertaions. Default value: False.
Definition: DepthStencilState.h:173
Diligent::TextureViewDesc::NumArraySlices
Uint32 NumArraySlices
For a texture array, number of array slices to address in the view. Set to 0 to address all array sli...
Definition: TextureView.h:119
Diligent::StencilOpDesc::StencilDepthFailOp
STENCIL_OP StencilDepthFailOp
The stencil operation to perform when stencil testing passes and depth testing fails....
Definition: DepthStencilState.h:106
Diligent::TEX_FORMAT_R11G11B10_FLOAT
@ TEX_FORMAT_R11G11B10_FLOAT
Three-component 32-bit format encoding three partial precision channels using 11 bits for red and gre...
Definition: GraphicsTypes.h:445
Diligent::RenderDeviceBase::m_TextureFormatsInfo
std::vector< TextureFormatInfoExt, STDAllocatorRawMem< TextureFormatInfoExt > > m_TextureFormatsInfo
Definition: RenderDeviceBase.hpp:616
Diligent::RenderDeviceBase::CreateSBTImpl
void CreateSBTImpl(IShaderBindingTable **ppSBT, const ShaderBindingTableDesc &Desc)
Definition: RenderDeviceBase.hpp:584
Diligent::TEX_FORMAT_NUM_FORMATS
@ TEX_FORMAT_NUM_FORMATS
Helper member containing the total number of texture formats in the enumeration.
Definition: GraphicsTypes.h:856
Diligent::TEX_FORMAT_RGBA16_FLOAT
@ TEX_FORMAT_RGBA16_FLOAT
Four-component 64-bit half-precision floating-point format with 16-bit channels. D3D counterpart: D...
Definition: GraphicsTypes.h:375
LOG_ERROR
#define LOG_ERROR(...)
Definition: Errors.hpp:76
Diligent::TEX_FORMAT_BC3_UNORM
@ TEX_FORMAT_BC3_UNORM
Four-component unsigned-normalized-integer block-compression format with 5 bits for R,...
Definition: GraphicsTypes.h:699
DeviceContext.h
Diligent::DepthStencilStateDesc::StencilWriteMask
Uint8 StencilWriteMask
Identify which bits of the depth-stencil buffer are accessed when writing stencil data....
Definition: DepthStencilState.h:181
Diligent::StencilOpDesc::StencilFunc
COMPARISON_FUNCTION StencilFunc
A function that compares stencil data against existing stencil data. Default value: Diligent::COMPARI...
Definition: DepthStencilState.h:114
Diligent::IFramebuffer
Framebuffer interface.
Definition: Framebuffer.h:73
Diligent::RenderDeviceBase::m_FramebufferAllocator
FixedBlockMemoryAllocator m_FramebufferAllocator
Allocator for framebuffer objects.
Definition: RenderDeviceBase.hpp:639
Diligent::ResourceMappingDesc
Resource mapping description.
Definition: ResourceMapping.h:75
Diligent::TextureViewDesc::AccessFlags
UAV_ACCESS_FLAG AccessFlags
For an unordered access view, allowed access flags. See Diligent::UAV_ACCESS_FLAG for details.
Definition: TextureView.h:128
DEV_CHECK_ERR
#define DEV_CHECK_ERR(...)
Definition: DebugUtilities.hpp:90
Diligent::TEX_FORMAT_RGBA8_SNORM
@ TEX_FORMAT_RGBA8_SNORM
Four-component 32-bit signed-normalized-integer format with 8-bit channels. D3D counterpart: DXGI_F...
Definition: GraphicsTypes.h:465
Diligent::RenderDeviceBase< EngineGLImplTraits >::PipelineStateImplType
typename EngineGLImplTraits ::PipelineStateImplType PipelineStateImplType
Definition: RenderDeviceBase.hpp:192
Diligent::RenderPassDesc
Render pass description.
Definition: RenderPass.h:341
Diligent::IDeviceObject
Base interface for all objects created by the render device Diligent::IRenderDevice.
Definition: DeviceObject.h:52
Diligent::TEX_FORMAT_A8_UNORM
@ TEX_FORMAT_A8_UNORM
Single-component 8-bit unsigned-normalized-integer format for alpha only. D3D counterpart: DXGI_FOR...
Definition: GraphicsTypes.h:611
Diligent::RenderDeviceBase::CreatePipelineResourceSignatureImpl
void CreatePipelineResourceSignatureImpl(IPipelineResourceSignature **ppSignature, const PipelineResourceSignatureDesc &Desc, const ExtraArgsType &... ExtraArgs)
Definition: RenderDeviceBase.hpp:595
Diligent::ObjectBase
Template class implementing base functionality for an object.
Definition: ObjectBase.hpp:66
Diligent::ShaderCreateInfo
Shader creation attributes.
Definition: Shader.h:241
Diligent::RenderDeviceBase::GetTextureFormatInfo
virtual const TextureFormatInfo & GetTextureFormatInfo(TEXTURE_FORMAT TexFormat) override final
Implementation of IRenderDevice::GetTextureFormatInfo().
Definition: RenderDeviceBase.hpp:343
Diligent::TEX_FORMAT_R16_SNORM
@ TEX_FORMAT_R16_SNORM
Single-component 16-bit signed-normalized-integer format. D3D counterpart: DXGI_FORMAT_R16_SNORM....
Definition: GraphicsTypes.h:582
Diligent::IBuffer
Buffer interface.
Definition: Buffer.h:187
Diligent::RasterizerStateDesc
Rasterizer state description.
Definition: RasterizerState.h:96
Diligent::SamplerDesc::MipLODBias
Float32 MipLODBias
Offset from the calculated mipmap level. For example, if a sampler calculates that a texture should b...
Definition: Sampler.h:89
Diligent::TEX_FORMAT_BC3_UNORM_SRGB
@ TEX_FORMAT_BC3_UNORM_SRGB
Four-component unsigned-normalized-integer block-compression sRGB format with 5 bits for R,...
Definition: GraphicsTypes.h:708
Diligent::IObject::QueryInterface
virtual void QueryInterface(const INTERFACE_ID &IID, IObject **ppInterface)=0
Queries the specific interface.
RenderDevice.h
Diligent::RenderDeviceBase::m_SBTAllocator
FixedBlockMemoryAllocator m_SBTAllocator
Allocator for shader binding table objects.
Definition: RenderDeviceBase.hpp:642
Diligent::TEX_FORMAT_UNKNOWN
@ TEX_FORMAT_UNKNOWN
Unknown format.
Definition: GraphicsTypes.h:331
Diligent::DepthStencilStateDesc::BackFace
StencilOpDesc BackFace
Identify stencil operations for the back-facing triangles, see Diligent::StencilOpDesc.
Definition: DepthStencilState.h:187
Diligent::STDAllocator
Definition: STDAllocator.hpp:53
Diligent::SamplerDesc::MaxAnisotropy
Uint32 MaxAnisotropy
Maximum anisotropy level for the anisotropic filter. Default value: 0.
Definition: Sampler.h:92
Diligent::DepthStencilStateDesc::StencilReadMask
Uint8 StencilReadMask
Identify which bits of the depth-stencil buffer are accessed when reading stencil data....
Definition: DepthStencilState.h:177
std::hash< Diligent::RasterizerStateDesc >::operator()
size_t operator()(const Diligent::RasterizerStateDesc &RasterizerDesc) const
Definition: RenderDeviceBase.hpp:109
Diligent::RenderDeviceBase::m_FenceAllocator
FixedBlockMemoryAllocator m_FenceAllocator
Allocator for fence objects.
Definition: RenderDeviceBase.hpp:636
Diligent::SamplerDesc::AddressW
TEXTURE_ADDRESS_MODE AddressW
Texture address mode for W coordinate, see Diligent::TEXTURE_ADDRESS_MODE for details Default value: ...
Definition: Sampler.h:84
Diligent::ShaderBindingTableDesc
Shader binding table description.
Definition: ShaderBindingTable.h:50
Diligent::Int32
int32_t Int32
32-bit signed integer
Definition: BasicTypes.h:46
Diligent::RenderDeviceBase< EngineGLImplTraits >::TextureViewImplType
typename EngineGLImplTraits ::TextureViewImplType TextureViewImplType
Definition: RenderDeviceBase.hpp:197
EngineMemory.h
std::hash< Diligent::DepthStencilStateDesc >::operator()
size_t operator()(const Diligent::DepthStencilStateDesc &DepthStencilDesc) const
Definition: RenderDeviceBase.hpp:92
Diligent::RenderDeviceBase::m_ResMappingAllocator
FixedBlockMemoryAllocator m_ResMappingAllocator
Allocator for resource mapping objects.
Definition: RenderDeviceBase.hpp:635
Diligent::RenderDeviceBase< EngineGLImplTraits >::RenderDeviceImplType
typename EngineGLImplTraits ::RenderDeviceImplType RenderDeviceImplType
Definition: RenderDeviceBase.hpp:191
Diligent::TEX_FORMAT_BC1_UNORM_SRGB
@ TEX_FORMAT_BC1_UNORM_SRGB
Four-component unsigned-normalized-integer block-compression sRGB format with 5 bits for R,...
Definition: GraphicsTypes.h:656
Diligent::TEX_FORMAT_BC2_UNORM
@ TEX_FORMAT_BC2_UNORM
Four-component unsigned-normalized-integer block-compression format with 5 bits for R,...
Definition: GraphicsTypes.h:673
Diligent::TextureViewDesc::ViewType
TEXTURE_VIEW_TYPE ViewType
Describes the texture view type, see Diligent::TEXTURE_VIEW_TYPE for details.
Definition: TextureView.h:83
Diligent::StencilOpDesc
Describes stencil operations that are performed based on the results of depth test.
Definition: DepthStencilState.h:98
Diligent::TEX_FORMAT_R8_UNORM
@ TEX_FORMAT_R8_UNORM
Single-component 8-bit unsigned-normalized-integer format. D3D counterpart: DXGI_FORMAT_R8_UNORM....
Definition: GraphicsTypes.h:594
Diligent::TextureDesc
Texture description.
Definition: Texture.h:47
Diligent::TextureViewDesc::FirstArraySlice
Uint32 FirstArraySlice
For a texture array, first array slice to address in the view.
Definition: TextureView.h:109
Diligent::RasterizerStateDesc::SlopeScaledDepthBias
Float32 SlopeScaledDepthBias
Scalar that scales the given pixel's slope before adding to the pixel's depth. Default value: 0.
Definition: RasterizerState.h:136
Diligent::TEX_FORMAT_B5G6R5_UNORM
@ TEX_FORMAT_B5G6R5_UNORM
Three-component 16-bit unsigned-normalized-integer format with 5 bits for blue, 6 bits for green,...
Definition: GraphicsTypes.h:765
Diligent::TEX_FORMAT_BC4_UNORM
@ TEX_FORMAT_BC4_UNORM
One-component unsigned-normalized-integer block-compression format with 8 bits for R channel....
Definition: GraphicsTypes.h:725
Diligent::RenderDeviceBase::RenderDeviceBase
RenderDeviceBase(IReferenceCounters *pRefCounters, IMemoryAllocator &RawMemAllocator, IEngineFactory *pEngineFactory, Uint32 NumDeferredContexts)
Definition: RenderDeviceBase.hpp:216
Diligent::RenderDeviceBase::m_BufObjAllocator
FixedBlockMemoryAllocator m_BufObjAllocator
Allocator for buffer objects.
Definition: RenderDeviceBase.hpp:629
Diligent::GetRawAllocator
IMemoryAllocator & GetRawAllocator()
Returns raw memory allocator.
Definition: EngineMemory.cpp:51
Diligent::RenderDeviceBase::m_TexViewObjAllocator
FixedBlockMemoryAllocator m_TexViewObjAllocator
Allocator for texture view objects.
Definition: RenderDeviceBase.hpp:628
std::hash< Diligent::StencilOpDesc >::operator()
size_t operator()(const Diligent::StencilOpDesc &StOpDesc) const
Definition: RenderDeviceBase.hpp:79
Diligent::RasterizerStateDesc::AntialiasedLineEnable
Bool AntialiasedLineEnable
Specifies whether to enable line antialiasing. Default value: False.
Definition: RasterizerState.h:123
Diligent::TextureFormatAttribs
struct TextureFormatAttribs TextureFormatAttribs
Definition: GraphicsTypes.h:2542
Diligent::RenderDeviceBase< EngineGLImplTraits >::ShaderResourceBindingImplType
typename EngineGLImplTraits ::ShaderResourceBindingImplType ShaderResourceBindingImplType
Definition: RenderDeviceBase.hpp:193
Diligent::RenderDeviceBase::m_RawMemAllocator
IMemoryAllocator & m_RawMemAllocator
Raw memory allocator.
Definition: RenderDeviceBase.hpp:626
Diligent::TEX_FORMAT_R8_SNORM
@ TEX_FORMAT_R8_SNORM
Single-component 8-bit signed-normalized-integer format. D3D counterpart: DXGI_FORMAT_R8_SNORM....
Definition: GraphicsTypes.h:602
Diligent::RenderDeviceBase< EngineGLImplTraits >::PipelineResourceSignatureImplType
typename EngineGLImplTraits ::PipelineResourceSignatureImplType PipelineResourceSignatureImplType
Definition: RenderDeviceBase.hpp:207
Diligent::BlendStateDesc::RenderTargets
RenderTargetBlendDesc RenderTargets[DILIGENT_MAX_RENDER_TARGETS]
An array of RenderTargetBlendDesc structures that describe the blend states for render targets.
Definition: BlendState.h:386
Diligent::TEX_FORMAT_RGBA32_FLOAT
@ TEX_FORMAT_RGBA32_FLOAT
Four-component 128-bit floating-point format with 32-bit channels. D3D counterpart: DXGI_FORMAT_R32...
Definition: GraphicsTypes.h:339
Diligent::RasterizerStateDesc::ScissorEnable
Bool ScissorEnable
Enable scissor-rectangle culling. All pixels outside an active scissor rectangle are culled....
Definition: RasterizerState.h:119
IMPLEMENT_QUERY_INTERFACE_IN_PLACE
#define IMPLEMENT_QUERY_INTERFACE_IN_PLACE(InterfaceID, ParentClassName)
Definition: ObjectBase.hpp:59
Diligent::TEX_FORMAT_R16_FLOAT
@ TEX_FORMAT_R16_FLOAT
Single-component 16-bit half-precisoin floating-point format. D3D counterpart: DXGI_FORMAT_R16_FLOA...
Definition: GraphicsTypes.h:562
Diligent::RenderDeviceBase< EngineGLImplTraits >::BaseInterface
typename EngineGLImplTraits ::RenderDeviceInterface BaseInterface
Definition: RenderDeviceBase.hpp:188
Diligent::DeviceProperties
Device properties.
Definition: GraphicsTypes.h:1970
Diligent::TextureViewDesc::Flags
TEXTURE_VIEW_FLAGS Flags
Texture view flags, see Diligent::TEXTURE_VIEW_FLAGS.
Definition: TextureView.h:131
Diligent::RenderDeviceBase::m_BLASAllocator
FixedBlockMemoryAllocator m_BLASAllocator
Allocator for bottom-level acceleration structure objects.
Definition: RenderDeviceBase.hpp:640
Diligent::RefCntAutoPtr
Template class that implements reference counting.
Definition: RefCntAutoPtr.hpp:73
Diligent::RenderDeviceBase::SetDeferredContext
void SetDeferredContext(size_t Ctx, IDeviceContext *pDeferredCtx)
Set weak reference to the deferred context.
Definition: RenderDeviceBase.hpp:381
Diligent::SamplerDesc::MaxLOD
float MaxLOD
Specifies the maximum value that LOD is clamped to before accessing the texture MIP levels....
Definition: Sampler.h:110
Diligent::TEX_FORMAT_RG16_UNORM
@ TEX_FORMAT_RG16_UNORM
Two-component 32-bit unsigned-normalized-integer format with 16-bit channels. D3D counterpart: DXGI...
Definition: GraphicsTypes.h:483
DILIGENT_CALL_TYPE
#define DILIGENT_CALL_TYPE
Definition: CommonDefinitions.h:45
Diligent::DepthStencilStateDesc::DepthFunc
COMPARISON_FUNCTION DepthFunc
A function that compares depth data against existing depth data. See Diligent::COMPARISON_FUNCTION fo...
Definition: DepthStencilState.h:170
Diligent::RenderDeviceBase::CreateRenderPassImpl
void CreateRenderPassImpl(IRenderPass **ppRenderPass, const RenderPassDesc &Desc, const ExtraArgsType &... ExtraArgs)
Definition: RenderDeviceBase.hpp:541
Diligent::TextureViewDesc
struct TextureViewDesc TextureViewDesc
Definition: TextureView.h:183
Diligent::StencilOpDesc::StencilFailOp
STENCIL_OP StencilFailOp
The stencil operation to perform when stencil testing fails. Default value: Diligent::STENCIL_OP_KEEP...
Definition: DepthStencilState.h:102
Diligent::BlendStateDesc
struct BlendStateDesc BlendStateDesc
Definition: BlendState.h:431
Diligent::RasterizerStateDesc::DepthBiasClamp
Float32 DepthBiasClamp
Maximum depth bias of a pixel.
Definition: RasterizerState.h:132
Diligent::Uint32
uint32_t Uint32
32-bit unsigned integer
Definition: BasicTypes.h:51
Diligent::TEX_FORMAT_RGBA8_UNORM
@ TEX_FORMAT_RGBA8_UNORM
Four-component 32-bit unsigned-normalized-integer format with 8-bit channels. D3D counterpart: DXGI...
Definition: GraphicsTypes.h:453
Diligent::TEX_FORMAT_BC5_SNORM
@ TEX_FORMAT_BC5_SNORM
Two-component signed-normalized-integer block-compression format with 8 bits for R and 8 bits for G c...
Definition: GraphicsTypes.h:760
Diligent::SamplerDesc::MinLOD
float MinLOD
Specifies the minimum value that LOD is clamped to before accessing the texture MIP levels....
Definition: Sampler.h:105
Diligent::ComputeHash
std::size_t ComputeHash(const ArgsType &... Args)
Definition: HashUtils.hpp:57
Diligent::StateObjectsRegistry
Template class implementing state object registry.
Definition: StateObjectsRegistry.hpp:62
Diligent::RenderDeviceBase::m_QueryAllocator
FixedBlockMemoryAllocator m_QueryAllocator
Allocator for query objects.
Definition: RenderDeviceBase.hpp:637
Diligent::RenderDeviceBase::m_BuffViewObjAllocator
FixedBlockMemoryAllocator m_BuffViewObjAllocator
Allocator for buffer view objects.
Definition: RenderDeviceBase.hpp:630
Diligent::TEX_FORMAT_RG32_FLOAT
@ TEX_FORMAT_RG32_FLOAT
Two-component 64-bit floating-point format with 32-bit channels. D3D counterpart: DXGI_FORMAT_R32G3...
Definition: GraphicsTypes.h:404
Diligent::RenderDeviceBase< EngineGLImplTraits >::ShaderImplType
typename EngineGLImplTraits ::ShaderImplType ShaderImplType
Definition: RenderDeviceBase.hpp:198
Diligent::RefCountedObject< BaseInterface >::Release
virtual ReferenceCounterValueType Release() override
Definition: RefCountedObjectImpl.hpp:552
Diligent::RenderDeviceBase::m_PipeResSignAllocator
FixedBlockMemoryAllocator m_PipeResSignAllocator
Allocator for pipeline resource signature objects.
Definition: RenderDeviceBase.hpp:643
Diligent::TEX_FORMAT_RG8_SNORM
@ TEX_FORMAT_RG8_SNORM
Two-component 16-bit signed-normalized-integer format with 8-bit channels. D3D counterpart: DXGI_FO...
Definition: GraphicsTypes.h:550
Diligent::RenderDeviceBase::CreateBufferImpl
void CreateBufferImpl(IBuffer **ppBuffer, const BufferDesc &BuffDesc, const ExtraArgsType &... ExtraArgs)
Definition: RenderDeviceBase.hpp:470
Diligent::TextureFormatInfo
Basic texture format description.
Definition: GraphicsTypes.h:2548
Diligent::RenderDeviceBase::CreateBLASImpl
void CreateBLASImpl(IBottomLevelAS **ppBLAS, const BottomLevelASDesc &Desc, const ExtraArgsType &... ExtraArgs)
Definition: RenderDeviceBase.hpp:563
Diligent::RenderDeviceBase< EngineGLImplTraits >::BufferViewImplType
typename EngineGLImplTraits ::BufferViewImplType BufferViewImplType
Definition: RenderDeviceBase.hpp:195
Diligent::RenderDeviceBase::SetImmediateContext
void SetImmediateContext(IDeviceContext *pImmediateContext)
Set weak reference to the immediate context.
Definition: RenderDeviceBase.hpp:374
Diligent::TextureViewDesc::TextureDim
RESOURCE_DIMENSION TextureDim
View interpretation of the original texture. For instance, one slice of a 2D texture array can be vie...
Definition: TextureView.h:90
Diligent::DepthStencilStateDesc::DepthWriteEnable
Bool DepthWriteEnable
Enable or disable writes to a depth buffer. Default value: True.
Definition: DepthStencilState.h:165
Diligent::RenderDeviceBase::m_PSOAllocator
FixedBlockMemoryAllocator m_PSOAllocator
Allocator for pipeline state objects.
Definition: RenderDeviceBase.hpp:633
Diligent::DepthStencilStateDesc
struct DepthStencilStateDesc DepthStencilStateDesc
Definition: DepthStencilState.h:233
Diligent::SamplerDesc::AddressV
TEXTURE_ADDRESS_MODE AddressV
Texture address mode for V coordinate, see Diligent::TEXTURE_ADDRESS_MODE for details Default value: ...
Definition: Sampler.h:80
Diligent::RenderDeviceBase::GetBuffViewObjAllocator
FixedBlockMemoryAllocator & GetBuffViewObjAllocator()
Definition: RenderDeviceBase.hpp:397
Diligent::RenderDeviceBase::~RenderDeviceBase
~RenderDeviceBase()
Definition: RenderDeviceBase.hpp:297
Diligent::RenderDeviceBase::GetDeviceProperties
virtual const DeviceProperties & GetDeviceProperties() const override final
Implementation of IRenderDevice::GetDeviceProperties().
Definition: RenderDeviceBase.hpp:337
Diligent::TEX_FORMAT_RGBA16_UNORM
@ TEX_FORMAT_RGBA16_UNORM
Four-component 64-bit unsigned-normalized-integer format with 16-bit channels. D3D counterpart: DXG...
Definition: GraphicsTypes.h:381
Diligent::TEXTURE_FORMAT
TEXTURE_FORMAT
Texture formats.
Definition: GraphicsTypes.h:328
Diligent::RenderDeviceBase::GetDeferredContext
RefCntAutoPtr< IDeviceContext > GetDeferredContext(size_t Ctx)
Definition: RenderDeviceBase.hpp:394
Diligent::RenderDeviceBase::m_SamplersRegistry
StateObjectsRegistry< SamplerDesc > m_SamplersRegistry
Sampler state registry.
Definition: RenderDeviceBase.hpp:615
Diligent::RenderDeviceBase::CreateQueryImpl
void CreateQueryImpl(IQuery **ppQuery, const QueryDesc &Desc)
Definition: RenderDeviceBase.hpp:530
Diligent::BufferDesc
Buffer description.
Definition: Buffer.h:74
Diligent::RenderDeviceBase::m_pEngineFactory
RefCntAutoPtr< IEngineFactory > m_pEngineFactory
Definition: RenderDeviceBase.hpp:607
Diligent::RasterizerStateDesc::FillMode
FILL_MODE FillMode
Determines traingle fill mode, see Diligent::FILL_MODE for details. Default value: Diligent::FILL_MOD...
Definition: RasterizerState.h:100
Diligent::RenderDeviceBase::m_TLASAllocator
FixedBlockMemoryAllocator m_TLASAllocator
Allocator for top-level acceleration structure objects.
Definition: RenderDeviceBase.hpp:641
Diligent::IMemoryAllocator
Base interface for a raw memory allocator.
Definition: MemoryAllocator.h:41
Diligent::RenderDeviceBase::CreateSamplerImpl
void CreateSamplerImpl(ISampler **ppSampler, const SamplerDesc &SamplerDesc, const ExtraArgsType &... ExtraArgs)
Definition: RenderDeviceBase.hpp:505
Diligent::RenderDeviceBase::CreateResourceMapping
virtual void CreateResourceMapping(const ResourceMappingDesc &MappingDesc, IResourceMapping **ppMapping) override final
Implementation of IRenderDevice::CreateResourceMapping().
Definition: RenderDeviceBase.hpp:311
HashUtils.hpp
Diligent::SamplerDesc::MinFilter
FILTER_TYPE MinFilter
Texture minification filter, see Diligent::FILTER_TYPE for details. Default value: Diligent::FILTER_T...
Definition: Sampler.h:62
Diligent::DeviceCaps
Device capabilities.
Definition: GraphicsTypes.h:1833
SwapChain.h
Diligent::IFence
Fence interface.
Definition: Fence.h:62
std
Definition: AdvancedMath.hpp:979
Diligent::DepthStencilStateDesc::FrontFace
StencilOpDesc FrontFace
Identify stencil operations for the front-facing triangles, see Diligent::StencilOpDesc.
Definition: DepthStencilState.h:184
Diligent::RenderDeviceBase::m_TexObjAllocator
FixedBlockMemoryAllocator m_TexObjAllocator
Allocator for texture objects.
Definition: RenderDeviceBase.hpp:627
Diligent::RenderDeviceBase< EngineGLImplTraits >::BottomLevelASImplType
typename EngineGLImplTraits ::BottomLevelASImplType BottomLevelASImplType
Definition: RenderDeviceBase.hpp:204
Diligent::RasterizerStateDesc::CullMode
CULL_MODE CullMode
Determines traingle cull mode, see Diligent::CULL_MODE for details. Default value: Diligent::CULL_MOD...
Definition: RasterizerState.h:104
Diligent::IDeviceContext
Device context interface.
Definition: DeviceContext.h:1460
Diligent::RenderDeviceBase::CreateTLASImpl
void CreateTLASImpl(ITopLevelAS **ppTLAS, const TopLevelASDesc &Desc, const ExtraArgsType &... ExtraArgs)
Definition: RenderDeviceBase.hpp:574
Diligent::TEX_FORMAT_G8R8_G8B8_UNORM
@ TEX_FORMAT_G8R8_G8B8_UNORM
Four-component unsigned-normalized integer format analogous to YUY2 encoding. D3D counterpart: DXGI...
Definition: GraphicsTypes.h:630
STD_ALLOCATOR_RAW_MEM
#define STD_ALLOCATOR_RAW_MEM(Type, Allocator, Description)
Definition: STDAllocator.hpp:179
Diligent::RasterizerStateDesc::DepthBias
Int32 DepthBias
Constant value added to the depth of a given pixel. Default value: 0.
Definition: RasterizerState.h:127
Diligent::IQuery
Query interface.
Definition: Query.h:177
Diligent::TEX_FORMAT_R32_FLOAT_X8X24_TYPELESS
@ TEX_FORMAT_R32_FLOAT_X8X24_TYPELESS
Two-component 64-bit format with 32-bit floating-point R channel and 8+24-bits of typeless data....
Definition: GraphicsTypes.h:424
Diligent::SamplerDesc
struct SamplerDesc SamplerDesc
Definition: Sampler.h:172
Diligent::RenderDeviceBase< EngineGLImplTraits >::SamplerImplType
typename EngineGLImplTraits ::SamplerImplType SamplerImplType
Definition: RenderDeviceBase.hpp:199
Diligent::TEX_FORMAT_BC4_SNORM
@ TEX_FORMAT_BC4_SNORM
One-component signed-normalized-integer block-compression format with 8 bits for R channel....
Definition: GraphicsTypes.h:734
Diligent::TEX_FORMAT_RGBA8_UNORM_SRGB
@ TEX_FORMAT_RGBA8_UNORM_SRGB
Four-component 32-bit unsigned-normalized-integer sRGB format with 8-bit channels....
Definition: GraphicsTypes.h:457
Diligent::FramebufferDesc
Framebuffer description.
Definition: Framebuffer.h:46
Diligent::TEX_FORMAT_R16_UNORM
@ TEX_FORMAT_R16_UNORM
Single-component 16-bit unsigned-normalized-integer format. D3D counterpart: DXGI_FORMAT_R16_UNORM....
Definition: GraphicsTypes.h:572
Diligent::RasterizerStateDesc::FrontCounterClockwise
Bool FrontCounterClockwise
Determines if a triangle is front- or back-facing. If this parameter is True, a triangle will be cons...
Definition: RasterizerState.h:111
Diligent::IBottomLevelAS
Bottom-level AS interface.
Definition: BottomLevelAS.h:207
VERIFY
#define VERIFY(...)
Definition: DebugUtilities.hpp:76
Diligent::FixedBlockMemoryAllocator
Memory allocator that allocates memory in a fixed-size chunks.
Definition: FixedBlockMemoryAllocator.hpp:56
Diligent::RenderDeviceBase::Release
virtual ReferenceCounterValueType Release() override final
Definition: RenderDeviceBase.hpp:305
std::hash< Diligent::BlendStateDesc >::operator()
size_t operator()(const Diligent::BlendStateDesc &BSDesc) const
Definition: RenderDeviceBase.hpp:127
_countof
#define _countof(_Array)
Definition: AndroidPlatformDefinitions.h:38
std::hash< Diligent::TextureViewDesc >::operator()
size_t operator()(const Diligent::TextureViewDesc &TexViewDesc) const
Definition: RenderDeviceBase.hpp:155
Diligent::TEX_FORMAT_RGB9E5_SHAREDEXP
@ TEX_FORMAT_RGB9E5_SHAREDEXP
Three partial-precision floating pointer numbers sharing single exponent encoded into a 32-bit value....
Definition: GraphicsTypes.h:620
Diligent::RenderDeviceBase::GetEngineFactory
virtual IEngineFactory * GetEngineFactory() const override final
Definition: RenderDeviceBase.hpp:366
Diligent::RenderDeviceBase::CreateShaderImpl
void CreateShaderImpl(IShader **ppShader, const ShaderCreateInfo &ShaderCI, const ExtraArgsType &... ExtraArgs)
Definition: RenderDeviceBase.hpp:494
Diligent::ReferenceCounterValueType
long ReferenceCounterValueType
Definition: ReferenceCounters.h:37
Diligent::StencilOpDesc::StencilPassOp
STENCIL_OP StencilPassOp
The stencil operation to perform when stencil testing and depth testing both pass....
Definition: DepthStencilState.h:110
Diligent::RenderDeviceBase< EngineGLImplTraits >::TextureImplType
typename EngineGLImplTraits ::TextureImplType TextureImplType
Definition: RenderDeviceBase.hpp:196
Diligent::ResourceMappingImpl
Implementation of the resource mapping.
Definition: ResourceMappingImpl.hpp:47
Diligent::RenderDeviceBase::CreateFramebufferImpl
void CreateFramebufferImpl(IFramebuffer **ppFramebuffer, const FramebufferDesc &Desc, const ExtraArgsType &... ExtraArgs)
Definition: RenderDeviceBase.hpp:552
Diligent::DepthStencilStateDesc::DepthEnable
Bool DepthEnable
Enable depth-stencil operations. When it is set to False, depth test always passes,...
Definition: DepthStencilState.h:162
Diligent::RenderDeviceBase::m_TexFmtInfoInitFlags
std::vector< bool, STDAllocatorRawMem< bool > > m_TexFmtInfoInitFlags
Definition: RenderDeviceBase.hpp:617
Diligent::SamplerDesc::MipFilter
FILTER_TYPE MipFilter
Mip filter, see Diligent::FILTER_TYPE for details. Only FILTER_TYPE_POINT, FILTER_TYPE_LINEAR,...
Definition: Sampler.h:72
Diligent::TextureViewDesc
Texture view description.
Definition: TextureView.h:80
Diligent::TEX_FORMAT_RG8_B8G8_UNORM
@ TEX_FORMAT_RG8_B8G8_UNORM
Four-component unsigned-normalized integer format analogous to UYVY encoding. D3D counterpart: DXGI...
Definition: GraphicsTypes.h:625
Diligent::BottomLevelASDesc
Bottom-level AS description.
Definition: BottomLevelAS.h:145
Diligent::GetTextureFormatAttribs
const TextureFormatAttribs & GetTextureFormatAttribs(TEXTURE_FORMAT Format)
Returns invariant texture format attributes, see TextureFormatAttribs for details.
Definition: GraphicsAccessories.cpp:250
Diligent::SamplerDesc::AddressU
TEXTURE_ADDRESS_MODE AddressU
Texture address mode for U coordinate, see Diligent::TEXTURE_ADDRESS_MODE for details Default value: ...
Definition: Sampler.h:76
Diligent::RasterizerStateDesc::DepthClipEnable
Bool DepthClipEnable
Enable clipping against near and far clip planes. Default value: True.
Definition: RasterizerState.h:115
Diligent::RenderDeviceBase< EngineGLImplTraits >::BufferImplType
typename EngineGLImplTraits ::BufferImplType BufferImplType
Definition: RenderDeviceBase.hpp:194
Diligent::IEngineFactory
Engine factory base interface.
Definition: EngineFactory.h:60
Diligent::TEX_FORMAT_RG8_UNORM
@ TEX_FORMAT_RG8_UNORM
Two-component 16-bit unsigned-normalized-integer format with 8-bit channels. D3D counterpart: DXGI_...
Definition: GraphicsTypes.h:542
Diligent::FenceDesc
Fence description.
Definition: Fence.h:43
Diligent::RenderDeviceBase::CreateDeviceObject
void CreateDeviceObject(const Char *ObjectTypeName, const ObjectDescType &Desc, ObjectType **ppObject, ObjectConstructorType ConstructObject)
Helper template function to facilitate device object creation.
Definition: RenderDeviceBase.hpp:414
Diligent::RasterizerStateDesc
struct RasterizerStateDesc RasterizerStateDesc
Definition: RasterizerState.h:184
Diligent::ITexture
Texture inteface.
Definition: Texture.h:273
Diligent::HashCombine
void HashCombine(std::size_t &Seed, const T &Val)
Definition: HashUtils.hpp:44
Diligent::TEX_FORMAT_BC2_UNORM_SRGB
@ TEX_FORMAT_BC2_UNORM_SRGB
Four-component signed-normalized-integer block-compression sRGB format with 5 bits for R,...
Definition: GraphicsTypes.h:682
Diligent::RenderDeviceBase::m_wpImmediateContext
RefCntWeakPtr< IDeviceContext > m_wpImmediateContext
Weak reference to the immediate context. Immediate context holds strong reference to the device,...
Definition: RenderDeviceBase.hpp:621
Diligent::RenderDeviceBase::m_SamplerObjAllocator
FixedBlockMemoryAllocator m_SamplerObjAllocator
Allocator for sampler objects.
Definition: RenderDeviceBase.hpp:632
Diligent::RenderDeviceBase::GetSamplerRegistry
StateObjectsRegistry< SamplerDesc > & GetSamplerRegistry()
Definition: RenderDeviceBase.hpp:371
Diligent::DepthStencilStateDesc
Depth stencil state description.
Definition: DepthStencilState.h:157
NEW_RC_OBJ
#define NEW_RC_OBJ(Allocator, Desc, Type,...)
Definition: RefCountedObjectImpl.hpp:698
Diligent::IRenderPass
Render pass interface.
Definition: RenderPass.h:369
Diligent::ShaderCreateInfo::Desc
ShaderDesc Desc
Shader description. See Diligent::ShaderDesc.
Definition: Shader.h:316
Diligent::RenderDeviceBase
Base implementation of a render device.
Definition: RenderDeviceBase.hpp:185
Diligent::BlendStateDesc
Blend state description.
Definition: BlendState.h:374
FixedBlockMemoryAllocator.hpp
Diligent
The library uses Direct3D-style math:
Definition: AdvancedMath.hpp:37
Diligent::TEX_FORMAT_BC5_UNORM
@ TEX_FORMAT_BC5_UNORM
Two-component unsigned-normalized-integer block-compression format with 8 bits for R and 8 bits for G...
Definition: GraphicsTypes.h:751
Diligent::RenderDeviceBase::GetDeviceCaps
virtual const DeviceCaps & GetDeviceCaps() const override final
Implementation of IRenderDevice::GetDeviceCaps().
Definition: RenderDeviceBase.hpp:331
Diligent::IResourceMapping
Resouce mapping.
Definition: ResourceMapping.h:107
std::hash< Diligent::SamplerDesc >::operator()
size_t operator()(const Diligent::SamplerDesc &SamDesc) const
Definition: RenderDeviceBase.hpp:53