Diligent Engine  v.2.4.g
DeviceContextVkImpl.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 <unordered_map>
34 #include <bitset>
35 
36 #include "EngineVkImplTraits.hpp"
38 
39 // Vk object implementations are required by DeviceContextBase
40 #include "BufferVkImpl.hpp"
41 #include "TextureVkImpl.hpp"
42 #include "PipelineStateVkImpl.hpp"
43 #include "QueryVkImpl.hpp"
44 #include "FramebufferVkImpl.hpp"
45 #include "RenderPassVkImpl.hpp"
46 #include "BottomLevelASVkImpl.hpp"
47 #include "TopLevelASVkImpl.hpp"
50 
51 #include "GenerateMipsVkHelper.hpp"
52 #include "PipelineLayoutVk.hpp"
55 #include "VulkanUploadHeap.hpp"
56 #include "VulkanDynamicHeap.hpp"
57 #include "ResourceReleaseQueue.hpp"
59 #include "HashUtils.hpp"
60 #include "ManagedVulkanObject.hpp"
61 #include "QueryManagerVk.hpp"
62 
63 namespace Diligent
64 {
65 
67 class DeviceContextVkImpl final : public DeviceContextNextGenBase<EngineVkImplTraits>
68 {
69 public:
71 
73  RenderDeviceVkImpl* pDevice,
74  bool bIsDeferred,
75  const EngineVkCreateInfo& EngineCI,
76  Uint32 ContextId,
77  Uint32 CommandQueueId,
78  std::shared_ptr<GenerateMipsVkHelper> GenerateMipsHelper);
80 
82 
83 
84  virtual void DILIGENT_CALL_TYPE SetPipelineState(IPipelineState* pPipelineState) override final;
85 
87  virtual void DILIGENT_CALL_TYPE TransitionShaderResources(IPipelineState* pPipelineState,
88  IShaderResourceBinding* pShaderResourceBinding) override final;
89 
91  virtual void DILIGENT_CALL_TYPE CommitShaderResources(IShaderResourceBinding* pShaderResourceBinding,
92  RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final;
93 
95  virtual void DILIGENT_CALL_TYPE SetStencilRef(Uint32 StencilRef) override final;
96 
98  virtual void DILIGENT_CALL_TYPE SetBlendFactors(const float* pBlendFactors = nullptr) override final;
99 
101  virtual void DILIGENT_CALL_TYPE SetVertexBuffers(Uint32 StartSlot,
102  Uint32 NumBuffersSet,
103  IBuffer** ppBuffers,
104  Uint32* pOffsets,
105  RESOURCE_STATE_TRANSITION_MODE StateTransitionMode,
106  SET_VERTEX_BUFFERS_FLAGS Flags) override final;
107 
109  virtual void DILIGENT_CALL_TYPE InvalidateState() override final;
110 
112  virtual void DILIGENT_CALL_TYPE SetIndexBuffer(IBuffer* pIndexBuffer,
113  Uint32 ByteOffset,
114  RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final;
115 
117  virtual void DILIGENT_CALL_TYPE SetViewports(Uint32 NumViewports,
118  const Viewport* pViewports,
119  Uint32 RTWidth,
120  Uint32 RTHeight) override final;
121 
123  virtual void DILIGENT_CALL_TYPE SetScissorRects(Uint32 NumRects,
124  const Rect* pRects,
125  Uint32 RTWidth,
126  Uint32 RTHeight) override final;
127 
129  virtual void DILIGENT_CALL_TYPE SetRenderTargets(Uint32 NumRenderTargets,
130  ITextureView* ppRenderTargets[],
131  ITextureView* pDepthStencil,
132  RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final;
133 
135  virtual void DILIGENT_CALL_TYPE BeginRenderPass(const BeginRenderPassAttribs& Attribs) override final;
136 
138  virtual void DILIGENT_CALL_TYPE NextSubpass() override final;
139 
141  virtual void DILIGENT_CALL_TYPE EndRenderPass() override final;
142 
143  // clang-format off
145  virtual void DILIGENT_CALL_TYPE Draw (const DrawAttribs& Attribs) override final;
147  virtual void DILIGENT_CALL_TYPE DrawIndexed (const DrawIndexedAttribs& Attribs) override final;
149  virtual void DILIGENT_CALL_TYPE DrawIndirect (const DrawIndirectAttribs& Attribs, IBuffer* pAttribsBuffer) override final;
151  virtual void DILIGENT_CALL_TYPE DrawIndexedIndirect(const DrawIndexedIndirectAttribs& Attribs, IBuffer* pAttribsBuffer) override final;
153  virtual void DILIGENT_CALL_TYPE DrawMesh (const DrawMeshAttribs& Attribs) override final;
155  virtual void DILIGENT_CALL_TYPE DrawMeshIndirect (const DrawMeshIndirectAttribs& Attribs, IBuffer* pAttribsBuffer) override final;
157  virtual void DILIGENT_CALL_TYPE DrawMeshIndirectCount(const DrawMeshIndirectCountAttribs& Attribs, IBuffer* pAttribsBuffer, IBuffer* pCountBuffer) override final;
158 
160  virtual void DILIGENT_CALL_TYPE DispatchCompute (const DispatchComputeAttribs& Attribs) override final;
162  virtual void DILIGENT_CALL_TYPE DispatchComputeIndirect(const DispatchComputeIndirectAttribs& Attribs, IBuffer* pAttribsBuffer) override final;
163  // clang-format on
164 
167  CLEAR_DEPTH_STENCIL_FLAGS ClearFlags,
168  float fDepth,
169  Uint8 Stencil,
170  RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final;
171 
174  const float* RGBA,
175  RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final;
176 
178  virtual void DILIGENT_CALL_TYPE UpdateBuffer(IBuffer* pBuffer,
179  Uint32 Offset,
180  Uint32 Size,
181  const void* pData,
182  RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final;
183 
185  virtual void DILIGENT_CALL_TYPE CopyBuffer(IBuffer* pSrcBuffer,
186  Uint32 SrcOffset,
187  RESOURCE_STATE_TRANSITION_MODE SrcBufferTransitionMode,
188  IBuffer* pDstBuffer,
189  Uint32 DstOffset,
190  Uint32 Size,
191  RESOURCE_STATE_TRANSITION_MODE DstBufferTransitionMode) override final;
192 
194  virtual void DILIGENT_CALL_TYPE MapBuffer(IBuffer* pBuffer,
195  MAP_TYPE MapType,
196  MAP_FLAGS MapFlags,
197  PVoid& pMappedData) override final;
198 
200  virtual void DILIGENT_CALL_TYPE UnmapBuffer(IBuffer* pBuffer, MAP_TYPE MapType) override final;
201 
203  virtual void DILIGENT_CALL_TYPE UpdateTexture(ITexture* pTexture,
204  Uint32 MipLevel,
205  Uint32 Slice,
206  const Box& DstBox,
207  const TextureSubResData& SubresData,
208  RESOURCE_STATE_TRANSITION_MODE SrcBufferStateTransitionMode,
209  RESOURCE_STATE_TRANSITION_MODE TextureStateTransitionModee) override final;
210 
212  virtual void DILIGENT_CALL_TYPE CopyTexture(const CopyTextureAttribs& CopyAttribs) override final;
213 
215  virtual void DILIGENT_CALL_TYPE MapTextureSubresource(ITexture* pTexture,
216  Uint32 MipLevel,
217  Uint32 ArraySlice,
218  MAP_TYPE MapType,
219  MAP_FLAGS MapFlags,
220  const Box* pMapRegion,
221  MappedTextureSubresource& MappedData) override final;
222 
224  virtual void DILIGENT_CALL_TYPE UnmapTextureSubresource(ITexture* pTexture, Uint32 MipLevel, Uint32 ArraySlice) override final;
225 
227  virtual void DILIGENT_CALL_TYPE FinishCommandList(class ICommandList** ppCommandList) override final;
228 
230  virtual void DILIGENT_CALL_TYPE ExecuteCommandLists(Uint32 NumCommandLists,
231  ICommandList* const* ppCommandLists) override final;
232 
234  virtual void DILIGENT_CALL_TYPE SignalFence(IFence* pFence, Uint64 Value) override final;
235 
237  virtual void DILIGENT_CALL_TYPE WaitForFence(IFence* pFence, Uint64 Value, bool FlushContext) override final;
238 
240  virtual void DILIGENT_CALL_TYPE WaitForIdle() override final;
241 
243  virtual void DILIGENT_CALL_TYPE BeginQuery(IQuery* pQuery) override final;
244 
246  virtual void DILIGENT_CALL_TYPE EndQuery(IQuery* pQuery) override final;
247 
249  virtual void DILIGENT_CALL_TYPE Flush() override final;
250 
252  virtual void DILIGENT_CALL_TYPE BuildBLAS(const BuildBLASAttribs& Attribs) override final;
253 
255  virtual void DILIGENT_CALL_TYPE BuildTLAS(const BuildTLASAttribs& Attribs) override final;
256 
258  virtual void DILIGENT_CALL_TYPE CopyBLAS(const CopyBLASAttribs& Attribs) override final;
259 
261  virtual void DILIGENT_CALL_TYPE CopyTLAS(const CopyTLASAttribs& Attribs) override final;
262 
264  virtual void DILIGENT_CALL_TYPE WriteBLASCompactedSize(const WriteBLASCompactedSizeAttribs& Attribs) override final;
265 
267  virtual void DILIGENT_CALL_TYPE WriteTLASCompactedSize(const WriteTLASCompactedSizeAttribs& Attribs) override final;
268 
270  virtual void DILIGENT_CALL_TYPE TraceRays(const TraceRaysAttribs& Attribs) override final;
271 
273  virtual void DILIGENT_CALL_TYPE TraceRaysIndirect(const TraceRaysIndirectAttribs& Attribs, IBuffer* pAttribsBuffer) override final;
274 
276  virtual void DILIGENT_CALL_TYPE UpdateSBT(IShaderBindingTable* pSBT, const UpdateIndirectRTBufferAttribs* pUpdateIndirectBufferAttribs) override final;
277 
278  // Transitions texture subresources from OldState to NewState, and optionally updates
279  // internal texture state.
280  // If OldState == RESOURCE_STATE_UNKNOWN, internal texture state is used as old state.
281  void TransitionTextureState(TextureVkImpl& TextureVk,
282  RESOURCE_STATE OldState,
283  RESOURCE_STATE NewState,
284  bool UpdateTextureState,
285  VkImageSubresourceRange* pSubresRange = nullptr);
286 
287  void TransitionImageLayout(TextureVkImpl& TextureVk,
288  VkImageLayout OldLayout,
289  VkImageLayout NewLayout,
290  const VkImageSubresourceRange& SubresRange);
291 
293  virtual void DILIGENT_CALL_TYPE TransitionImageLayout(ITexture* pTexture, VkImageLayout NewLayout) override final;
294 
295 
296  // Transitions buffer state from OldState to NewState, and optionally updates
297  // internal buffer state.
298  // If OldState == RESOURCE_STATE_UNKNOWN, internal buffer state is used as old state.
299  void TransitionBufferState(BufferVkImpl& BufferVk,
300  RESOURCE_STATE OldState,
301  RESOURCE_STATE NewState,
302  bool UpdateBufferState);
303 
305  virtual void DILIGENT_CALL_TYPE BufferMemoryBarrier(IBuffer* pBuffer, VkAccessFlags NewAccessFlags) override final;
306 
307 
308  // Transitions BLAS state from OldState to NewState, and optionally updates internal state.
309  // If OldState == RESOURCE_STATE_UNKNOWN, internal BLAS state is used as old state.
311  RESOURCE_STATE OldState,
312  RESOURCE_STATE NewState,
313  bool UpdateInternalState);
314 
315  // Transitions TLAS state from OldState to NewState, and optionally updates internal state.
316  // If OldState == RESOURCE_STATE_UNKNOWN, internal TLAS state is used as old state.
318  RESOURCE_STATE OldState,
319  RESOURCE_STATE NewState,
320  bool UpdateInternalState);
321 
322  void AddWaitSemaphore(ManagedSemaphore* pWaitSemaphore, VkPipelineStageFlags WaitDstStageMask)
323  {
324  VERIFY_EXPR(pWaitSemaphore != nullptr);
325  m_WaitSemaphores.emplace_back(pWaitSemaphore);
326  m_VkWaitSemaphores.push_back(pWaitSemaphore->Get());
327  m_WaitDstStageMasks.push_back(WaitDstStageMask);
328  }
329  void AddSignalSemaphore(ManagedSemaphore* pSignalSemaphore)
330  {
331  VERIFY_EXPR(pSignalSemaphore != nullptr);
332  m_SignalSemaphores.emplace_back(pSignalSemaphore);
333  m_VkSignalSemaphores.push_back(pSignalSemaphore->Get());
334  }
335 
336  void UpdateBufferRegion(BufferVkImpl* pBuffVk,
337  Uint64 DstOffset,
338  Uint64 NumBytes,
339  VkBuffer vkSrcBuffer,
340  Uint64 SrcOffset,
341  RESOURCE_STATE_TRANSITION_MODE TransitionMode);
342 
343  void CopyTextureRegion(TextureVkImpl* pSrcTexture,
344  RESOURCE_STATE_TRANSITION_MODE SrcTextureTransitionMode,
345  TextureVkImpl* pDstTexture,
346  RESOURCE_STATE_TRANSITION_MODE DstTextureTransitionMode,
347  const VkImageCopy& CopyRegion);
348 
349  void UpdateTextureRegion(const void* pSrcData,
350  Uint32 SrcStride,
351  Uint32 SrcDepthStride,
352  TextureVkImpl& TextureVk,
353  Uint32 MipLevel,
354  Uint32 Slice,
355  const Box& DstBox,
356  RESOURCE_STATE_TRANSITION_MODE TextureTransitionMode);
357 
358  virtual void DILIGENT_CALL_TYPE GenerateMips(ITextureView* pTexView) override final;
359 
360  Uint32 GetContextId() const { return m_ContextId; }
361 
362  size_t GetNumCommandsInCtx() const { return m_State.NumCommands; }
363 
365  {
366  EnsureVkCmdBuffer();
367  m_CommandBuffer.FlushBarriers();
368  return m_CommandBuffer;
369  }
370 
371  virtual void DILIGENT_CALL_TYPE FinishFrame() override final;
372 
373  virtual void DILIGENT_CALL_TYPE TransitionResourceStates(Uint32 BarrierCount, StateTransitionDesc* pResourceBarriers) override final;
374 
375  virtual void DILIGENT_CALL_TYPE ResolveTextureSubresource(ITexture* pSrcTexture,
376  ITexture* pDstTexture,
377  const ResolveTextureSubresourceAttribs& ResolveAttribs) override final;
378 
379  VkDescriptorSet AllocateDynamicDescriptorSet(VkDescriptorSetLayout SetLayout, const char* DebugName = "")
380  {
381  // Descriptor pools are externally synchronized, meaning that the application must not allocate
382  // and/or free descriptor sets from the same pool in multiple threads simultaneously (13.2.3)
383  return m_DynamicDescrSetAllocator.Allocate(SetLayout, DebugName);
384  }
385 
387 
388  virtual void ResetRenderTargets() override final;
389 
390  GenerateMipsVkHelper& GetGenerateMipsHelper() { return *m_GenerateMipsHelper; }
391  QueryManagerVk* GetQueryManager() { return m_QueryMgr.get(); }
392 
393 private:
394  void TransitionRenderTargets(RESOURCE_STATE_TRANSITION_MODE StateTransitionMode);
395  __forceinline void CommitRenderPassAndFramebuffer(bool VerifyStates);
396  void CommitVkVertexBuffers();
397  void CommitViewports();
398  void CommitScissorRects();
399 
400  void Flush(Uint32 NumCommandLists,
401  ICommandList* const* ppCommandLists);
402 
403  __forceinline void TransitionOrVerifyBufferState(BufferVkImpl& Buffer,
404  RESOURCE_STATE_TRANSITION_MODE TransitionMode,
405  RESOURCE_STATE RequiredState,
406  VkAccessFlagBits ExpectedAccessFlags,
407  const char* OperationName);
408 
409  __forceinline void TransitionOrVerifyTextureState(TextureVkImpl& Texture,
410  RESOURCE_STATE_TRANSITION_MODE TransitionMode,
411  RESOURCE_STATE RequiredState,
412  VkImageLayout ExpectedLayout,
413  const char* OperationName);
414 
415  __forceinline void TransitionOrVerifyBLASState(BottomLevelASVkImpl& BLAS,
416  RESOURCE_STATE_TRANSITION_MODE TransitionMode,
417  RESOURCE_STATE RequiredState,
418  const char* OperationName);
419 
420  __forceinline void TransitionOrVerifyTLASState(TopLevelASVkImpl& TLAS,
421  RESOURCE_STATE_TRANSITION_MODE TransitionMode,
422  RESOURCE_STATE RequiredState,
423  const char* OperationName);
424 
425  __forceinline void EnsureVkCmdBuffer()
426  {
427  // Make sure that the number of commands in the context is at least one,
428  // so that the context cannot be disposed by Flush()
429  m_State.NumCommands = m_State.NumCommands != 0 ? m_State.NumCommands : 1;
430  if (m_CommandBuffer.GetVkCmdBuffer() == VK_NULL_HANDLE)
431  {
432  auto vkCmdBuff = m_CmdPool->GetCommandBuffer();
433  m_CommandBuffer.SetVkCmdBuffer(vkCmdBuff);
434  }
435  }
436 
437  inline void DisposeVkCmdBuffer(Uint32 CmdQueue, VkCommandBuffer vkCmdBuff, Uint64 FenceValue);
438  inline void DisposeCurrentCmdBuffer(Uint32 CmdQueue, Uint64 FenceValue);
439 
440  void CopyBufferToTexture(VkBuffer vkSrcBuffer,
441  Uint32 SrcBufferOffset,
442  Uint32 SrcBufferRowStrideInTexels,
443  TextureVkImpl& DstTextureVk,
444  const Box& DstRegion,
445  Uint32 DstMipLevel,
446  Uint32 DstArraySlice,
447  RESOURCE_STATE_TRANSITION_MODE DstTextureTransitionMode);
448 
449  void CopyTextureToBuffer(TextureVkImpl& SrcTextureVk,
450  const Box& SrcRegion,
451  Uint32 SrcMipLevel,
452  Uint32 SrcArraySlice,
453  RESOURCE_STATE_TRANSITION_MODE SrcTextureTransitionMode,
454  VkBuffer vkDstBuffer,
455  Uint32 DstBufferOffset,
456  Uint32 DstBufferRowStrideInTexels);
457 
458  __forceinline void PrepareForDraw(DRAW_FLAGS Flags);
459  __forceinline void PrepareForIndexedDraw(DRAW_FLAGS Flags, VALUE_TYPE IndexType);
460  __forceinline BufferVkImpl* PrepareIndirectAttribsBuffer(IBuffer* pAttribsBuffer, RESOURCE_STATE_TRANSITION_MODE TransitonMode, const char* OpName);
461  __forceinline void PrepareForDispatchCompute();
462  __forceinline void PrepareForRayTracing();
463 
464  void DvpLogRenderPass_PSOMismatch();
465 
466  void CreateASCompactedSizeQueryPool();
467 
468  VulkanUtilities::VulkanCommandBuffer m_CommandBuffer;
469 
470  struct ContextState
471  {
473  bool CommittedVBsUpToDate = false;
474 
476  bool CommittedIBUpToDate = false;
477 
478  Uint32 NumCommands = 0;
479 
480  VkPipelineBindPoint vkPipelineBindPoint = VK_PIPELINE_BIND_POINT_MAX_ENUM;
481  } m_State;
482 
483  // Graphics/mesh, compute, ray tracing
484  static constexpr Uint32 NUM_PIPELINE_BIND_POINTS = 3;
485 
486  static constexpr Uint32 MAX_DESCR_SET_PER_SIGNATURE = PipelineResourceSignatureVkImpl::MAX_DESCRIPTOR_SETS;
487 
488  struct ResourceBindInfo : CommittedShaderResources
489  {
491  {
492  // Static/mutable and dynamic descriptor sets
493  std::array<VkDescriptorSet, MAX_DESCR_SET_PER_SIGNATURE> vkSets = {};
494 
495  // Descriptor set base index given by Layout.GetFirstDescrSetIndex
497 
498  // The total number of descriptors with dynamic offset, given by pSignature->GetDynamicOffsetCount().
499  // Note that this is not the actual number of dynamic buffers in the resource cache.
501 
502 #ifdef DILIGENT_DEVELOPMENT
503  // The descriptor set base indext that was used in the last BindDescriptorSets() call
504  Uint32 LastBoundBaseInd = ~0u;
505 #endif
506  };
507  std::array<DescriptorSetInfo, MAX_RESOURCE_SIGNATURES> SetInfo;
508 
509  SRBMaskType DynamicBuffersMask = 0; // Indicates which SRBs have dynamic buffers
510 
511  // Pipeline layout of the currently bound pipeline
512  VkPipelineLayout vkPipelineLayout = VK_NULL_HANDLE;
513 
514  ResourceBindInfo()
515  {}
516 
517  __forceinline bool RequireUpdate(bool DynamicBuffersIntact = false) const
518  {
519  return (StaleSRBMask & ActiveSRBMask) != 0 || ((DynamicBuffersMask & ActiveSRBMask) != 0 && !DynamicBuffersIntact);
520  }
521 
522  void SetDynamicBufferBit(Uint32 Index) { DynamicBuffersMask |= static_cast<SRBMaskType>(1u << Index); }
523  void ClearDynamicBufferBit(Uint32 Index) { DynamicBuffersMask &= static_cast<SRBMaskType>(~(1u << Index)); }
524  };
525 
526  __forceinline ResourceBindInfo& GetBindInfo(PIPELINE_TYPE Type);
527 
528  __forceinline void CommitDescriptorSets(ResourceBindInfo& BindInfo, bool DynamicBuffersIntact = false);
529 #ifdef DILIGENT_DEVELOPMENT
530  void DvpValidateCommittedShaderResources(ResourceBindInfo& BindInfo);
531 #endif
532 
534  std::array<ResourceBindInfo, NUM_PIPELINE_BIND_POINTS> m_BindInfo;
535 
537  std::vector<Uint32> m_DynamicBufferOffsets;
538 
541  VkRenderPass m_vkRenderPass = VK_NULL_HANDLE;
542 
545  VkFramebuffer m_vkFramebuffer = VK_NULL_HANDLE;
546 
547  FixedBlockMemoryAllocator m_CmdListAllocator;
548 
549  // Semaphores are not owned by the command context
550  std::vector<RefCntAutoPtr<ManagedSemaphore>> m_WaitSemaphores;
551  std::vector<VkPipelineStageFlags> m_WaitDstStageMasks;
552  std::vector<RefCntAutoPtr<ManagedSemaphore>> m_SignalSemaphores;
553 
554  std::vector<VkSemaphore> m_VkWaitSemaphores;
555  std::vector<VkSemaphore> m_VkSignalSemaphores;
556 
557  // List of fences to signal next time the command context is flushed
558  std::vector<std::pair<Uint64, RefCntAutoPtr<IFence>>> m_PendingFences;
559 
560  std::unordered_map<BufferVkImpl*, VulkanUploadAllocation> m_UploadAllocations;
561 
562  struct MappedTextureKey
563  {
564  TextureVkImpl* const Texture;
565  Uint32 const MipLevel;
566  Uint32 const ArraySlice;
567 
568  bool operator==(const MappedTextureKey& rhs) const
569  {
570  return Texture == rhs.Texture &&
571  MipLevel == rhs.MipLevel &&
572  ArraySlice == rhs.ArraySlice;
573  }
574  struct Hasher
575  {
576  size_t operator()(const MappedTextureKey& Key) const
577  {
578  return ComputeHash(Key.Texture, Key.MipLevel, Key.ArraySlice);
579  }
580  };
581  };
582  struct MappedTexture
583  {
584  BufferToTextureCopyInfo CopyInfo;
585  VulkanDynamicAllocation Allocation;
586  };
587  std::unordered_map<MappedTextureKey, MappedTexture, MappedTextureKey::Hasher> m_MappedTextures;
588 
589  std::unique_ptr<VulkanUtilities::VulkanCommandBufferPool> m_CmdPool;
590 
591  VulkanUploadHeap m_UploadHeap;
592  VulkanDynamicHeap m_DynamicHeap;
593  DynamicDescriptorSetAllocator m_DynamicDescrSetAllocator;
594 
595  std::shared_ptr<GenerateMipsVkHelper> m_GenerateMipsHelper;
596  RefCntAutoPtr<IShaderResourceBinding> m_GenerateMipsSRB;
597 
598  // In Vulkan we can't bind null vertex buffer, so we have to create a dummy VB
599  RefCntAutoPtr<BufferVkImpl> m_DummyVB;
600 
601  std::unique_ptr<QueryManagerVk> m_QueryMgr;
602  Int32 m_ActiveQueriesCounter = 0;
603 
604  std::vector<VkClearValue> m_vkClearValues;
605 
606  VulkanUtilities::QueryPoolWrapper m_ASQueryPool;
607 };
608 
609 } // namespace Diligent
Diligent::MAP_FLAGS
MAP_FLAGS
Special map flags.
Definition: GraphicsTypes.h:227
FramebufferVkImpl.hpp
Diligent::VulkanDynamicAllocation
Definition: VulkanDynamicHeap.hpp:50
Diligent::DeviceContextVkImpl::DrawIndirect
virtual void DrawIndirect(const DrawIndirectAttribs &Attribs, IBuffer *pAttribsBuffer) override final
Implementation of IDeviceContext::DrawIndirect() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:772
PipelineLayoutVk.hpp
Diligent::DeviceContextVkImpl::TransitionBLASState
void TransitionBLASState(BottomLevelASVkImpl &BLAS, RESOURCE_STATE OldState, RESOURCE_STATE NewState, bool UpdateInternalState)
Definition: DeviceContextVkImpl.cpp:2675
Diligent::IReferenceCounters
Base interface for a reference counter object that stores the number of strong and weak references an...
Definition: ReferenceCounters.h:44
Diligent::DeviceContextVkImpl::AllocateDynamicSpace
VulkanDynamicAllocation AllocateDynamicSpace(Uint32 SizeInBytes, Uint32 Alignment)
Definition: DeviceContextVkImpl.cpp:2814
Diligent::DeviceContextNextGenBase< EngineVkImplTraits >::m_ContextId
const Uint32 m_ContextId
Definition: DeviceContextNextGenBase.hpp:110
Diligent::PVoid
void * PVoid
Definition: BasicTypes.h:56
Diligent::RenderDeviceVkImpl
Render device implementation in Vulkan backend.
Definition: RenderDeviceVkImpl.hpp:58
Diligent::DeviceContextVkImpl::ResetRenderTargets
virtual void ResetRenderTargets() override final
Definition: DeviceContextVkImpl.cpp:1537
Diligent::DeviceContextVkImpl::UpdateSBT
virtual void UpdateSBT(IShaderBindingTable *pSBT, const UpdateIndirectRTBufferAttribs *pUpdateIndirectBufferAttribs) override final
Implementation of IDeviceContext::UpdateSBT() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:3337
VulkanUtilities::VulkanCommandBuffer
Definition: VulkanCommandBuffer.hpp:36
Diligent::UpdateIndirectRTBufferAttribs
This structure is used by IDeviceContext::UpdateSBT().
Definition: DeviceContext.h:1303
Diligent::TraceRaysIndirectAttribs
This structure is used by IDeviceContext::TraceRaysIndirect().
Definition: DeviceContext.h:1284
Diligent::IShaderResourceBinding
Shader resource binding interface.
Definition: ShaderResourceBinding.h:58
Diligent::DeviceContextVkImpl::EndQuery
virtual void EndQuery(IQuery *pQuery) override final
Implementation of IDeviceContext::EndQuery() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:2397
Diligent::TraceRaysAttribs
This structure is used by IDeviceContext::TraceRays().
Definition: DeviceContext.h:1267
Diligent::DeviceContextVkImpl::GetNumCommandsInCtx
size_t GetNumCommandsInCtx() const
Definition: DeviceContextVkImpl.hpp:362
Diligent::BeginRenderPassAttribs
BeginRenderPass command attributes.
Definition: DeviceContext.h:731
BottomLevelASVkImpl.hpp
Diligent::IShaderBindingTable
Shader binding table interface.
Definition: ShaderBindingTable.h:93
Diligent::DrawMeshIndirectCountAttribs
Defines the mesh indirect draw count command attributes.
Definition: DeviceContext.h:440
Diligent::IPipelineState
Pipeline state interface.
Definition: PipelineState.h:505
Diligent::RESOURCE_STATE_TRANSITION_MODE
RESOURCE_STATE_TRANSITION_MODE
Defines resource state transition mode performed by various commands.
Definition: DeviceContext.h:136
Diligent::DeviceContextVkImpl::GetContextId
Uint32 GetContextId() const
Definition: DeviceContextVkImpl.hpp:360
Diligent::DeviceContextVkImpl::SetViewports
virtual void SetViewports(Uint32 NumViewports, const Viewport *pViewports, Uint32 RTWidth, Uint32 RTHeight) override final
Implementation of IDeviceContext::SetViewports() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:1381
BufferVkImpl.hpp
Flags
Uint32 Flags
Definition: DXBCUtils.cpp:71
Diligent::CLEAR_DEPTH_STENCIL_FLAGS
CLEAR_DEPTH_STENCIL_FLAGS
Defines which parts of the depth-stencil buffer to clear.
Definition: DeviceContext.h:483
Diligent::DeviceContextVkImpl::DrawMeshIndirect
virtual void DrawMeshIndirect(const DrawMeshIndirectAttribs &Attribs, IBuffer *pAttribsBuffer) override final
Implementation of IDeviceContext::DrawMeshIndirect() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:810
Diligent::Uint64
uint64_t Uint64
64-bit unsigned integer
Definition: BasicTypes.h:50
Diligent::DeviceContextVkImpl::UpdateBuffer
virtual void UpdateBuffer(IBuffer *pBuffer, Uint32 Offset, Uint32 Size, const void *pData, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final
Implementation of IDeviceContext::UpdateBuffer() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:1629
Diligent::DeviceContextVkImpl::AddSignalSemaphore
void AddSignalSemaphore(ManagedSemaphore *pSignalSemaphore)
Definition: DeviceContextVkImpl.hpp:329
Diligent::PIPELINE_TYPE
PIPELINE_TYPE
Pipeline type.
Definition: PipelineState.h:295
Diligent::ManagedVulkanObject
Definition: ManagedVulkanObject.hpp:38
Diligent::WriteBLASCompactedSizeAttribs
This structure is used by IDeviceContext::WriteBLASCompactedSize().
Definition: DeviceContext.h:1217
Diligent::DeviceContextVkImpl::TraceRaysIndirect
virtual void TraceRaysIndirect(const TraceRaysIndirectAttribs &Attribs, IBuffer *pAttribsBuffer) override final
Implementation of IDeviceContext::TraceRaysIndirect() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:3321
Diligent::WriteTLASCompactedSizeAttribs
This structure is used by IDeviceContext::WriteTLASCompactedSize().
Definition: DeviceContext.h:1242
Diligent::DeviceContextVkImpl::GetGenerateMipsHelper
GenerateMipsVkHelper & GetGenerateMipsHelper()
Definition: DeviceContextVkImpl.hpp:390
Diligent::DeviceContextVkImpl::CopyTLAS
virtual void CopyTLAS(const CopyTLASAttribs &Attribs) override final
Implementation of IDeviceContext::CopyTLAS() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:3225
Diligent::operator==
bool operator==(const Plane3D &p1, const Plane3D &p2)
Definition: AdvancedMath.hpp:442
Diligent::DeviceContextVkImpl::CopyBuffer
virtual void CopyBuffer(IBuffer *pSrcBuffer, Uint32 SrcOffset, RESOURCE_STATE_TRANSITION_MODE SrcBufferTransitionMode, IBuffer *pDstBuffer, Uint32 DstOffset, Uint32 Size, RESOURCE_STATE_TRANSITION_MODE DstBufferTransitionMode) override final
Implementation of IDeviceContext::CopyBuffer() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:1652
Diligent::DeviceContextVkImpl::DispatchCompute
virtual void DispatchCompute(const DispatchComputeAttribs &Attribs) override final
Implementation of IDeviceContext::DispatchCompute() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:879
Diligent::DeviceContextVkImpl::WaitForIdle
virtual void WaitForIdle() override final
Implementation of IDeviceContext::WaitForIdle() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:2347
Diligent::ITextureView
Texture view interface.
Definition: TextureView.h:202
Diligent::DeviceContextVkImpl::SignalFence
virtual void SignalFence(IFence *pFence, Uint64 Value) override final
Implementation of IDeviceContext::SignalFence() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:2332
Diligent::DeviceContextVkImpl::MappedTextureKey::Hasher
Definition: DeviceContextVkImpl.hpp:574
Diligent::DXBCUtils::BindInfo
ResourceBinding::BindInfo BindInfo
Definition: DXBCUtils.hpp:40
Diligent::DrawMeshAttribs
Defines the mesh draw command attributes.
Definition: DeviceContext.h:376
VulkanDynamicHeap.hpp
Diligent::Box
Box.
Definition: GraphicsTypes.h:2407
Diligent::DeviceContextVkImpl::WriteTLASCompactedSize
virtual void WriteTLASCompactedSize(const WriteTLASCompactedSizeAttribs &Attribs) override final
Implementation of IDeviceContext::WriteTLASCompactedSize() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:3273
Diligent::MappedTextureSubresource
Definition: Texture.h:245
Diligent::DeviceContextVkImpl::WriteBLASCompactedSize
virtual void WriteBLASCompactedSize(const WriteBLASCompactedSizeAttribs &Attribs) override final
Implementation of IDeviceContext::WriteBLASCompactedSize() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:3253
Diligent::BottomLevelASVkImpl
Definition: BottomLevelASVkImpl.hpp:41
Diligent::DeviceContextVkImpl::UnmapTextureSubresource
virtual void UnmapTextureSubresource(ITexture *pTexture, Uint32 MipLevel, Uint32 ArraySlice) override final
Implementation of IDeviceContext::UnmapTextureSubresource() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:2246
Diligent::DeviceContextVkImpl::ClearRenderTarget
virtual void ClearRenderTarget(ITextureView *pView, const float *RGBA, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final
Implementation of IDeviceContext::ClearRenderTarget() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:1015
Diligent::DeviceContextVkImpl::CopyTexture
virtual void CopyTexture(const CopyTextureAttribs &CopyAttribs) override final
Implementation of IDeviceContext::CopyTexture() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:1811
Diligent::DeviceContextVkImpl::NextSubpass
virtual void NextSubpass() override final
Implementation of IDeviceContext::NextSubpass() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:1593
Diligent::DeviceContextVkImpl::AllocateDynamicDescriptorSet
VkDescriptorSet AllocateDynamicDescriptorSet(VkDescriptorSetLayout SetLayout, const char *DebugName="")
Definition: DeviceContextVkImpl.hpp:379
Diligent::DynamicDescriptorSetAllocator::Allocate
VkDescriptorSet Allocate(VkDescriptorSetLayout SetLayout, const char *DebugName)
Definition: DescriptorPoolManager.cpp:290
VulkanUtilities::VulkanCommandBuffer::FlushBarriers
void FlushBarriers()
Definition: VulkanCommandBuffer.cpp:437
Diligent::IBuffer
Buffer interface.
Definition: Buffer.h:187
DeviceContextNextGenBase.hpp
Diligent::DeviceContextVkImpl::SetScissorRects
virtual void SetScissorRects(Uint32 NumRects, const Rect *pRects, Uint32 RTWidth, Uint32 RTHeight) override final
Implementation of IDeviceContext::SetScissorRects() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:1410
Diligent::GenerateMipsHelper
Definition: GenerateMips.hpp:55
TopLevelASVkImpl.hpp
Diligent::GenerateMipsVkHelper
Definition: GenerateMipsVkHelper.hpp:46
Diligent::Int32
int32_t Int32
32-bit signed integer
Definition: BasicTypes.h:46
RenderPassVkImpl.hpp
Diligent::DeviceContextVkImpl::BeginQuery
virtual void BeginQuery(IQuery *pQuery) override final
Implementation of IDeviceContext::BeginQuery() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:2354
Diligent::DeviceContextVkImpl::CommitShaderResources
virtual void CommitShaderResources(IShaderResourceBinding *pShaderResourceBinding, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final
Implementation of IDeviceContext::CommitShaderResources() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:471
Diligent::StateTransitionDesc
Resource state transition barrier description.
Definition: DeviceContext.h:1333
Diligent::DeviceContextVkImpl::CopyTextureRegion
void CopyTextureRegion(TextureVkImpl *pSrcTexture, RESOURCE_STATE_TRANSITION_MODE SrcTextureTransitionMode, TextureVkImpl *pDstTexture, RESOURCE_STATE_TRANSITION_MODE DstTextureTransitionMode, const VkImageCopy &CopyRegion)
Definition: DeviceContextVkImpl.cpp:1942
Diligent::DeviceContextVkImpl::UpdateTextureRegion
void UpdateTextureRegion(const void *pSrcData, Uint32 SrcStride, Uint32 SrcDepthStride, TextureVkImpl &TextureVk, Uint32 MipLevel, Uint32 Slice, const Box &DstBox, RESOURCE_STATE_TRANSITION_MODE TextureTransitionMode)
Definition: DeviceContextVkImpl.cpp:1960
Diligent::DeviceContextVkImpl::EndRenderPass
virtual void EndRenderPass() override final
Implementation of IDeviceContext::EndRenderPass() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:1600
Diligent::ICommandList
Command list interface.
Definition: CommandList.h:48
VulkanCommandBufferPool.hpp
Diligent::DeviceContextVkImpl::SetIndexBuffer
virtual void SetIndexBuffer(IBuffer *pIndexBuffer, Uint32 ByteOffset, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final
Implementation of IDeviceContext::SetIndexBuffer() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:1323
TextureVkImpl.hpp
Diligent::DeviceContextVkImpl::ResourceBindInfo::DescriptorSetInfo::BaseInd
Uint32 BaseInd
Definition: DeviceContextVkImpl.hpp:496
Diligent::SET_VERTEX_BUFFERS_FLAGS
SET_VERTEX_BUFFERS_FLAGS
Defines allowed flags for IDeviceContext::SetVertexBuffers() function.
Definition: DeviceContext.h:578
Diligent::DeviceContextVkImpl::UpdateTexture
virtual void UpdateTexture(ITexture *pTexture, Uint32 MipLevel, Uint32 Slice, const Box &DstBox, const TextureSubResData &SubresData, RESOURCE_STATE_TRANSITION_MODE SrcBufferStateTransitionMode, RESOURCE_STATE_TRANSITION_MODE TextureStateTransitionModee) override final
Implementation of IDeviceContext::UpdateTexture() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:1786
Diligent::DeviceContextVkImpl::InvalidateState
virtual void InvalidateState() override final
Implementation of IDeviceContext::InvalidateState() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:1308
Diligent::ResolveTextureSubresourceAttribs
Describes multi-sampled texture resolve command arguments.
Definition: DeviceContext.h:549
Diligent::Box
struct Box Box
Definition: GraphicsTypes.h:2440
Diligent::DispatchComputeIndirectAttribs
Describes dispatch command arguments.
Definition: DeviceContext.h:523
Diligent::DeviceContextVkImpl::ResourceBindInfo::DescriptorSetInfo
Definition: DeviceContextVkImpl.hpp:490
VulkanUtilities::VulkanCommandBuffer::SetVkCmdBuffer
__forceinline void SetVkCmdBuffer(VkCommandBuffer VkCmdBuffer)
Definition: VulkanCommandBuffer.hpp:704
Diligent::VALUE_TYPE
VALUE_TYPE
Value type.
Definition: GraphicsTypes.h:49
Diligent::DeviceContextVkImpl::TraceRays
virtual void TraceRays(const TraceRaysAttribs &Attribs) override final
Implementation of IDeviceContext::TraceRays() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:3308
Diligent::DrawIndexedIndirectAttribs
Defines the indexed indirect draw command attributes.
Definition: DeviceContext.h:330
IMPLEMENT_QUERY_INTERFACE_IN_PLACE
#define IMPLEMENT_QUERY_INTERFACE_IN_PLACE(InterfaceID, ParentClassName)
Definition: ObjectBase.hpp:59
ManagedVulkanObject.hpp
Diligent::DeviceContextVkImpl::WaitForFence
virtual void WaitForFence(IFence *pFence, Uint64 Value, bool FlushContext) override final
Implementation of IDeviceContext::WaitForFence() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:2338
Diligent::DeviceContextVkImpl::MapBuffer
virtual void MapBuffer(IBuffer *pBuffer, MAP_TYPE MapType, MAP_FLAGS MapFlags, PVoid &pMappedData) override final
Implementation of IDeviceContext::MapBuffer() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:1681
Diligent::DeviceContextVkImpl::MapTextureSubresource
virtual void MapTextureSubresource(ITexture *pTexture, Uint32 MipLevel, Uint32 ArraySlice, MAP_TYPE MapType, MAP_FLAGS MapFlags, const Box *pMapRegion, MappedTextureSubresource &MappedData) override final
Implementation of IDeviceContext::MapTextureSubresource() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:2141
Diligent::DeviceContextVkImpl::GenerateMips
virtual void GenerateMips(ITextureView *pTexView) override final
Definition: DeviceContextVkImpl.cpp:2026
Diligent::ManagedVulkanObject::Get
VulkanObjectWrapperType::VkObjectType Get() const
Definition: ManagedVulkanObject.hpp:69
DILIGENT_CALL_TYPE
#define DILIGENT_CALL_TYPE
Definition: CommonDefinitions.h:45
Type
const D3D12_PIPELINE_STATE_SUBOBJECT_TYPE Type
Definition: PipelineStateD3D12Impl.cpp:69
Diligent::DeviceContextVkImpl::CopyBLAS
virtual void CopyBLAS(const CopyBLASAttribs &Attribs) override final
Implementation of IDeviceContext::CopyBLAS() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:3192
VulkanUtilities::QueryPoolWrapper
DEFINE_VULKAN_OBJECT_WRAPPER(QueryPool) QueryPoolWrapper
Definition: VulkanLogicalDevice.hpp:84
Diligent::BuildTLASAttribs
This structure is used by IDeviceContext::BuildTLAS().
Definition: DeviceContext.h:1082
Diligent::DeviceContextVkImpl::SetStencilRef
virtual void SetStencilRef(Uint32 StencilRef) override final
Implementation of IDeviceContext::SetStencilRef() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:554
Diligent::DeviceContextVkImpl::TransitionImageLayout
void TransitionImageLayout(TextureVkImpl &TextureVk, VkImageLayout OldLayout, VkImageLayout NewLayout, const VkImageSubresourceRange &SubresRange)
Definition: DeviceContextVkImpl.cpp:2577
Diligent::Uint32
uint32_t Uint32
32-bit unsigned integer
Definition: BasicTypes.h:51
ShaderResourceBindingVkImpl.hpp
Diligent::DrawMeshIndirectAttribs
Defines the mesh indirect draw command attributes.
Definition: DeviceContext.h:402
Diligent::DeviceContextVkImpl::DrawIndexedIndirect
virtual void DrawIndexedIndirect(const DrawIndexedIndirectAttribs &Attribs, IBuffer *pAttribsBuffer) override final
Implementation of IDeviceContext::DrawIndexedIndirect() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:786
Diligent::ComputeHash
std::size_t ComputeHash(const ArgsType &... Args)
Definition: HashUtils.hpp:57
Diligent::Viewport
Describes the viewport.
Definition: DeviceContext.h:593
Diligent::DeviceContextVkImpl::BuildBLAS
virtual void BuildBLAS(const BuildBLASAttribs &Attribs) override final
Implementation of IDeviceContext::BuildBLAS() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:2930
Diligent::DispatchComputeAttribs
Describes dispatch command arguments.
Definition: DeviceContext.h:500
QueryVkImpl.hpp
Diligent::BufferToTextureCopyInfo
Information required to perform a copy operation between a buffer and a texture.
Definition: GraphicsAccessories.hpp:572
Diligent::DeviceContextVkImpl::ExecuteCommandLists
virtual void ExecuteCommandLists(Uint32 NumCommandLists, ICommandList *const *ppCommandLists) override final
Implementation of IDeviceContext::ExecuteCommandLists() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:2318
Diligent::DeviceContextVkImpl
Device context implementation in Vulkan backend.
Definition: DeviceContextVkImpl.hpp:67
Diligent::DeviceContextVkImpl::TransitionResourceStates
virtual void TransitionResourceStates(Uint32 BarrierCount, StateTransitionDesc *pResourceBarriers) override final
Definition: DeviceContextVkImpl.cpp:2823
Diligent::DeviceContextVkImpl::DrawMesh
virtual void DrawMesh(const DrawMeshAttribs &Attribs) override final
Implementation of IDeviceContext::DrawMesh() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:800
Diligent::DeviceContextVkImpl::TransitionTextureState
void TransitionTextureState(TextureVkImpl &TextureVk, RESOURCE_STATE OldState, RESOURCE_STATE NewState, bool UpdateTextureState, VkImageSubresourceRange *pSubresRange=nullptr)
Definition: DeviceContextVkImpl.cpp:2473
Diligent::BuildBLASAttribs
This structure is used by IDeviceContext::BuildBLAS().
Definition: DeviceContext.h:925
Diligent::CopyBLASAttribs
This structure is used by IDeviceContext::CopyBLAS().
Definition: DeviceContext.h:1159
Diligent::DeviceContextVkImpl::ResourceBindInfo::DescriptorSetInfo::DynamicOffsetCount
Uint32 DynamicOffsetCount
Definition: DeviceContextVkImpl.hpp:500
Diligent::DeviceContextVkImpl::DrawIndexed
virtual void DrawIndexed(const DrawIndexedAttribs &Attribs) override final
Implementation of IDeviceContext::DrawIndexed() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:762
Diligent::DeviceContextVkImpl::SetPipelineState
virtual void SetPipelineState(IPipelineState *pPipelineState) override final
Implementation of IDeviceContext::SetPipelineState() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:239
Diligent::TextureVkImpl
Texture object implementation in Vulkan backend.
Definition: TextureVkImpl.hpp:42
Diligent::DeviceContextVkImpl::ResourceBindInfo::DescriptorSetInfo::vkSets
std::array< VkDescriptorSet, MAX_DESCR_SET_PER_SIGNATURE > vkSets
Definition: DeviceContextVkImpl.hpp:493
Diligent::DrawIndirectAttribs
Defines the indirect draw command attributes.
Definition: DeviceContext.h:291
Diligent::DRAW_FLAGS
DRAW_FLAGS
Draw command flags.
Definition: DeviceContext.h:68
HashUtils.hpp
ResourceReleaseQueue.hpp
Diligent::DeviceContextVkImpl::UpdateBufferRegion
void UpdateBufferRegion(BufferVkImpl *pBuffVk, Uint64 DstOffset, Uint64 NumBytes, VkBuffer vkSrcBuffer, Uint64 SrcOffset, RESOURCE_STATE_TRANSITION_MODE TransitionMode)
Definition: DeviceContextVkImpl.cpp:1607
Diligent::CopyTLASAttribs
This structure is used by IDeviceContext::CopyTLAS().
Definition: DeviceContext.h:1188
Diligent::BufferVkImpl
Buffer object implementation in Vulkan backend.
Definition: BufferVkImpl.hpp:46
Diligent::IFence
Fence interface.
Definition: Fence.h:62
Diligent::DeviceContextVkImpl::SetBlendFactors
virtual void SetBlendFactors(const float *pBlendFactors=nullptr) override final
Implementation of IDeviceContext::SetBlendFactors() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:563
Diligent::DrawIndexedAttribs
Defines the indexed draw command attributes.
Definition: DeviceContext.h:224
VulkanUploadHeap.hpp
Diligent::DeviceContextVkImpl::SetRenderTargets
virtual void SetRenderTargets(Uint32 NumRenderTargets, ITextureView *ppRenderTargets[], ITextureView *pDepthStencil, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final
Implementation of IDeviceContext::SetRenderTargets() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:1472
VulkanCommandBuffer.hpp
Diligent::DeviceContextVkImpl::Flush
virtual void Flush() override final
Implementation of IDeviceContext::Flush() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:1176
Diligent::DeviceContextVkImpl::BuildTLAS
virtual void BuildTLAS(const BuildTLASAttribs &Attribs) override final
Implementation of IDeviceContext::BuildTLAS() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:3091
Diligent::IQuery
Query interface.
Definition: Query.h:177
Diligent::DeviceContextVkImpl::DispatchComputeIndirect
virtual void DispatchComputeIndirect(const DispatchComputeIndirectAttribs &Attribs, IBuffer *pAttribsBuffer) override final
Implementation of IDeviceContext::DispatchComputeIndirect() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:888
Diligent::Uint8
uint8_t Uint8
8-bit unsigned integer
Definition: BasicTypes.h:53
Diligent::DeviceContextVkImpl::DrawMeshIndirectCount
virtual void DrawMeshIndirectCount(const DrawMeshIndirectCountAttribs &Attribs, IBuffer *pAttribsBuffer, IBuffer *pCountBuffer) override final
Implementation of IDeviceContext::DrawMeshIndirectCount() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:824
Diligent::DeviceContextVkImpl::MappedTextureKey::Hasher::operator()
size_t operator()(const MappedTextureKey &Key) const
Definition: DeviceContextVkImpl.hpp:576
VERIFY_EXPR
#define VERIFY_EXPR(...)
Definition: DebugUtilities.hpp:79
ShaderBindingTableVkImpl.hpp
Diligent::PipelineResourceSignatureVkImpl::MAX_DESCRIPTOR_SETS
static constexpr Uint32 MAX_DESCRIPTOR_SETS
Definition: PipelineResourceSignatureVkImpl.hpp:74
Diligent::QueryManagerVk
Definition: QueryManagerVk.hpp:46
Diligent::DeviceContextVkImpl::TransitionShaderResources
virtual void TransitionShaderResources(IPipelineState *pPipelineState, IShaderResourceBinding *pShaderResourceBinding) override final
Implementation of IDeviceContext::TransitionShaderResources() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:460
Diligent::Rect
Describes the rectangle.
Definition: DeviceContext.h:642
EngineVkImplTraits.hpp
Diligent::DeviceContextVkImpl::AddWaitSemaphore
void AddWaitSemaphore(ManagedSemaphore *pWaitSemaphore, VkPipelineStageFlags WaitDstStageMask)
Definition: DeviceContextVkImpl.hpp:322
Diligent::DrawAttribs
Defines the draw command attributes.
Definition: DeviceContext.h:169
Diligent::DeviceContextVkImpl::FinishCommandList
virtual void FinishCommandList(class ICommandList **ppCommandList) override final
Implementation of IDeviceContext::FinishCommandList() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:2294
VulkanUtilities::VulkanCommandBuffer::GetVkCmdBuffer
VkCommandBuffer GetVkCmdBuffer() const
Definition: VulkanCommandBuffer.hpp:708
Diligent::DeviceContextVkImpl::GetCommandBuffer
__forceinline VulkanUtilities::VulkanCommandBuffer & GetCommandBuffer()
Definition: DeviceContextVkImpl.hpp:364
Diligent::DeviceContextNextGenBase
Base implementation of the device context for next-generation backends.
Definition: DeviceContextNextGenBase.hpp:44
Diligent::RESOURCE_STATE
RESOURCE_STATE
Resource usage state.
Definition: GraphicsTypes.h:2814
PipelineStateVkImpl.hpp
GenerateMipsVkHelper.hpp
Diligent::DeviceContextVkImpl::GetQueryManager
QueryManagerVk * GetQueryManager()
Definition: DeviceContextVkImpl.hpp:391
Diligent::DeviceContextVkImpl::BeginRenderPass
virtual void BeginRenderPass(const BeginRenderPassAttribs &Attribs) override final
Implementation of IDeviceContext::BeginRenderPass() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:1546
Diligent::DeviceContextVkImpl::TransitionTLASState
void TransitionTLASState(TopLevelASVkImpl &TLAS, RESOURCE_STATE OldState, RESOURCE_STATE NewState, bool UpdateInternalState)
Definition: DeviceContextVkImpl.cpp:2721
Diligent::DeviceContextVkImpl::ResolveTextureSubresource
virtual void ResolveTextureSubresource(ITexture *pSrcTexture, ITexture *pDstTexture, const ResolveTextureSubresourceAttribs &ResolveAttribs) override final
Definition: DeviceContextVkImpl.cpp:2875
Diligent::MAP_TYPE
MAP_TYPE
Resource mapping type.
Definition: GraphicsTypes.h:206
Diligent::CopyTextureAttribs
Defines copy texture command attributes.
Definition: DeviceContext.h:672
DescriptorPoolManager.hpp
Diligent::DeviceContextVkImpl::FinishFrame
virtual void FinishFrame() override final
Definition: DeviceContextVkImpl.cpp:1110
Diligent::DeviceContextVkImpl::DeviceContextVkImpl
DeviceContextVkImpl(IReferenceCounters *pRefCounters, RenderDeviceVkImpl *pDevice, bool bIsDeferred, const EngineVkCreateInfo &EngineCI, Uint32 ContextId, Uint32 CommandQueueId, std::shared_ptr< GenerateMipsVkHelper > GenerateMipsHelper)
Definition: DeviceContextVkImpl.cpp:60
Diligent::EngineVkCreateInfo
Attributes specific to Vulkan engine.
Definition: GraphicsTypes.h:2282
Diligent::TopLevelASVkImpl
Definition: TopLevelASVkImpl.hpp:41
Diligent::DeviceContextVkImpl::BufferMemoryBarrier
virtual void BufferMemoryBarrier(IBuffer *pBuffer, VkAccessFlags NewAccessFlags) override final
Implementation of IDeviceContextVk::BufferMemoryBarrier().
Definition: DeviceContextVkImpl.cpp:2589
Diligent::DeviceContextVkImpl::ClearDepthStencil
virtual void ClearDepthStencil(ITextureView *pView, CLEAR_DEPTH_STENCIL_FLAGS ClearFlags, float fDepth, Uint8 Stencil, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) override final
Implementation of IDeviceContext::ClearDepthStencil() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:910
Diligent::ITexture
Texture inteface.
Definition: Texture.h:273
QueryManagerVk.hpp
Diligent::DeviceContextVkImpl::~DeviceContextVkImpl
~DeviceContextVkImpl()
Definition: DeviceContextVkImpl.cpp:134
Diligent::DeviceContextVkImpl::UnmapBuffer
virtual void UnmapBuffer(IBuffer *pBuffer, MAP_TYPE MapType) override final
Implementation of IDeviceContext::UnmapBuffer() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:1758
Diligent
The library uses Direct3D-style math:
Definition: AdvancedMath.hpp:37
Diligent::DeviceContextVkImpl::TransitionBufferState
void TransitionBufferState(BufferVkImpl &BufferVk, RESOURCE_STATE OldState, RESOURCE_STATE NewState, bool UpdateBufferState)
Definition: DeviceContextVkImpl.cpp:2605
Diligent::TextureSubResData
Describes data for one subresource.
Definition: Texture.h:165
Diligent::DeviceContextVkImpl::Draw
virtual void Draw(const DrawAttribs &Attribs) override final
Implementation of IDeviceContext::Draw() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:752
Diligent::DeviceContextVkImpl::SetVertexBuffers
virtual void SetVertexBuffers(Uint32 StartSlot, Uint32 NumBuffersSet, IBuffer **ppBuffers, Uint32 *pOffsets, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode, SET_VERTEX_BUFFERS_FLAGS Flags) override final
Implementation of IDeviceContext::SetVertexBuffers() in Vulkan backend.
Definition: DeviceContextVkImpl.cpp:1288