Determine depth/stencil texture aspect based off of image swizzle

Required since we can't have a non-rt image with both a depth/stencil aspect at the same time according to vk spec.
This commit is contained in:
Billy Laws
2022-04-11 23:42:36 +01:00
committed by PixelyIon
parent 1878e582ad
commit 2c697ec36a
4 changed files with 31 additions and 6 deletions

View File

@ -48,7 +48,7 @@ namespace skyline::gpu {
if (matchGuestTexture.format->IsCompatible(*guestTexture.format) && matchGuestTexture.dimensions == guestTexture.dimensions && matchGuestTexture.tileConfig == guestTexture.tileConfig) {
auto &texture{hostMapping->texture};
return texture->GetView(static_cast<vk::ImageViewType>(guestTexture.type), vk::ImageSubresourceRange{
.aspectMask = guestTexture.format->vkAspect,
.aspectMask = guestTexture.aspect,
.levelCount = texture->mipLevels,
.layerCount = texture->layerCount,
}, guestTexture.format, guestTexture.swizzle);
@ -80,7 +80,7 @@ namespace skyline::gpu {
}
return texture->GetView(static_cast<vk::ImageViewType>(guestTexture.type), vk::ImageSubresourceRange{
.aspectMask = guestTexture.format->vkAspect,
.aspectMask = guestTexture.aspect,
.levelCount = texture->mipLevels,
.layerCount = texture->layerCount,
}, guestTexture.format, guestTexture.swizzle);