Fix various cases of image views with incorrect stencil aspect
This commit is contained in:
parent
397c2e6d9b
commit
9fef899e42
9 changed files with 27 additions and 9 deletions
|
|
@ -190,7 +190,9 @@ public:
|
|||
}
|
||||
if (usage & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT)
|
||||
{
|
||||
aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT;
|
||||
aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT;
|
||||
if (format >= VK_FORMAT_D16_UNORM_S8_UINT)
|
||||
aspectMask |=VK_IMAGE_ASPECT_STENCIL_BIT;
|
||||
imageLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -314,7 +314,9 @@ public:
|
|||
}
|
||||
if (usage & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT)
|
||||
{
|
||||
aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT;
|
||||
aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT;
|
||||
if (format >= VK_FORMAT_D16_UNORM_S8_UINT)
|
||||
aspectMask |=VK_IMAGE_ASPECT_STENCIL_BIT;
|
||||
imageLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -186,7 +186,9 @@ public:
|
|||
viewInfo.components.g = VK_COMPONENT_SWIZZLE_G;
|
||||
viewInfo.components.b = VK_COMPONENT_SWIZZLE_B;
|
||||
viewInfo.components.a = VK_COMPONENT_SWIZZLE_A;
|
||||
viewInfo.subresourceRange.aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT;
|
||||
viewInfo.subresourceRange.aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT;
|
||||
if (depthFormat >= VK_FORMAT_D16_UNORM_S8_UINT)
|
||||
viewInfo.subresourceRange.aspectMask |= VK_IMAGE_ASPECT_STENCIL_BIT;
|
||||
viewInfo.subresourceRange.levelCount = 1;
|
||||
viewInfo.subresourceRange.layerCount = 1;
|
||||
|
||||
|
|
|
|||
|
|
@ -150,7 +150,9 @@ public:
|
|||
depthStencilView.format = depthFormat;
|
||||
depthStencilView.flags = 0;
|
||||
depthStencilView.subresourceRange = {};
|
||||
depthStencilView.subresourceRange.aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT;
|
||||
depthStencilView.subresourceRange.aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT;
|
||||
if (depthFormat >= VK_FORMAT_D16_UNORM_S8_UINT)
|
||||
depthStencilView.subresourceRange.aspectMask |= VK_IMAGE_ASPECT_STENCIL_BIT;
|
||||
depthStencilView.subresourceRange.baseMipLevel = 0;
|
||||
depthStencilView.subresourceRange.levelCount = 1;
|
||||
depthStencilView.subresourceRange.baseArrayLayer = 0;
|
||||
|
|
|
|||
|
|
@ -209,7 +209,9 @@ public:
|
|||
depthStencilView.format = fbDepthFormat;
|
||||
depthStencilView.flags = 0;
|
||||
depthStencilView.subresourceRange = {};
|
||||
depthStencilView.subresourceRange.aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT;
|
||||
depthStencilView.subresourceRange.aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT;
|
||||
if (fbDepthFormat >= VK_FORMAT_D16_UNORM_S8_UINT)
|
||||
depthStencilView.subresourceRange.aspectMask |= VK_IMAGE_ASPECT_STENCIL_BIT;
|
||||
depthStencilView.subresourceRange.baseMipLevel = 0;
|
||||
depthStencilView.subresourceRange.levelCount = 1;
|
||||
depthStencilView.subresourceRange.baseArrayLayer = 0;
|
||||
|
|
|
|||
|
|
@ -208,7 +208,9 @@ public:
|
|||
depthStencilView.format = fbDepthFormat;
|
||||
depthStencilView.flags = 0;
|
||||
depthStencilView.subresourceRange = {};
|
||||
depthStencilView.subresourceRange.aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT;
|
||||
depthStencilView.subresourceRange.aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT;
|
||||
if (fbDepthFormat >= VK_FORMAT_D16_UNORM_S8_UINT)
|
||||
depthStencilView.subresourceRange.aspectMask |= VK_IMAGE_ASPECT_STENCIL_BIT;
|
||||
depthStencilView.subresourceRange.baseMipLevel = 0;
|
||||
depthStencilView.subresourceRange.levelCount = 1;
|
||||
depthStencilView.subresourceRange.baseArrayLayer = 0;
|
||||
|
|
|
|||
|
|
@ -418,7 +418,9 @@ public:
|
|||
depthStencilView.format = depthFormat;
|
||||
depthStencilView.flags = 0;
|
||||
depthStencilView.subresourceRange = {};
|
||||
depthStencilView.subresourceRange.aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT;
|
||||
depthStencilView.subresourceRange.aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT;
|
||||
if (depthFormat >= VK_FORMAT_D16_UNORM_S8_UINT)
|
||||
depthStencilView.subresourceRange.aspectMask |= VK_IMAGE_ASPECT_STENCIL_BIT;
|
||||
depthStencilView.subresourceRange.baseMipLevel = 0;
|
||||
depthStencilView.subresourceRange.levelCount = 1;
|
||||
depthStencilView.subresourceRange.baseArrayLayer = 0;
|
||||
|
|
|
|||
|
|
@ -291,7 +291,9 @@ public:
|
|||
depthStencilView.format = fbDepthFormat;
|
||||
depthStencilView.flags = 0;
|
||||
depthStencilView.subresourceRange = {};
|
||||
depthStencilView.subresourceRange.aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT;
|
||||
depthStencilView.subresourceRange.aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT;
|
||||
if (fbDepthFormat >= VK_FORMAT_D16_UNORM_S8_UINT)
|
||||
depthStencilView.subresourceRange.aspectMask |= VK_IMAGE_ASPECT_STENCIL_BIT;
|
||||
depthStencilView.subresourceRange.baseMipLevel = 0;
|
||||
depthStencilView.subresourceRange.levelCount = 1;
|
||||
depthStencilView.subresourceRange.baseArrayLayer = 0;
|
||||
|
|
|
|||
|
|
@ -196,7 +196,9 @@ public:
|
|||
}
|
||||
if (usage & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT)
|
||||
{
|
||||
aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT;
|
||||
aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT;
|
||||
if (format >= VK_FORMAT_D16_UNORM_S8_UINT)
|
||||
aspectMask |=VK_IMAGE_ASPECT_STENCIL_BIT;
|
||||
}
|
||||
|
||||
assert(aspectMask > 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue