mirror of
https://github.com/love2d/love.git
synced 2026-08-19 12:14:20 +02:00
vulkan: fix validation errors when generating mipmaps for a compute-writable texture.
This commit is contained in:
@@ -491,11 +491,22 @@ void Texture::generateMipmapsInternal()
|
|||||||
blit.dstSubresource.baseArrayLayer = rootView.startLayer;
|
blit.dstSubresource.baseArrayLayer = rootView.startLayer;
|
||||||
blit.dstSubresource.layerCount = static_cast<uint32_t>(layerCount);
|
blit.dstSubresource.layerCount = static_cast<uint32_t>(layerCount);
|
||||||
|
|
||||||
vkCmdBlitImage(commandBuffer,
|
if (imageLayout != VK_IMAGE_LAYOUT_GENERAL)
|
||||||
textureImage, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
|
{
|
||||||
textureImage, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
|
vkCmdBlitImage(commandBuffer,
|
||||||
1, &blit,
|
textureImage, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
|
||||||
VK_FILTER_LINEAR);
|
textureImage, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
|
||||||
|
1, &blit,
|
||||||
|
VK_FILTER_LINEAR);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
vkCmdBlitImage(commandBuffer,
|
||||||
|
textureImage, VK_IMAGE_LAYOUT_GENERAL,
|
||||||
|
textureImage, VK_IMAGE_LAYOUT_GENERAL,
|
||||||
|
1, &blit,
|
||||||
|
VK_FILTER_LINEAR);
|
||||||
|
}
|
||||||
|
|
||||||
barrier.oldLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL;
|
barrier.oldLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL;
|
||||||
barrier.newLayout = imageLayout;
|
barrier.newLayout = imageLayout;
|
||||||
|
|||||||
Reference in New Issue
Block a user