Clamp miplevel size to avoid zero width or height
I was seeing a zero height in certain circumstances for textures in scenerendering.
This commit is contained in:
parent
3977935d94
commit
bdc3b44e7d
1 changed files with 2 additions and 2 deletions
|
|
@ -182,8 +182,8 @@ namespace vks
|
|||
bufferCopyRegion.imageSubresource.mipLevel = i;
|
||||
bufferCopyRegion.imageSubresource.baseArrayLayer = 0;
|
||||
bufferCopyRegion.imageSubresource.layerCount = 1;
|
||||
bufferCopyRegion.imageExtent.width = ktxTexture->baseWidth >> i;
|
||||
bufferCopyRegion.imageExtent.height = ktxTexture->baseHeight >> i;
|
||||
bufferCopyRegion.imageExtent.width = std::max(1u, ktxTexture->baseWidth >> i);
|
||||
bufferCopyRegion.imageExtent.height = std::max(1u, ktxTexture->baseHeight >> i);
|
||||
bufferCopyRegion.imageExtent.depth = 1;
|
||||
bufferCopyRegion.bufferOffset = offset;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue