Commit 8ce8707b by Nicolas Capens Committed by Nicolas Capens

Fix single-plane views of YCbCr formats

Image views can select a single plane from a multi-planar format, so make sure we use the original plane aspect instead of assuming the color aspect. Bug: b/132437008 Tests: dEQP-VK.*ycbcr* Change-Id: I81c4c8b05e894c5f48d5718e912d5f6ee747a7e5 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/31617 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarBen Clayton <bclayton@google.com>
parent fcc64415
...@@ -368,7 +368,7 @@ void DescriptorSetLayout::WriteDescriptorSet(DescriptorSet *dstSet, VkDescriptor ...@@ -368,7 +368,7 @@ void DescriptorSetLayout::WriteDescriptorSet(DescriptorSet *dstSet, VkDescriptor
{ {
int level = sw::clamp(mipmapLevel, 0, (int)subresourceRange.levelCount - 1); // Level within the image view int level = sw::clamp(mipmapLevel, 0, (int)subresourceRange.levelCount - 1); // Level within the image view
VkImageAspectFlagBits aspect = VK_IMAGE_ASPECT_COLOR_BIT; VkImageAspectFlagBits aspect = static_cast<VkImageAspectFlagBits>(imageView->getSubresourceRange().aspectMask);
sw::Mipmap &mipmap = texture->mipmap[mipmapLevel]; sw::Mipmap &mipmap = texture->mipmap[mipmapLevel];
if(imageView->getType() == VK_IMAGE_VIEW_TYPE_CUBE) if(imageView->getType() == VK_IMAGE_VIEW_TYPE_CUBE)
......
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