From de0549ae632c6ad7919ccbdb3fc9a1c7dcb983ee Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sat, 13 Apr 2019 09:49:29 -0700 Subject: Improved names of default texture views --- Graphics/GraphicsEngine/include/TextureBase.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'Graphics/GraphicsEngine') diff --git a/Graphics/GraphicsEngine/include/TextureBase.h b/Graphics/GraphicsEngine/include/TextureBase.h index 939c0e3a..04922e1f 100644 --- a/Graphics/GraphicsEngine/include/TextureBase.h +++ b/Graphics/GraphicsEngine/include/TextureBase.h @@ -31,6 +31,7 @@ #include "DeviceObjectBase.h" #include "GraphicsAccessories.h" #include "STDAllocator.h" +#include "FormatString.h" #include namespace Diligent @@ -448,10 +449,13 @@ void TextureBasem_Desc.BindFlags & BIND_SHADER_RESOURCE ) + if (this->m_Desc.BindFlags & BIND_SHADER_RESOURCE ) { TextureViewDesc ViewDesc; ViewDesc.ViewType = TEXTURE_VIEW_SHADER_RESOURCE; + auto ViewName = FormatString("Default SRV of texture '", this->m_Desc.Name, "'"); + ViewDesc.Name = ViewName.c_str(); + ITextureView *pSRV = nullptr; if ((this->m_Desc.MiscFlags & MISC_TEXTURE_FLAG_GENERATE_MIPS) != 0) ViewDesc.Flags |= TEXTURE_VIEW_FLAG_ALLOW_MIP_MAP_GENERATION; @@ -464,6 +468,9 @@ void TextureBasem_Desc.Name, "'"); + ViewDesc.Name = ViewName.c_str(); + ITextureView *pRTV = nullptr; CreateViewInternal( ViewDesc, &pRTV, true ); m_pDefaultRTV.reset( static_cast(pRTV) ); @@ -474,6 +481,9 @@ void TextureBasem_Desc.Name, "'"); + ViewDesc.Name = ViewName.c_str(); + ITextureView *pDSV = nullptr; CreateViewInternal( ViewDesc, &pDSV, true ); m_pDefaultDSV.reset( static_cast(pDSV) ); @@ -484,6 +494,9 @@ void TextureBasem_Desc.Name, "'"); + ViewDesc.Name = ViewName.c_str(); + ViewDesc.AccessFlags = UAV_ACCESS_FLAG_READ_WRITE; ITextureView *pUAV = nullptr; CreateViewInternal( ViewDesc, &pUAV, true ); -- cgit v1.2.3