vulkan: fix one validation error when sending a depth-stencil texture to a shader.

This commit is contained in:
Sasha Szpakowski
2024-03-31 16:48:12 -03:00
parent f32b6bde57
commit 6ac3c5f990
+4
View File
@@ -355,6 +355,10 @@ void Texture::createTextureImageView()
viewInfo.viewType = Vulkan::getImageViewType(getTextureType());
viewInfo.format = vulkanFormat.internalFormat;
viewInfo.subresourceRange.aspectMask = imageAspect;
// This view is used in descriptor sets, where having both depth and
// stencil aspects in the same view isn't allowed.
if (imageAspect & VK_IMAGE_ASPECT_DEPTH_BIT)
viewInfo.subresourceRange.aspectMask &= ~VK_IMAGE_ASPECT_STENCIL_BIT;
viewInfo.subresourceRange.baseMipLevel = rootView.startMipmap;
viewInfo.subresourceRange.levelCount = getMipmapCount();
viewInfo.subresourceRange.baseArrayLayer = rootView.startLayer;