summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngine
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2019-04-19 15:11:58 +0000
committerEgor Yusov <egor.yusov@gmail.com>2019-04-19 15:11:58 +0000
commit3f81d1daa7b13e935cf43a6af30367f2b39c09bf (patch)
tree6203a390741d2179acca18397eced96af33167cb /Graphics/GraphicsEngine
parentFixed parameter issue in ALLOCATE macro (diff)
downloadDiligentCore-3f81d1daa7b13e935cf43a6af30367f2b39c09bf.tar.gz
DiligentCore-3f81d1daa7b13e935cf43a6af30367f2b39c09bf.zip
Fixed issues with multi-mip level staging resource in Vk and D3D12 back-ends
Diffstat (limited to 'Graphics/GraphicsEngine')
-rw-r--r--Graphics/GraphicsEngine/src/Texture.cpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/Graphics/GraphicsEngine/src/Texture.cpp b/Graphics/GraphicsEngine/src/Texture.cpp
index d33701ea..57b58279 100644
--- a/Graphics/GraphicsEngine/src/Texture.cpp
+++ b/Graphics/GraphicsEngine/src/Texture.cpp
@@ -238,18 +238,10 @@ void ValidateCopyTextureParams(const CopyTextureAttribs& CopyAttribs )
auto pSrcBox = CopyAttribs.pSrcBox;
if( pSrcBox == nullptr )
{
- SrcBox.MaxX = std::max( SrcTexDesc.Width >> CopyAttribs.SrcMipLevel, 1u );
- if( SrcTexDesc.Type == RESOURCE_DIM_TEX_1D ||
- SrcTexDesc.Type == RESOURCE_DIM_TEX_1D_ARRAY )
- SrcBox.MaxY = 1;
- else
- SrcBox.MaxY = std::max( SrcTexDesc.Height >> CopyAttribs.SrcMipLevel, 1u );
-
- if( SrcTexDesc.Type == RESOURCE_DIM_TEX_3D )
- SrcBox.MaxZ = std::max( SrcTexDesc.Depth >> CopyAttribs.SrcMipLevel, 1u );
- else
- SrcBox.MaxZ = 1;
-
+ auto MipLevelAttribs = GetMipLevelProperties(SrcTexDesc, CopyAttribs.SrcMipLevel);
+ SrcBox.MaxX = MipLevelAttribs.Width;
+ SrcBox.MaxY = MipLevelAttribs.Height;
+ SrcBox.MaxZ = MipLevelAttribs.Depth;
pSrcBox = &SrcBox;
}
ValidateTextureRegion(SrcTexDesc, CopyAttribs.SrcMipLevel, CopyAttribs.SrcSlice, *pSrcBox);