summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineVulkan
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2020-12-21 20:47:56 +0000
committerassiduous <assiduous@diligentgraphics.com>2020-12-21 20:47:56 +0000
commit0bc0ea3dcd760b864f1388359403f76916b9b100 (patch)
tree6d02cc4433d2cc56f3d75d578892679175701781 /Graphics/GraphicsEngineVulkan
parentRemoved SBTTransitionMode from TraceRaysAttribs (diff)
downloadDiligentCore-0bc0ea3dcd760b864f1388359403f76916b9b100.tar.gz
DiligentCore-0bc0ea3dcd760b864f1388359403f76916b9b100.zip
Vulkan backend: code clean-up
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
-rw-r--r--Graphics/GraphicsEngineVulkan/include/BottomLevelASVkImpl.hpp2
-rw-r--r--Graphics/GraphicsEngineVulkan/include/BufferViewVkImpl.hpp2
-rw-r--r--Graphics/GraphicsEngineVulkan/include/BufferVkImpl.hpp26
-rw-r--r--Graphics/GraphicsEngineVulkan/include/CommandQueueVkImpl.hpp2
-rw-r--r--Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.hpp2
-rw-r--r--Graphics/GraphicsEngineVulkan/include/PipelineStateVkImpl.hpp3
-rw-r--r--Graphics/GraphicsEngineVulkan/include/RenderDeviceVkImpl.hpp2
-rw-r--r--Graphics/GraphicsEngineVulkan/include/SamplerVkImpl.hpp2
-rw-r--r--Graphics/GraphicsEngineVulkan/include/ShaderBindingTableVkImpl.hpp2
-rw-r--r--Graphics/GraphicsEngineVulkan/include/ShaderResourceBindingVkImpl.hpp2
-rw-r--r--Graphics/GraphicsEngineVulkan/include/ShaderResourceCacheVk.hpp4
-rw-r--r--Graphics/GraphicsEngineVulkan/include/SwapChainVkImpl.hpp2
-rw-r--r--Graphics/GraphicsEngineVulkan/include/TextureViewVkImpl.hpp2
-rw-r--r--Graphics/GraphicsEngineVulkan/include/TextureVkImpl.hpp2
-rw-r--r--Graphics/GraphicsEngineVulkan/include/TopLevelASVkImpl.hpp2
-rw-r--r--Graphics/GraphicsEngineVulkan/include/VulkanDynamicHeap.hpp2
-rw-r--r--Graphics/GraphicsEngineVulkan/src/BottomLevelASVkImpl.cpp6
-rw-r--r--Graphics/GraphicsEngineVulkan/src/BufferViewVkImpl.cpp2
-rw-r--r--Graphics/GraphicsEngineVulkan/src/BufferVkImpl.cpp13
-rw-r--r--Graphics/GraphicsEngineVulkan/src/CommandQueueVkImpl.cpp3
-rw-r--r--Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp6
-rw-r--r--Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp3
-rw-r--r--Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp3
-rw-r--r--Graphics/GraphicsEngineVulkan/src/SamplerVkImpl.cpp2
-rw-r--r--Graphics/GraphicsEngineVulkan/src/ShaderResourceBindingVkImpl.cpp2
-rw-r--r--Graphics/GraphicsEngineVulkan/src/ShaderResourceLayoutVk.cpp2
-rw-r--r--Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp3
-rw-r--r--Graphics/GraphicsEngineVulkan/src/TextureViewVkImpl.cpp2
-rw-r--r--Graphics/GraphicsEngineVulkan/src/TextureVkImpl.cpp2
29 files changed, 48 insertions, 60 deletions
diff --git a/Graphics/GraphicsEngineVulkan/include/BottomLevelASVkImpl.hpp b/Graphics/GraphicsEngineVulkan/include/BottomLevelASVkImpl.hpp
index d67fe937..0ac9a622 100644
--- a/Graphics/GraphicsEngineVulkan/include/BottomLevelASVkImpl.hpp
+++ b/Graphics/GraphicsEngineVulkan/include/BottomLevelASVkImpl.hpp
@@ -67,7 +67,7 @@ public:
/// Implementation of IBottomLevelASVk::GetVkDeviceAddress().
virtual VkDeviceAddress DILIGENT_CALL_TYPE GetVkDeviceAddress() const override { return m_DeviceAddress; }
- IMPLEMENT_QUERY_INTERFACE_IN_PLACE(IID_BottomLevelASVk, TBottomLevelASBase);
+ IMPLEMENT_QUERY_INTERFACE_IN_PLACE(IID_BottomLevelASVk, TBottomLevelASBase)
private:
VkDeviceAddress m_DeviceAddress = 0;
diff --git a/Graphics/GraphicsEngineVulkan/include/BufferViewVkImpl.hpp b/Graphics/GraphicsEngineVulkan/include/BufferViewVkImpl.hpp
index 1d6acecd..0d948b25 100644
--- a/Graphics/GraphicsEngineVulkan/include/BufferViewVkImpl.hpp
+++ b/Graphics/GraphicsEngineVulkan/include/BufferViewVkImpl.hpp
@@ -56,7 +56,7 @@ public:
bool bIsDefaultView);
~BufferViewVkImpl();
- virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final;
+ IMPLEMENT_QUERY_INTERFACE_IN_PLACE(IID_BufferViewVk, TBufferViewBase)
/// Implementation of IBufferViewVk::GetVkBufferView().
virtual VkBufferView DILIGENT_CALL_TYPE GetVkBufferView() const override final { return m_BuffView; }
diff --git a/Graphics/GraphicsEngineVulkan/include/BufferVkImpl.hpp b/Graphics/GraphicsEngineVulkan/include/BufferVkImpl.hpp
index 90bfb884..6db3b400 100644
--- a/Graphics/GraphicsEngineVulkan/include/BufferVkImpl.hpp
+++ b/Graphics/GraphicsEngineVulkan/include/BufferVkImpl.hpp
@@ -66,7 +66,7 @@ public:
VkBuffer vkBuffer);
~BufferVkImpl();
- virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override;
+ IMPLEMENT_QUERY_INTERFACE_IN_PLACE(IID_BufferVk, TBufferBase)
#ifdef DILIGENT_DEVELOPMENT
void DvpVerifyDynamicAllocation(DeviceContextVkImpl* pCtx) const;
@@ -81,11 +81,11 @@ public:
else
{
VERIFY(m_Desc.Usage == USAGE_DYNAMIC, "Dynamic buffer is expected");
- VERIFY_EXPR(!m_DynamicAllocations.empty());
+ VERIFY_EXPR(!m_DynamicData.empty());
#ifdef DILIGENT_DEVELOPMENT
DvpVerifyDynamicAllocation(pCtx);
#endif
- auto& DynAlloc = m_DynamicAllocations[CtxId];
+ auto& DynAlloc = m_DynamicData[CtxId];
return static_cast<Uint32>(DynAlloc.AlignedOffset);
}
}
@@ -130,9 +130,23 @@ private:
Uint32 m_DynamicOffsetAlignment = 0;
VkDeviceSize m_BufferMemoryAlignedOffset = 0;
- // TODO (assiduous): improve cache performance, move dynamic allocations to
- // device context.
- std::vector<VulkanDynamicAllocation, STDAllocatorRawMem<VulkanDynamicAllocation>> m_DynamicAllocations;
+ // TODO (assiduous): move dynamic allocations to device context.
+ static constexpr size_t CacheLineSize = 64;
+ struct alignas(CacheLineSize) CtxDynamicData : VulkanDynamicAllocation
+ {
+ CtxDynamicData() noexcept {}
+ CtxDynamicData(CtxDynamicData&&) = default;
+
+ CtxDynamicData& operator=(VulkanDynamicAllocation&& Allocation)
+ {
+ *static_cast<VulkanDynamicAllocation*>(this) = std::move(Allocation);
+ return *this;
+ }
+
+ Uint8 Padding[CacheLineSize - sizeof(VulkanDynamicAllocation)];
+ };
+ static_assert(sizeof(CtxDynamicData) == CacheLineSize, "Unexpected sizeof(CtxDynamicData)");
+ std::vector<CtxDynamicData, STDAllocatorRawMem<CtxDynamicData>> m_DynamicData;
VulkanUtilities::BufferWrapper m_VulkanBuffer;
VulkanUtilities::VulkanMemoryAllocation m_MemoryAllocation;
diff --git a/Graphics/GraphicsEngineVulkan/include/CommandQueueVkImpl.hpp b/Graphics/GraphicsEngineVulkan/include/CommandQueueVkImpl.hpp
index 4f258afe..bcf1c908 100644
--- a/Graphics/GraphicsEngineVulkan/include/CommandQueueVkImpl.hpp
+++ b/Graphics/GraphicsEngineVulkan/include/CommandQueueVkImpl.hpp
@@ -52,7 +52,7 @@ public:
uint32_t QueueFamilyIndex);
~CommandQueueVkImpl();
- virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final;
+ IMPLEMENT_QUERY_INTERFACE_IN_PLACE(IID_CommandQueueVk, TBase)
/// Implementation of ICommandQueueVk::GetNextFenceValue().
virtual Uint64 DILIGENT_CALL_TYPE GetNextFenceValue() const override final { return m_NextFenceValue; }
diff --git a/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.hpp b/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.hpp
index 3ff38c4f..761f6c46 100644
--- a/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.hpp
+++ b/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.hpp
@@ -87,7 +87,7 @@ public:
std::shared_ptr<GenerateMipsVkHelper> GenerateMipsHelper);
~DeviceContextVkImpl();
- virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final;
+ IMPLEMENT_QUERY_INTERFACE_IN_PLACE(IID_DeviceContextVk, TDeviceContextBase)
/// Implementation of IDeviceContext::SetPipelineState() in Vulkan backend.
virtual void DILIGENT_CALL_TYPE SetPipelineState(IPipelineState* pPipelineState) override final;
diff --git a/Graphics/GraphicsEngineVulkan/include/PipelineStateVkImpl.hpp b/Graphics/GraphicsEngineVulkan/include/PipelineStateVkImpl.hpp
index 6aa4e073..f43cfc9e 100644
--- a/Graphics/GraphicsEngineVulkan/include/PipelineStateVkImpl.hpp
+++ b/Graphics/GraphicsEngineVulkan/include/PipelineStateVkImpl.hpp
@@ -62,7 +62,7 @@ public:
PipelineStateVkImpl(IReferenceCounters* pRefCounters, RenderDeviceVkImpl* pDeviceVk, const RayTracingPipelineStateCreateInfo& CreateInfo);
~PipelineStateVkImpl();
- virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final;
+ IMPLEMENT_QUERY_INTERFACE_IN_PLACE(IID_PipelineStateVk, TPipelineStateBase)
/// Implementation of IPipelineState::CreateShaderResourceBinding() in Vulkan backend.
virtual void DILIGENT_CALL_TYPE CreateShaderResourceBinding(IShaderResourceBinding** ppShaderResourceBinding, bool InitStaticResources) override final;
@@ -162,7 +162,6 @@ private:
ShaderResourceCacheVk* m_StaticResCaches = nullptr; // [m_NumShaderStages]
ShaderVariableManagerVk* m_StaticVarsMgrs = nullptr; // [m_NumShaderStages]
- // SRB memory allocator must be declared before m_pDefaultShaderResBinding
SRBMemoryAllocator m_SRBMemAllocator;
VulkanUtilities::PipelineWrapper m_Pipeline;
diff --git a/Graphics/GraphicsEngineVulkan/include/RenderDeviceVkImpl.hpp b/Graphics/GraphicsEngineVulkan/include/RenderDeviceVkImpl.hpp
index 2b8408ce..e4cbdb34 100644
--- a/Graphics/GraphicsEngineVulkan/include/RenderDeviceVkImpl.hpp
+++ b/Graphics/GraphicsEngineVulkan/include/RenderDeviceVkImpl.hpp
@@ -70,7 +70,7 @@ public:
std::shared_ptr<VulkanUtilities::VulkanLogicalDevice> LogicalDevice) noexcept(false);
~RenderDeviceVkImpl();
- virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final;
+ IMPLEMENT_QUERY_INTERFACE_IN_PLACE(IID_RenderDeviceVk, TRenderDeviceBase)
/// Implementation of IRenderDevice::CreateGraphicsPipelineState() in Vulkan backend.
virtual void DILIGENT_CALL_TYPE CreateGraphicsPipelineState(const GraphicsPipelineStateCreateInfo& PSOCreateInfo, IPipelineState** ppPipelineState) override final;
diff --git a/Graphics/GraphicsEngineVulkan/include/SamplerVkImpl.hpp b/Graphics/GraphicsEngineVulkan/include/SamplerVkImpl.hpp
index e51b4bea..f74c1b4d 100644
--- a/Graphics/GraphicsEngineVulkan/include/SamplerVkImpl.hpp
+++ b/Graphics/GraphicsEngineVulkan/include/SamplerVkImpl.hpp
@@ -50,7 +50,7 @@ public:
SamplerVkImpl(IReferenceCounters* pRefCounters, RenderDeviceVkImpl* pRenderDeviceVk, const SamplerDesc& SamplerDesc);
~SamplerVkImpl();
- virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override;
+ IMPLEMENT_QUERY_INTERFACE_IN_PLACE(IID_SamplerVk, TSamplerBase)
/// Implementation of ISamplerVk::GetVkSampler().
virtual VkSampler DILIGENT_CALL_TYPE GetVkSampler() const override final { return m_VkSampler; }
diff --git a/Graphics/GraphicsEngineVulkan/include/ShaderBindingTableVkImpl.hpp b/Graphics/GraphicsEngineVulkan/include/ShaderBindingTableVkImpl.hpp
index 6adc1677..31e4257f 100644
--- a/Graphics/GraphicsEngineVulkan/include/ShaderBindingTableVkImpl.hpp
+++ b/Graphics/GraphicsEngineVulkan/include/ShaderBindingTableVkImpl.hpp
@@ -52,7 +52,7 @@ public:
bool bIsDeviceInternal = false);
~ShaderBindingTableVkImpl();
- IMPLEMENT_QUERY_INTERFACE_IN_PLACE(IID_ShaderBindingTableVk, TShaderBindingTableBase);
+ IMPLEMENT_QUERY_INTERFACE_IN_PLACE(IID_ShaderBindingTableVk, TShaderBindingTableBase)
};
} // namespace Diligent
diff --git a/Graphics/GraphicsEngineVulkan/include/ShaderResourceBindingVkImpl.hpp b/Graphics/GraphicsEngineVulkan/include/ShaderResourceBindingVkImpl.hpp
index 0b427640..2fec4fb5 100644
--- a/Graphics/GraphicsEngineVulkan/include/ShaderResourceBindingVkImpl.hpp
+++ b/Graphics/GraphicsEngineVulkan/include/ShaderResourceBindingVkImpl.hpp
@@ -54,7 +54,7 @@ public:
bool IsPSOInternal);
~ShaderResourceBindingVkImpl();
- virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final;
+ IMPLEMENT_QUERY_INTERFACE_IN_PLACE(IID_ShaderResourceBindingVk, TBase)
/// Implementation of IShaderResourceBinding::BindResources() in Vulkan backend.
virtual void DILIGENT_CALL_TYPE BindResources(Uint32 ShaderFlags, IResourceMapping* pResMapping, Uint32 Flags) override final;
diff --git a/Graphics/GraphicsEngineVulkan/include/ShaderResourceCacheVk.hpp b/Graphics/GraphicsEngineVulkan/include/ShaderResourceCacheVk.hpp
index 0bcf79a0..077452b5 100644
--- a/Graphics/GraphicsEngineVulkan/include/ShaderResourceCacheVk.hpp
+++ b/Graphics/GraphicsEngineVulkan/include/ShaderResourceCacheVk.hpp
@@ -75,7 +75,7 @@ public:
};
// clang-format off
- ShaderResourceCacheVk(DbgCacheContentType dbgContentType) noexcept
+ explicit ShaderResourceCacheVk(DbgCacheContentType dbgContentType) noexcept
#ifdef DILIGENT_DEBUG
: m_DbgContentType{dbgContentType}
#endif
@@ -99,7 +99,7 @@ public:
struct Resource
{
// clang-format off
- Resource(SPIRVShaderResourceAttribs::ResourceType _Type) :
+ explicit Resource(SPIRVShaderResourceAttribs::ResourceType _Type) noexcept :
Type{_Type}
{}
diff --git a/Graphics/GraphicsEngineVulkan/include/SwapChainVkImpl.hpp b/Graphics/GraphicsEngineVulkan/include/SwapChainVkImpl.hpp
index 12699faa..bec3c621 100644
--- a/Graphics/GraphicsEngineVulkan/include/SwapChainVkImpl.hpp
+++ b/Graphics/GraphicsEngineVulkan/include/SwapChainVkImpl.hpp
@@ -52,7 +52,7 @@ public:
const NativeWindow& Window);
~SwapChainVkImpl();
- virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final;
+ IMPLEMENT_QUERY_INTERFACE_IN_PLACE(IID_SwapChainVk, TSwapChainBase)
/// Implementation of ISwapChain::Present() in Vulkan backend.
virtual void DILIGENT_CALL_TYPE Present(Uint32 SyncInterval) override final;
diff --git a/Graphics/GraphicsEngineVulkan/include/TextureViewVkImpl.hpp b/Graphics/GraphicsEngineVulkan/include/TextureViewVkImpl.hpp
index c0e87992..dd3da6dc 100644
--- a/Graphics/GraphicsEngineVulkan/include/TextureViewVkImpl.hpp
+++ b/Graphics/GraphicsEngineVulkan/include/TextureViewVkImpl.hpp
@@ -55,7 +55,7 @@ public:
bool bIsDefaultView);
~TextureViewVkImpl();
- virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final;
+ IMPLEMENT_QUERY_INTERFACE_IN_PLACE(IID_TextureViewVk, TTextureViewBase)
/// Implementation of ITextureViewVk::GetVulkanImageView().
virtual VkImageView DILIGENT_CALL_TYPE GetVulkanImageView() const override final { return m_ImageView; }
diff --git a/Graphics/GraphicsEngineVulkan/include/TextureVkImpl.hpp b/Graphics/GraphicsEngineVulkan/include/TextureVkImpl.hpp
index 7ca629ad..941e0039 100644
--- a/Graphics/GraphicsEngineVulkan/include/TextureVkImpl.hpp
+++ b/Graphics/GraphicsEngineVulkan/include/TextureVkImpl.hpp
@@ -66,7 +66,7 @@ public:
~TextureVkImpl();
- virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final;
+ IMPLEMENT_QUERY_INTERFACE_IN_PLACE(IID_TextureVk, TTextureBase)
/// Implementation of ITextureVk::GetVkImage().
virtual VkImage DILIGENT_CALL_TYPE GetVkImage() const override final { return m_VulkanImage; }
diff --git a/Graphics/GraphicsEngineVulkan/include/TopLevelASVkImpl.hpp b/Graphics/GraphicsEngineVulkan/include/TopLevelASVkImpl.hpp
index 6eda1339..57d054f0 100644
--- a/Graphics/GraphicsEngineVulkan/include/TopLevelASVkImpl.hpp
+++ b/Graphics/GraphicsEngineVulkan/include/TopLevelASVkImpl.hpp
@@ -55,7 +55,7 @@ public:
VkAccelerationStructureKHR vkTLAS);
~TopLevelASVkImpl();
- IMPLEMENT_QUERY_INTERFACE_IN_PLACE(IID_TopLevelASVk, TTopLevelASBase);
+ IMPLEMENT_QUERY_INTERFACE_IN_PLACE(IID_TopLevelASVk, TTopLevelASBase)
/// Implementation of ITopLevelAS::GetNativeHandle() in Vulkan backend.
virtual void* DILIGENT_CALL_TYPE GetNativeHandle() override final
diff --git a/Graphics/GraphicsEngineVulkan/include/VulkanDynamicHeap.hpp b/Graphics/GraphicsEngineVulkan/include/VulkanDynamicHeap.hpp
index 0aa286a4..8bf1e05b 100644
--- a/Graphics/GraphicsEngineVulkan/include/VulkanDynamicHeap.hpp
+++ b/Graphics/GraphicsEngineVulkan/include/VulkanDynamicHeap.hpp
@@ -52,7 +52,7 @@ struct VulkanDynamicAllocation
VulkanDynamicAllocation() noexcept {}
// clang-format off
- VulkanDynamicAllocation(VulkanDynamicMemoryManager& _DynamicMemMgr, size_t _AlignedOffset, size_t _Size)noexcept :
+ VulkanDynamicAllocation(VulkanDynamicMemoryManager& _DynamicMemMgr, size_t _AlignedOffset, size_t _Size) noexcept :
pDynamicMemMgr{&_DynamicMemMgr},
AlignedOffset {_AlignedOffset },
Size {_Size }
diff --git a/Graphics/GraphicsEngineVulkan/src/BottomLevelASVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/BottomLevelASVkImpl.cpp
index 19253b1f..5611f28b 100644
--- a/Graphics/GraphicsEngineVulkan/src/BottomLevelASVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/BottomLevelASVkImpl.cpp
@@ -76,7 +76,8 @@ BottomLevelASVkImpl::BottomLevelASVkImpl(IReferenceCounters* pRefCounters,
MaxPrimitiveCount += src.MaxPrimitiveCount;
}
- VERIFY_EXPR(MaxPrimitiveCount <= Limits.maxPrimitiveCount);
+ DEV_CHECK_ERR(MaxPrimitiveCount <= Limits.maxPrimitiveCount,
+ "Max primitives count (", MaxPrimitiveCount, ") exceeds device limit (", Limits.maxPrimitiveCount, ")");
}
else if (m_Desc.pBoxes != nullptr)
{
@@ -97,7 +98,8 @@ BottomLevelASVkImpl::BottomLevelASVkImpl(IReferenceCounters* pRefCounters,
MaxBoxCount += src.MaxBoxCount;
}
- VERIFY_EXPR(MaxBoxCount <= Limits.maxPrimitiveCount);
+ DEV_CHECK_ERR(MaxBoxCount <= Limits.maxPrimitiveCount,
+ "Max box count (", MaxBoxCount, ") exceeds device limit (", Limits.maxPrimitiveCount, ")");
}
else
{
diff --git a/Graphics/GraphicsEngineVulkan/src/BufferViewVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/BufferViewVkImpl.cpp
index 314358ef..6faac6b6 100644
--- a/Graphics/GraphicsEngineVulkan/src/BufferViewVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/BufferViewVkImpl.cpp
@@ -58,8 +58,6 @@ BufferViewVkImpl::~BufferViewVkImpl()
m_pDevice->SafeReleaseDeviceObject(std::move(m_BuffView), m_pBuffer->GetDesc().CommandQueueMask);
}
-IMPLEMENT_QUERY_INTERFACE(BufferViewVkImpl, IID_BufferViewVk, TBufferViewBase)
-
const BufferVkImpl* BufferViewVkImpl::GetBufferVk() const
{
return ValidatedCast<const BufferVkImpl>(m_pBuffer);
diff --git a/Graphics/GraphicsEngineVulkan/src/BufferVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/BufferVkImpl.cpp
index 06bb887a..e1d23169 100644
--- a/Graphics/GraphicsEngineVulkan/src/BufferVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/BufferVkImpl.cpp
@@ -54,7 +54,7 @@ BufferVkImpl::BufferVkImpl(IReferenceCounters* pRefCounters,
BuffDesc,
false
},
- m_DynamicAllocations(STD_ALLOCATOR_RAW_MEM(VulkanDynamicAllocation, GetRawAllocator(), "Allocator for vector<VulkanDynamicAllocation>"))
+ m_DynamicData(STD_ALLOCATOR_RAW_MEM(CtxDynamicData, GetRawAllocator(), "Allocator for vector<VulkanDynamicAllocation>"))
// clang-format on
{
ValidateBufferInitData(BuffDesc, pBuffData);
@@ -174,9 +174,9 @@ BufferVkImpl::BufferVkImpl(IReferenceCounters* pRefCounters,
if (m_Desc.Usage == USAGE_DYNAMIC)
{
auto CtxCount = 1 + pRenderDeviceVk->GetNumDeferredContexts();
- m_DynamicAllocations.reserve(CtxCount);
+ m_DynamicData.reserve(CtxCount);
for (Uint32 ctx = 0; ctx < CtxCount; ++ctx)
- m_DynamicAllocations.emplace_back();
+ m_DynamicData.emplace_back();
}
if (m_Desc.Usage == USAGE_DYNAMIC && (VkBuffCI.usage & (VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT)) == 0)
@@ -394,7 +394,7 @@ BufferVkImpl::BufferVkImpl(IReferenceCounters* pRefCounters,
BuffDesc,
false
},
- m_DynamicAllocations(STD_ALLOCATOR_RAW_MEM(VulkanDynamicAllocation, GetRawAllocator(), "Allocator for vector<VulkanDynamicAllocation>")),
+ m_DynamicData(STD_ALLOCATOR_RAW_MEM(CtxDynamicData, GetRawAllocator(), "Allocator for vector<VulkanDynamicAllocation>")),
m_VulkanBuffer{vkBuffer}
// clang-format on
{
@@ -410,9 +410,6 @@ BufferVkImpl::~BufferVkImpl()
m_pDevice->SafeReleaseDeviceObject(std::move(m_MemoryAllocation), m_Desc.CommandQueueMask);
}
-IMPLEMENT_QUERY_INTERFACE(BufferVkImpl, IID_BufferVk, TBufferBase)
-
-
void BufferVkImpl::CreateViewInternal(const BufferViewDesc& OrigViewDesc, IBufferView** ppView, bool bIsDefaultView)
{
VERIFY(ppView != nullptr, "Null pointer provided");
@@ -526,7 +523,7 @@ VkDeviceAddress BufferVkImpl::GetVkDeviceAddress() const
void BufferVkImpl::DvpVerifyDynamicAllocation(DeviceContextVkImpl* pCtx) const
{
const auto ContextId = pCtx->GetContextId();
- const auto& DynAlloc = m_DynamicAllocations[ContextId];
+ const auto& DynAlloc = m_DynamicData[ContextId];
const auto CurrentFrame = pCtx->GetFrameNumber();
DEV_CHECK_ERR(DynAlloc.pDynamicMemMgr != nullptr, "Dynamic buffer '", m_Desc.Name, "' has not been mapped before its first use. Context Id: ", ContextId, ". Note: memory for dynamic buffers is allocated when a buffer is mapped.");
DEV_CHECK_ERR(DynAlloc.dvpFrameNumber == CurrentFrame, "Dynamic allocation of dynamic buffer '", m_Desc.Name, "' in frame ", CurrentFrame, " is out-of-date. Note: contents of all dynamic resources is discarded at the end of every frame. A buffer must be mapped before its first use in any frame.");
diff --git a/Graphics/GraphicsEngineVulkan/src/CommandQueueVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/CommandQueueVkImpl.cpp
index 4a4367e0..a4f2f3d5 100644
--- a/Graphics/GraphicsEngineVulkan/src/CommandQueueVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/CommandQueueVkImpl.cpp
@@ -52,9 +52,6 @@ CommandQueueVkImpl::~CommandQueueVkImpl()
// is called on that device.
}
-IMPLEMENT_QUERY_INTERFACE(CommandQueueVkImpl, IID_CommandQueueVk, TBase)
-
-
Uint64 CommandQueueVkImpl::Submit(const VkSubmitInfo& SubmitInfo)
{
std::lock_guard<std::mutex> Lock{m_QueueMutex};
diff --git a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp
index 45e94a0b..723cf8b4 100644
--- a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp
@@ -171,8 +171,6 @@ DeviceContextVkImpl::~DeviceContextVkImpl()
DEV_CHECK_ERR(m_CmdPool.DvpGetBufferCounter() == 0, "All command buffers must have been returned to the pool");
}
-IMPLEMENT_QUERY_INTERFACE(DeviceContextVkImpl, IID_DeviceContextVk, TDeviceContextBase)
-
void DeviceContextVkImpl::DisposeVkCmdBuffer(Uint32 CmdQueue, VkCommandBuffer vkCmdBuff, Uint64 FenceValue)
{
VERIFY_EXPR(vkCmdBuff != VK_NULL_HANDLE);
@@ -1493,7 +1491,7 @@ void DeviceContextVkImpl::MapBuffer(IBuffer* pBuffer, MAP_TYPE MapType, MAP_FLAG
DEV_CHECK_ERR((MapFlags & (MAP_FLAG_DISCARD | MAP_FLAG_NO_OVERWRITE)) != 0, "Failed to map buffer '",
BuffDesc.Name, "': Vulkan buffer must be mapped for writing with MAP_FLAG_DISCARD or MAP_FLAG_NO_OVERWRITE flag. Context Id: ", m_ContextId);
- auto& DynAllocation = pBufferVk->m_DynamicAllocations[m_ContextId];
+ auto& DynAllocation = pBufferVk->m_DynamicData[m_ContextId];
if ((MapFlags & MAP_FLAG_DISCARD) != 0 || DynAllocation.pDynamicMemMgr == nullptr)
{
DynAllocation = AllocateDynamicSpace(BuffDesc.uiSizeInBytes, pBufferVk->m_DynamicOffsetAlignment);
@@ -1559,7 +1557,7 @@ void DeviceContextVkImpl::UnmapBuffer(IBuffer* pBuffer, MAP_TYPE MapType)
{
if (pBufferVk->m_VulkanBuffer != VK_NULL_HANDLE)
{
- auto& DynAlloc = pBufferVk->m_DynamicAllocations[m_ContextId];
+ auto& DynAlloc = pBufferVk->m_DynamicData[m_ContextId];
auto vkSrcBuff = DynAlloc.pDynamicMemMgr->GetVkBuffer();
UpdateBufferRegion(pBufferVk, 0, BuffDesc.uiSizeInBytes, vkSrcBuff, DynAlloc.AlignedOffset, RESOURCE_STATE_TRANSITION_MODE_TRANSITION);
}
diff --git a/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp
index 263e6cb3..931a3121 100644
--- a/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp
@@ -825,9 +825,6 @@ void PipelineStateVkImpl::Destruct()
}
}
-IMPLEMENT_QUERY_INTERFACE(PipelineStateVkImpl, IID_PipelineStateVk, TPipelineStateBase)
-
-
void PipelineStateVkImpl::CreateShaderResourceBinding(IShaderResourceBinding** ppShaderResourceBinding, bool InitStaticResources)
{
auto& SRBAllocator = m_pDevice->GetSRBAllocator();
diff --git a/Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp
index 4a82921d..21f78733 100644
--- a/Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp
@@ -565,9 +565,6 @@ void RenderDeviceVkImpl::TestTextureFormat(TEXTURE_FORMAT TexFormat)
}
}
-
-IMPLEMENT_QUERY_INTERFACE(RenderDeviceVkImpl, IID_RenderDeviceVk, TRenderDeviceBase)
-
template <typename PSOCreateInfoType>
void RenderDeviceVkImpl::CreatePipelineState(const PSOCreateInfoType& PSOCreateInfo, IPipelineState** ppPipelineState)
{
diff --git a/Graphics/GraphicsEngineVulkan/src/SamplerVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/SamplerVkImpl.cpp
index 1cdad70b..5e49af21 100644
--- a/Graphics/GraphicsEngineVulkan/src/SamplerVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/SamplerVkImpl.cpp
@@ -89,6 +89,4 @@ SamplerVkImpl::~SamplerVkImpl()
m_pDevice->SafeReleaseDeviceObject(std::move(m_VkSampler), m_CommandQueueMask);
}
-IMPLEMENT_QUERY_INTERFACE(SamplerVkImpl, IID_SamplerVk, TSamplerBase)
-
} // namespace Diligent
diff --git a/Graphics/GraphicsEngineVulkan/src/ShaderResourceBindingVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/ShaderResourceBindingVkImpl.cpp
index d81fb675..2d6c740f 100644
--- a/Graphics/GraphicsEngineVulkan/src/ShaderResourceBindingVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/ShaderResourceBindingVkImpl.cpp
@@ -123,8 +123,6 @@ void ShaderResourceBindingVkImpl::Destruct()
}
}
-IMPLEMENT_QUERY_INTERFACE(ShaderResourceBindingVkImpl, IID_ShaderResourceBindingVk, TBase)
-
void ShaderResourceBindingVkImpl::BindResources(Uint32 ShaderFlags, IResourceMapping* pResMapping, Uint32 Flags)
{
const auto PipelineType = m_pPSO->GetDesc().PipelineType;
diff --git a/Graphics/GraphicsEngineVulkan/src/ShaderResourceLayoutVk.cpp b/Graphics/GraphicsEngineVulkan/src/ShaderResourceLayoutVk.cpp
index e2ea6cb5..617fa63f 100644
--- a/Graphics/GraphicsEngineVulkan/src/ShaderResourceLayoutVk.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/ShaderResourceLayoutVk.cpp
@@ -336,7 +336,7 @@ void ShaderResourceLayoutVk::InitializeStaticResourceLayout(const std::vector<co
else
{
// merge with existing
- auto& ExistingRes = GetResource(VarType, ResIter->second);
+ const auto& ExistingRes = GetResource(VarType, ResIter->second);
VERIFY_EXPR(ExistingRes.VariableType == VarType);
VERIFY_EXPR(ExistingRes.Type == Attribs.Type);
VERIFY_EXPR(ExistingRes.ResourceDim == Attribs.ResourceDim);
diff --git a/Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp
index b5f7e041..0caccd9b 100644
--- a/Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp
@@ -661,9 +661,6 @@ VkResult SwapChainVkImpl::AcquireNextImage(DeviceContextVkImpl* pDeviceCtxVk)
return res;
}
-IMPLEMENT_QUERY_INTERFACE(SwapChainVkImpl, IID_SwapChainVk, TSwapChainBase)
-
-
void SwapChainVkImpl::Present(Uint32 SyncInterval)
{
if (SyncInterval != 0 && SyncInterval != 1)
diff --git a/Graphics/GraphicsEngineVulkan/src/TextureViewVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/TextureViewVkImpl.cpp
index 1c65b3d5..e248265f 100644
--- a/Graphics/GraphicsEngineVulkan/src/TextureViewVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/TextureViewVkImpl.cpp
@@ -70,6 +70,4 @@ TextureViewVkImpl::~TextureViewVkImpl()
m_pDevice->SafeReleaseDeviceObject(std::move(m_ImageView), m_pTexture->GetDesc().CommandQueueMask);
}
-IMPLEMENT_QUERY_INTERFACE(TextureViewVkImpl, IID_TextureViewVk, TTextureViewBase)
-
} // namespace Diligent
diff --git a/Graphics/GraphicsEngineVulkan/src/TextureVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/TextureVkImpl.cpp
index 0fb3dd79..8445617b 100644
--- a/Graphics/GraphicsEngineVulkan/src/TextureVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/TextureVkImpl.cpp
@@ -482,8 +482,6 @@ TextureVkImpl::TextureVkImpl(IReferenceCounters* pRefCounters,
SetState(InitialState);
}
-IMPLEMENT_QUERY_INTERFACE(TextureVkImpl, IID_TextureVk, TTextureBase)
-
void TextureVkImpl::CreateViewInternal(const TextureViewDesc& ViewDesc, ITextureView** ppView, bool bIsDefaultView)
{
VERIFY(ppView != nullptr, "View pointer address is null");