summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineVulkan
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2020-03-26 18:40:00 +0000
committerassiduous <assiduous@diligentgraphics.com>2020-03-26 18:40:00 +0000
commit09b9f1dc1ec69683c3143f309e6e8a0141361624 (patch)
treeb6f1a63031e72e09d313f681a311eb3043405441 /Graphics/GraphicsEngineVulkan
parentFixed latest MSVC (19.25.28610.4) build issue (diff)
downloadDiligentCore-09b9f1dc1ec69683c3143f309e6e8a0141361624.tar.gz
DiligentCore-09b9f1dc1ec69683c3143f309e6e8a0141361624.zip
Renamed _DEBUG and DEVELOPMENT macros to DILGENT_DEBUG and DILIGENT_DEVELOPMENT
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
-rw-r--r--Graphics/GraphicsEngineVulkan/include/BufferVkImpl.hpp4
-rw-r--r--Graphics/GraphicsEngineVulkan/include/CommandPoolManager.hpp4
-rw-r--r--Graphics/GraphicsEngineVulkan/include/DescriptorPoolManager.hpp12
-rw-r--r--Graphics/GraphicsEngineVulkan/include/PipelineLayout.hpp6
-rw-r--r--Graphics/GraphicsEngineVulkan/include/ShaderResourceCacheVk.hpp8
-rw-r--r--Graphics/GraphicsEngineVulkan/include/ShaderResourceLayoutVk.hpp2
-rw-r--r--Graphics/GraphicsEngineVulkan/include/ShaderVariableVk.hpp2
-rw-r--r--Graphics/GraphicsEngineVulkan/include/VulkanDynamicHeap.hpp8
-rw-r--r--Graphics/GraphicsEngineVulkan/include/VulkanUtilities/VulkanCommandBufferPool.hpp4
-rw-r--r--Graphics/GraphicsEngineVulkan/src/BufferVkImpl.cpp4
-rw-r--r--Graphics/GraphicsEngineVulkan/src/CommandPoolManager.cpp6
-rw-r--r--Graphics/GraphicsEngineVulkan/src/DescriptorPoolManager.cpp10
-rw-r--r--Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp40
-rw-r--r--Graphics/GraphicsEngineVulkan/src/PipelineLayout.cpp10
-rw-r--r--Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp22
-rw-r--r--Graphics/GraphicsEngineVulkan/src/QueryManagerVk.cpp2
-rw-r--r--Graphics/GraphicsEngineVulkan/src/SamplerVkImpl.cpp4
-rw-r--r--Graphics/GraphicsEngineVulkan/src/ShaderResourceBindingVkImpl.cpp2
-rw-r--r--Graphics/GraphicsEngineVulkan/src/ShaderResourceCacheVk.cpp12
-rw-r--r--Graphics/GraphicsEngineVulkan/src/ShaderResourceLayoutVk.cpp38
-rw-r--r--Graphics/GraphicsEngineVulkan/src/ShaderVariableVk.cpp2
-rw-r--r--Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp2
-rw-r--r--Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanCommandBufferPool.cpp6
-rw-r--r--Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanFencePool.cpp2
-rw-r--r--Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanPhysicalDevice.cpp2
25 files changed, 107 insertions, 107 deletions
diff --git a/Graphics/GraphicsEngineVulkan/include/BufferVkImpl.hpp b/Graphics/GraphicsEngineVulkan/include/BufferVkImpl.hpp
index 0f9a5a9e..a54fe6bc 100644
--- a/Graphics/GraphicsEngineVulkan/include/BufferVkImpl.hpp
+++ b/Graphics/GraphicsEngineVulkan/include/BufferVkImpl.hpp
@@ -68,7 +68,7 @@ public:
virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override;
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
void DvpVerifyDynamicAllocation(DeviceContextVkImpl* pCtx) const;
#endif
@@ -82,7 +82,7 @@ public:
{
VERIFY(m_Desc.Usage == USAGE_DYNAMIC, "Dynamic buffer is expected");
VERIFY_EXPR(!m_DynamicAllocations.empty());
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
DvpVerifyDynamicAllocation(pCtx);
#endif
auto& DynAlloc = m_DynamicAllocations[CtxId];
diff --git a/Graphics/GraphicsEngineVulkan/include/CommandPoolManager.hpp b/Graphics/GraphicsEngineVulkan/include/CommandPoolManager.hpp
index 33aec74d..75bbccb8 100644
--- a/Graphics/GraphicsEngineVulkan/include/CommandPoolManager.hpp
+++ b/Graphics/GraphicsEngineVulkan/include/CommandPoolManager.hpp
@@ -62,7 +62,7 @@ public:
void DestroyPools();
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
int32_t GetAllocatedPoolCount() const
{
return m_AllocatedPoolCounter;
@@ -81,7 +81,7 @@ private:
std::mutex m_Mutex;
std::deque<VulkanUtilities::CommandPoolWrapper, STDAllocatorRawMem<VulkanUtilities::CommandPoolWrapper>> m_CmdPools;
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
std::atomic_int32_t m_AllocatedPoolCounter;
#endif
};
diff --git a/Graphics/GraphicsEngineVulkan/include/DescriptorPoolManager.hpp b/Graphics/GraphicsEngineVulkan/include/DescriptorPoolManager.hpp
index bba4c285..98438da3 100644
--- a/Graphics/GraphicsEngineVulkan/include/DescriptorPoolManager.hpp
+++ b/Graphics/GraphicsEngineVulkan/include/DescriptorPoolManager.hpp
@@ -144,7 +144,7 @@ public:
m_MaxSets {MaxSets },
m_AllowFreeing{AllowFreeing }
{
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
m_AllocatedPoolCounter = 0;
#endif
}
@@ -162,7 +162,7 @@ public:
RenderDeviceVkImpl& GetDeviceVkImpl() { return m_DeviceVkImpl; }
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
int32_t GetAllocatedPoolCounter() const
{
return m_AllocatedPoolCounter;
@@ -185,7 +185,7 @@ protected:
private:
void FreePool(VulkanUtilities::DescriptorPoolWrapper&& Pool);
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
std::atomic_int32_t m_AllocatedPoolCounter;
#endif
};
@@ -213,7 +213,7 @@ public:
}
// clang-format on
{
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
m_AllocatedSetCounter = 0;
#endif
}
@@ -222,7 +222,7 @@ public:
DescriptorSetAllocation Allocate(Uint64 CommandQueueMask, VkDescriptorSetLayout SetLayout, const char* DebugName = "");
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
int32_t GetAllocatedDescriptorSetCounter() const
{
return m_AllocatedSetCounter;
@@ -232,7 +232,7 @@ public:
private:
void FreeDescriptorSet(VkDescriptorSet Set, VkDescriptorPool Pool, Uint64 QueueMask);
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
std::atomic_int32_t m_AllocatedSetCounter;
#endif
};
diff --git a/Graphics/GraphicsEngineVulkan/include/PipelineLayout.hpp b/Graphics/GraphicsEngineVulkan/include/PipelineLayout.hpp
index a0ac52c8..73fced1f 100644
--- a/Graphics/GraphicsEngineVulkan/include/PipelineLayout.hpp
+++ b/Graphics/GraphicsEngineVulkan/include/PipelineLayout.hpp
@@ -102,7 +102,7 @@ public:
Uint32 DynamicOffsetCount = 0;
bool DynamicBuffersPresent = false;
bool DynamicDescriptorsBound = false;
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
const PipelineLayout* pDbgPipelineLayout = nullptr;
#endif
DescriptorSetBindInfo() :
@@ -122,7 +122,7 @@ public:
DynamicBuffersPresent = false;
DynamicDescriptorsBound = false;
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
// In release mode, do not clear vectors as this causes unnecessary work
vkSets.clear();
DynamicOffsets.clear();
@@ -235,7 +235,7 @@ __forceinline void PipelineLayout::BindDescriptorSetsWithDynamicOffsets(VulkanUt
VERIFY(BindInfo.DynamicOffsetCount > 0, "This function should only be called for pipelines that contain dynamic descriptors");
VERIFY_EXPR(BindInfo.pResourceCache != nullptr);
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
Uint32 TotalDynamicDescriptors = 0;
for (SHADER_RESOURCE_VARIABLE_TYPE VarType = SHADER_RESOURCE_VARIABLE_TYPE_MUTABLE; VarType <= SHADER_RESOURCE_VARIABLE_TYPE_DYNAMIC; VarType = static_cast<SHADER_RESOURCE_VARIABLE_TYPE>(VarType + 1))
{
diff --git a/Graphics/GraphicsEngineVulkan/include/ShaderResourceCacheVk.hpp b/Graphics/GraphicsEngineVulkan/include/ShaderResourceCacheVk.hpp
index b1c7f56b..172c82a8 100644
--- a/Graphics/GraphicsEngineVulkan/include/ShaderResourceCacheVk.hpp
+++ b/Graphics/GraphicsEngineVulkan/include/ShaderResourceCacheVk.hpp
@@ -76,7 +76,7 @@ public:
// clang-format off
ShaderResourceCacheVk(DbgCacheContentType dbgContentType)
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
: m_DbgContentType{dbgContentType}
#endif
{
@@ -186,7 +186,7 @@ public:
Uint16& GetDynamicBuffersCounter() { return m_NumDynamicBuffers; }
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
// Only for debug purposes: indicates what types of resources are stored in the cache
DbgCacheContentType DbgGetContentType() const { return m_DbgContentType; }
void DbgVerifyResourceInitialization() const;
@@ -215,7 +215,7 @@ private:
Uint16 m_NumDynamicBuffers = 0;
Uint32 m_TotalResources = 0;
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
// Only for debug purposes: indicates what types of resources are stored in the cache
const DbgCacheContentType m_DbgContentType;
// Debug array that stores flags indicating if resources in the cache have been initialized
@@ -269,7 +269,7 @@ __forceinline Uint32 ShaderResourceCacheVk::GetDynamicBufferOffsets(Uint32
++res;
}
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
for (; res < DescrSet.GetSize(); ++res)
{
const auto& Res = DescrSet.GetResource(res);
diff --git a/Graphics/GraphicsEngineVulkan/include/ShaderResourceLayoutVk.hpp b/Graphics/GraphicsEngineVulkan/include/ShaderResourceLayoutVk.hpp
index d0852883..529255a0 100644
--- a/Graphics/GraphicsEngineVulkan/include/ShaderResourceLayoutVk.hpp
+++ b/Graphics/GraphicsEngineVulkan/include/ShaderResourceLayoutVk.hpp
@@ -270,7 +270,7 @@ public:
const ShaderResourceCacheVk& SrcResourceCache,
ShaderResourceCacheVk& DstResourceCache) const;
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
bool dvpVerifyBindings(const ShaderResourceCacheVk& ResourceCache) const;
static void dvpVerifyResourceLayoutDesc(Uint32 NumShaders,
const std::shared_ptr<const SPIRVShaderResources> pShaderResources[],
diff --git a/Graphics/GraphicsEngineVulkan/include/ShaderVariableVk.hpp b/Graphics/GraphicsEngineVulkan/include/ShaderVariableVk.hpp
index d54e440c..9039e04e 100644
--- a/Graphics/GraphicsEngineVulkan/include/ShaderVariableVk.hpp
+++ b/Graphics/GraphicsEngineVulkan/include/ShaderVariableVk.hpp
@@ -114,7 +114,7 @@ private:
ShaderVariableVkImpl* m_pVariables = nullptr;
Uint32 m_NumVariables = 0;
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
IMemoryAllocator& m_DbgAllocator;
#endif
};
diff --git a/Graphics/GraphicsEngineVulkan/include/VulkanDynamicHeap.hpp b/Graphics/GraphicsEngineVulkan/include/VulkanDynamicHeap.hpp
index b9b066b5..6aa8ba38 100644
--- a/Graphics/GraphicsEngineVulkan/include/VulkanDynamicHeap.hpp
+++ b/Graphics/GraphicsEngineVulkan/include/VulkanDynamicHeap.hpp
@@ -65,14 +65,14 @@ struct VulkanDynamicAllocation
pDynamicMemMgr{rhs.pDynamicMemMgr},
AlignedOffset {rhs.AlignedOffset },
Size {rhs.Size }
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
, dvpFrameNumber{rhs.dvpFrameNumber}
#endif
{
rhs.pDynamicMemMgr = nullptr;
rhs.AlignedOffset = 0;
rhs.Size = 0;
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
rhs.dvpFrameNumber = 0;
#endif
}
@@ -86,7 +86,7 @@ struct VulkanDynamicAllocation
rhs.pDynamicMemMgr = nullptr;
rhs.AlignedOffset = 0;
rhs.Size = 0;
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
dvpFrameNumber = rhs.dvpFrameNumber;
rhs.dvpFrameNumber = 0;
#endif
@@ -96,7 +96,7 @@ struct VulkanDynamicAllocation
VulkanDynamicMemoryManager* pDynamicMemMgr = nullptr;
size_t AlignedOffset = 0; // Offset from the start of the buffer
size_t Size = 0; // Reserved size of this allocation
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
Int64 dvpFrameNumber = 0;
#endif
};
diff --git a/Graphics/GraphicsEngineVulkan/include/VulkanUtilities/VulkanCommandBufferPool.hpp b/Graphics/GraphicsEngineVulkan/include/VulkanUtilities/VulkanCommandBufferPool.hpp
index 1454a0a5..e755ffe4 100644
--- a/Graphics/GraphicsEngineVulkan/include/VulkanUtilities/VulkanCommandBufferPool.hpp
+++ b/Graphics/GraphicsEngineVulkan/include/VulkanUtilities/VulkanCommandBufferPool.hpp
@@ -60,7 +60,7 @@ public:
CommandPoolWrapper&& Release();
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
int32_t DvpGetBufferCounter() const
{
return m_BuffCounter;
@@ -74,7 +74,7 @@ private:
std::mutex m_Mutex;
std::deque<VkCommandBuffer> m_CmdBuffers;
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
std::atomic_int32_t m_BuffCounter;
#endif
};
diff --git a/Graphics/GraphicsEngineVulkan/src/BufferVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/BufferVkImpl.cpp
index a7a655b1..1e64e97b 100644
--- a/Graphics/GraphicsEngineVulkan/src/BufferVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/BufferVkImpl.cpp
@@ -160,7 +160,7 @@ BufferVkImpl::BufferVkImpl(IReferenceCounters* pRefCounters,
RESOURCE_STATE_INDIRECT_ARGUMENT);
SetState(State);
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
{
VkAccessFlags AccessFlags =
VK_ACCESS_INDIRECT_COMMAND_READ_BIT |
@@ -405,7 +405,7 @@ VkAccessFlags BufferVkImpl::GetAccessFlags() const
return ResourceStateFlagsToVkAccessFlags(GetState());
}
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
void BufferVkImpl::DvpVerifyDynamicAllocation(DeviceContextVkImpl* pCtx) const
{
auto ContextId = pCtx->GetContextId();
diff --git a/Graphics/GraphicsEngineVulkan/src/CommandPoolManager.cpp b/Graphics/GraphicsEngineVulkan/src/CommandPoolManager.cpp
index 1c0f21c5..e7fbc9bd 100644
--- a/Graphics/GraphicsEngineVulkan/src/CommandPoolManager.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/CommandPoolManager.cpp
@@ -44,7 +44,7 @@ CommandPoolManager::CommandPoolManager(RenderDeviceVkImpl& DeviceVkImpl,
m_CmdPools (STD_ALLOCATOR_RAW_MEM(VulkanUtilities::CommandPoolWrapper, GetRawAllocator(), "Allocator for deque<VulkanUtilities::CommandPoolWrapper>"))
// clang-format on
{
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
m_AllocatedPoolCounter = 0;
#endif
}
@@ -76,7 +76,7 @@ VulkanUtilities::CommandPoolWrapper CommandPoolManager::AllocateCommandPool(cons
LogicalDevice.ResetCommandPool(CmdPool);
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
++m_AllocatedPoolCounter;
#endif
return std::move(CmdPool);
@@ -130,7 +130,7 @@ void CommandPoolManager::SafeReleaseCommandPool(VulkanUtilities::CommandPoolWrap
void CommandPoolManager::FreeCommandPool(VulkanUtilities::CommandPoolWrapper&& CmdPool)
{
std::lock_guard<std::mutex> LockGuard(m_Mutex);
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
--m_AllocatedPoolCounter;
#endif
m_CmdPools.emplace_back(std::move(CmdPool));
diff --git a/Graphics/GraphicsEngineVulkan/src/DescriptorPoolManager.cpp b/Graphics/GraphicsEngineVulkan/src/DescriptorPoolManager.cpp
index a4cf5973..412ddd7b 100644
--- a/Graphics/GraphicsEngineVulkan/src/DescriptorPoolManager.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/DescriptorPoolManager.cpp
@@ -68,7 +68,7 @@ DescriptorPoolManager::~DescriptorPoolManager()
VulkanUtilities::DescriptorPoolWrapper DescriptorPoolManager::GetPool(const char* DebugName)
{
std::lock_guard<std::mutex> Lock{m_Mutex};
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
++m_AllocatedPoolCounter;
#endif
if (m_Pools.empty())
@@ -128,7 +128,7 @@ void DescriptorPoolManager::FreePool(VulkanUtilities::DescriptorPoolWrapper&& Po
std::lock_guard<std::mutex> Lock{m_Mutex};
m_DeviceVkImpl.GetLogicalDevice().ResetDescriptorPool(Pool);
m_Pools.emplace_back(std::move(Pool));
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
--m_AllocatedPoolCounter;
#endif
}
@@ -177,7 +177,7 @@ DescriptorSetAllocation DescriptorSetAllocator::Allocate(Uint64 CommandQueueMask
std::swap(*it, m_Pools.front());
}
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
++m_AllocatedSetCounter;
#endif
return {Set, Pool, CommandQueueMask, *this};
@@ -192,7 +192,7 @@ DescriptorSetAllocation DescriptorSetAllocator::Allocate(Uint64 CommandQueueMask
auto Set = AllocateDescriptorSet(LogicalDevice, NewPool, SetLayout, DebugName);
DEV_CHECK_ERR(Set != VK_NULL_HANDLE, "Failed to allocate descriptor set");
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
++m_AllocatedSetCounter;
#endif
@@ -234,7 +234,7 @@ void DescriptorSetAllocator::FreeDescriptorSet(VkDescriptorSet Set, VkDescriptor
{
std::lock_guard<std::mutex> Lock{Allocator->m_Mutex};
Allocator->m_DeviceVkImpl.GetLogicalDevice().FreeDescriptorSet(Pool, Set);
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
--Allocator->m_AllocatedSetCounter;
#endif
}
diff --git a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp
index 75b1305d..1681b456 100644
--- a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp
@@ -327,7 +327,7 @@ void DeviceContextVkImpl::SetBlendFactors(const float* pBlendFactors)
void DeviceContextVkImpl::CommitVkVertexBuffers()
{
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
if (m_NumVertexStreams < m_pPipelineState->GetNumBufferSlotsUsed())
LOG_ERROR("Currently bound pipeline state '", m_pPipelineState->GetDesc().Name, "' expects ", m_pPipelineState->GetNumBufferSlotsUsed(), " input buffer slots, but only ", m_NumVertexStreams, " is bound");
#endif
@@ -344,7 +344,7 @@ void DeviceContextVkImpl::CommitVkVertexBuffers()
if (pBufferVk->GetDesc().Usage == USAGE_DYNAMIC)
{
DynamicBufferPresent = true;
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
pBufferVk->DvpVerifyDynamicAllocation(this);
#endif
}
@@ -414,7 +414,7 @@ void DeviceContextVkImpl::DvpLogRenderPass_PSOMismatch()
void DeviceContextVkImpl::PrepareForDraw(DRAW_FLAGS Flags)
{
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
if ((Flags & DRAW_FLAG_VERIFY_RENDER_TARGETS) != 0)
DvpVerifyRenderTargets();
#endif
@@ -426,7 +426,7 @@ void DeviceContextVkImpl::PrepareForDraw(DRAW_FLAGS Flags)
CommitVkVertexBuffers();
}
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
if ((Flags & DRAW_FLAG_VERIFY_STATES) != 0)
{
for (Uint32 slot = 0; slot < m_NumVertexStreams; ++slot)
@@ -451,7 +451,7 @@ void DeviceContextVkImpl::PrepareForDraw(DRAW_FLAGS Flags)
}
}
#if 0
-# ifdef _DEBUG
+# ifdef DILIGENT_DEBUG
else
{
if ( m_pPipelineState->dbgContainsShaderResources() )
@@ -460,7 +460,7 @@ void DeviceContextVkImpl::PrepareForDraw(DRAW_FLAGS Flags)
# endif
#endif
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
if (m_pPipelineState->GetVkRenderPass() != m_RenderPass)
{
DvpLogRenderPass_PSOMismatch();
@@ -475,7 +475,7 @@ BufferVkImpl* DeviceContextVkImpl::PrepareIndirectDrawAttribsBuffer(IBuffer* pAt
DEV_CHECK_ERR(pAttribsBuffer, "Indirect draw attribs buffer must not be null");
auto* pIndirectDrawAttribsVk = ValidatedCast<BufferVkImpl>(pAttribsBuffer);
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
if (pIndirectDrawAttribsVk->GetDesc().Usage == USAGE_DYNAMIC)
pIndirectDrawAttribsVk->DvpVerifyDynamicAllocation(this);
#endif
@@ -490,7 +490,7 @@ void DeviceContextVkImpl::PrepareForIndexedDraw(DRAW_FLAGS Flags, VALUE_TYPE Ind
{
PrepareForDraw(Flags);
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
if ((Flags & DRAW_FLAG_VERIFY_STATES) != 0)
{
DvpVerifyBufferState(*m_pIndexBuffer, RESOURCE_STATE_INDEX_BUFFER, "Indexed draw call (DeviceContextVkImpl::Draw)");
@@ -570,7 +570,7 @@ void DeviceContextVkImpl::PrepareForDispatchCompute()
}
}
#if 0
-# ifdef _DEBUG
+# ifdef DILIGENT_DEBUG
else
{
if ( m_pPipelineState->dbgContainsShaderResources() )
@@ -599,7 +599,7 @@ void DeviceContextVkImpl::DispatchComputeIndirect(const DispatchComputeIndirectA
auto* pBufferVk = ValidatedCast<BufferVkImpl>(pAttribsBuffer);
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
if (pBufferVk->GetDesc().Usage == USAGE_DYNAMIC)
pBufferVk->DvpVerifyDynamicAllocation(this);
#endif
@@ -803,7 +803,7 @@ void DeviceContextVkImpl::ClearRenderTarget(ITextureView* pView, const float* RG
void DeviceContextVkImpl::FinishFrame()
{
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
for (const auto& MappedBuffIt : m_DbgMappedBuffers)
{
const auto& BuffDesc = MappedBuffIt.first->GetDesc();
@@ -1107,7 +1107,7 @@ void DeviceContextVkImpl::CommitRenderPassAndFramebuffer(bool VerifyStates)
if (m_Framebuffer != VK_NULL_HANDLE)
{
VERIFY_EXPR(m_RenderPass != VK_NULL_HANDLE);
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
if (VerifyStates)
{
TransitionRenderTargets(RESOURCE_STATE_TRANSITION_MODE_VERIFY);
@@ -1197,7 +1197,7 @@ void DeviceContextVkImpl::UpdateBufferRegion(BufferVkImpl* pBuf
Uint64 SrcOffset,
RESOURCE_STATE_TRANSITION_MODE TransitionMode)
{
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
if (DstOffset + NumBytes > pBuffVk->GetDesc().uiSizeInBytes)
{
LOG_ERROR("Update region is out of buffer bounds which will result in an undefined behavior");
@@ -1228,7 +1228,7 @@ void DeviceContextVkImpl::UpdateBuffer(IBuffer* pBuffer,
// be resource barrier issues in the cmd list in the device context
auto* pBuffVk = ValidatedCast<BufferVkImpl>(pBuffer);
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
if (pBuffVk->GetDesc().Usage == USAGE_DYNAMIC)
{
LOG_ERROR("Dynamic buffers must be updated via Map()");
@@ -1258,7 +1258,7 @@ void DeviceContextVkImpl::CopyBuffer(IBuffer* pSrcBuffer,
auto* pSrcBuffVk = ValidatedCast<BufferVkImpl>(pSrcBuffer);
auto* pDstBuffVk = ValidatedCast<BufferVkImpl>(pDstBuffer);
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
if (pDstBuffVk->GetDesc().Usage == USAGE_DYNAMIC)
{
LOG_ERROR("Dynamic buffers cannot be copy destinations");
@@ -1634,7 +1634,7 @@ void DeviceContextVkImpl::UpdateTextureRegion(const void* pSr
// pages will be discarded
VERIFY((Allocation.AlignedOffset % BufferOffsetAlignment) == 0, "Allocation offset must be at least 32-bit algined");
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
{
VERIFY(SrcStride >= CopyInfo.RowSize, "Source data stride (", SrcStride, ") is below the image row size (", CopyInfo.RowSize, ")");
const Uint32 PlaneSize = SrcStride * CopyInfo.RowCount;
@@ -2205,7 +2205,7 @@ void DeviceContextVkImpl::TransitionOrVerifyTextureState(TextureVkImpl&
VERIFY_EXPR(Texture.GetLayout() == ExpectedLayout);
}
}
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
else if (TransitionMode == RESOURCE_STATE_TRANSITION_MODE_VERIFY)
{
DvpVerifyTextureState(Texture, RequiredState, OperationName);
@@ -2301,7 +2301,7 @@ void DeviceContextVkImpl::TransitionOrVerifyBufferState(BufferVkImpl&
VERIFY_EXPR(Buffer.CheckAccessFlags(ExpectedAccessFlags));
}
}
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
else if (TransitionMode == RESOURCE_STATE_TRANSITION_MODE_VERIFY)
{
DvpVerifyBufferState(Buffer, RequiredState, OperationName);
@@ -2312,7 +2312,7 @@ void DeviceContextVkImpl::TransitionOrVerifyBufferState(BufferVkImpl&
VulkanDynamicAllocation DeviceContextVkImpl::AllocateDynamicSpace(Uint32 SizeInBytes, Uint32 Alignment)
{
auto DynAlloc = m_DynamicHeap.Allocate(SizeInBytes, Alignment);
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
DynAlloc.dvpFrameNumber = m_ContextFrameNumber;
#endif
return DynAlloc;
@@ -2328,7 +2328,7 @@ void DeviceContextVkImpl::TransitionResourceStates(Uint32 BarrierCount, StateTra
for (Uint32 i = 0; i < BarrierCount; ++i)
{
const auto& Barrier = pResourceBarriers[i];
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
DvpVerifyStateTransitionDesc(Barrier);
#endif
if (Barrier.TransitionType == STATE_TRANSITION_TYPE_BEGIN)
diff --git a/Graphics/GraphicsEngineVulkan/src/PipelineLayout.cpp b/Graphics/GraphicsEngineVulkan/src/PipelineLayout.cpp
index 95e652ec..32a68780 100644
--- a/Graphics/GraphicsEngineVulkan/src/PipelineLayout.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/PipelineLayout.cpp
@@ -146,7 +146,7 @@ size_t PipelineLayout::DescriptorSetLayoutManager::DescriptorSetLayout::GetMemor
}
VERIFY_EXPR(((NumBindings & (NumBindings - 1)) == 0) && NumBindings == MemSize || NumBindings < MemSize);
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
static constexpr size_t MinMemSize = 1;
#else
static constexpr size_t MinMemSize = 16;
@@ -442,7 +442,7 @@ void PipelineLayout::InitResourceCache(RenderDeviceVkImpl* pDeviceVkImpl,
if (StaticAndMutSet.SetIndex >= 0)
{
const char* DescrSetName = "Static/Mutable Descriptor Set";
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
std::string _DescrSetName(DbgPipelineName);
_DescrSetName.append(" - static/mutable set");
DescrSetName = _DescrSetName.c_str();
@@ -458,7 +458,7 @@ void PipelineLayout::PrepareDescriptorSets(DeviceContextVkImpl* pCtxVkIm
DescriptorSetBindInfo& BindInfo,
VkDescriptorSet VkDynamicDescrSet) const
{
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
BindInfo.vkSets.clear();
#endif
@@ -491,7 +491,7 @@ void PipelineLayout::PrepareDescriptorSets(DeviceContextVkImpl* pCtxVkIm
TotalDynamicDescriptors += Set.NumDynamicDescriptors;
}
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
for (const auto& set : BindInfo.vkSets)
VERIFY(set != VK_NULL_HANDLE, "Descriptor set must not be null");
#endif
@@ -501,7 +501,7 @@ void PipelineLayout::PrepareDescriptorSets(DeviceContextVkImpl* pCtxVkIm
BindInfo.DynamicOffsets.resize(TotalDynamicDescriptors);
BindInfo.BindPoint = IsCompute ? VK_PIPELINE_BIND_POINT_COMPUTE : VK_PIPELINE_BIND_POINT_GRAPHICS;
BindInfo.pResourceCache = &ResourceCache;
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
BindInfo.pDbgPipelineLayout = this;
#endif
BindInfo.DynamicBuffersPresent = ResourceCache.GetNumDynamicBuffers() > 0;
diff --git a/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp
index 1d2339a4..9e7b69c7 100644
--- a/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp
@@ -271,7 +271,7 @@ PipelineStateVkImpl::PipelineStateVkImpl(IReferenceCounters* pRefCounters,
PipelineCI.sType = VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO;
PipelineCI.pNext = nullptr;
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
PipelineCI.flags = VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT;
#endif
PipelineCI.basePipelineHandle = VK_NULL_HANDLE; // a pipeline to derive from
@@ -299,7 +299,7 @@ PipelineStateVkImpl::PipelineStateVkImpl(IReferenceCounters* pRefCounters,
PipelineCI.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO;
PipelineCI.pNext = nullptr;
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
PipelineCI.flags = VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT;
#endif
@@ -512,7 +512,7 @@ bool PipelineStateVkImpl::IsCompatibleWith(const IPipelineState* pPSO) const
auto IsSamePipelineLayout = m_PipelineLayout.IsSameAs(pPSOVk->m_PipelineLayout);
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
{
bool IsCompatibleShaders = true;
if (m_NumShaders != pPSOVk->m_NumShaders)
@@ -559,7 +559,7 @@ void PipelineStateVkImpl::CommitAndTransitionShaderResources(IShaderResourceBind
if (!m_HasStaticResources && !m_HasNonStaticResources)
return;
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
if (pShaderResourceBinding == nullptr)
{
LOG_ERROR_MESSAGE("Pipeline state '", m_Desc.Name, "' requires shader resource binding object to ",
@@ -570,7 +570,7 @@ void PipelineStateVkImpl::CommitAndTransitionShaderResources(IShaderResourceBind
auto* pResBindingVkImpl = ValidatedCast<ShaderResourceBindingVkImpl>(pShaderResourceBinding);
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
{
auto* pRefPSO = pResBindingVkImpl->GetPipelineState();
if (IsIncompatibleWith(pRefPSO))
@@ -588,13 +588,13 @@ void PipelineStateVkImpl::CommitAndTransitionShaderResources(IShaderResourceBind
auto& ResourceCache = pResBindingVkImpl->GetResourceCache();
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
for (Uint32 s = 0; s < m_NumShaders; ++s)
{
m_ShaderResourceLayouts[s].dvpVerifyBindings(ResourceCache);
}
#endif
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
ResourceCache.DbgVerifyDynamicBuffersCounter();
#endif
@@ -602,7 +602,7 @@ void PipelineStateVkImpl::CommitAndTransitionShaderResources(IShaderResourceBind
{
ResourceCache.TransitionResources<false>(pCtxVkImpl);
}
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
else if (StateTransitionMode == RESOURCE_STATE_TRANSITION_MODE_VERIFY)
{
ResourceCache.TransitionResources<true>(pCtxVkImpl);
@@ -616,7 +616,7 @@ void PipelineStateVkImpl::CommitAndTransitionShaderResources(IShaderResourceBind
if (DynamicDescriptorSetVkLayout != VK_NULL_HANDLE)
{
const char* DynamicDescrSetName = "Dynamic Descriptor Set";
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
std::string _DynamicDescrSetName(m_Desc.Name);
_DynamicDescrSetName.append(" - dynamic set");
DynamicDescrSetName = _DynamicDescrSetName.c_str();
@@ -689,7 +689,7 @@ void PipelineStateVkImpl::InitializeStaticSRBResources(ShaderResourceCacheVk& Re
{
const auto& StaticResLayout = GetStaticShaderResLayout(s);
const auto& StaticResCache = GetStaticResCache(s);
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
if (!StaticResLayout.dvpVerifyBindings(StaticResCache))
{
const auto* pShaderVk = GetShader<const ShaderVkImpl>(s);
@@ -703,7 +703,7 @@ void PipelineStateVkImpl::InitializeStaticSRBResources(ShaderResourceCacheVk& Re
const auto& ShaderResourceLayouts = GetShaderResLayout(s);
ShaderResourceLayouts.InitializeStaticResources(StaticResLayout, StaticResCache, ResourceCache);
}
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
ResourceCache.DbgVerifyDynamicBuffersCounter();
#endif
}
diff --git a/Graphics/GraphicsEngineVulkan/src/QueryManagerVk.cpp b/Graphics/GraphicsEngineVulkan/src/QueryManagerVk.cpp
index 901f7228..ebc57289 100644
--- a/Graphics/GraphicsEngineVulkan/src/QueryManagerVk.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/QueryManagerVk.cpp
@@ -186,7 +186,7 @@ void QueryManagerVk::DiscardQuery(QUERY_TYPE Type, Uint32 Index)
auto& HeapInfo = m_Heaps[Type];
VERIFY(Index < HeapInfo.PoolSize, "Query index ", Index, " is out of range");
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
for (const auto& ind : HeapInfo.AvailableQueries)
{
VERIFY(ind != Index, "Index ", Index, " already present in available queries list");
diff --git a/Graphics/GraphicsEngineVulkan/src/SamplerVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/SamplerVkImpl.cpp
index 13800f49..22135811 100644
--- a/Graphics/GraphicsEngineVulkan/src/SamplerVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/SamplerVkImpl.cpp
@@ -59,7 +59,7 @@ SamplerVkImpl::SamplerVkImpl(IReferenceCounters* pRefCounters, RenderDeviceVkImp
SamplerCI.addressModeW = AddressModeToVkAddressMode(m_Desc.AddressW);
SamplerCI.mipLodBias = m_Desc.MipLODBias;
SamplerCI.anisotropyEnable = IsAnisotropicFilter(m_Desc.MinFilter);
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
if (!((SamplerCI.anisotropyEnable && IsAnisotropicFilter(m_Desc.MagFilter)) ||
(!SamplerCI.anisotropyEnable && !IsAnisotropicFilter(m_Desc.MagFilter))))
{
@@ -69,7 +69,7 @@ SamplerVkImpl::SamplerVkImpl(IReferenceCounters* pRefCounters, RenderDeviceVkImp
SamplerCI.maxAnisotropy = static_cast<float>(m_Desc.MaxAnisotropy);
SamplerCI.compareEnable = IsComparisonFilter(m_Desc.MinFilter);
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
if (!((SamplerCI.compareEnable && IsComparisonFilter(m_Desc.MagFilter)) ||
(!SamplerCI.compareEnable && !IsComparisonFilter(m_Desc.MagFilter))))
{
diff --git a/Graphics/GraphicsEngineVulkan/src/ShaderResourceBindingVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/ShaderResourceBindingVkImpl.cpp
index da361e1a..ee6a3709 100644
--- a/Graphics/GraphicsEngineVulkan/src/ShaderResourceBindingVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/ShaderResourceBindingVkImpl.cpp
@@ -78,7 +78,7 @@ ShaderResourceBindingVkImpl::ShaderResourceBindingVkImpl(IReferenceCounters* pR
const SHADER_RESOURCE_VARIABLE_TYPE VarTypes[] = {SHADER_RESOURCE_VARIABLE_TYPE_MUTABLE, SHADER_RESOURCE_VARIABLE_TYPE_DYNAMIC};
new (m_pShaderVarMgrs + s) ShaderVariableManagerVk(*this, SrcLayout, VarDataAllocator, VarTypes, _countof(VarTypes), m_ShaderResourceCache);
}
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
m_ShaderResourceCache.DbgVerifyResourceInitialization();
#endif
}
diff --git a/Graphics/GraphicsEngineVulkan/src/ShaderResourceCacheVk.cpp b/Graphics/GraphicsEngineVulkan/src/ShaderResourceCacheVk.cpp
index 1f09846a..06239703 100644
--- a/Graphics/GraphicsEngineVulkan/src/ShaderResourceCacheVk.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/ShaderResourceCacheVk.cpp
@@ -68,7 +68,7 @@ void ShaderResourceCacheVk::InitializeSets(IMemoryAllocator& MemAllocator, Uint3
m_TotalResources += SetSizes[t];
auto MemorySize = NumSets * sizeof(DescriptorSet) + m_TotalResources * sizeof(Resource);
VERIFY_EXPR(MemorySize == GetRequiredMemorySize(NumSets, SetSizes));
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
m_DbgInitializedResources.resize(m_NumSets);
#endif
if (MemorySize > 0)
@@ -80,7 +80,7 @@ void ShaderResourceCacheVk::InitializeSets(IMemoryAllocator& MemAllocator, Uint3
{
new (&GetDescriptorSet(t)) DescriptorSet(SetSizes[t], SetSizes[t] > 0 ? pCurrResPtr : nullptr);
pCurrResPtr += SetSizes[t];
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
m_DbgInitializedResources[t].resize(SetSizes[t]);
#endif
}
@@ -94,13 +94,13 @@ void ShaderResourceCacheVk::InitializeResources(Uint32 Set, Uint32 Offset, Uint3
for (Uint32 res = 0; res < ArraySize; ++res)
{
new (&DescrSet.GetResource(Offset + res)) Resource{Type};
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
m_DbgInitializedResources[Set][Offset + res] = true;
#endif
}
}
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
void ShaderResourceCacheVk::DbgVerifyResourceInitialization() const
{
for (const auto& SetFlags : m_DbgInitializedResources)
@@ -203,7 +203,7 @@ void ShaderResourceCacheVk::TransitionResources(DeviceContextVkImpl* pCtxVkImpl)
Res.Type == SPIRVShaderResourceAttribs::ResourceType::StorageTexelBuffer) ?
RESOURCE_STATE_UNORDERED_ACCESS :
RESOURCE_STATE_SHADER_RESOURCE;
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
const VkAccessFlags RequiredAccessFlags = (RequiredState == RESOURCE_STATE_SHADER_RESOURCE) ?
VK_ACCESS_SHADER_READ_BIT :
(VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT);
@@ -416,7 +416,7 @@ VkDescriptorImageInfo ShaderResourceCacheVk::Resource::GetImageDescriptorWriteIn
// object (13.2.4)
DescrImgInfo.sampler = pSamplerVk->GetVkSampler();
}
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
else
{
LOG_ERROR_MESSAGE("No sampler is assigned to texture view '", pTexViewVk->GetDesc().Name, "'");
diff --git a/Graphics/GraphicsEngineVulkan/src/ShaderResourceLayoutVk.cpp b/Graphics/GraphicsEngineVulkan/src/ShaderResourceLayoutVk.cpp
index 69883529..af258044 100644
--- a/Graphics/GraphicsEngineVulkan/src/ShaderResourceLayoutVk.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/ShaderResourceLayoutVk.cpp
@@ -220,7 +220,7 @@ void ShaderResourceLayoutVk::InitializeStaticResourceLayout(std::shared_ptr<cons
} //
);
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
for (SHADER_RESOURCE_VARIABLE_TYPE VarType = SHADER_RESOURCE_VARIABLE_TYPE_STATIC; VarType < SHADER_RESOURCE_VARIABLE_TYPE_NUM_TYPES; VarType = static_cast<SHADER_RESOURCE_VARIABLE_TYPE>(VarType + 1))
{
VERIFY(CurrResInd[VarType] == m_NumResources[VarType], "Not all resources have been initialized, which will cause a crash when dtor is called");
@@ -229,12 +229,12 @@ void ShaderResourceLayoutVk::InitializeStaticResourceLayout(std::shared_ptr<cons
StaticResourceCache.InitializeSets(GetRawAllocator(), 1, &StaticResCacheSize);
InitializeResourceMemoryInCache(StaticResourceCache);
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
StaticResourceCache.DbgVerifyResourceInitialization();
#endif
}
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
void ShaderResourceLayoutVk::dvpVerifyResourceLayoutDesc(Uint32 NumShaders,
const std::shared_ptr<const SPIRVShaderResources> pShaderResources[],
const PipelineResourceLayoutDesc& ResourceLayoutDesc)
@@ -344,7 +344,7 @@ void ShaderResourceLayoutVk::Initialize(IRenderDevice*
std::vector<uint32_t> SPIRVs[],
class PipelineLayout& PipelineLayout)
{
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
dvpVerifyResourceLayoutDesc(NumShaders, pShaderResources, ResourceLayoutDesc);
#endif
@@ -361,7 +361,7 @@ void ShaderResourceLayoutVk::Initialize(IRenderDevice*
VERIFY_EXPR(NumShaders <= MAX_SHADERS_IN_PIPELINE);
std::array<std::array<Uint32, SHADER_RESOURCE_VARIABLE_TYPE_NUM_TYPES>, MAX_SHADERS_IN_PIPELINE> CurrResInd = {};
std::array<Uint32, MAX_SHADERS_IN_PIPELINE> CurrImmutableSamplerInd = {};
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
std::unordered_map<Uint32, std::pair<Uint32, Uint32>> dbgBindings_CacheOffsets;
#endif
@@ -408,7 +408,7 @@ void ShaderResourceLayoutVk::Initialize(IRenderDevice*
VERIFY(DescriptorSet <= std::numeric_limits<decltype(VkResource::DescriptorSet)>::max(), "Descriptor set (", DescriptorSet, ") excceeds maximum representable value");
VERIFY(Binding <= std::numeric_limits<decltype(VkResource::Binding)>::max(), "Binding (", Binding, ") excceeds maximum representable value");
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
// Verify that bindings and cache offsets monotonically increase in every descriptor set
auto Binding_OffsetIt = dbgBindings_CacheOffsets.find(DescriptorSet);
if (Binding_OffsetIt != dbgBindings_CacheOffsets.end())
@@ -501,7 +501,7 @@ void ShaderResourceLayoutVk::Initialize(IRenderDevice*
// clang-format on
}
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
for (Uint32 s = 0; s < NumShaders; ++s)
{
auto& Layout = Layouts[s];
@@ -611,7 +611,7 @@ void ShaderResourceLayoutVk::VkResource::CacheUniformBuffer(IDeviceObject*
{
VERIFY(SpirvAttribs.Type == SPIRVShaderResourceAttribs::ResourceType::UniformBuffer, "Uniform buffer resource is expected");
RefCntAutoPtr<BufferVkImpl> pBufferVk(pBuffer, IID_BufferVk);
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
VerifyConstantBufferBinding(SpirvAttribs, GetVariableType(), ArrayInd, pBuffer, pBufferVk.RawPtr(), DstRes.pObject.RawPtr(), ParentResLayout.GetShaderName());
#endif
@@ -652,7 +652,7 @@ void ShaderResourceLayoutVk::VkResource::CacheStorageBuffer(IDeviceObject*
// clang-format on
RefCntAutoPtr<BufferViewVkImpl> pBufferViewVk(pBufferView, IID_BufferViewVk);
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
{
// HLSL buffer SRVs are mapped to storge buffers in GLSL
auto RequiredViewType = SpirvAttribs.Type == SPIRVShaderResourceAttribs::ResourceType::ROStorageBuffer ? BUFFER_VIEW_SHADER_RESOURCE : BUFFER_VIEW_UNORDERED_ACCESS;
@@ -698,7 +698,7 @@ void ShaderResourceLayoutVk::VkResource::CacheTexelBuffer(IDeviceObject*
// clang-format on
RefCntAutoPtr<BufferViewVkImpl> pBufferViewVk(pBufferView, IID_BufferViewVk);
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
{
// HLSL buffer SRVs are mapped to storge buffers in GLSL
auto RequiredViewType = SpirvAttribs.Type == SPIRVShaderResourceAttribs::ResourceType::StorageTexelBuffer ? BUFFER_VIEW_UNORDERED_ACCESS : BUFFER_VIEW_SHADER_RESOURCE;
@@ -747,7 +747,7 @@ void ShaderResourceLayoutVk::VkResource::CacheImage(IDeviceObject*
// clang-format on
RefCntAutoPtr<TextureViewVkImpl> pTexViewVk0(pTexView, IID_TextureViewVk);
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
{
// HLSL buffer SRVs are mapped to storge buffers in GLSL
auto RequiredViewType = SpirvAttribs.Type == SPIRVShaderResourceAttribs::ResourceType::StorageImage ? TEXTURE_VIEW_UNORDERED_ACCESS : TEXTURE_VIEW_SHADER_RESOURCE;
@@ -758,7 +758,7 @@ void ShaderResourceLayoutVk::VkResource::CacheImage(IDeviceObject*
{
// We can do RawPtr here safely since UpdateCachedResource() returned true
auto* pTexViewVk = DstRes.pObject.RawPtr<TextureViewVkImpl>();
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
if (SpirvAttribs.Type == SPIRVShaderResourceAttribs::ResourceType::SampledImage && !IsImmutableSamplerAssigned())
{
if (pTexViewVk->GetSampler() == nullptr)
@@ -811,7 +811,7 @@ void ShaderResourceLayoutVk::VkResource::CacheSeparateSampler(IDeviceObject*
VERIFY(!IsImmutableSamplerAssigned(), "This separate sampler is assigned an immutable sampler");
RefCntAutoPtr<SamplerVkImpl> pSamplerVk(pSampler, IID_Sampler);
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
if (pSampler != nullptr && pSamplerVk == nullptr)
{
LOG_ERROR_MESSAGE("Failed to bind object '", pSampler->GetDesc().Name, "' to variable '", SpirvAttribs.GetPrintName(ArrayInd),
@@ -845,7 +845,7 @@ void ShaderResourceLayoutVk::VkResource::BindResource(IDeviceObject* pObj, Uint3
auto& DstDescrSet = ResourceCache.GetDescriptorSet(DescriptorSet);
auto vkDescrSet = DstDescrSet.GetVkDescriptorSet();
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
if (ResourceCache.DbgGetContentType() == ShaderResourceCacheVk::DbgCacheContentType::SRBResources)
{
if (VariableType == SHADER_RESOURCE_VARIABLE_TYPE_STATIC || VariableType == SHADER_RESOURCE_VARIABLE_TYPE_MUTABLE)
@@ -991,7 +991,7 @@ void ShaderResourceLayoutVk::InitializeStaticResources(const ShaderResourceLayou
}
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
bool ShaderResourceLayoutVk::dvpVerifyBindings(const ShaderResourceCacheVk& ResourceCache) const
{
bool BindingsOK = true;
@@ -1012,7 +1012,7 @@ bool ShaderResourceLayoutVk::dvpVerifyBindings(const ShaderResourceCacheVk& Reso
LOG_ERROR_MESSAGE("No resource is bound to ", GetShaderVariableTypeLiteralName(Res.GetVariableType()), " variable '", Res.SpirvAttribs.GetPrintName(ArrInd), "' in shader '", GetShaderName(), "'");
BindingsOK = false;
}
-# ifdef _DEBUG
+# ifdef DILIGENT_DEBUG
auto vkDescSet = CachedDescrSet.GetVkDescriptorSet();
auto dbgCacheContentType = ResourceCache.DbgGetContentType();
if (dbgCacheContentType == ShaderResourceCacheVk::DbgCacheContentType::StaticShaderResources)
@@ -1055,7 +1055,7 @@ void ShaderResourceLayoutVk::CommitDynamicResources(const ShaderResourceCacheVk&
VERIFY(NumDynamicResources != 0, "This shader resource layout does not contain dynamic resources");
VERIFY_EXPR(vkDynamicDescriptorSet != VK_NULL_HANDLE);
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
static constexpr size_t ImgUpdateBatchSize = 4;
static constexpr size_t BuffUpdateBatchSize = 2;
static constexpr size_t TexelBuffUpdateBatchSize = 2;
@@ -1079,7 +1079,7 @@ void ShaderResourceLayoutVk::CommitDynamicResources(const ShaderResourceCacheVk&
auto BuffViewIt = DescrBuffViewArr.begin();
auto WriteDescrSetIt = WriteDescrSetArr.begin();
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
Int32 DynamicDescrSetIndex = -1;
#endif
@@ -1087,7 +1087,7 @@ void ShaderResourceLayoutVk::CommitDynamicResources(const ShaderResourceCacheVk&
{
const auto& Res = GetResource(SHADER_RESOURCE_VARIABLE_TYPE_DYNAMIC, ResNum);
VERIFY_EXPR(Res.GetVariableType() == SHADER_RESOURCE_VARIABLE_TYPE_DYNAMIC);
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
if (DynamicDescrSetIndex < 0)
DynamicDescrSetIndex = Res.DescriptorSet;
else
diff --git a/Graphics/GraphicsEngineVulkan/src/ShaderVariableVk.cpp b/Graphics/GraphicsEngineVulkan/src/ShaderVariableVk.cpp
index 8f476082..82d26b44 100644
--- a/Graphics/GraphicsEngineVulkan/src/ShaderVariableVk.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/ShaderVariableVk.cpp
@@ -74,7 +74,7 @@ ShaderVariableManagerVk::ShaderVariableManagerVk(IObject&
// clang-format off
m_Owner {Owner },
m_ResourceCache{ResourceCache}
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
, m_DbgAllocator {Allocator}
#endif
// clang-format on
diff --git a/Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp
index 147e4f1f..5ed8c222 100644
--- a/Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp
@@ -404,7 +404,7 @@ void SwapChainVkImpl::InitBuffersAndViews()
auto* pDeviceVkImpl = m_pRenderDevice.RawPtr<RenderDeviceVkImpl>();
auto LogicalVkDevice = pDeviceVkImpl->GetVkDevice();
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
{
uint32_t swapchainImageCount = 0;
auto err = vkGetSwapchainImagesKHR(LogicalVkDevice, m_VkSwapChain, &swapchainImageCount, NULL);
diff --git a/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanCommandBufferPool.cpp b/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanCommandBufferPool.cpp
index c0f49db1..c881f0dd 100644
--- a/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanCommandBufferPool.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanCommandBufferPool.cpp
@@ -49,7 +49,7 @@ VulkanCommandBufferPool::VulkanCommandBufferPool(std::shared_ptr<const VulkanLog
m_CmdPool = m_LogicalDevice->CreateCommandPool(CmdPoolCI);
DEV_CHECK_ERR(m_CmdPool != VK_NULL_HANDLE, "Failed to create vulkan command pool");
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
m_BuffCounter = 0;
#endif
}
@@ -108,7 +108,7 @@ VkCommandBuffer VulkanCommandBufferPool::GetCommandBuffer(const char* DebugName)
auto err = vkBeginCommandBuffer(CmdBuffer, &CmdBuffBeginInfo);
DEV_CHECK_ERR(err == VK_SUCCESS, "Failed to begin command buffer");
(void)err;
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
++m_BuffCounter;
#endif
return CmdBuffer;
@@ -119,7 +119,7 @@ void VulkanCommandBufferPool::FreeCommandBuffer(VkCommandBuffer&& CmdBuffer)
std::lock_guard<std::mutex> Lock{m_Mutex};
m_CmdBuffers.emplace_back(CmdBuffer);
CmdBuffer = VK_NULL_HANDLE;
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
--m_BuffCounter;
#endif
}
diff --git a/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanFencePool.cpp b/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanFencePool.cpp
index b4d57a7c..5bb694b3 100644
--- a/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanFencePool.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanFencePool.cpp
@@ -39,7 +39,7 @@ VulkanFencePool::VulkanFencePool(std::shared_ptr<const VulkanLogicalDevice> Logi
VulkanFencePool::~VulkanFencePool()
{
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
for (const auto& fence : m_Fences)
{
DEV_CHECK_ERR(m_LogicalDevice->GetFenceStatus(fence) == VK_SUCCESS, "Destroying a fence that has not been signaled");
diff --git a/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanPhysicalDevice.cpp b/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanPhysicalDevice.cpp
index 11eb766d..22eee45e 100644
--- a/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanPhysicalDevice.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanPhysicalDevice.cpp
@@ -116,7 +116,7 @@ uint32_t VulkanPhysicalDevice::FindQueueFamily(VkQueueFlags QueueFlags) const
{
if (QueueFlags & (VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT))
{
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
const auto& Props = m_QueueFamilyProperties[FamilyInd];
// Queues supporting graphics and/or compute operations must report (1,1,1)
// in minImageTransferGranularity, meaning that there are no additional restrictions