Commit b188cf9e by Nicolas Capens Committed by Nicolas Capens

Fix baseMipLevel usage

The imageView's baseMipLevel is already taken into account when obtaining each level's parameters, so don't offset a second time. Bug b/129523279 Tests: dEQP-VK.texture.mipmap.* Change-Id: I5a5c35f36d2f8517136c095f8c80202984a777bd Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/31690 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarChris Forbes <chrisforbes@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 1e322233
...@@ -360,12 +360,10 @@ void DescriptorSetLayout::WriteDescriptorSet(DescriptorSet *dstSet, VkDescriptor ...@@ -360,12 +360,10 @@ void DescriptorSetLayout::WriteDescriptorSet(DescriptorSet *dstSet, VkDescriptor
imageSampler[i].format = imageView->getFormat(ImageView::SAMPLING); imageSampler[i].format = imageView->getFormat(ImageView::SAMPLING);
auto &subresourceRange = imageView->getSubresourceRange(); auto &subresourceRange = imageView->getSubresourceRange();
int baseLevel = subresourceRange.baseMipLevel;
for(int mipmapLevel = 0; mipmapLevel < sw::MIPMAP_LEVELS; mipmapLevel++) for(int mipmapLevel = 0; mipmapLevel < sw::MIPMAP_LEVELS; mipmapLevel++)
{ {
int level = mipmapLevel - baseLevel; // Level within the image view int level = sw::clamp(mipmapLevel, 0, (int)subresourceRange.levelCount - 1); // Level within the image view
level = sw::clamp(level, 0, (int)subresourceRange.levelCount - 1);
VkImageAspectFlagBits aspect = VK_IMAGE_ASPECT_COLOR_BIT; VkImageAspectFlagBits aspect = VK_IMAGE_ASPECT_COLOR_BIT;
sw::Mipmap &mipmap = texture->mipmap[mipmapLevel]; sw::Mipmap &mipmap = texture->mipmap[mipmapLevel];
......
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