diff options
| author | assiduous <assiduous@diligentgraphics.com> | 2020-03-26 18:40:00 +0000 |
|---|---|---|
| committer | assiduous <assiduous@diligentgraphics.com> | 2020-03-26 18:40:00 +0000 |
| commit | 09b9f1dc1ec69683c3143f309e6e8a0141361624 (patch) | |
| tree | b6f1a63031e72e09d313f681a311eb3043405441 /Graphics/GraphicsEngineD3D12 | |
| parent | Fixed latest MSVC (19.25.28610.4) build issue (diff) | |
| download | DiligentCore-09b9f1dc1ec69683c3143f309e6e8a0141361624.tar.gz DiligentCore-09b9f1dc1ec69683c3143f309e6e8a0141361624.zip | |
Renamed _DEBUG and DEVELOPMENT macros to DILGENT_DEBUG and DILIGENT_DEVELOPMENT
Diffstat (limited to 'Graphics/GraphicsEngineD3D12')
25 files changed, 101 insertions, 101 deletions
diff --git a/Graphics/GraphicsEngineD3D12/include/BufferD3D12Impl.hpp b/Graphics/GraphicsEngineD3D12/include/BufferD3D12Impl.hpp index e15e70f2..ab90dfe7 100644 --- a/Graphics/GraphicsEngineD3D12/include/BufferD3D12Impl.hpp +++ b/Graphics/GraphicsEngineD3D12/include/BufferD3D12Impl.hpp @@ -65,7 +65,7 @@ public: virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT void DvpVerifyDynamicAllocation(class DeviceContextD3D12Impl* pCtx) const; #endif @@ -92,7 +92,7 @@ public: { if (m_Desc.Usage == USAGE_DYNAMIC) { -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT DvpVerifyDynamicAllocation(pCtx); #endif return m_DynamicData[ContextId].GPUAddress; diff --git a/Graphics/GraphicsEngineD3D12/include/CommandContext.hpp b/Graphics/GraphicsEngineD3D12/include/CommandContext.hpp index 30134445..a8211db6 100644 --- a/Graphics/GraphicsEngineD3D12/include/CommandContext.hpp +++ b/Graphics/GraphicsEngineD3D12/include/CommandContext.hpp @@ -413,7 +413,7 @@ inline ComputeContext& CommandContext::AsComputeContext() inline void CommandContext::SetDescriptorHeaps(ShaderDescriptorHeaps& Heaps) { -#ifdef _DEBUG +#ifdef DILIGENT_DEBUG VERIFY(Heaps.pSrvCbvUavHeap != nullptr || Heaps.pSamplerHeap != nullptr, "At least one heap is expected to be set"); VERIFY(Heaps.pSrvCbvUavHeap == nullptr || Heaps.pSrvCbvUavHeap->GetDesc().Type == D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, "Invalid heap type provided in pSrvCbvUavHeap"); VERIFY(Heaps.pSamplerHeap == nullptr || Heaps.pSamplerHeap->GetDesc().Type == D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER, "Invalid heap type provided in pSamplerHeap"); diff --git a/Graphics/GraphicsEngineD3D12/include/CommandListManager.hpp b/Graphics/GraphicsEngineD3D12/include/CommandListManager.hpp index 6548a637..b9fe244c 100644 --- a/Graphics/GraphicsEngineD3D12/include/CommandListManager.hpp +++ b/Graphics/GraphicsEngineD3D12/include/CommandListManager.hpp @@ -58,7 +58,7 @@ public: // allocator void FreeAllocator(CComPtr<ID3D12CommandAllocator>&& Allocator); -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT Atomics::Long GetAllocatorCounter() const { return m_AllocatorCounter; @@ -73,7 +73,7 @@ private: Atomics::AtomicLong m_NumAllocators = 0; // For debug purposes only -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT Atomics::AtomicLong m_AllocatorCounter = 0; #endif }; diff --git a/Graphics/GraphicsEngineD3D12/include/D3D12DynamicHeap.hpp b/Graphics/GraphicsEngineD3D12/include/D3D12DynamicHeap.hpp index cc0b1a9e..636ae0a5 100644 --- a/Graphics/GraphicsEngineD3D12/include/D3D12DynamicHeap.hpp +++ b/Graphics/GraphicsEngineD3D12/include/D3D12DynamicHeap.hpp @@ -45,7 +45,7 @@ struct D3D12DynamicAllocation Uint64 _Size, void* _CPUAddress, D3D12_GPU_VIRTUAL_ADDRESS _GPUAddress -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT , Uint64 _DvpCtxFrameNumber #endif @@ -56,7 +56,7 @@ struct D3D12DynamicAllocation Size {_Size }, CPUAddress {_CPUAddress }, GPUAddress {_GPUAddress } -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT , DvpCtxFrameNumber(_DvpCtxFrameNumber) #endif // clang-format on @@ -67,7 +67,7 @@ struct D3D12DynamicAllocation Uint64 Size = 0; // Reserved size of this allocation void* CPUAddress = nullptr; // The CPU-writeable address D3D12_GPU_VIRTUAL_ADDRESS GPUAddress = 0; // The GPU-visible address -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT Uint64 DvpCtxFrameNumber = static_cast<Uint64>(-1); #endif }; @@ -141,7 +141,7 @@ public: D3D12DynamicPage AllocatePage(Uint64 SizeInBytes); -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT int32_t GetAllocatedPageCounter() const { return m_AllocatedPageCounter; @@ -155,7 +155,7 @@ private: using AvailablePagesMapElemType = std::pair<const Uint64, D3D12DynamicPage>; std::multimap<Uint64, D3D12DynamicPage, std::less<Uint64>, STDAllocatorRawMem<AvailablePagesMapElemType>> m_AvailablePages; -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT std::atomic_int32_t m_AllocatedPageCounter = 0; #endif }; diff --git a/Graphics/GraphicsEngineD3D12/include/DescriptorHeap.hpp b/Graphics/GraphicsEngineD3D12/include/DescriptorHeap.hpp index f1267e59..7a96bdc2 100644 --- a/Graphics/GraphicsEngineD3D12/include/DescriptorHeap.hpp +++ b/Graphics/GraphicsEngineD3D12/include/DescriptorHeap.hpp @@ -273,7 +273,7 @@ public: rhs.m_FirstCPUHandle.ptr = 0; rhs.m_FirstGPUHandle.ptr = 0; rhs.m_MaxAllocatedSize = 0; -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT m_AllocationsCounter.store(rhs.m_AllocationsCounter.load()); rhs.m_AllocationsCounter = 0; #endif @@ -298,7 +298,7 @@ public: size_t GetMaxAllocatedSize() const { return m_MaxAllocatedSize; } // clang-format on -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT int32_t DvpGetAllocationsCounter() const { return m_AllocationsCounter; @@ -337,7 +337,7 @@ private: size_t m_MaxAllocatedSize = 0; -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT std::atomic_int32_t m_AllocationsCounter = 0; #endif @@ -384,7 +384,7 @@ public: virtual void Free(DescriptorHeapAllocation&& Allocation, Uint64 CmdQueueMask) override final; virtual Uint32 GetDescriptorSize() const override final { return m_DescriptorSize; } -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT int32_t DvpGetTotalAllocationCount(); #endif @@ -483,7 +483,7 @@ public: Uint32 GetMaxStaticDescriptors() const { return m_HeapAllocationManager.GetMaxDescriptors(); } Uint32 GetMaxDynamicDescriptors() const { return m_DynamicAllocationsManager.GetMaxDescriptors(); } -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT int32_t DvpGetTotalAllocationCount() const { return m_HeapAllocationManager.DvpGetAllocationsCounter() + diff --git a/Graphics/GraphicsEngineD3D12/include/RenderDeviceD3D12Impl.hpp b/Graphics/GraphicsEngineD3D12/include/RenderDeviceD3D12Impl.hpp index 9790aa7c..d2ce5e0b 100644 --- a/Graphics/GraphicsEngineD3D12/include/RenderDeviceD3D12Impl.hpp +++ b/Graphics/GraphicsEngineD3D12/include/RenderDeviceD3D12Impl.hpp @@ -161,7 +161,7 @@ private: std::mutex m_ContextPoolMutex; std::vector<PooledCommandContext, STDAllocatorRawMem<PooledCommandContext>> m_ContextPool; -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT Atomics::AtomicLong m_AllocatedCtxCounter = 0; #endif diff --git a/Graphics/GraphicsEngineD3D12/include/RootSignature.hpp b/Graphics/GraphicsEngineD3D12/include/RootSignature.hpp index e723896a..cc7ae67f 100644 --- a/Graphics/GraphicsEngineD3D12/include/RootSignature.hpp +++ b/Graphics/GraphicsEngineD3D12/include/RootSignature.hpp @@ -99,7 +99,7 @@ public: m_RootParam.ShaderVisibility = Visibility; m_RootParam.DescriptorTable.NumDescriptorRanges = NumRanges; m_RootParam.DescriptorTable.pDescriptorRanges = pRanges; -#ifdef _DEBUG +#ifdef DILIGENT_DEBUG for (Uint32 r = 0; r < NumRanges; ++r) pRanges[r].RangeType = static_cast<D3D12_DESCRIPTOR_RANGE_TYPE>(-1); #endif @@ -133,7 +133,7 @@ public: DstTbl.pDescriptorRanges = pRanges; const auto& SrcTbl = RP.m_RootParam.DescriptorTable; memcpy(pRanges, SrcTbl.pDescriptorRanges, SrcTbl.NumDescriptorRanges * sizeof(D3D12_DESCRIPTOR_RANGE)); -#ifdef _DEBUG +#ifdef DILIGENT_DEBUG { Uint32 dbgTableSize = 0; for (Uint32 r = 0; r < SrcTbl.NumDescriptorRanges; ++r) @@ -375,11 +375,11 @@ public: } private: -#ifdef _DEBUG +#ifdef DILIGENT_DEBUG void dbgVerifyRootParameters() const; #endif -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT static void DvpVerifyResourceState(const ShaderResourceCacheD3D12::Resource& Res, D3D12_DESCRIPTOR_RANGE_TYPE RangeType); #endif @@ -533,7 +533,7 @@ void RootSignature::CommitRootViews(ShaderResourceCacheD3D12& ResourceCache, auto RootInd = RootView.GetRootIndex(); SHADER_TYPE dbgShaderType = SHADER_TYPE_UNKNOWN; -#ifdef _DEBUG +#ifdef DILIGENT_DEBUG { auto& Param = static_cast<const D3D12_ROOT_PARAMETER&>(RootView); VERIFY_EXPR(Param.ParameterType == D3D12_ROOT_PARAMETER_TYPE_CBV); @@ -549,7 +549,7 @@ void RootSignature::CommitRootViews(ShaderResourceCacheD3D12& ResourceCache, { if (IsDynamic) { -#ifdef _DEBUG +#ifdef DILIGENT_DEBUG if (pBuffToTransition->IsInKnownState()) { VERIFY(pBuffToTransition->CheckState(RESOURCE_STATE_CONSTANT_BUFFER), @@ -566,7 +566,7 @@ void RootSignature::CommitRootViews(ShaderResourceCacheD3D12& ResourceCache, CmdCtx.TransitionResource(pBuffToTransition, RESOURCE_STATE_CONSTANT_BUFFER); } } -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT else if (ValidateStates) { diff --git a/Graphics/GraphicsEngineD3D12/include/ShaderResourceBindingD3D12Impl.hpp b/Graphics/GraphicsEngineD3D12/include/ShaderResourceBindingD3D12Impl.hpp index 240366c5..09854e17 100644 --- a/Graphics/GraphicsEngineD3D12/include/ShaderResourceBindingD3D12Impl.hpp +++ b/Graphics/GraphicsEngineD3D12/include/ShaderResourceBindingD3D12Impl.hpp @@ -67,7 +67,7 @@ public: ShaderResourceCacheD3D12& GetResourceCache() { return m_ShaderResourceCache; } -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT void dvpVerifyResourceBindings(const PipelineStateD3D12Impl* pPSO) const; #endif diff --git a/Graphics/GraphicsEngineD3D12/include/ShaderResourceCacheD3D12.hpp b/Graphics/GraphicsEngineD3D12/include/ShaderResourceCacheD3D12.hpp index 9f24d2d4..1a0362ab 100644 --- a/Graphics/GraphicsEngineD3D12/include/ShaderResourceCacheD3D12.hpp +++ b/Graphics/GraphicsEngineD3D12/include/ShaderResourceCacheD3D12.hpp @@ -112,7 +112,7 @@ public: ShaderResourceCacheD3D12(DbgCacheContentType dbgContentType) // clang-format off -#ifdef _DEBUG +#ifdef DILIGENT_DEBUG : m_DbgContentType { dbgContentType @@ -183,7 +183,7 @@ public: // Offset from the start of the descriptor heap allocation to the start of the table Uint32 m_TableStartOffset = InvalidDescriptorOffset; -#ifdef _DEBUG +#ifdef DILIGENT_DEBUG void SetDebugAttribs(Uint32 MaxOffset, const D3D12_DESCRIPTOR_HEAP_TYPE dbgDescriptorHeapType, const SHADER_TYPE dbgRefShaderType) @@ -199,7 +199,7 @@ public: const Uint32 m_NumResources = 0; private: -#ifdef _DEBUG +#ifdef DILIGENT_DEBUG D3D12_DESCRIPTOR_HEAP_TYPE m_dbgHeapType = D3D12_DESCRIPTOR_HEAP_TYPE_NUM_TYPES; SHADER_TYPE m_dbgShaderType = SHADER_TYPE_UNKNOWN; #endif @@ -223,7 +223,7 @@ public: void SetDescriptorHeapSpace(DescriptorHeapAllocation&& CbcSrvUavHeapSpace, DescriptorHeapAllocation&& SamplerHeapSpace) { VERIFY(m_SamplerHeapSpace.GetCpuHandle().ptr == 0 && m_CbvSrvUavHeapSpace.GetCpuHandle().ptr == 0, "Space has already been allocated in GPU descriptor heaps"); -#ifdef _DEBUG +#ifdef DILIGENT_DEBUG Uint32 NumSamplerDescriptors = 0, NumSrvCbvUavDescriptors = 0; for (Uint32 rt = 0; rt < m_NumTables; ++rt) { @@ -319,7 +319,7 @@ public: // Returns the number of dynamic constant buffers bound in the cache regardless of their variable types Uint32 GetNumDynamicCBsBound() const { return m_NumDynamicCBsBound; } -#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 DbgVerifyBoundDynamicCBsCounter() const; @@ -345,7 +345,7 @@ private: // The number of the dynamic buffers bound in the resource cache regardless of their variable type Uint32 m_NumDynamicCBsBound = 0; -#ifdef _DEBUG +#ifdef DILIGENT_DEBUG // Only for debug purposes: indicates what types of resources are stored in the cache const DbgCacheContentType m_DbgContentType; #endif diff --git a/Graphics/GraphicsEngineD3D12/include/ShaderResourceLayoutD3D12.hpp b/Graphics/GraphicsEngineD3D12/include/ShaderResourceLayoutD3D12.hpp index 56889271..19c8afb7 100644 --- a/Graphics/GraphicsEngineD3D12/include/ShaderResourceLayoutD3D12.hpp +++ b/Graphics/GraphicsEngineD3D12/include/ShaderResourceLayoutD3D12.hpp @@ -239,7 +239,7 @@ public: const ShaderResourceLayoutD3D12& DstLayout, ShaderResourceCacheD3D12& DstCache) const; -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT bool dvpVerifyBindings(const ShaderResourceCacheD3D12& ResourceCache) const; #endif diff --git a/Graphics/GraphicsEngineD3D12/include/ShaderVariableD3D12.hpp b/Graphics/GraphicsEngineD3D12/include/ShaderVariableD3D12.hpp index deadc6d6..213748d9 100644 --- a/Graphics/GraphicsEngineD3D12/include/ShaderVariableD3D12.hpp +++ b/Graphics/GraphicsEngineD3D12/include/ShaderVariableD3D12.hpp @@ -119,7 +119,7 @@ private: ShaderVariableD3D12Impl* m_pVariables = nullptr; Uint32 m_NumVariables = 0; -#ifdef _DEBUG +#ifdef DILIGENT_DEBUG IMemoryAllocator& m_DbgAllocator; #endif // clang-format on diff --git a/Graphics/GraphicsEngineD3D12/src/BufferD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/BufferD3D12Impl.cpp index b1c4c8e8..a6e4a0c8 100644 --- a/Graphics/GraphicsEngineD3D12/src/BufferD3D12Impl.cpp +++ b/Graphics/GraphicsEngineD3D12/src/BufferD3D12Impl.cpp @@ -388,7 +388,7 @@ ID3D12Resource* BufferD3D12Impl::GetD3D12Buffer(Uint64& DataStartByteOffset, IDe { VERIFY(m_Desc.Usage == USAGE_DYNAMIC, "Dynamic buffer is expected"); auto* pCtxD3D12 = ValidatedCast<DeviceContextD3D12Impl>(pContext); -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT DvpVerifyDynamicAllocation(pCtxD3D12); #endif auto ContextId = pCtxD3D12->GetContextId(); @@ -397,7 +397,7 @@ ID3D12Resource* BufferD3D12Impl::GetD3D12Buffer(Uint64& DataStartByteOffset, IDe } } -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT void BufferD3D12Impl::DvpVerifyDynamicAllocation(DeviceContextD3D12Impl* pCtx) const { auto ContextId = pCtx->GetContextId(); diff --git a/Graphics/GraphicsEngineD3D12/src/CommandContext.cpp b/Graphics/GraphicsEngineD3D12/src/CommandContext.cpp index 253d2822..dded6b29 100644 --- a/Graphics/GraphicsEngineD3D12/src/CommandContext.cpp +++ b/Graphics/GraphicsEngineD3D12/src/CommandContext.cpp @@ -167,7 +167,7 @@ void CommandContext::TransitionResource(const StateTransitionDesc& Barrier) pd3d12Resource = pBufferD3D12Impl->GetD3D12Resource(); OldState = pBufferD3D12Impl->GetState(); -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT // Dynamic buffers wtih no SRV/UAV bind flags are suballocated in // the upload heap when Map() is called and must always be in // D3D12_RESOURCE_STATE_GENERIC_READ state diff --git a/Graphics/GraphicsEngineD3D12/src/CommandListManager.cpp b/Graphics/GraphicsEngineD3D12/src/CommandListManager.cpp index 53827add..f1099ac7 100644 --- a/Graphics/GraphicsEngineD3D12/src/CommandListManager.cpp +++ b/Graphics/GraphicsEngineD3D12/src/CommandListManager.cpp @@ -81,7 +81,7 @@ void CommandListManager::RequestAllocator(ID3D12CommandAllocator** ppAllocator) swprintf(AllocatorName, _countof(AllocatorName), L"Cmd list allocator %ld", Atomics::AtomicIncrement(m_NumAllocators) - 1); (*ppAllocator)->SetName(AllocatorName); } -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT Atomics::AtomicIncrement(m_AllocatorCounter); #endif } @@ -125,7 +125,7 @@ void CommandListManager::FreeAllocator(CComPtr<ID3D12CommandAllocator>&& Allocat { std::lock_guard<std::mutex> LockGuard(m_AllocatorMutex); m_FreeAllocators.emplace_back(std::move(Allocator)); -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT Atomics::AtomicDecrement(m_AllocatorCounter); #endif } diff --git a/Graphics/GraphicsEngineD3D12/src/D3D12DynamicHeap.cpp b/Graphics/GraphicsEngineD3D12/src/D3D12DynamicHeap.cpp index 2c010f84..98fb5ada 100644 --- a/Graphics/GraphicsEngineD3D12/src/D3D12DynamicHeap.cpp +++ b/Graphics/GraphicsEngineD3D12/src/D3D12DynamicHeap.cpp @@ -92,7 +92,7 @@ D3D12DynamicMemoryManager::D3D12DynamicMemoryManager(IMemoryAllocator& Allo D3D12DynamicPage D3D12DynamicMemoryManager::AllocatePage(Uint64 SizeInBytes) { std::lock_guard<std::mutex> AvailablePagesLock(m_AvailablePagesMtx); -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT ++m_AllocatedPageCounter; #endif auto PageIt = m_AvailablePages.lower_bound(SizeInBytes); // Returns an iterator pointing to the first element that is not less than key @@ -140,7 +140,7 @@ void D3D12DynamicMemoryManager::ReleasePages(std::vector<D3D12DynamicPage>& Page if (Mgr != nullptr) { std::lock_guard<std::mutex> Lock{Mgr->m_AvailablePagesMtx}; -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT --Mgr->m_AllocatedPageCounter; #endif auto PageSize = Page.GetSize(); @@ -238,7 +238,7 @@ D3D12DynamicAllocation D3D12DynamicHeap::Allocate(Uint64 SizeInBytes, Uint64 Ali SizeInBytes, CurrPage.GetCPUAddress(AlignedOffset), CurrPage.GetGPUAddress(AlignedOffset) -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT , DvpCtxFrameNumber #endif }; diff --git a/Graphics/GraphicsEngineD3D12/src/DescriptorHeap.cpp b/Graphics/GraphicsEngineD3D12/src/DescriptorHeap.cpp index be598856..48345745 100644 --- a/Graphics/GraphicsEngineD3D12/src/DescriptorHeap.cpp +++ b/Graphics/GraphicsEngineD3D12/src/DescriptorHeap.cpp @@ -122,7 +122,7 @@ DescriptorHeapAllocation DescriptorHeapAllocationManager::Allocate(uint32_t Coun m_MaxAllocatedSize = std::max(m_MaxAllocatedSize, m_FreeBlockManager.GetUsedSize()); -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT ++m_AllocationsCounter; #endif @@ -144,7 +144,7 @@ void DescriptorHeapAllocationManager::FreeAllocation(DescriptorHeapAllocation&& // Clear the allocation Allocation.Reset(); -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT --m_AllocationsCounter; #endif } @@ -196,7 +196,7 @@ CPUDescriptorHeap::~CPUDescriptorHeap() " (", std::fixed, std::setprecision(2), m_MaxSize * 100.0 / std::max(TotalDescriptors, 1u), "%)."); } -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT int32_t CPUDescriptorHeap::DvpGetTotalAllocationCount() { int32_t AllocationCount = 0; diff --git a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp index 582b8cad..f118bc98 100644 --- a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp +++ b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp @@ -317,7 +317,7 @@ void DeviceContextD3D12Impl::CommitD3D12IndexBuffer(GraphicsContext& GraphCtx, V //GraphicsCtx.AddReferencedObject(pd3d12Resource); bool IsDynamic = m_pIndexBuffer->GetDesc().Usage == USAGE_DYNAMIC; -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT if (IsDynamic) m_pIndexBuffer->DvpVerifyDynamicAllocation(this); #endif @@ -359,7 +359,7 @@ void DeviceContextD3D12Impl::CommitD3D12VertexBuffers(GraphicsContext& GraphCtx) if (pBufferD3D12->GetDesc().Usage == USAGE_DYNAMIC) { DynamicBufferPresent = true; -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT pBufferD3D12->DvpVerifyDynamicAllocation(this); #endif } @@ -390,7 +390,7 @@ void DeviceContextD3D12Impl::CommitD3D12VertexBuffers(GraphicsContext& GraphCtx) void DeviceContextD3D12Impl::PrepareForDraw(GraphicsContext& GraphCtx, DRAW_FLAGS Flags) { -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT if ((Flags & DRAW_FLAG_VERIFY_RENDER_TARGETS) != 0) DvpVerifyRenderTargets(); #endif @@ -400,7 +400,7 @@ void DeviceContextD3D12Impl::PrepareForDraw(GraphicsContext& GraphCtx, DRAW_FLAG CommitD3D12VertexBuffers(GraphCtx); } -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT if ((Flags & DRAW_FLAG_VERIFY_STATES) != 0) { for (Uint32 Buff = 0; Buff < m_NumVertexStreams; ++Buff) @@ -440,7 +440,7 @@ void DeviceContextD3D12Impl::PrepareForDraw(GraphicsContext& GraphCtx, DRAW_FLAG } } } -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT else { if (m_pPipelineState->ContainsShaderResources()) @@ -458,7 +458,7 @@ void DeviceContextD3D12Impl::PrepareForIndexedDraw(GraphicsContext& GraphCtx, DR { CommitD3D12IndexBuffer(GraphCtx, IndexType); } -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT if ((Flags & DRAW_FLAG_VERIFY_STATES) != 0) { DvpVerifyBufferState(*m_pIndexBuffer, RESOURCE_STATE_INDEX_BUFFER, "Indexed draw (DeviceContextD3D12Impl::Draw())"); @@ -497,7 +497,7 @@ void DeviceContextD3D12Impl::PrepareDrawIndirectBuffer(GraphicsContext& DEV_CHECK_ERR(pAttribsBuffer != nullptr, "Indirect draw attribs buffer must not be null"); auto* pIndirectDrawAttribsD3D12 = ValidatedCast<BufferD3D12Impl>(pAttribsBuffer); -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT if (pIndirectDrawAttribsD3D12->GetDesc().Usage == USAGE_DYNAMIC) pIndirectDrawAttribsD3D12->DvpVerifyDynamicAllocation(this); #endif @@ -563,7 +563,7 @@ void DeviceContextD3D12Impl::PrepareForDispatchCompute(ComputeContext& ComputeCt ); } } -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT else { if (m_pPipelineState->ContainsShaderResources()) @@ -593,7 +593,7 @@ void DeviceContextD3D12Impl::DispatchComputeIndirect(const DispatchComputeIndire auto* pBufferD3D12 = ValidatedCast<BufferD3D12Impl>(pAttribsBuffer); -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT if (pBufferD3D12->GetDesc().Usage == USAGE_DYNAMIC) pBufferD3D12->DvpVerifyDynamicAllocation(this); #endif @@ -712,7 +712,7 @@ void DeviceContextD3D12Impl::Flush() void DeviceContextD3D12Impl::FinishFrame() { -#ifdef _DEBUG +#ifdef DILIGENT_DEBUG for (const auto& MappedBuffIt : m_DbgMappedBuffers) { const auto& BuffDesc = MappedBuffIt.first->GetDesc(); @@ -1302,7 +1302,7 @@ void DeviceContextD3D12Impl::CopyTextureRegion(ID3D12Resource* pd { StateTransitionRequired = TextureD3D12.IsInKnownState() && !TextureD3D12.CheckState(RESOURCE_STATE_COPY_DEST); } -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT else if (TextureTransitionMode == RESOURCE_STATE_TRANSITION_MODE_VERIFY) { DvpVerifyTextureState(TextureD3D12, RESOURCE_STATE_COPY_DEST, "Using texture as copy destination (DeviceContextD3D12Impl::CopyTextureRegion)"); @@ -1337,7 +1337,7 @@ void DeviceContextD3D12Impl::CopyTextureRegion(ID3D12Resource* pd Footprint.Footprint.RowPitch = static_cast<UINT>(SrcStride); -#ifdef _DEBUG +#ifdef DILIGENT_DEBUG { const auto& FmtAttribs = GetTextureFormatAttribs(TexDesc.Format); const Uint32 RowCount = std::max((Footprint.Footprint.Height / FmtAttribs.BlockHeight), 1u); @@ -1388,7 +1388,7 @@ void DeviceContextD3D12Impl::CopyTextureRegion(IBuffer* pS if (pBufferD3D12->IsInKnownState() && pBufferD3D12->GetState() != RESOURCE_STATE_GENERIC_READ) GetCmdContext().TransitionResource(pBufferD3D12, RESOURCE_STATE_GENERIC_READ); } -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT else if (BufferTransitionMode == RESOURCE_STATE_TRANSITION_MODE_VERIFY) { DvpVerifyBufferState(*pBufferD3D12, RESOURCE_STATE_COPY_SOURCE, "Using buffer as copy source (DeviceContextD3D12Impl::CopyTextureRegion)"); @@ -1447,7 +1447,7 @@ void DeviceContextD3D12Impl::UpdateTextureRegion(const void* const auto& TexDesc = TextureD3D12.GetDesc(); auto UploadSpace = AllocateTextureUploadSpace(TexDesc.Format, DstBox); auto UpdateRegionDepth = DstBox.MaxZ - DstBox.MinZ; -#ifdef _DEBUG +#ifdef DILIGENT_DEBUG { VERIFY(SrcStride >= UploadSpace.RowSize, "Source data stride (", SrcStride, ") is below the image row size (", UploadSpace.RowSize, ")"); const Uint32 PlaneSize = SrcStride * UploadSpace.RowCount; @@ -1732,7 +1732,7 @@ void DeviceContextD3D12Impl::TransitionResourceStates(Uint32 BarrierCount, State auto& CmdCtx = GetCmdContext(); for (Uint32 i = 0; i < BarrierCount; ++i) { -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT DvpVerifyStateTransitionDesc(pResourceBarriers[i]); #endif CmdCtx.TransitionResource(pResourceBarriers[i]); @@ -1750,7 +1750,7 @@ void DeviceContextD3D12Impl::TransitionOrVerifyBufferState(CommandContext& if (Buffer.IsInKnownState() && !Buffer.CheckState(RequiredState)) CmdCtx.TransitionResource(&Buffer, RequiredState); } -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT else if (TransitionMode == RESOURCE_STATE_TRANSITION_MODE_VERIFY) { DvpVerifyBufferState(Buffer, RequiredState, OperationName); @@ -1769,7 +1769,7 @@ void DeviceContextD3D12Impl::TransitionOrVerifyTextureState(CommandContext& if (Texture.IsInKnownState() && !Texture.CheckState(RequiredState)) CmdCtx.TransitionResource(&Texture, RequiredState); } -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT else if (TransitionMode == RESOURCE_STATE_TRANSITION_MODE_VERIFY) { DvpVerifyTextureState(Texture, RequiredState, OperationName); diff --git a/Graphics/GraphicsEngineD3D12/src/PipelineStateD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/PipelineStateD3D12Impl.cpp index c2fa083c..467ed491 100644 --- a/Graphics/GraphicsEngineD3D12/src/PipelineStateD3D12Impl.cpp +++ b/Graphics/GraphicsEngineD3D12/src/PipelineStateD3D12Impl.cpp @@ -92,7 +92,7 @@ PipelineStateD3D12Impl::PipelineStateD3D12Impl(IReferenceCounters* pRefCoun m_pStaticVarManagers = ALLOCATE(ShaderVarMgrAllocator, "Raw memory for ShaderVariableManagerD3D12", ShaderVariableManagerD3D12, m_NumShaders); } -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT { const ShaderResources* pResources[MAX_SHADERS_IN_PIPELINE] = {}; for (Uint32 s = 0; s < m_NumShaders; ++s) @@ -348,7 +348,7 @@ bool PipelineStateD3D12Impl::IsCompatibleWith(const IPipelineState* pPSO) const auto IsSameRootSignature = m_RootSig.IsSameAs(pPSOD3D12->m_RootSig); -#ifdef _DEBUG +#ifdef DILIGENT_DEBUG { bool IsCompatibleShaders = true; if (m_NumShaders != pPSOD3D12->m_NumShaders) @@ -387,7 +387,7 @@ ShaderResourceCacheD3D12* PipelineStateD3D12Impl::CommitAndTransitionShaderResou class CommandContext& CmdCtx, CommitAndTransitionResourcesAttribs& Attrib) const { -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT if (Attrib.pShaderResourceBinding == nullptr && ContainsShaderResources()) { LOG_ERROR_MESSAGE("Pipeline state '", m_Desc.Name, "' requires shader resource binding object to ", @@ -408,7 +408,7 @@ ShaderResourceCacheD3D12* PipelineStateD3D12Impl::CommitAndTransitionShaderResou return nullptr; } -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT if (IsIncompatibleWith(pResBindingD3D12Impl->GetPipelineState())) { LOG_ERROR_MESSAGE("Shader resource binding is incompatible with the pipeline state '", m_Desc.Name, "'. Operation will be ignored."); diff --git a/Graphics/GraphicsEngineD3D12/src/QueryManagerD3D12.cpp b/Graphics/GraphicsEngineD3D12/src/QueryManagerD3D12.cpp index e27d6be6..2391e2a6 100644 --- a/Graphics/GraphicsEngineD3D12/src/QueryManagerD3D12.cpp +++ b/Graphics/GraphicsEngineD3D12/src/QueryManagerD3D12.cpp @@ -183,7 +183,7 @@ void QueryManagerD3D12::ReleaseQuery(QUERY_TYPE Type, Uint32 Index) auto& HeapInfo = m_Heaps[Type]; VERIFY(Index < HeapInfo.HeapSize, "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/GraphicsEngineD3D12/src/RenderDeviceD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/RenderDeviceD3D12Impl.cpp index 781a711d..e86c0373 100644 --- a/Graphics/GraphicsEngineD3D12/src/RenderDeviceD3D12Impl.cpp +++ b/Graphics/GraphicsEngineD3D12/src/RenderDeviceD3D12Impl.cpp @@ -207,7 +207,7 @@ RenderDeviceD3D12Impl::~RenderDeviceD3D12Impl() IdleGPU(); ReleaseStaleResources(true); -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT for (auto i = 0; i < _countof(m_CPUDescriptorHeaps); ++i) { DEV_CHECK_ERR(m_CPUDescriptorHeaps[i].DvpGetTotalAllocationCount() == 0, "All CPU descriptor heap allocations must be released"); @@ -240,7 +240,7 @@ void RenderDeviceD3D12Impl::FreeCommandContext(PooledCommandContext&& Ctx) { std::lock_guard<std::mutex> LockGuard(m_ContextPoolMutex); m_ContextPool.emplace_back(std::move(Ctx)); -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT Atomics::AtomicDecrement(m_AllocatedCtxCounter); #endif } @@ -339,7 +339,7 @@ RenderDeviceD3D12Impl::PooledCommandContext RenderDeviceD3D12Impl::AllocateComma m_ContextPool.pop_back(); Ctx->Reset(m_CmdListManager); Ctx->SetID(ID); -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT Atomics::AtomicIncrement(m_AllocatedCtxCounter); #endif return Ctx; @@ -350,7 +350,7 @@ RenderDeviceD3D12Impl::PooledCommandContext RenderDeviceD3D12Impl::AllocateComma auto* pRawMem = ALLOCATE(CmdCtxAllocator, "CommandContext instance", CommandContext, 1); auto pCtx = new (pRawMem) CommandContext(m_CmdListManager); pCtx->SetID(ID); -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT Atomics::AtomicIncrement(m_AllocatedCtxCounter); #endif return PooledCommandContext(pCtx, CmdCtxAllocator); diff --git a/Graphics/GraphicsEngineD3D12/src/RootSignature.cpp b/Graphics/GraphicsEngineD3D12/src/RootSignature.cpp index 33978eaf..958df523 100644 --- a/Graphics/GraphicsEngineD3D12/src/RootSignature.cpp +++ b/Graphics/GraphicsEngineD3D12/src/RootSignature.cpp @@ -189,7 +189,7 @@ D3D12_SHADER_VISIBILITY GetShaderVisibility(SHADER_TYPE ShaderType) { auto ShaderInd = GetShaderTypeIndex(ShaderType); auto ShaderVisibility = ShaderTypeInd2ShaderVisibilityMap[ShaderInd]; -#ifdef _DEBUG +#ifdef DILIGENT_DEBUG switch (ShaderType) { // clang-format off @@ -222,7 +222,7 @@ SHADER_TYPE ShaderTypeFromShaderVisibility(D3D12_SHADER_VISIBILITY ShaderVisibil { VERIFY_EXPR(ShaderVisibility >= D3D12_SHADER_VISIBILITY_ALL && ShaderVisibility <= D3D12_SHADER_VISIBILITY_PIXEL); auto ShaderType = ShaderVisibility2ShaderTypeMap[ShaderVisibility]; -#ifdef _DEBUG +#ifdef DILIGENT_DEBUG switch (ShaderVisibility) { // clang-format off @@ -254,7 +254,7 @@ D3D12_DESCRIPTOR_HEAP_TYPE HeapTypeFromRangeType(D3D12_DESCRIPTOR_RANGE_TYPE Ran VERIFY_EXPR(RangeType >= D3D12_DESCRIPTOR_RANGE_TYPE_SRV && RangeType <= D3D12_DESCRIPTOR_RANGE_TYPE_SAMPLER); auto HeapType = RangeType2HeapTypeMap[RangeType]; -#ifdef _DEBUG +#ifdef DILIGENT_DEBUG switch (RangeType) { // clang-format off @@ -367,7 +367,7 @@ void RootSignature::AllocateResourceSlot(SHADER_TYPE ShaderT } -#ifdef _DEBUG +#ifdef DILIGENT_DEBUG void RootSignature::dbgVerifyRootParameters() const { Uint32 dbgTotalSrvCbvUavSlots = 0; @@ -473,7 +473,7 @@ void RootSignature::Finalize(ID3D12Device* pd3d12Device) ++m_TotalRootViews[RootView.GetShaderVariableType()]; } -#ifdef _DEBUG +#ifdef DILIGENT_DEBUG dbgVerifyRootParameters(); #endif @@ -645,7 +645,7 @@ void RootSignature::InitResourceCache(RenderDeviceD3D12Impl* pDeviceD3D12Impl auto& RootTableCache = ResourceCache.GetRootTable(RootParam.GetRootIndex()); SHADER_TYPE dbgShaderType = SHADER_TYPE_UNKNOWN; -#ifdef _DEBUG +#ifdef DILIGENT_DEBUG dbgShaderType = ShaderTypeFromShaderVisibility(D3D12RootParam.ShaderVisibility); #endif VERIFY_EXPR(D3D12RootParam.ParameterType == D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE); @@ -655,7 +655,7 @@ void RootSignature::InitResourceCache(RenderDeviceD3D12Impl* pDeviceD3D12Impl auto HeapType = HeapTypeFromRangeType(D3D12RootParam.DescriptorTable.pDescriptorRanges[0].RangeType); -#ifdef _DEBUG +#ifdef DILIGENT_DEBUG RootTableCache.SetDebugAttribs(TableSize, HeapType, dbgShaderType); #endif @@ -679,7 +679,7 @@ void RootSignature::InitResourceCache(RenderDeviceD3D12Impl* pDeviceD3D12Impl } } -#ifdef _DEBUG +#ifdef DILIGENT_DEBUG for (Uint32 rv = 0; rv < m_RootParams.GetNumRootViews(); ++rv) { auto& RootParam = m_RootParams.GetRootView(rv); @@ -776,7 +776,7 @@ __forceinline void TransitionResource(CommandContext& Ctx, } -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT void RootSignature::DvpVerifyResourceState(const ShaderResourceCacheD3D12::Resource& Res, D3D12_DESCRIPTOR_RANGE_TYPE RangeType) { @@ -872,7 +872,7 @@ void RootSignature::DvpVerifyResourceState(const ShaderResourceCacheD3D12::Resou VERIFY(Res.pObject == nullptr && Res.CPUDescriptorHandle.ptr == 0, "Bound resource is unexpected"); } } -#endif // DEVELOPMENT +#endif // DILIGENT_DEVELOPMENT template <class TOperation> __forceinline void RootSignature::RootParamsManager::ProcessRootTables(TOperation Operation) const @@ -889,7 +889,7 @@ __forceinline void RootSignature::RootParamsManager::ProcessRootTables(TOperatio VERIFY(d3d12Table.NumDescriptorRanges > 0 && RootTable.GetDescriptorTableSize() > 0, "Unexepected empty descriptor table"); bool IsResourceTable = d3d12Table.pDescriptorRanges[0].RangeType != D3D12_DESCRIPTOR_RANGE_TYPE_SAMPLER; D3D12_DESCRIPTOR_HEAP_TYPE dbgHeapType = D3D12_DESCRIPTOR_HEAP_TYPE_NUM_TYPES; -#ifdef _DEBUG +#ifdef DILIGENT_DEBUG dbgHeapType = IsResourceTable ? D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV : D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER; #endif Operation(RootInd, RootTable, D3D12Param, IsResourceTable, dbgHeapType); @@ -909,7 +909,7 @@ __forceinline void ProcessCachedTableResources(Uint32 RootI for (UINT d = 0; d < range.NumDescriptors; ++d) { SHADER_TYPE dbgShaderType = SHADER_TYPE_UNKNOWN; -#ifdef _DEBUG +#ifdef DILIGENT_DEBUG dbgShaderType = ShaderTypeFromShaderVisibility(D3D12Param.ShaderVisibility); VERIFY(dbgHeapType == HeapTypeFromRangeType(range.RangeType), "Mistmatch between descriptor heap type and descriptor range type"); #endif @@ -1016,7 +1016,7 @@ void RootSignature::CommitDescriptorHandlesInternal_SMD(RenderDeviceD3D12Impl* { TransitionResource(Ctx, Res, range.RangeType); } -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT else if (ValidateStates) { DvpVerifyResourceState(Res, range.RangeType); @@ -1033,7 +1033,7 @@ void RootSignature::CommitDescriptorHandlesInternal_SMD(RenderDeviceD3D12Impl* { pd3d12Device->CopyDescriptorsSimple(1, DynamicCbvSrvUavDescriptors.GetCpuHandle(DynamicCbvSrvUavTblOffset), Res.CPUDescriptorHandle, D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV); } -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT else { LOG_ERROR_MESSAGE("No valid CbvSrvUav descriptor handle found for root parameter ", RootInd, ", descriptor slot ", OffsetFromTableStart); @@ -1050,7 +1050,7 @@ void RootSignature::CommitDescriptorHandlesInternal_SMD(RenderDeviceD3D12Impl* { pd3d12Device->CopyDescriptorsSimple(1, DynamicSamplerDescriptors.GetCpuHandle(DynamicSamplerTblOffset), Res.CPUDescriptorHandle, D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER); } -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT else { LOG_ERROR_MESSAGE("No valid sampler descriptor handle found for root parameter ", RootInd, ", descriptor slot ", OffsetFromTableStart); @@ -1108,7 +1108,7 @@ void RootSignature::CommitDescriptorHandlesInternal_SM(RenderDeviceD3D12Impl* } // ); } -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT else if (ValidateStates) { ProcessCachedTableResources( diff --git a/Graphics/GraphicsEngineD3D12/src/ShaderResourceBindingD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/ShaderResourceBindingD3D12Impl.cpp index 93d444d7..19ad36bc 100644 --- a/Graphics/GraphicsEngineD3D12/src/ShaderResourceBindingD3D12Impl.cpp +++ b/Graphics/GraphicsEngineD3D12/src/ShaderResourceBindingD3D12Impl.cpp @@ -155,7 +155,7 @@ IShaderResourceVariable* ShaderResourceBindingD3D12Impl::GetVariableByIndex(SHAD } -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT void ShaderResourceBindingD3D12Impl::dvpVerifyResourceBindings(const PipelineStateD3D12Impl* pPSO) const { auto* pRefPSO = GetPipelineState<const PipelineStateD3D12Impl>(); @@ -170,7 +170,7 @@ void ShaderResourceBindingD3D12Impl::dvpVerifyResourceBindings(const PipelineSta const auto& ShaderResLayout = pRefPSO->GetShaderResLayout(l); ShaderResLayout.dvpVerifyBindings(m_ShaderResourceCache); } -# ifdef _DEBUG +# ifdef DILIGENT_DEBUG m_ShaderResourceCache.DbgVerifyBoundDynamicCBsCounter(); # endif } @@ -203,7 +203,7 @@ void ShaderResourceBindingD3D12Impl::InitializeStaticResources(const IPipelineSt const auto& ShaderResLayout = pPSO12->GetShaderResLayout(s); auto& StaticResLayout = pPSO12->GetStaticShaderResLayout(s); auto& StaticResCache = pPSO12->GetStaticShaderResCache(s); -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT if (!StaticResLayout.dvpVerifyBindings(StaticResCache)) { auto* pShader = pPSO12->GetShader<ShaderD3D12Impl>(s); @@ -217,7 +217,7 @@ void ShaderResourceBindingD3D12Impl::InitializeStaticResources(const IPipelineSt StaticResLayout.CopyStaticResourceDesriptorHandles(StaticResCache, ShaderResLayout, m_ShaderResourceCache); } -#ifdef _DEBUG +#ifdef DILIGENT_DEBUG m_ShaderResourceCache.DbgVerifyBoundDynamicCBsCounter(); #endif diff --git a/Graphics/GraphicsEngineD3D12/src/ShaderResourceCacheD3D12.cpp b/Graphics/GraphicsEngineD3D12/src/ShaderResourceCacheD3D12.cpp index 482443a7..a5224fb3 100644 --- a/Graphics/GraphicsEngineD3D12/src/ShaderResourceCacheD3D12.cpp +++ b/Graphics/GraphicsEngineD3D12/src/ShaderResourceCacheD3D12.cpp @@ -99,7 +99,7 @@ ShaderResourceCacheD3D12::~ShaderResourceCacheD3D12() } } -#ifdef _DEBUG +#ifdef DILIGENT_DEBUG void ShaderResourceCacheD3D12::DbgVerifyBoundDynamicCBsCounter() const { Uint32 NumDynamicCBsBound = 0; diff --git a/Graphics/GraphicsEngineD3D12/src/ShaderResourceLayoutD3D12.cpp b/Graphics/GraphicsEngineD3D12/src/ShaderResourceLayoutD3D12.cpp index ce7c81f8..66f6c1d7 100644 --- a/Graphics/GraphicsEngineD3D12/src/ShaderResourceLayoutD3D12.cpp +++ b/Graphics/GraphicsEngineD3D12/src/ShaderResourceLayoutD3D12.cpp @@ -293,7 +293,7 @@ ShaderResourceLayoutD3D12::ShaderResourceLayoutD3D12(IObject& if (StaticSamplerInd >= 0) { // Static samplers are never copied, and SamplerId == InvalidSamplerId -#ifdef _DEBUG +#ifdef DILIGENT_DEBUG auto SamplerCount = GetTotalSamplerCount(); for (Uint32 s = 0; s < SamplerCount; ++s) { @@ -346,7 +346,7 @@ ShaderResourceLayoutD3D12::ShaderResourceLayoutD3D12(IObject& } // ); -#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(CurrCbvSrvUav[VarType] == CbvSrvUavCount[VarType], "Not all Srv/Cbv/Uavs are initialized, which result in a crash when dtor is called"); @@ -361,7 +361,7 @@ ShaderResourceLayoutD3D12::ShaderResourceLayoutD3D12(IObject& // http://diligentgraphics.com/diligent-engine/architecture/d3d12/shader-resource-cache#Initializing-Shader-Objects VERIFY_EXPR(pRootSig == nullptr); pResourceCache->Initialize(GetRawAllocator(), _countof(StaticResCacheTblSizes), StaticResCacheTblSizes); -#ifdef _DEBUG +#ifdef DILIGENT_DEBUG pResourceCache->GetRootTable(D3D12_DESCRIPTOR_RANGE_TYPE_SRV).SetDebugAttribs(StaticResCacheTblSizes[D3D12_DESCRIPTOR_RANGE_TYPE_SRV], D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, m_pResources->GetShaderType()); pResourceCache->GetRootTable(D3D12_DESCRIPTOR_RANGE_TYPE_UAV).SetDebugAttribs(StaticResCacheTblSizes[D3D12_DESCRIPTOR_RANGE_TYPE_UAV], D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, m_pResources->GetShaderType()); pResourceCache->GetRootTable(D3D12_DESCRIPTOR_RANGE_TYPE_CBV).SetDebugAttribs(StaticResCacheTblSizes[D3D12_DESCRIPTOR_RANGE_TYPE_CBV], D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, m_pResources->GetShaderType()); @@ -382,7 +382,7 @@ void ShaderResourceLayoutD3D12::D3D12Resource::CacheCB(IDeviceObject* // We cannot use ValidatedCast<> here as the resource retrieved from the // resource mapping can be of wrong type RefCntAutoPtr<BufferD3D12Impl> pBuffD3D12(pBuffer, IID_BufferD3D12); -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT VerifyConstantBufferBinding(Attribs, GetVariableType(), ArrayInd, pBuffer, pBuffD3D12.RawPtr(), DstRes.pObject.RawPtr(), ParentResLayout.GetShaderName()); #endif if (pBuffD3D12) @@ -451,7 +451,7 @@ void ShaderResourceLayoutD3D12::D3D12Resource::CacheResourceView(IDeviceObject* // We cannot use ValidatedCast<> here as the resource retrieved from the // resource mapping can be of wrong type RefCntAutoPtr<TResourceViewType> pViewD3D12(pView, ResourceViewTraits<TResourceViewType>::IID); -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT VerifyResourceViewBinding(Attribs, GetVariableType(), ArrayIndex, pView, pViewD3D12.RawPtr(), {dbgExpectedViewType}, DstRes.pObject.RawPtr(), ParentResLayout.GetShaderName()); #endif if (pViewD3D12) @@ -563,7 +563,7 @@ void ShaderResourceLayoutD3D12::D3D12Resource::BindResource(IDeviceObject* ResourceCache.GetShaderVisibleTableCPUDescriptorHandle<D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER>(RootIndex, OffsetFromTableStart + ArrayIndex) : ResourceCache.GetShaderVisibleTableCPUDescriptorHandle<D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV>(RootIndex, OffsetFromTableStart + ArrayIndex); -#ifdef _DEBUG +#ifdef DILIGENT_DEBUG { if (ResourceCache.DbgGetContentType() == ShaderResourceCacheD3D12::DbgCacheContentType::StaticShaderResources) { @@ -613,7 +613,7 @@ void ShaderResourceLayoutD3D12::D3D12Resource::BindResource(IDeviceObject* auto ShdrVisibleSamplerHeapCPUDescriptorHandle = ResourceCache.GetShaderVisibleTableCPUDescriptorHandle<D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER>(Sam.RootIndex, Sam.OffsetFromTableStart + SamplerArrInd); auto& DstSam = ResourceCache.GetRootTable(Sam.RootIndex).GetResource(Sam.OffsetFromTableStart + SamplerArrInd, D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER, ParentResLayout.m_pResources->GetShaderType()); -#ifdef _DEBUG +#ifdef DILIGENT_DEBUG { if (ResourceCache.DbgGetContentType() == ShaderResourceCacheD3D12::DbgCacheContentType::StaticShaderResources) { @@ -828,7 +828,7 @@ void ShaderResourceLayoutD3D12::CopyStaticResourceDesriptorHandles(const ShaderR } -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT bool ShaderResourceLayoutD3D12::dvpVerifyBindings(const ShaderResourceCacheD3D12& ResourceCache) const { bool BindingsOK = true; @@ -874,7 +874,7 @@ bool ShaderResourceLayoutD3D12::dvpVerifyBindings(const ShaderResourceCacheD3D12 } } -# ifdef _DEBUG +# ifdef DILIGENT_DEBUG { const auto ShdrVisibleHeapCPUDescriptorHandle = ResourceCache.GetShaderVisibleTableCPUDescriptorHandle<D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV>(res.RootIndex, res.OffsetFromTableStart + ArrInd); if (ResourceCache.DbgGetContentType() == ShaderResourceCacheD3D12::DbgCacheContentType::StaticShaderResources) @@ -923,7 +923,7 @@ bool ShaderResourceLayoutD3D12::dvpVerifyBindings(const ShaderResourceCacheD3D12 BindingsOK = false; } -# ifdef _DEBUG +# ifdef DILIGENT_DEBUG { const auto ShdrVisibleHeapCPUDescriptorHandle = ResourceCache.GetShaderVisibleTableCPUDescriptorHandle<D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER>(SamInfo.RootIndex, SamInfo.OffsetFromTableStart + ArrInd); if (ResourceCache.DbgGetContentType() == ShaderResourceCacheD3D12::DbgCacheContentType::StaticShaderResources) diff --git a/Graphics/GraphicsEngineD3D12/src/ShaderVariableD3D12.cpp b/Graphics/GraphicsEngineD3D12/src/ShaderVariableD3D12.cpp index 1c825a15..f7c23096 100644 --- a/Graphics/GraphicsEngineD3D12/src/ShaderVariableD3D12.cpp +++ b/Graphics/GraphicsEngineD3D12/src/ShaderVariableD3D12.cpp @@ -63,7 +63,7 @@ ShaderVariableManagerD3D12::ShaderVariableManagerD3D12(IObject& // clang-format off m_Owner {Owner}, m_ResourceCache {ResourceCache} -#ifdef _DEBUG +#ifdef DILIGENT_DEBUG , m_DbgAllocator {Allocator} #endif // clang-format on |
