Browse Source

Vulkan: Fixed an issue where layout transitions on the depth-stencil buffer would only transition the depth portion, without the stencil portion

BearishSun 9 years ago
parent
commit
8ca20f7e95
1 changed files with 5 additions and 1 deletions
  1. 5 1
      Source/BansheeVulkanRenderAPI/Source/BsVulkanTexture.cpp

+ 5 - 1
Source/BansheeVulkanRenderAPI/Source/BsVulkanTexture.cpp

@@ -210,12 +210,16 @@ namespace bs
 	VkImageSubresourceRange VulkanImage::getRange() const
 	{
 		VkImageSubresourceRange range;
-		range.aspectMask = mImageViewCI.subresourceRange.aspectMask;
 		range.baseArrayLayer = 0;
 		range.layerCount = mNumFaces;
 		range.baseMipLevel = 0;
 		range.levelCount = mNumMipLevels;
 
+		if (mIsDepthStencil)
+			range.aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT;
+		else
+			range.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
+
 		return range;
 	}