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/GraphicsEngineD3D11 | |
| 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/GraphicsEngineD3D11')
12 files changed, 82 insertions, 74 deletions
diff --git a/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.hpp b/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.hpp index 987faccc..f8db6f23 100644 --- a/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.hpp +++ b/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.hpp @@ -39,7 +39,7 @@ #include "QueryD3D11Impl.hpp" #include "DisjointQueryPool.hpp" -#ifdef _DEBUG +#ifdef DILIGENT_DEBUG # define VERIFY_CONTEXT_BINDINGS #endif diff --git a/Graphics/GraphicsEngineD3D11/include/EngineD3D11Defines.h b/Graphics/GraphicsEngineD3D11/include/EngineD3D11Defines.h index b17cf359..0e62e63f 100644 --- a/Graphics/GraphicsEngineD3D11/include/EngineD3D11Defines.h +++ b/Graphics/GraphicsEngineD3D11/include/EngineD3D11Defines.h @@ -27,6 +27,6 @@ #pragma once -#ifdef _DEBUG +#ifdef DILIGENT_DEBUG # define VERIFY_SHADER_BINDINGS #endif diff --git a/Graphics/GraphicsEngineD3D11/include/ShaderResourceCacheD3D11.hpp b/Graphics/GraphicsEngineD3D11/include/ShaderResourceCacheD3D11.hpp index 4c7e2c69..dc70eec1 100644 --- a/Graphics/GraphicsEngineD3D11/include/ShaderResourceCacheD3D11.hpp +++ b/Graphics/GraphicsEngineD3D11/include/ShaderResourceCacheD3D11.hpp @@ -327,7 +327,7 @@ private: Uint8* m_pResourceData = nullptr; -#ifdef _DEBUG +#ifdef DILIGENT_DEBUG IMemoryAllocator* m_pdbgMemoryAllocator = nullptr; #endif }; diff --git a/Graphics/GraphicsEngineD3D11/include/ShaderResourceLayoutD3D11.hpp b/Graphics/GraphicsEngineD3D11/include/ShaderResourceLayoutD3D11.hpp index 6325d3c6..4b4d13b2 100644 --- a/Graphics/GraphicsEngineD3D11/include/ShaderResourceLayoutD3D11.hpp +++ b/Graphics/GraphicsEngineD3D11/include/ShaderResourceLayoutD3D11.hpp @@ -259,7 +259,7 @@ public: // while Layout is alive void BindResources(IResourceMapping* pResourceMapping, Uint32 Flags, const ShaderResourceCacheD3D11& dbgResourceCache); -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT bool dvpVerifyBindings() const; #endif diff --git a/Graphics/GraphicsEngineD3D11/include/ShaderResourcesD3D11.hpp b/Graphics/GraphicsEngineD3D11/include/ShaderResourcesD3D11.hpp index 6fe91203..ce0e0478 100644 --- a/Graphics/GraphicsEngineD3D11/include/ShaderResourcesD3D11.hpp +++ b/Graphics/GraphicsEngineD3D11/include/ShaderResourcesD3D11.hpp @@ -111,7 +111,7 @@ public: __forceinline Int32 GetMaxUAVBindPoint() const { return m_MaxUAVBindPoint; } // clang-format on -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT void dvpVerifyCommittedResources(ID3D11Buffer* CommittedD3D11CBs[], ID3D11ShaderResourceView* CommittedD3D11SRVs[], ID3D11Resource* CommittedD3D11SRVResources[], diff --git a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp index f7e8c886..0ff2227d 100755 --- a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp +++ b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp @@ -173,7 +173,7 @@ void DeviceContextD3D11Impl::TransitionAndCommitShaderResources(IPipelineState* if (pShaderResourceBinding == nullptr)
{
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
bool ResourcesPresent = false;
for (Uint32 s = 0; s < pPipelineStateD3D11->GetNumShaders(); ++s)
{
@@ -193,7 +193,7 @@ void DeviceContextD3D11Impl::TransitionAndCommitShaderResources(IPipelineState* auto pShaderResBindingD3D11 = ValidatedCast<ShaderResourceBindingD3D11Impl>(pShaderResourceBinding);
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
if (pPipelineStateD3D11->IsIncompatibleWith(pShaderResourceBinding->GetPipelineState()))
{
LOG_ERROR_MESSAGE("Shader resource binding does not match Pipeline State");
@@ -204,18 +204,20 @@ void DeviceContextD3D11Impl::TransitionAndCommitShaderResources(IPipelineState* auto NumShaders = pShaderResBindingD3D11->GetNumActiveShaders();
VERIFY(NumShaders == pPipelineStateD3D11->GetNumShaders(), "Number of active shaders in shader resource binding is not consistent with the number of shaders in the pipeline state");
-#ifdef DEVELOPMENT
- bool StaticResourcesPresent = false;
- for (Uint32 s = 0; s < NumShaders; ++s)
- {
- const auto& StaticResLayout = pPipelineStateD3D11->GetStaticResourceLayout(s);
- if (StaticResLayout.GetTotalResourceCount() > 0)
- StaticResourcesPresent = true;
- }
- // Static resource bindings are verified in BindStaticShaderResources()
- if (StaticResourcesPresent && !pShaderResBindingD3D11->IsStaticResourcesBound())
+#ifdef DILIGENT_DEVELOPMENT
{
- LOG_ERROR_MESSAGE("Static resources have not been initialized in the shader resource binding object being committed for PSO '", pPSO->GetDesc().Name, "'. Please call IShaderResourceBinding::InitializeStaticResources().");
+ bool StaticResourcesPresent = false;
+ for (Uint32 s = 0; s < NumShaders; ++s)
+ {
+ const auto& StaticResLayout = pPipelineStateD3D11->GetStaticResourceLayout(s);
+ if (StaticResLayout.GetTotalResourceCount() > 0)
+ StaticResourcesPresent = true;
+ }
+ // Static resource bindings are verified in BindStaticShaderResources()
+ if (StaticResourcesPresent && !pShaderResBindingD3D11->IsStaticResourcesBound())
+ {
+ LOG_ERROR_MESSAGE("Static resources have not been initialized in the shader resource binding object being committed for PSO '", pPSO->GetDesc().Name, "'. Please call IShaderResourceBinding::InitializeStaticResources().");
+ }
}
#endif
@@ -225,7 +227,7 @@ void DeviceContextD3D11Impl::TransitionAndCommitShaderResources(IPipelineState* {
auto ShaderTypeInd = pShaderResBindingD3D11->GetActiveShaderTypeIndex(s);
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
auto* pShaderD3D11 = pPipelineStateD3D11->GetShader<ShaderD3D11Impl>(s);
VERIFY_EXPR(ShaderTypeInd == static_cast<Int32>(GetShaderTypeIndex(pShaderD3D11->GetDesc().ShaderType)));
#endif
@@ -274,7 +276,7 @@ void DeviceContextD3D11Impl::TransitionAndCommitShaderResources(IPipelineState* }
}
}
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
else if (VerifyStates)
{
if (const auto* pTexture = ValidatedCast<TextureBaseD3D11>(UAVRes.pTexture))
@@ -336,7 +338,7 @@ void DeviceContextD3D11Impl::TransitionAndCommitShaderResources(IPipelineState* }
}
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
if ((m_DebugFlags & D3D11_DEBUG_FLAG_VERIFY_COMMITTED_RESOURCE_RELEVANCE) != 0 && ShaderTypeInd == CSInd)
{
dbgVerifyCommittedUAVs(pShaderD3D11->GetDesc().ShaderType);
@@ -371,7 +373,7 @@ void DeviceContextD3D11Impl::TransitionAndCommitShaderResources(IPipelineState* {
auto ShaderTypeInd = pShaderResBindingD3D11->GetActiveShaderTypeIndex(s);
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
auto* pShaderD3D11 = pPipelineStateD3D11->GetShader<ShaderD3D11Impl>(s);
VERIFY_EXPR(ShaderTypeInd == static_cast<Int32>(GetShaderTypeIndex(pShaderD3D11->GetDesc().ShaderType)));
#endif
@@ -414,7 +416,7 @@ void DeviceContextD3D11Impl::TransitionAndCommitShaderResources(IPipelineState* }
}
}
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
else if (VerifyStates)
{
VERIFY_EXPR(CommitResources);
@@ -446,7 +448,7 @@ void DeviceContextD3D11Impl::TransitionAndCommitShaderResources(IPipelineState* (m_pd3d11DeviceContext->*SetCBMethod)(MinSlot, MaxSlot - MinSlot + 1, CommittedD3D11CBs + MinSlot);
m_NumCommittedCBs[ShaderTypeInd] = std::max(m_NumCommittedCBs[ShaderTypeInd], static_cast<Uint8>(NumCBs));
}
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
if (m_DebugFlags & D3D11_DEBUG_FLAG_VERIFY_COMMITTED_RESOURCE_RELEVANCE)
{
dbgVerifyCommittedCBs(pShaderD3D11->GetDesc().ShaderType);
@@ -513,7 +515,7 @@ void DeviceContextD3D11Impl::TransitionAndCommitShaderResources(IPipelineState* }
}
}
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
else if (VerifyStates)
{
VERIFY_EXPR(CommitResources);
@@ -553,7 +555,7 @@ void DeviceContextD3D11Impl::TransitionAndCommitShaderResources(IPipelineState* (m_pd3d11DeviceContext->*SetSRVMethod)(MinSlot, MaxSlot - MinSlot + 1, CommittedD3D11SRVs + MinSlot);
m_NumCommittedSRVs[ShaderTypeInd] = std::max(m_NumCommittedSRVs[ShaderTypeInd], static_cast<Uint8>(NumSRVs));
}
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
if (m_DebugFlags & D3D11_DEBUG_FLAG_VERIFY_COMMITTED_RESOURCE_RELEVANCE)
{
dbgVerifyCommittedSRVs(pShaderD3D11->GetDesc().ShaderType);
@@ -593,7 +595,7 @@ void DeviceContextD3D11Impl::TransitionAndCommitShaderResources(IPipelineState* (m_pd3d11DeviceContext->*SetSamplerMethod)(MinSlot, MaxSlot - MinSlot + 1, CommittedD3D11Samplers + MinSlot);
m_NumCommittedSamplers[ShaderTypeInd] = std::max(m_NumCommittedSamplers[ShaderTypeInd], static_cast<Uint8>(NumSamplers));
}
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
if (m_DebugFlags & D3D11_DEBUG_FLAG_VERIFY_COMMITTED_RESOURCE_RELEVANCE)
{
dbgVerifyCommittedSamplers(pShaderD3D11->GetDesc().ShaderType);
@@ -604,7 +606,7 @@ void DeviceContextD3D11Impl::TransitionAndCommitShaderResources(IPipelineState* -#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
if (CommitResources && (m_DebugFlags & D3D11_DEBUG_FLAG_VERIFY_COMMITTED_SHADER_RESOURCES) != 0)
{
// Use full resource layout to verify that all required resources are committed
@@ -751,7 +753,7 @@ void DeviceContextD3D11Impl::CommitD3D11VertexBuffers(PipelineStateD3D11Impl* pP void DeviceContextD3D11Impl::PrepareForDraw(DRAW_FLAGS Flags)
{
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
if ((Flags & DRAW_FLAG_VERIFY_RENDER_TARGETS) != 0)
DvpVerifyRenderTargets();
#endif
@@ -763,7 +765,7 @@ void DeviceContextD3D11Impl::PrepareForDraw(DRAW_FLAGS Flags) CommitD3D11VertexBuffers(m_pPipelineState);
}
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
if ((Flags & DRAW_FLAG_VERIFY_STATES) != 0)
{
for (UINT Slot = 0; Slot < m_NumVertexStreams; ++Slot)
@@ -801,7 +803,7 @@ void DeviceContextD3D11Impl::PrepareForIndexedDraw(DRAW_FLAGS Flags, VALUE_TYPE {
CommitD3D11IndexBuffer(IndexType);
}
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
if (Flags & DRAW_FLAG_VERIFY_STATES)
{
if (m_pIndexBuffer->IsInKnownState() && m_pIndexBuffer->CheckState(RESOURCE_STATE_UNORDERED_ACCESS))
@@ -873,7 +875,7 @@ void DeviceContextD3D11Impl::DispatchCompute(const DispatchComputeAttribs& Attri if (!DvpVerifyDispatchArguments(Attribs))
return;
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
if (m_DebugFlags & D3D11_DEBUG_FLAG_VERIFY_COMMITTED_RESOURCE_RELEVANCE)
{
// Verify bindings
@@ -893,7 +895,7 @@ void DeviceContextD3D11Impl::DispatchComputeIndirect(const DispatchComputeIndire if (!DvpVerifyDispatchIndirectArguments(Attribs, pAttribsBuffer))
return;
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
if (m_DebugFlags & D3D11_DEBUG_FLAG_VERIFY_COMMITTED_RESOURCE_RELEVANCE)
{
// Verify bindings
@@ -1178,7 +1180,7 @@ void DeviceContextD3D11Impl::SetVertexBuffers(Uint32 Sta pBuffD3D11Impl->ClearState(RESOURCE_STATE_UNORDERED_ACCESS);
}
}
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
else if (StateTransitionMode == RESOURCE_STATE_TRANSITION_MODE_VERIFY)
{
if (pBuffD3D11Impl->IsInKnownState() && pBuffD3D11Impl->CheckState(RESOURCE_STATE_UNORDERED_ACCESS))
@@ -1208,7 +1210,7 @@ void DeviceContextD3D11Impl::SetIndexBuffer(IBuffer* pIndexBuffer, Uint32 ByteOf m_pIndexBuffer->ClearState(RESOURCE_STATE_UNORDERED_ACCESS);
}
}
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
else if (StateTransitionMode == RESOURCE_STATE_TRANSITION_MODE_VERIFY)
{
if (m_pIndexBuffer->IsInKnownState() && m_pIndexBuffer->CheckState(RESOURCE_STATE_UNORDERED_ACCESS))
@@ -1444,7 +1446,7 @@ void DeviceContextD3D11Impl::UnbindBufferFromInput(BufferD3D11Impl* pBuffer, ID3 m_bCommittedD3D11IBUpToDate = false;
m_pd3d11DeviceContext->IASetIndexBuffer(nullptr, DXGI_FORMAT_R32_UINT, m_CommittedD3D11IndexDataStartOffset);
}
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
if (m_DebugFlags & D3D11_DEBUG_FLAG_VERIFY_COMMITTED_RESOURCE_RELEVANCE)
{
dbgVerifyCommittedIndexBuffer();
@@ -1472,7 +1474,7 @@ void DeviceContextD3D11Impl::UnbindBufferFromInput(BufferD3D11Impl* pBuffer, ID3 m_pd3d11DeviceContext->IASetVertexBuffers(Slot, _countof(ppNullBuffer), ppNullBuffer, Zero, Zero);
}
}
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
if (m_DebugFlags & D3D11_DEBUG_FLAG_VERIFY_COMMITTED_RESOURCE_RELEVANCE)
{
dbgVerifyCommittedVertexBuffers();
@@ -1498,7 +1500,7 @@ void DeviceContextD3D11Impl::UnbindBufferFromInput(BufferD3D11Impl* pBuffer, ID3 }
}
}
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
if (m_DebugFlags & D3D11_DEBUG_FLAG_VERIFY_COMMITTED_RESOURCE_RELEVANCE)
{
dbgVerifyCommittedCBs();
@@ -1582,7 +1584,7 @@ void DeviceContextD3D11Impl::SetRenderTargets(Uint32 Num if (pTex->IsInKnownState())
pTex->SetState(RESOURCE_STATE_RENDER_TARGET);
}
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
else if (StateTransitionMode == RESOURCE_STATE_TRANSITION_MODE_VERIFY)
{
DvpVerifyTextureState(*pTex, RESOURCE_STATE_RENDER_TARGET, "Setting render targets (DeviceContextD3D11Impl::SetRenderTargets)");
@@ -1600,7 +1602,7 @@ void DeviceContextD3D11Impl::SetRenderTargets(Uint32 Num if (pTex->IsInKnownState())
pTex->SetState(RESOURCE_STATE_DEPTH_WRITE);
}
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
else if (StateTransitionMode == RESOURCE_STATE_TRANSITION_MODE_VERIFY)
{
DvpVerifyTextureState(*pTex, RESOURCE_STATE_DEPTH_WRITE, "Setting depth-stencil buffer (DeviceContextD3D11Impl::SetRenderTargets)");
@@ -1684,7 +1686,7 @@ void DeviceContextD3D11Impl::ReleaseCommittedShaderResources() m_NumCommittedUAVs[ShaderType] = 0;
}
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
if (m_DebugFlags & D3D11_DEBUG_FLAG_VERIFY_COMMITTED_RESOURCE_RELEVANCE)
{
dbgVerifyCommittedSRVs();
@@ -1717,7 +1719,7 @@ void DeviceContextD3D11Impl::FinishCommandList(ICommandList** ppCommandList) // Device context is now in default state
InvalidateState();
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
if (m_DebugFlags & D3D11_DEBUG_FLAG_VERIFY_COMMITTED_RESOURCE_RELEVANCE)
{
// Verify bindings
@@ -1754,7 +1756,7 @@ void DeviceContextD3D11Impl::ExecuteCommandList(ICommandList* pCommandList) // Device context is now in default state
InvalidateState();
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
if (m_DebugFlags & D3D11_DEBUG_FLAG_VERIFY_COMMITTED_RESOURCE_RELEVANCE)
{
// Verify bindings
@@ -1945,7 +1947,7 @@ void DeviceContextD3D11Impl::TransitionResourceStates(Uint32 BarrierCount, State for (Uint32 i = 0; i < BarrierCount; ++i)
{
const auto& Barrier = pResourceBarriers[i];
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
DvpVerifyStateTransitionDesc(Barrier);
#endif
DEV_CHECK_ERR((Barrier.pTexture != nullptr) ^ (Barrier.pBuffer != nullptr), "Exactly one of pTexture or pBuffer must not be null");
diff --git a/Graphics/GraphicsEngineD3D11/src/EngineFactoryD3D11.cpp b/Graphics/GraphicsEngineD3D11/src/EngineFactoryD3D11.cpp index 6dd980a6..d82f0668 100644 --- a/Graphics/GraphicsEngineD3D11/src/EngineFactoryD3D11.cpp +++ b/Graphics/GraphicsEngineD3D11/src/EngineFactoryD3D11.cpp @@ -77,7 +77,7 @@ public: }; -#if defined(_DEBUG) +#if defined(DILIGENT_DEVELOPMENT) // Check for SDK Layer support. inline bool SdkLayersAvailable() { @@ -130,7 +130,7 @@ void EngineFactoryD3D11Impl::CreateDeviceAndContextsD3D11(const EngineD3D11Creat // D3D11_CREATE_DEVICE_BGRA_SUPPORT; UINT creationFlags = 0; -#if defined(DEVELOPMENT) +#if defined(DILIGENT_DEVELOPMENT) if ((EngineCI.DebugFlags & D3D11_DEBUG_FLAG_CREATE_DEBUG_DEVICE) != 0 && SdkLayersAvailable()) { // If the project is in a debug build, enable debugging via SDK Layers with this flag. diff --git a/Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp index f155c4fd..984a34a6 100644 --- a/Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp +++ b/Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp @@ -131,7 +131,7 @@ PipelineStateD3D11Impl::PipelineStateD3D11Impl(IReferenceCounters* pRefCoun const auto& ResourceLayout = m_Desc.ResourceLayout; -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT { const ShaderResources* pResources[MAX_SHADERS_IN_PIPELINE] = {}; for (Uint32 s = 0; s < m_NumShaders; ++s) diff --git a/Graphics/GraphicsEngineD3D11/src/ShaderResourceBindingD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/ShaderResourceBindingD3D11Impl.cpp index 7af06af3..12875694 100644 --- a/Graphics/GraphicsEngineD3D11/src/ShaderResourceBindingD3D11Impl.cpp +++ b/Graphics/GraphicsEngineD3D11/src/ShaderResourceBindingD3D11Impl.cpp @@ -154,7 +154,7 @@ void ShaderResourceBindingD3D11Impl::InitializeStaticResources(const IPipelineSt { const auto& StaticResLayout = pPSOD3D11->GetStaticResourceLayout(shader); auto* pShaderD3D11 = ValidatedCast<ShaderD3D11Impl>(ppShaders[shader]); -#ifdef DEVELOPMENT +#ifdef DILIGENT_DEVELOPMENT if (!StaticResLayout.dvpVerifyBindings()) { LOG_ERROR_MESSAGE("Static resources in SRB of PSO '", pPSOD3D11->GetDesc().Name, @@ -165,10 +165,12 @@ void ShaderResourceBindingD3D11Impl::InitializeStaticResources(const IPipelineSt } #endif -#ifdef _DEBUG - auto ShaderTypeInd = GetShaderTypeIndex(pShaderD3D11->GetDesc().ShaderType); - auto ResourceLayoutInd = m_ResourceLayoutIndex[ShaderTypeInd]; - VERIFY_EXPR(ResourceLayoutInd == static_cast<Int8>(shader)); +#ifdef DILIGENT_DEBUG + { + auto ShaderTypeInd = GetShaderTypeIndex(pShaderD3D11->GetDesc().ShaderType); + auto ResourceLayoutInd = m_ResourceLayoutIndex[ShaderTypeInd]; + VERIFY_EXPR(ResourceLayoutInd == static_cast<Int8>(shader)); + } #endif StaticResLayout.CopyResources(m_pBoundResourceCaches[shader]); pPSOD3D11->SetStaticSamplers(m_pBoundResourceCaches[shader], shader); diff --git a/Graphics/GraphicsEngineD3D11/src/ShaderResourceCacheD3D11.cpp b/Graphics/GraphicsEngineD3D11/src/ShaderResourceCacheD3D11.cpp index 2286d65e..28086285 100755 --- a/Graphics/GraphicsEngineD3D11/src/ShaderResourceCacheD3D11.cpp +++ b/Graphics/GraphicsEngineD3D11/src/ShaderResourceCacheD3D11.cpp @@ -99,7 +99,7 @@ void ShaderResourceCacheD3D11::Initialize(Uint32 CBCount, Uint32 SRVCount, Uint3 (sizeof(CachedResource) + sizeof(ID3D11UnorderedAccessView*)) * UAVCount );
// clang-format on
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
m_pdbgMemoryAllocator = &MemAllocator;
#endif
if (BufferSize > 0)
diff --git a/Graphics/GraphicsEngineD3D11/src/ShaderResourceLayoutD3D11.cpp b/Graphics/GraphicsEngineD3D11/src/ShaderResourceLayoutD3D11.cpp index 741b5692..fd6c7299 100755 --- a/Graphics/GraphicsEngineD3D11/src/ShaderResourceLayoutD3D11.cpp +++ b/Graphics/GraphicsEngineD3D11/src/ShaderResourceLayoutD3D11.cpp @@ -239,7 +239,7 @@ ShaderResourceLayoutD3D11::ShaderResourceLayoutD3D11(IObject& if (!SamplerFound)
{
AssignedSamplerIndex = TexSRVBindInfo::InvalidSamplerIndex;
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
// Shader error will be logged by the PipelineStateD3D11Impl
constexpr bool LogStaticSamplerArrayError = false;
if (m_pResources->FindStaticSampler(AssignedSamplerAttribs, ResourceLayout, LogStaticSamplerArrayError) < 0)
@@ -250,7 +250,7 @@ ShaderResourceLayoutD3D11::ShaderResourceLayoutD3D11(IObject& }
else
{
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
// Shader error will be logged by the PipelineStateD3D11Impl
constexpr bool LogStaticSamplerArrayError = false;
if (m_pResources->FindStaticSampler(AssignedSamplerAttribs, ResourceLayout, LogStaticSamplerArrayError) >= 0)
@@ -430,7 +430,7 @@ void ShaderResourceLayoutD3D11::ConstBuffBindInfo::BindResource(IDeviceObject* p // We cannot use ValidatedCast<> here as the resource retrieved from the
// resource mapping can be of wrong type
RefCntAutoPtr<BufferD3D11Impl> pBuffD3D11Impl(pBuffer, IID_BufferD3D11);
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
{
auto& CachedCB = m_ParentResLayout.m_ResourceCache.GetCB(m_Attribs.BindPoint + ArrayIndex);
VerifyConstantBufferBinding(m_Attribs, GetType(), ArrayIndex, pBuffer, pBuffD3D11Impl.RawPtr(), CachedCB.pBuff.RawPtr(), m_ParentResLayout.GetShaderName());
@@ -449,7 +449,7 @@ void ShaderResourceLayoutD3D11::TexSRVBindInfo::BindResource(IDeviceObject* pVie // We cannot use ValidatedCast<> here as the resource retrieved from the
// resource mapping can be of wrong type
RefCntAutoPtr<TextureViewD3D11Impl> pViewD3D11(pView, IID_TextureViewD3D11);
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
{
auto& CachedSRV = ResourceCache.GetSRV(m_Attribs.BindPoint + ArrayIndex);
VerifyResourceViewBinding(m_Attribs, GetType(), ArrayIndex, pView, pViewD3D11.RawPtr(), {TEXTURE_VIEW_SHADER_RESOURCE}, CachedSRV.pView.RawPtr(), m_ParentResLayout.GetShaderName());
@@ -467,7 +467,7 @@ void ShaderResourceLayoutD3D11::TexSRVBindInfo::BindResource(IDeviceObject* pVie if (pViewD3D11)
{
pSamplerD3D11Impl = ValidatedCast<SamplerD3D11Impl>(pViewD3D11->GetSampler());
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
if (pSamplerD3D11Impl == nullptr)
{
if (Sampler.m_Attribs.BindCount > 1)
@@ -477,7 +477,7 @@ void ShaderResourceLayoutD3D11::TexSRVBindInfo::BindResource(IDeviceObject* pVie }
#endif
}
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
if (Sampler.GetType() != SHADER_RESOURCE_VARIABLE_TYPE_DYNAMIC)
{
auto& CachedSampler = ResourceCache.GetSampler(SamplerBindPoint);
@@ -507,7 +507,7 @@ void ShaderResourceLayoutD3D11::SamplerBindInfo::BindResource(IDeviceObject* pSa // resource mapping can be of wrong type
RefCntAutoPtr<SamplerD3D11Impl> pSamplerD3D11(pSampler, IID_SamplerD3D11);
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
if (pSampler && !pSamplerD3D11)
{
LOG_ERROR_MESSAGE("Failed to bind object '", pSampler->GetDesc().Name, "' to variable '", m_Attribs.GetPrintName(ArrayIndex),
@@ -549,7 +549,7 @@ void ShaderResourceLayoutD3D11::BuffSRVBindInfo::BindResource(IDeviceObject* pVi // We cannot use ValidatedCast<> here as the resource retrieved from the
// resource mapping can be of wrong type
RefCntAutoPtr<BufferViewD3D11Impl> pViewD3D11(pView, IID_BufferViewD3D11);
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
{
auto& CachedSRV = ResourceCache.GetSRV(m_Attribs.BindPoint + ArrayIndex);
VerifyResourceViewBinding(m_Attribs, GetType(), ArrayIndex, pView, pViewD3D11.RawPtr(), {BUFFER_VIEW_SHADER_RESOURCE}, CachedSRV.pView.RawPtr(), m_ParentResLayout.GetShaderName());
@@ -569,7 +569,7 @@ void ShaderResourceLayoutD3D11::TexUAVBindInfo::BindResource(IDeviceObject* pVie // We cannot use ValidatedCast<> here as the resource retrieved from the
// resource mapping can be of wrong type
RefCntAutoPtr<TextureViewD3D11Impl> pViewD3D11(pView, IID_TextureViewD3D11);
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
{
auto& CachedUAV = ResourceCache.GetUAV(m_Attribs.BindPoint + ArrayIndex);
VerifyResourceViewBinding(m_Attribs, GetType(), ArrayIndex, pView, pViewD3D11.RawPtr(), {TEXTURE_VIEW_UNORDERED_ACCESS}, CachedUAV.pView.RawPtr(), m_ParentResLayout.GetShaderName());
@@ -589,7 +589,7 @@ void ShaderResourceLayoutD3D11::BuffUAVBindInfo::BindResource(IDeviceObject* pVi // We cannot use ValidatedCast<> here as the resource retrieved from the
// resource mapping can be of wrong type
RefCntAutoPtr<BufferViewD3D11Impl> pViewD3D11(pView, IID_BufferViewD3D11);
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
{
auto& CachedUAV = ResourceCache.GetUAV(m_Attribs.BindPoint + ArrayIndex);
VerifyResourceViewBinding(m_Attribs, GetType(), ArrayIndex, pView, pViewD3D11.RawPtr(), {BUFFER_VIEW_UNORDERED_ACCESS}, CachedUAV.pView.RawPtr(), m_ParentResLayout.GetShaderName());
@@ -752,10 +752,12 @@ public: template <typename ResourceType>
bool TryResource(ShaderResourceLayoutD3D11::OffsetType NextResourceTypeOffset)
{
-#ifdef _DEBUG
- VERIFY(Layout.GetResourceOffset<ResourceType>() >= dbgPreviousResourceOffset, "Resource types are processed out of order!");
- dbgPreviousResourceOffset = Layout.GetResourceOffset<ResourceType>();
- VERIFY_EXPR(NextResourceTypeOffset >= Layout.GetResourceOffset<ResourceType>());
+#ifdef DILIGENT_DEBUG
+ {
+ VERIFY(Layout.GetResourceOffset<ResourceType>() >= dbgPreviousResourceOffset, "Resource types are processed out of order!");
+ dbgPreviousResourceOffset = Layout.GetResourceOffset<ResourceType>();
+ VERIFY_EXPR(NextResourceTypeOffset >= Layout.GetResourceOffset<ResourceType>());
+ }
#endif
if (VarOffset < NextResourceTypeOffset)
{
@@ -777,7 +779,7 @@ private: const ShaderResourceLayoutD3D11& Layout;
const size_t VarOffset;
Uint32 Index = 0;
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
Uint32 dbgPreviousResourceOffset = 0;
#endif
};
@@ -830,9 +832,11 @@ public: template <typename ResourceType>
IShaderResourceVariable* TryResource()
{
-#ifdef _DEBUG
- VERIFY(Layout.GetResourceOffset<ResourceType>() >= dbgPreviousResourceOffset, "Resource types are processed out of order!");
- dbgPreviousResourceOffset = Layout.GetResourceOffset<ResourceType>();
+#ifdef DILIGENT_DEBUG
+ {
+ VERIFY(Layout.GetResourceOffset<ResourceType>() >= dbgPreviousResourceOffset, "Resource types are processed out of order!");
+ dbgPreviousResourceOffset = Layout.GetResourceOffset<ResourceType>();
+ }
#endif
auto NumResources = Layout.GetNumResources<ResourceType>();
if (Index < NumResources)
@@ -847,7 +851,7 @@ public: private:
ShaderResourceLayoutD3D11& Layout;
Uint32 Index = 0;
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
Uint32 dbgPreviousResourceOffset = 0;
#endif
};
@@ -883,7 +887,7 @@ IShaderResourceVariable* ShaderResourceLayoutD3D11::GetShaderVariable(Uint32 Ind }
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
bool ShaderResourceLayoutD3D11::dvpVerifyBindings() const
{
diff --git a/Graphics/GraphicsEngineD3D11/src/ShaderResourcesD3D11.cpp b/Graphics/GraphicsEngineD3D11/src/ShaderResourcesD3D11.cpp index e39830aa..769c91e2 100755 --- a/Graphics/GraphicsEngineD3D11/src/ShaderResourcesD3D11.cpp +++ b/Graphics/GraphicsEngineD3D11/src/ShaderResourcesD3D11.cpp @@ -118,7 +118,7 @@ ShaderResourcesD3D11::~ShaderResourcesD3D11() }
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
static String DbgMakeResourceName(const D3DShaderResourceAttribs& Attr, Uint32 BindPoint)
{
VERIFY(BindPoint >= Uint32{Attr.BindPoint} && BindPoint < Uint32{Attr.BindPoint} + Attr.BindCount, "Bind point is out of allowed range");
|
