summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngine
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-07-06 17:41:55 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-07-06 17:41:55 +0000
commitb3311e60b7dc6ee1581469e2d3ac8854cdcb5ba0 (patch)
treef86c8128992f1ae2a4511ca124314b37411384ab /Graphics/GraphicsEngine
parentAlways using negative viewport height in Vulkan to be 100% consistent with Di... (diff)
downloadDiligentCore-b3311e60b7dc6ee1581469e2d3ac8854cdcb5ba0.tar.gz
DiligentCore-b3311e60b7dc6ee1581469e2d3ac8854cdcb5ba0.zip
Fixed Vulkan swapchain present error when window is minimized
Diffstat (limited to 'Graphics/GraphicsEngine')
-rw-r--r--Graphics/GraphicsEngine/src/Texture.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/Graphics/GraphicsEngine/src/Texture.cpp b/Graphics/GraphicsEngine/src/Texture.cpp
index b1769cf3..b8d30af8 100644
--- a/Graphics/GraphicsEngine/src/Texture.cpp
+++ b/Graphics/GraphicsEngine/src/Texture.cpp
@@ -37,12 +37,32 @@ void ValidateTextureDesc( const TextureDesc& Desc )
LOG_TEXTURE_ERROR_AND_THROW("Resource dimension is undefined");
}
+ if ( !(Desc.Type >= RESOURCE_DIM_TEX_1D && Desc.Type <= RESOURCE_DIM_TEX_CUBE_ARRAY) )
+ {
+ LOG_TEXTURE_ERROR_AND_THROW("Unexpected resource dimension");
+ }
+
+ if (Desc.Width == 0)
+ {
+ LOG_TEXTURE_ERROR_AND_THROW("Texture width cannot be zero");
+ }
+
// Perform some parameter correctness check
if( Desc.Type == RESOURCE_DIM_TEX_1D || Desc.Type == RESOURCE_DIM_TEX_1D_ARRAY )
{
if( Desc.Height != 1 )
LOG_TEXTURE_ERROR_AND_THROW("Height (", Desc.Height,") of Texture 1D/Texture 1D Array must be 1");
}
+ else
+ {
+ if (Desc.Height == 0)
+ LOG_TEXTURE_ERROR_AND_THROW("Texture height cannot be zero");
+ }
+
+ if( Desc.Type == RESOURCE_DIM_TEX_3D && Desc.Depth == 0 )
+ {
+ LOG_TEXTURE_ERROR_AND_THROW("3D texture depth cannot be zero");
+ }
if( Desc.Type == RESOURCE_DIM_TEX_1D || Desc.Type == RESOURCE_DIM_TEX_2D )
{