Fix copying 4-byte 32-bit depth/stencil formats between buffers and textures.
This commit is contained in:
parent
8d9ee9b518
commit
67f659c064
@ -658,9 +658,12 @@ void MVKCmdBufferImageCopy::encode(MVKCommandEncoder* cmdEncoder) {
|
|||||||
bool wantStencil = mvkAreFlagsEnabled(imgFlags, VK_IMAGE_ASPECT_STENCIL_BIT);
|
bool wantStencil = mvkAreFlagsEnabled(imgFlags, VK_IMAGE_ASPECT_STENCIL_BIT);
|
||||||
|
|
||||||
// The stencil component is always 1 byte per pixel.
|
// The stencil component is always 1 byte per pixel.
|
||||||
|
// Don't reduce depths of 32-bit depth/stencil formats.
|
||||||
if (wantDepth && !wantStencil) {
|
if (wantDepth && !wantStencil) {
|
||||||
|
if (mvkMTLPixelFormatBytesPerTexel(mtlPixFmt) != 4) {
|
||||||
bytesPerRow -= buffImgWd;
|
bytesPerRow -= buffImgWd;
|
||||||
bytesPerImg -= buffImgWd * buffImgHt;
|
bytesPerImg -= buffImgWd * buffImgHt;
|
||||||
|
}
|
||||||
blitOptions |= MTLBlitOptionDepthFromDepthStencil;
|
blitOptions |= MTLBlitOptionDepthFromDepthStencil;
|
||||||
} else if (wantStencil && !wantDepth) {
|
} else if (wantStencil && !wantDepth) {
|
||||||
bytesPerRow = buffImgWd;
|
bytesPerRow = buffImgWd;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user