summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineOpenGL
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/GraphicsEngineOpenGL
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/GraphicsEngineOpenGL')
-rw-r--r--Graphics/GraphicsEngineOpenGL/include/GLPipelineResourceLayout.hpp2
-rw-r--r--Graphics/GraphicsEngineOpenGL/include/GLProgramResourceCache.hpp2
-rw-r--r--Graphics/GraphicsEngineOpenGL/include/pch.h2
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/BufferGLImpl.cpp2
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp6
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/FBOCache.cpp4
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/GLContextWindows.cpp2
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/GLPipelineResourceLayout.cpp18
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/GLProgramResourceCache.cpp2
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/GLProgramResources.cpp4
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp2
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/ShaderResourceBindingGLImpl.cpp4
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/Texture2DArray_OGL.cpp2
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/Texture2D_OGL.cpp2
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/TextureBaseGL.cpp44
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/TextureCubeArray_OGL.cpp2
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/TextureCube_OGL.cpp2
17 files changed, 52 insertions, 50 deletions
diff --git a/Graphics/GraphicsEngineOpenGL/include/GLPipelineResourceLayout.hpp b/Graphics/GraphicsEngineOpenGL/include/GLPipelineResourceLayout.hpp
index 67f1e1ec..cf6a9e86 100644
--- a/Graphics/GraphicsEngineOpenGL/include/GLPipelineResourceLayout.hpp
+++ b/Graphics/GraphicsEngineOpenGL/include/GLPipelineResourceLayout.hpp
@@ -283,7 +283,7 @@ public:
// while Layout is alive
void BindResources(SHADER_TYPE ShaderStage, IResourceMapping* pResourceMapping, Uint32 Flags, const GLProgramResourceCache& dbgResourceCache);
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
bool dvpVerifyBindings(const GLProgramResourceCache& ResourceCache) const;
#endif
diff --git a/Graphics/GraphicsEngineOpenGL/include/GLProgramResourceCache.hpp b/Graphics/GraphicsEngineOpenGL/include/GLProgramResourceCache.hpp
index cb2cce48..3fbc550e 100644
--- a/Graphics/GraphicsEngineOpenGL/include/GLProgramResourceCache.hpp
+++ b/Graphics/GraphicsEngineOpenGL/include/GLProgramResourceCache.hpp
@@ -268,7 +268,7 @@ private:
Uint8* m_pResourceData = nullptr;
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
IMemoryAllocator* m_pdbgMemoryAllocator = nullptr;
#endif
};
diff --git a/Graphics/GraphicsEngineOpenGL/include/pch.h b/Graphics/GraphicsEngineOpenGL/include/pch.h
index 739cfa4c..2d81c6b3 100644
--- a/Graphics/GraphicsEngineOpenGL/include/pch.h
+++ b/Graphics/GraphicsEngineOpenGL/include/pch.h
@@ -142,7 +142,7 @@
LogError<true>(/*IsFatal=*/false, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__, "\nGL Error Code: ", err); \
} while (false)
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
# define DEV_CHECK_GL_ERROR CHECK_GL_ERROR
#else
# define DEV_CHECK_GL_ERROR(...) \
diff --git a/Graphics/GraphicsEngineOpenGL/src/BufferGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/BufferGLImpl.cpp
index e3fff3ee..70df3725 100644
--- a/Graphics/GraphicsEngineOpenGL/src/BufferGLImpl.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/BufferGLImpl.cpp
@@ -342,7 +342,7 @@ void BufferGLImpl::Unmap(GLContextState& CtxState)
void BufferGLImpl::BufferMemoryBarrier(Uint32 RequiredBarriers, GLContextState& GLContextState)
{
#if GL_ARB_shader_image_load_store
-# ifdef _DEBUG
+# ifdef DILIGENT_DEBUG
{
// clang-format off
constexpr Uint32 BufferBarriers =
diff --git a/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp
index 8b13486d..02ab028c 100644
--- a/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp
@@ -416,7 +416,7 @@ void DeviceContextGLImpl::BindProgramResources(Uint32& NewMemoryBarriers, IShade
auto* pShaderResBindingGL = ValidatedCast<ShaderResourceBindingGLImpl>(pResBinding);
const auto& ResourceCache = pShaderResBindingGL->GetResourceCache(m_pPipelineState);
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
m_pPipelineState->GetResourceLayout().dvpVerifyBindings(ResourceCache);
#endif
@@ -517,7 +517,7 @@ void DeviceContextGLImpl::BindProgramResources(Uint32& NewMemoryBarriers, IShade
m_BoundWritableTextures.push_back(pTextureGL);
}
-# ifdef _DEBUG
+# ifdef DILIGENT_DEBUG
// Check that the texure being bound has immutable storage
{
m_ContextState.BindTexture(-1, pTexViewGL->GetBindTarget(), pTexViewGL->GetHandle());
@@ -655,7 +655,7 @@ void DeviceContextGLImpl::BindProgramResources(Uint32& NewMemoryBarriers, IShade
void DeviceContextGLImpl::PrepareForDraw(DRAW_FLAGS Flags, bool IsIndexed, GLenum& GlTopology)
{
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
if ((Flags & DRAW_FLAG_VERIFY_RENDER_TARGETS) != 0)
DvpVerifyRenderTargets();
#endif
diff --git a/Graphics/GraphicsEngineOpenGL/src/FBOCache.cpp b/Graphics/GraphicsEngineOpenGL/src/FBOCache.cpp
index 1165dba8..5d18a955 100644
--- a/Graphics/GraphicsEngineOpenGL/src/FBOCache.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/FBOCache.cpp
@@ -186,7 +186,7 @@ const GLObjectWrappers::GLFrameBufferObj& FBOCache::GetFBO(Uint32 Nu
if (DSVDesc.Format == TEX_FORMAT_D32_FLOAT ||
DSVDesc.Format == TEX_FORMAT_D16_UNORM)
{
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
{
const auto GLTexFmt = pDepthTexGL->GetGLTexFormat();
VERIFY(GLTexFmt == GL_DEPTH_COMPONENT32F || GLTexFmt == GL_DEPTH_COMPONENT16,
@@ -199,7 +199,7 @@ const GLObjectWrappers::GLFrameBufferObj& FBOCache::GetFBO(Uint32 Nu
else if (DSVDesc.Format == TEX_FORMAT_D32_FLOAT_S8X24_UINT ||
DSVDesc.Format == TEX_FORMAT_D24_UNORM_S8_UINT)
{
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
{
const auto GLTexFmt = pDepthTexGL->GetGLTexFormat();
VERIFY(GLTexFmt == GL_DEPTH24_STENCIL8 || GLTexFmt == GL_DEPTH32F_STENCIL8,
diff --git a/Graphics/GraphicsEngineOpenGL/src/GLContextWindows.cpp b/Graphics/GraphicsEngineOpenGL/src/GLContextWindows.cpp
index 978a810f..4d4eb383 100644
--- a/Graphics/GraphicsEngineOpenGL/src/GLContextWindows.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/GLContextWindows.cpp
@@ -207,7 +207,7 @@ GLContext::GLContext(const EngineGLCreateInfo& InitAttribs, DeviceCaps& deviceCa
0, 0 //
};
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
attribs[5] |= WGL_CONTEXT_DEBUG_BIT_ARB;
#endif
diff --git a/Graphics/GraphicsEngineOpenGL/src/GLPipelineResourceLayout.cpp b/Graphics/GraphicsEngineOpenGL/src/GLPipelineResourceLayout.cpp
index f0110128..16940bda 100644
--- a/Graphics/GraphicsEngineOpenGL/src/GLPipelineResourceLayout.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/GLPipelineResourceLayout.cpp
@@ -119,7 +119,7 @@ void GLPipelineResourceLayout::Initialize(GLProgramResources* P
Uint32 ImageBindingSlots = 0;
Uint32 SSBOBindingSlots = 0;
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
const Uint32 DbgAllowedTypeBits = GetAllowedTypeBits(AllowedVarTypes, NumAllowedTypes);
#endif
for (Uint32 prog = 0; prog < NumPrograms; ++prog)
@@ -256,7 +256,7 @@ void GLPipelineResourceLayout::UniformBuffBindInfo::BindResource(IDeviceObject*
// We cannot use ValidatedCast<> here as the resource retrieved from the
// resource mapping can be of wrong type
RefCntAutoPtr<BufferGLImpl> pBuffGLImpl(pBuffer, IID_BufferGL);
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
{
const auto& CachedUB = ResourceCache.GetConstUB(m_Attribs.Binding + ArrayIndex);
VerifyConstantBufferBinding(m_Attribs, GetType(), ArrayIndex, pBuffer, pBuffGLImpl.RawPtr(), CachedUB.pBuffer.RawPtr());
@@ -283,7 +283,7 @@ void GLPipelineResourceLayout::SamplerBindInfo::BindResource(IDeviceObject* pVie
// We cannot use ValidatedCast<> here as the resource retrieved from the
// resource mapping can be of wrong type
RefCntAutoPtr<TextureViewGLImpl> pViewGL(pView, IID_TextureViewGL);
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
{
auto& CachedTexSampler = ResourceCache.GetConstSampler(m_Attribs.Binding + ArrayIndex);
VerifyResourceViewBinding(m_Attribs, GetType(), ArrayIndex, pView, pViewGL.RawPtr(), {TEXTURE_VIEW_SHADER_RESOURCE}, CachedTexSampler.pView.RawPtr());
@@ -300,7 +300,7 @@ void GLPipelineResourceLayout::SamplerBindInfo::BindResource(IDeviceObject* pVie
// We cannot use ValidatedCast<> here as the resource retrieved from the
// resource mapping can be of wrong type
RefCntAutoPtr<BufferViewGLImpl> pViewGL(pView, IID_BufferViewGL);
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
{
auto& CachedBuffSampler = ResourceCache.GetConstSampler(m_Attribs.Binding + ArrayIndex);
VerifyResourceViewBinding(m_Attribs, GetType(), ArrayIndex, pView, pViewGL.RawPtr(), {BUFFER_VIEW_SHADER_RESOURCE}, CachedBuffSampler.pView.RawPtr());
@@ -327,7 +327,7 @@ void GLPipelineResourceLayout::ImageBindInfo::BindResource(IDeviceObject* pView,
// We cannot use ValidatedCast<> here as the resource retrieved from the
// resource mapping can be of wrong type
RefCntAutoPtr<TextureViewGLImpl> pViewGL(pView, IID_TextureViewGL);
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
{
auto& CachedUAV = ResourceCache.GetConstImage(m_Attribs.Binding + ArrayIndex);
VerifyResourceViewBinding(m_Attribs, GetType(), ArrayIndex, pView, pViewGL.RawPtr(), {TEXTURE_VIEW_UNORDERED_ACCESS}, CachedUAV.pView.RawPtr());
@@ -340,7 +340,7 @@ void GLPipelineResourceLayout::ImageBindInfo::BindResource(IDeviceObject* pView,
// We cannot use ValidatedCast<> here as the resource retrieved from the
// resource mapping can be of wrong type
RefCntAutoPtr<BufferViewGLImpl> pViewGL(pView, IID_BufferViewGL);
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
{
auto& CachedUAV = ResourceCache.GetConstImage(m_Attribs.Binding + ArrayIndex);
VerifyResourceViewBinding(m_Attribs, GetType(), ArrayIndex, pView, pViewGL.RawPtr(), {BUFFER_VIEW_UNORDERED_ACCESS}, CachedUAV.pView.RawPtr());
@@ -367,7 +367,7 @@ void GLPipelineResourceLayout::StorageBufferBindInfo::BindResource(IDeviceObject
// We cannot use ValidatedCast<> here as the resource retrieved from the
// resource mapping can be of wrong type
RefCntAutoPtr<BufferViewGLImpl> pViewGL(pView, IID_BufferViewGL);
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
{
auto& CachedSSBO = ResourceCache.GetConstSSBO(m_Attribs.Binding + ArrayIndex);
// HLSL structured buffers are mapped to SSBOs in GLSL
@@ -521,7 +521,7 @@ Uint32 GLPipelineResourceLayout::GetNumVariables(SHADER_TYPE ShaderStage) const
VariableEndOffset.NumStorageBlocks - VariableStartOffset.NumStorageBlocks;
// clang-format on
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
{
Uint32 DbgNumVars = 0;
auto CountVar = [&](const GLVariableBase& Var) {
@@ -721,7 +721,7 @@ void GLPipelineResourceLayout::CopyResources(GLProgramResourceCache& DstCache) c
);
}
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
bool GLPipelineResourceLayout::dvpVerifyBindings(const GLProgramResourceCache& ResourceCache) const
{
# define LOG_MISSING_BINDING(VarType, BindInfo, BindPt) LOG_ERROR_MESSAGE("No resource is bound to ", VarType, " variable '", BindInfo.m_Attribs.GetPrintName(BindPt - BindInfo.m_Attribs.Binding), "'")
diff --git a/Graphics/GraphicsEngineOpenGL/src/GLProgramResourceCache.cpp b/Graphics/GraphicsEngineOpenGL/src/GLProgramResourceCache.cpp
index 5981ce86..95557557 100644
--- a/Graphics/GraphicsEngineOpenGL/src/GLProgramResourceCache.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/GLProgramResourceCache.cpp
@@ -62,7 +62,7 @@ void GLProgramResourceCache::Initialize(Uint32 UBCount, Uint32 SamplerCount, Uin
VERIFY_EXPR(BufferSize == GetRequriedMemorySize(UBCount, SamplerCount, ImageCount, SSBOCount));
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
m_pdbgMemoryAllocator = &MemAllocator;
#endif
if (BufferSize > 0)
diff --git a/Graphics/GraphicsEngineOpenGL/src/GLProgramResources.cpp b/Graphics/GraphicsEngineOpenGL/src/GLProgramResources.cpp
index f3e206ec..176c1651 100644
--- a/Graphics/GraphicsEngineOpenGL/src/GLProgramResources.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/GLProgramResources.cpp
@@ -511,7 +511,7 @@ void GLProgramResources::LoadUniforms(SHADER_TYPE Shad
}
else
{
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
for (const auto& ub : UniformBlocks)
VERIFY(strcmp(ub.Name, Name.data()) != 0, "Uniform block with the name '", ub.Name, "' has already been enumerated");
#endif
@@ -567,7 +567,7 @@ void GLProgramResources::LoadUniforms(SHADER_TYPE Shad
}
else
{
-# ifdef _DEBUG
+# ifdef DILIGENT_DEBUG
for (const auto& sb : StorageBlocks)
VERIFY(strcmp(sb.Name, Name.data()) != 0, "Storage block with the name \"", sb.Name, "\" has already been enumerated");
# endif
diff --git a/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp
index c2e6a576..407b4b22 100644
--- a/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp
@@ -639,7 +639,7 @@ void RenderDeviceGLImpl::FlagSupportedTexFormats()
FLAG_FORMAT(TEX_FORMAT_BC7_UNORM_SRGB, bBPTC );
// clang-format on
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
bool bGL43OrAbove = DeviceCaps.DevType == RENDER_DEVICE_TYPE_GL &&
(DeviceCaps.MajorVersion >= 5 || (DeviceCaps.MajorVersion == 4 && DeviceCaps.MinorVersion >= 3));
diff --git a/Graphics/GraphicsEngineOpenGL/src/ShaderResourceBindingGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/ShaderResourceBindingGLImpl.cpp
index ac855bb2..c9639956 100644
--- a/Graphics/GraphicsEngineOpenGL/src/ShaderResourceBindingGLImpl.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/ShaderResourceBindingGLImpl.cpp
@@ -85,7 +85,7 @@ IShaderResourceVariable* ShaderResourceBindingGLImpl::GetVariableByIndex(SHADER_
const GLProgramResourceCache& ShaderResourceBindingGLImpl::GetResourceCache(PipelineStateGLImpl* pdbgPSO)
{
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
if (pdbgPSO->IsIncompatibleWith(GetPipelineState()))
{
LOG_ERROR("Shader resource binding is incompatible with the currently bound pipeline state.");
@@ -114,7 +114,7 @@ void ShaderResourceBindingGLImpl::InitializeStaticResources(const IPipelineState
const auto* pPSOGL = ValidatedCast<const PipelineStateGLImpl>(pPipelineState);
const auto& StaticResLayout = pPSOGL->GetStaticResourceLayout();
-#ifdef DEVELOPMENT
+#ifdef DILIGENT_DEVELOPMENT
if (!StaticResLayout.dvpVerifyBindings(pPSOGL->GetStaticResourceCache()))
{
LOG_ERROR_MESSAGE("Static resources in SRB of PSO '", pPSOGL->GetDesc().Name,
diff --git a/Graphics/GraphicsEngineOpenGL/src/Texture2DArray_OGL.cpp b/Graphics/GraphicsEngineOpenGL/src/Texture2DArray_OGL.cpp
index 4c9c0e19..ee8b1182 100644
--- a/Graphics/GraphicsEngineOpenGL/src/Texture2DArray_OGL.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/Texture2DArray_OGL.cpp
@@ -186,7 +186,7 @@ void Texture2DArray_OGL::UpdateData(GLContextState& ContextState,
((DstBox.MaxX % 4) == 0 || DstBox.MaxX == MipWidth) &&
((DstBox.MaxY % 4) == 0 || DstBox.MaxY == MipHeight),
"Compressed texture update region must be 4 pixel-aligned");
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
{
const auto& FmtAttribs = GetTextureFormatAttribs(m_Desc.Format);
auto BlockBytesInRow = ((DstBox.MaxX - DstBox.MinX + 3) / 4) * Uint32{FmtAttribs.ComponentSize};
diff --git a/Graphics/GraphicsEngineOpenGL/src/Texture2D_OGL.cpp b/Graphics/GraphicsEngineOpenGL/src/Texture2D_OGL.cpp
index e854960f..fd2f4dc2 100644
--- a/Graphics/GraphicsEngineOpenGL/src/Texture2D_OGL.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/Texture2D_OGL.cpp
@@ -208,7 +208,7 @@ void Texture2D_OGL::UpdateData(GLContextState& ContextState,
((DstBox.MaxX % 4) == 0 || DstBox.MaxX == MipWidth) &&
((DstBox.MaxY % 4) == 0 || DstBox.MaxY == MipHeight),
"Compressed texture update region must be 4 pixel-aligned");
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
{
const auto& FmtAttribs = GetTextureFormatAttribs(m_Desc.Format);
auto BlockBytesInRow = ((DstBox.MaxX - DstBox.MinX + 3) / 4) * Uint32{FmtAttribs.ComponentSize};
diff --git a/Graphics/GraphicsEngineOpenGL/src/TextureBaseGL.cpp b/Graphics/GraphicsEngineOpenGL/src/TextureBaseGL.cpp
index 19119423..e5914960 100644
--- a/Graphics/GraphicsEngineOpenGL/src/TextureBaseGL.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/TextureBaseGL.cpp
@@ -517,7 +517,7 @@ void TextureBaseGL::CopyData(DeviceContextGLImpl* pDeviceCtxGL,
}
auto* pRenderDeviceGL = ValidatedCast<RenderDeviceGLImpl>(GetDevice());
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
{
auto& TexViewObjAllocator = pRenderDeviceGL->GetTexViewObjAllocator();
VERIFY(&TexViewObjAllocator == &m_dbgTexViewObjAllocator, "Texture view allocator does not match allocator provided during texture initialization");
@@ -582,7 +582,7 @@ void TextureBaseGL::CopyData(DeviceContextGLImpl* pDeviceCtxGL,
void TextureBaseGL::TextureMemoryBarrier(Uint32 RequiredBarriers, GLContextState& GLContextState)
{
#if GL_ARB_shader_image_load_store
-# ifdef _DEBUG
+# ifdef DILIGENT_DEBUG
{
// clang-format off
constexpr Uint32 TextureBarriers =
@@ -603,27 +603,29 @@ void TextureBaseGL::TextureMemoryBarrier(Uint32 RequiredBarriers, GLContextState
void TextureBaseGL::SetDefaultGLParameters()
{
-#ifdef _DEBUG
- GLint BoundTex;
- GLint TextureBinding = 0;
- switch (m_BindTarget)
+#ifdef DILIGENT_DEBUG
{
- // clang-format off
- case GL_TEXTURE_1D: TextureBinding = GL_TEXTURE_BINDING_1D; break;
- case GL_TEXTURE_1D_ARRAY: TextureBinding = GL_TEXTURE_BINDING_1D_ARRAY; break;
- case GL_TEXTURE_2D: TextureBinding = GL_TEXTURE_BINDING_2D; break;
- case GL_TEXTURE_2D_ARRAY: TextureBinding = GL_TEXTURE_BINDING_2D_ARRAY; break;
- case GL_TEXTURE_2D_MULTISAMPLE: TextureBinding = GL_TEXTURE_BINDING_2D_MULTISAMPLE; break;
- case GL_TEXTURE_2D_MULTISAMPLE_ARRAY: TextureBinding = GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY; break;
- case GL_TEXTURE_3D: TextureBinding = GL_TEXTURE_BINDING_3D; break;
- case GL_TEXTURE_CUBE_MAP: TextureBinding = GL_TEXTURE_BINDING_CUBE_MAP; break;
- case GL_TEXTURE_CUBE_MAP_ARRAY: TextureBinding = GL_TEXTURE_BINDING_CUBE_MAP_ARRAY; break;
- default: UNEXPECTED("Unknown bind target");
- // clang-format on
+ GLint BoundTex;
+ GLint TextureBinding = 0;
+ switch (m_BindTarget)
+ {
+ // clang-format off
+ case GL_TEXTURE_1D: TextureBinding = GL_TEXTURE_BINDING_1D; break;
+ case GL_TEXTURE_1D_ARRAY: TextureBinding = GL_TEXTURE_BINDING_1D_ARRAY; break;
+ case GL_TEXTURE_2D: TextureBinding = GL_TEXTURE_BINDING_2D; break;
+ case GL_TEXTURE_2D_ARRAY: TextureBinding = GL_TEXTURE_BINDING_2D_ARRAY; break;
+ case GL_TEXTURE_2D_MULTISAMPLE: TextureBinding = GL_TEXTURE_BINDING_2D_MULTISAMPLE; break;
+ case GL_TEXTURE_2D_MULTISAMPLE_ARRAY: TextureBinding = GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY; break;
+ case GL_TEXTURE_3D: TextureBinding = GL_TEXTURE_BINDING_3D; break;
+ case GL_TEXTURE_CUBE_MAP: TextureBinding = GL_TEXTURE_BINDING_CUBE_MAP; break;
+ case GL_TEXTURE_CUBE_MAP_ARRAY: TextureBinding = GL_TEXTURE_BINDING_CUBE_MAP_ARRAY; break;
+ default: UNEXPECTED("Unknown bind target");
+ // clang-format on
+ }
+ glGetIntegerv(TextureBinding, &BoundTex);
+ CHECK_GL_ERROR("Failed to set GL_TEXTURE_MIN_FILTER texture parameter");
+ VERIFY(static_cast<GLuint>(BoundTex) == m_GlTexture, "Current texture is not bound to GL context");
}
- glGetIntegerv(TextureBinding, &BoundTex);
- CHECK_GL_ERROR("Failed to set GL_TEXTURE_MIN_FILTER texture parameter");
- VERIFY(static_cast<GLuint>(BoundTex) == m_GlTexture, "Current texture is not bound to GL context");
#endif
if (m_BindTarget != GL_TEXTURE_2D_MULTISAMPLE &&
diff --git a/Graphics/GraphicsEngineOpenGL/src/TextureCubeArray_OGL.cpp b/Graphics/GraphicsEngineOpenGL/src/TextureCubeArray_OGL.cpp
index 646e78f2..8acdd5f5 100644
--- a/Graphics/GraphicsEngineOpenGL/src/TextureCubeArray_OGL.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/TextureCubeArray_OGL.cpp
@@ -176,7 +176,7 @@ void TextureCubeArray_OGL::UpdateData(GLContextState& ContextState,
((DstBox.MaxY % 4) == 0 || DstBox.MaxY == MipHeight),
"Compressed texture update region must be 4 pixel-aligned");
// clang-format on
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
{
const auto& FmtAttribs = GetTextureFormatAttribs(m_Desc.Format);
auto BlockBytesInRow = ((DstBox.MaxX - DstBox.MinX + 3) / 4) * Uint32{FmtAttribs.ComponentSize};
diff --git a/Graphics/GraphicsEngineOpenGL/src/TextureCube_OGL.cpp b/Graphics/GraphicsEngineOpenGL/src/TextureCube_OGL.cpp
index 8193aca5..165961fa 100644
--- a/Graphics/GraphicsEngineOpenGL/src/TextureCube_OGL.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/TextureCube_OGL.cpp
@@ -193,7 +193,7 @@ void TextureCube_OGL::UpdateData(GLContextState& ContextState,
((DstBox.MaxY % 4) == 0 || DstBox.MaxY == MipHeight),
"Compressed texture update region must be 4 pixel-aligned" );
// clang-format on
-#ifdef _DEBUG
+#ifdef DILIGENT_DEBUG
{
const auto& FmtAttribs = GetTextureFormatAttribs(m_Desc.Format);
auto BlockBytesInRow = ((DstBox.MaxX - DstBox.MinX + 3) / 4) * Uint32{FmtAttribs.ComponentSize};