Commit 4ac42dbf by Chris Forbes

Punt image->image copies requiring quadlayout awareness to blitter

Bug: b/132156862 Test: dEQP-VK.api.* Test: dEQP-VK.image.* Change-Id: I3672bb34e9556c65ba9630f66e7d926fb15761ea Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/30888Tested-by: 's avatarChris Forbes <chrisforbes@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 011744e6
...@@ -163,9 +163,16 @@ void Image::copyTo(VkImage dstImage, const VkImageCopy& pRegion) ...@@ -163,9 +163,16 @@ void Image::copyTo(VkImage dstImage, const VkImageCopy& pRegion)
UNIMPLEMENTED("dstSubresource"); UNIMPLEMENTED("dstSubresource");
} }
if((samples > VK_SAMPLE_COUNT_1_BIT) && (imageType == VK_IMAGE_TYPE_2D) && !format.isNonNormalizedInteger()) VkImageAspectFlagBits srcAspect = static_cast<VkImageAspectFlagBits>(pRegion.srcSubresource.aspectMask);
VkImageAspectFlagBits dstAspect = static_cast<VkImageAspectFlagBits>(pRegion.dstSubresource.aspectMask);
Format srcFormat = getFormat(srcAspect);
Format dstFormat = dst->getFormat(dstAspect);
if(((samples > VK_SAMPLE_COUNT_1_BIT) && (imageType == VK_IMAGE_TYPE_2D) && !format.isNonNormalizedInteger()) ||
srcFormat.hasQuadLayout() || dstFormat.hasQuadLayout())
{ {
// Requires multisampling resolve // Requires multisampling resolve, or quadlayout awareness
VkImageBlit region; VkImageBlit region;
region.srcSubresource = pRegion.srcSubresource; region.srcSubresource = pRegion.srcSubresource;
region.srcOffsets[0] = pRegion.srcOffset; region.srcOffsets[0] = pRegion.srcOffset;
...@@ -182,19 +189,9 @@ void Image::copyTo(VkImage dstImage, const VkImageCopy& pRegion) ...@@ -182,19 +189,9 @@ void Image::copyTo(VkImage dstImage, const VkImageCopy& pRegion)
return device->getBlitter()->blit(this, dst, region, VK_FILTER_NEAREST); return device->getBlitter()->blit(this, dst, region, VK_FILTER_NEAREST);
} }
VkImageAspectFlagBits srcAspect = static_cast<VkImageAspectFlagBits>(pRegion.srcSubresource.aspectMask);
VkImageAspectFlagBits dstAspect = static_cast<VkImageAspectFlagBits>(pRegion.dstSubresource.aspectMask);
Format srcFormat = getFormat(srcAspect);
Format dstFormat = dst->getFormat(dstAspect);
int srcBytesPerBlock = srcFormat.bytesPerBlock(); int srcBytesPerBlock = srcFormat.bytesPerBlock();
ASSERT(srcBytesPerBlock == dstFormat.bytesPerBlock()); ASSERT(srcBytesPerBlock == dstFormat.bytesPerBlock());
if (srcFormat.hasQuadLayout() || dstFormat.hasQuadLayout())
{
UNIMPLEMENTED("Quad layout copies");
}
const uint8_t* srcMem = static_cast<const uint8_t*>(getTexelPointer(pRegion.srcOffset, pRegion.srcSubresource)); const uint8_t* srcMem = static_cast<const uint8_t*>(getTexelPointer(pRegion.srcOffset, pRegion.srcSubresource));
uint8_t* dstMem = static_cast<uint8_t*>(dst->getTexelPointer(pRegion.dstOffset, pRegion.dstSubresource)); uint8_t* dstMem = static_cast<uint8_t*>(dst->getTexelPointer(pRegion.dstOffset, pRegion.dstSubresource));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment