From f36e4d9aaf8bc6f3ae6a210cd0f3c4131172eced Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sun, 7 Oct 2018 09:30:24 -0700 Subject: Removed D3D11 debug names for Depth-stencil, Rasterizer, Blend states and samplers. D3D11 runtime caches these objects and setting different names generates warnings. Also not setting debug name for D3D11 cmd list. --- .../src/CommandListD3D11Impl.cpp | 5 ---- .../src/PipelineStateD3D11Impl.cpp | 30 +--------------------- .../GraphicsEngineD3D11/src/SamplerD3D11Impl.cpp | 5 ---- 3 files changed, 1 insertion(+), 39 deletions(-) (limited to 'Graphics/GraphicsEngineD3D11') diff --git a/Graphics/GraphicsEngineD3D11/src/CommandListD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/CommandListD3D11Impl.cpp index bff165fa..06e476c1 100644 --- a/Graphics/GraphicsEngineD3D11/src/CommandListD3D11Impl.cpp +++ b/Graphics/GraphicsEngineD3D11/src/CommandListD3D11Impl.cpp @@ -36,11 +36,6 @@ CommandListD3D11Impl :: CommandListD3D11Impl(IReferenceCounters* pRefCounters TCommandListBase(pRefCounters, pDevice), m_pd3d11CommandList(pd3d11CommandList) { - if (*m_Desc.Name != 0) - { - auto hr = m_pd3d11CommandList->SetPrivateData(WKPDID_D3DDebugObjectName, static_cast(strlen(m_Desc.Name)), m_Desc.Name); - DEV_CHECK_ERR(SUCCEEDED(hr), "Failed to set command list name"); - } } CommandListD3D11Impl :: ~CommandListD3D11Impl() diff --git a/Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp index ec672ca8..d61c85e1 100644 --- a/Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp +++ b/Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp @@ -96,7 +96,7 @@ PipelineStateD3D11Impl::PipelineStateD3D11Impl(IReferenceCounters* pRefCoun CHECK_D3D_RESULT_THROW( pDeviceD3D11->CreateDepthStencilState( &D3D11DSSDesc, &m_pd3d11DepthStencilState ), "Failed to create D3D11 depth stencil state" ); - // Create input layout + // Create input layout if( m_LayoutElements.size() > 0 ) { std::vector > d311InputElements(STD_ALLOCATOR_RAW_MEM(D3D11_INPUT_ELEMENT_DESC, GetRawAllocator(), "Allocator for vector") ); @@ -109,34 +109,6 @@ PipelineStateD3D11Impl::PipelineStateD3D11Impl(IReferenceCounters* pRefCoun CHECK_D3D_RESULT_THROW( pDeviceD3D11->CreateInputLayout(d311InputElements.data(), static_cast(d311InputElements.size()), pVSByteCode->GetBufferPointer(), pVSByteCode->GetBufferSize(), &m_pd3d11InputLayout ), "Failed to create the Direct3D11 input layout"); } - - if (*m_Desc.Name != 0) - { - { - String BSName = String(m_Desc.Name) + " - Blend State"; - auto hr = m_pd3d11BlendState->SetPrivateData(WKPDID_D3DDebugObjectName, static_cast(BSName.length()), BSName.c_str()); - DEV_CHECK_ERR(SUCCEEDED(hr), "Failed to set blend state name"); - } - - { - String DSSName = String(m_Desc.Name) + " - Depth-Stencil State"; - auto hr = m_pd3d11DepthStencilState->SetPrivateData(WKPDID_D3DDebugObjectName, static_cast(DSSName.length()), DSSName.c_str()); - DEV_CHECK_ERR(SUCCEEDED(hr), "Failed to set depth-stencil state name"); - } - - { - String RSName = String(m_Desc.Name) + " - Raterizer State"; - auto hr = m_pd3d11RasterizerState->SetPrivateData(WKPDID_D3DDebugObjectName, static_cast(RSName.length()), RSName.c_str()); - DEV_CHECK_ERR(SUCCEEDED(hr), "Failed to set rasterizer state name"); - } - - if (m_pd3d11InputLayout) - { - String LayoutName = String(m_Desc.Name) + " - Input Layout"; - auto hr = m_pd3d11InputLayout->SetPrivateData(WKPDID_D3DDebugObjectName, static_cast(LayoutName.length()), LayoutName.c_str()); - DEV_CHECK_ERR(SUCCEEDED(hr), "Failed to set input layout state name"); - } - } } if(PipelineDesc.SRBAllocationGranularity > 1) diff --git a/Graphics/GraphicsEngineD3D11/src/SamplerD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/SamplerD3D11Impl.cpp index 73a6785e..a2777163 100644 --- a/Graphics/GraphicsEngineD3D11/src/SamplerD3D11Impl.cpp +++ b/Graphics/GraphicsEngineD3D11/src/SamplerD3D11Impl.cpp @@ -50,11 +50,6 @@ SamplerD3D11Impl::SamplerD3D11Impl(IReferenceCounters* pRefCounters, }; CHECK_D3D_RESULT_THROW( pd3d11Device->CreateSamplerState(&D3D11SamplerDesc, &m_pd3dSampler), "Failed to create the Direct3D11 sampler"); - if (*m_Desc.Name != 0) - { - auto hr = m_pd3dSampler->SetPrivateData(WKPDID_D3DDebugObjectName, static_cast(strlen(m_Desc.Name)), m_Desc.Name); - DEV_CHECK_ERR(SUCCEEDED(hr), "Failed to set sampler name"); - } } SamplerD3D11Impl::~SamplerD3D11Impl() -- cgit v1.2.3