Skip to content

Commit

Permalink
Fixed the behavior of mipmapped staging textures on Vulkan.
Browse files Browse the repository at this point in the history
  • Loading branch information
apanteleev committed Oct 10, 2023
1 parent 89515b8 commit d4f6dbf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/vulkan/vulkan-staging-texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ namespace nvrhi::vulkan
{
assert(arraySlice == 0);
assert(z == 0);
assert(sliceRegions.size() == 1);
return sliceRegions[0];
assert(sliceRegions.size() == desc.mipLevels);
return sliceRegions[mipLevel];
}
}

Expand Down Expand Up @@ -182,7 +182,7 @@ namespace nvrhi::vulkan
srcMipSize.height = std::max(srcMipSize.height >> resolvedDstSlice.mipLevel, 1u);

auto dstRegion = dst->getSliceRegion(resolvedDstSlice.mipLevel, resolvedDstSlice.arraySlice, resolvedDstSlice.z);
assert((dstRegion.offset % 0x3) == 0); // per Vulkan spec
assert((dstRegion.offset & 0x3) == 0); // per Vulkan spec

TextureSubresourceSet srcSubresource = TextureSubresourceSet(
resolvedSrcSlice.mipLevel, 1,
Expand Down

0 comments on commit d4f6dbf

Please sign in to comment.