소스 검색

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

BearishSun 9 년 전
부모
커밋
8ca20f7e95
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  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;
 	}