From ef2432a82253769209515af1af1d112afcd04472 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sun, 25 Nov 2018 13:42:52 -0800 Subject: Updated texture view creation error reporting --- Graphics/GraphicsEngine/include/TextureBase.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Graphics/GraphicsEngine') diff --git a/Graphics/GraphicsEngine/include/TextureBase.h b/Graphics/GraphicsEngine/include/TextureBase.h index 23eb1078..1aaec627 100644 --- a/Graphics/GraphicsEngine/include/TextureBase.h +++ b/Graphics/GraphicsEngine/include/TextureBase.h @@ -214,16 +214,16 @@ protected: template void TextureBase :: CorrectTextureViewDesc(struct TextureViewDesc& ViewDesc) { -#define TEX_VIEW_VALIDATION_ERROR(...) LOG_ERROR_AND_THROW( "Texture view '", ViewDesc.Name ? ViewDesc.Name : "", "': ", ##__VA_ARGS__ ) +#define TEX_VIEW_VALIDATION_ERROR(...) LOG_ERROR_AND_THROW( "\n Failed to create texture view '", (ViewDesc.Name ? ViewDesc.Name : ""), "' for texture '", this->m_Desc.Name, "': ", ##__VA_ARGS__ ) if( !(ViewDesc.ViewType > TEXTURE_VIEW_UNDEFINED && ViewDesc.ViewType < TEXTURE_VIEW_NUM_VIEWS) ) TEX_VIEW_VALIDATION_ERROR( "Texture view type is not specified" ); if( ViewDesc.MostDetailedMip >= this->m_Desc.MipLevels ) - TEX_VIEW_VALIDATION_ERROR( "Most detailed mip (", ViewDesc.MostDetailedMip, ") is out of range. Texture '", this->m_Desc.Name, "' has only ", this->m_Desc.MipLevels, " mip ", (this->m_Desc.MipLevels >= 1 ? "levels." : "level.")); + TEX_VIEW_VALIDATION_ERROR( "Most detailed mip (", ViewDesc.MostDetailedMip, ") is out of range. The texture has only ", this->m_Desc.MipLevels, " mip ", (this->m_Desc.MipLevels > 1 ? "levels." : "level.")); if( ViewDesc.NumMipLevels != TextureViewDesc::RemainingMipLevels && ViewDesc.MostDetailedMip + ViewDesc.NumMipLevels > this->m_Desc.MipLevels ) - TEX_VIEW_VALIDATION_ERROR( "Most detailed mip (", ViewDesc.MostDetailedMip, ") and number of mip levels in the view (", ViewDesc.NumMipLevels, ") is out of range. Texture '", this->m_Desc.Name, "' has only ", this->m_Desc.MipLevels, " mip ", (this->m_Desc.MipLevels >= 1 ? "levels." : "level.")); + TEX_VIEW_VALIDATION_ERROR( "Most detailed mip (", ViewDesc.MostDetailedMip, ") and number of mip levels in the view (", ViewDesc.NumMipLevels, ") is out of range. The texture has only ", this->m_Desc.MipLevels, " mip ", (this->m_Desc.MipLevels > 1 ? "levels." : "level.")); if( ViewDesc.Format == TEX_FORMAT_UNKNOWN ) ViewDesc.Format = GetDefaultTextureViewFormat( this->m_Desc.Format, ViewDesc.ViewType, this->m_Desc.BindFlags ); @@ -353,7 +353,7 @@ void TextureBase