summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3D11
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-10-04 06:53:20 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-10-04 06:53:20 +0000
commitcaab72a09ce3bb26577ad487ea1ea61b5ec33c39 (patch)
treed7edea29c0392ff7b134b53194a390eeae68567b /Graphics/GraphicsEngineD3D11
parentFixed depth-stencil format correction in D3D (diff)
downloadDiligentCore-caab72a09ce3bb26577ad487ea1ea61b5ec33c39.tar.gz
DiligentCore-caab72a09ce3bb26577ad487ea1ea61b5ec33c39.zip
Setting debug names of D3D11 objects
Diffstat (limited to 'Graphics/GraphicsEngineD3D11')
-rw-r--r--Graphics/GraphicsEngineD3D11/CMakeLists.txt1
-rw-r--r--Graphics/GraphicsEngineD3D11/src/BufferD3D11Impl.cpp6
-rw-r--r--Graphics/GraphicsEngineD3D11/src/BufferViewD3D11Impl.cpp5
-rw-r--r--Graphics/GraphicsEngineD3D11/src/GUIDDef.cpp25
-rw-r--r--Graphics/GraphicsEngineD3D11/src/Texture1D_D3D11.cpp6
-rw-r--r--Graphics/GraphicsEngineD3D11/src/Texture2D_D3D11.cpp6
-rw-r--r--Graphics/GraphicsEngineD3D11/src/Texture3D_D3D11.cpp6
-rw-r--r--Graphics/GraphicsEngineD3D11/src/TextureViewD3D11Impl.cpp5
8 files changed, 60 insertions, 0 deletions
diff --git a/Graphics/GraphicsEngineD3D11/CMakeLists.txt b/Graphics/GraphicsEngineD3D11/CMakeLists.txt
index 37033c33..7b51a05a 100644
--- a/Graphics/GraphicsEngineD3D11/CMakeLists.txt
+++ b/Graphics/GraphicsEngineD3D11/CMakeLists.txt
@@ -55,6 +55,7 @@ set(SRC
src/D3D11TypeConversions.cpp
src/DeviceContextD3D11Impl.cpp
src/FenceD3D11Impl.cpp
+ src/GUIDDef.cpp
src/PipelineStateD3D11Impl.cpp
src/RenderDeviceD3D11Impl.cpp
src/RenderDeviceFactoryD3D11.cpp
diff --git a/Graphics/GraphicsEngineD3D11/src/BufferD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/BufferD3D11Impl.cpp
index 9e83f09a..4f73c91d 100644
--- a/Graphics/GraphicsEngineD3D11/src/BufferD3D11Impl.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/BufferD3D11Impl.cpp
@@ -97,6 +97,12 @@ BufferD3D11Impl :: BufferD3D11Impl(IReferenceCounters* pRefCounters,
auto *pDeviceD3D11 = pRenderDeviceD3D11->GetD3D11Device();
CHECK_D3D_RESULT_THROW( pDeviceD3D11->CreateBuffer(&D3D11BuffDesc, InitData.pSysMem ? &InitData : nullptr, &m_pd3d11Buffer),
"Failed to create the Direct3D11 buffer" );
+
+ if (*m_Desc.Name != 0)
+ {
+ auto hr = m_pd3d11Buffer->SetPrivateData(WKPDID_D3DDebugObjectName, static_cast<UINT>(strlen(m_Desc.Name)), m_Desc.Name);
+ DEV_CHECK_ERR(SUCCEEDED(hr), "Failed to set buffer name");
+ }
}
static BufferDesc BuffDescFromD3D11Buffer(ID3D11Buffer *pd3d11Buffer, BufferDesc BuffDesc)
diff --git a/Graphics/GraphicsEngineD3D11/src/BufferViewD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/BufferViewD3D11Impl.cpp
index 10d8bbc1..636d6d66 100644
--- a/Graphics/GraphicsEngineD3D11/src/BufferViewD3D11Impl.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/BufferViewD3D11Impl.cpp
@@ -36,6 +36,11 @@ BufferViewD3D11Impl::BufferViewD3D11Impl( IReferenceCounters* pRefCounters,
TBufferViewBase( pRefCounters, pDevice, ViewDesc, pBuffer, bIsDefaultView ),
m_pD3D11View( pD3D11View )
{
+ if (*m_Desc.Name != 0)
+ {
+ auto hr = m_pD3D11View->SetPrivateData(WKPDID_D3DDebugObjectName, static_cast<UINT>(strlen(m_Desc.Name)), m_Desc.Name);
+ DEV_CHECK_ERR(SUCCEEDED(hr), "Failed to set buffer view name");
+ }
}
IMPLEMENT_QUERY_INTERFACE( BufferViewD3D11Impl, IID_BufferViewD3D11, TBufferViewBase )
diff --git a/Graphics/GraphicsEngineD3D11/src/GUIDDef.cpp b/Graphics/GraphicsEngineD3D11/src/GUIDDef.cpp
new file mode 100644
index 00000000..ac45b964
--- /dev/null
+++ b/Graphics/GraphicsEngineD3D11/src/GUIDDef.cpp
@@ -0,0 +1,25 @@
+/* Copyright 2015-2018 Egor Yusov
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS.
+ *
+ * In no event and under no legal theory, whether in tort (including negligence),
+ * contract, or otherwise, unless required by applicable law (such as deliberate
+ * and grossly negligent acts) or agreed to in writing, shall any Contributor be
+ * liable for any damages, including any direct, indirect, special, incidental,
+ * or consequential damages of any character arising as a result of this License or
+ * out of the use or inability to use the software (including but not limited to damages
+ * for loss of goodwill, work stoppage, computer failure or malfunction, or any and
+ * all other commercial damages or losses), even if such Contributor has been advised
+ * of the possibility of such damages.
+ */
+
+#define INITGUID
+#include <d3dcommon.h>
diff --git a/Graphics/GraphicsEngineD3D11/src/Texture1D_D3D11.cpp b/Graphics/GraphicsEngineD3D11/src/Texture1D_D3D11.cpp
index d3801fe3..4d26ba9a 100644
--- a/Graphics/GraphicsEngineD3D11/src/Texture1D_D3D11.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/Texture1D_D3D11.cpp
@@ -62,6 +62,12 @@ Texture1D_D3D11 :: Texture1D_D3D11(IReferenceCounters* pRefCounters,
HRESULT hr = pDeviceD3D11->CreateTexture1D(&Tex1DDesc, D3D11InitData.size() ? D3D11InitData.data() : nullptr, &ptex1D);
m_pd3d11Texture.Attach(ptex1D);
CHECK_D3D_RESULT_THROW( hr, "Failed to create the Direct3D11 Texture1D" );
+
+ if (*m_Desc.Name != 0)
+ {
+ hr = m_pd3d11Texture->SetPrivateData(WKPDID_D3DDebugObjectName, static_cast<UINT>(strlen(m_Desc.Name)), m_Desc.Name);
+ DEV_CHECK_ERR(SUCCEEDED(hr), "Failed to set texture name");
+ }
}
static TextureDesc TexDescFromD3D11Texture1D(ID3D11Texture1D *pd3d11Texture)
diff --git a/Graphics/GraphicsEngineD3D11/src/Texture2D_D3D11.cpp b/Graphics/GraphicsEngineD3D11/src/Texture2D_D3D11.cpp
index 99c40da2..1e338e84 100644
--- a/Graphics/GraphicsEngineD3D11/src/Texture2D_D3D11.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/Texture2D_D3D11.cpp
@@ -67,6 +67,12 @@ Texture2D_D3D11 :: Texture2D_D3D11(IReferenceCounters* pRefCounters,
HRESULT hr = pDeviceD3D11->CreateTexture2D(&Tex2DDesc, D3D11InitData.size() ? D3D11InitData.data() : nullptr, &ptex2D);
m_pd3d11Texture.Attach(ptex2D);
CHECK_D3D_RESULT_THROW( hr, "Failed to create the Direct3D11 Texture2D" );
+
+ if (*m_Desc.Name != 0)
+ {
+ hr = m_pd3d11Texture->SetPrivateData(WKPDID_D3DDebugObjectName, static_cast<UINT>(strlen(m_Desc.Name)), m_Desc.Name);
+ DEV_CHECK_ERR(SUCCEEDED(hr), "Failed to set texture name");
+ }
}
static TextureDesc TexDescFromD3D11Texture2D(ID3D11Texture2D *pd3d11Texture)
diff --git a/Graphics/GraphicsEngineD3D11/src/Texture3D_D3D11.cpp b/Graphics/GraphicsEngineD3D11/src/Texture3D_D3D11.cpp
index 3fefb804..960720dd 100644
--- a/Graphics/GraphicsEngineD3D11/src/Texture3D_D3D11.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/Texture3D_D3D11.cpp
@@ -63,6 +63,12 @@ Texture3D_D3D11 :: Texture3D_D3D11(IReferenceCounters* pRefCounters,
HRESULT hr = pDeviceD3D11->CreateTexture3D(&Tex3DDesc, D3D11InitData.size() ? D3D11InitData.data() : nullptr, &ptex3D);
m_pd3d11Texture.Attach(ptex3D);
CHECK_D3D_RESULT_THROW( hr, "Failed to create the Direct3D11 Texture3D" );
+
+ if (*m_Desc.Name != 0)
+ {
+ hr = m_pd3d11Texture->SetPrivateData(WKPDID_D3DDebugObjectName, static_cast<UINT>(strlen(m_Desc.Name)), m_Desc.Name);
+ DEV_CHECK_ERR(SUCCEEDED(hr), "Failed to set texture name");
+ }
}
static TextureDesc TexDescFromD3D11Texture3D(ID3D11Texture3D* pd3d11Texture)
diff --git a/Graphics/GraphicsEngineD3D11/src/TextureViewD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/TextureViewD3D11Impl.cpp
index 9af2324c..d1bece27 100644
--- a/Graphics/GraphicsEngineD3D11/src/TextureViewD3D11Impl.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/TextureViewD3D11Impl.cpp
@@ -37,6 +37,11 @@ TextureViewD3D11Impl::TextureViewD3D11Impl( IReferenceCounters* pRefCounters,
TTextureViewBase( pRefCounters, pDevice, ViewDesc, pTexture, bIsDefaultView ),
m_pD3D11View( pD3D11View )
{
+ if (*m_Desc.Name != 0)
+ {
+ auto hr = m_pD3D11View->SetPrivateData(WKPDID_D3DDebugObjectName, static_cast<UINT>(strlen(m_Desc.Name)), m_Desc.Name);
+ DEV_CHECK_ERR(SUCCEEDED(hr), "Failed to set texture view name");
+ }
}
IMPLEMENT_QUERY_INTERFACE( TextureViewD3D11Impl, IID_TextureViewD3D11, TTextureViewBase )