Add SEPARATE_DEPTH_STENCIL_LAYOUTS support in new image state

Change-Id: I54458143cd075c0239f55ccb7e50916d725188ec
This commit is contained in:
Benson Joeris
2020-01-23 17:50:55 -05:00
committed by Baldur Karlsson
parent cb66100840
commit a03499d909
4 changed files with 12 additions and 6 deletions
+1 -1
View File
@@ -133,7 +133,7 @@ void CheckSubresourceState(const ImageSubresourceState &substate,
TEST_CASE("Test ImageState type", "[imagestate]")
{
ImageTransitionInfo transitionInfo(CaptureState::ActiveCapturing, 0);
ImageTransitionInfo transitionInfo(CaptureState::ActiveCapturing, 0, true);
VkImage image = (VkImage)123;
VkFormat format = VK_FORMAT_D16_UNORM_S8_UINT;
VkExtent3D extent = {100, 100, 13};
+1 -1
View File
@@ -1056,7 +1056,7 @@ public:
inline ImageTransitionInfo GetImageTransitionInfo() const
{
return ImageTransitionInfo(m_State, m_QueueFamilyIdx);
return ImageTransitionInfo(m_State, m_QueueFamilyIdx, SeparateDepthStencil());
}
// Device initialization
+4 -2
View File
@@ -1211,7 +1211,8 @@ void ImageState::ResetToOldState(ImageBarrierSequence &barriers, ImageTransition
}
if((GetImageInfo().Aspects() & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) ==
(VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT))
(VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT) &&
!info.separateDepthStencil)
{
// This is a subresource of a depth and stencil image, and
// VK_KHR_separate_depth_stencil_layouts is not enabled, so the barrier needs to include both
@@ -1348,7 +1349,8 @@ void ImageState::Transition(const ImageState &dstState, VkAccessFlags srcAccessM
VkImageAspectFlags aspectMask = srcRng.aspectMask & dstRng.aspectMask;
if((GetImageInfo().Aspects() & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) ==
(VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT))
(VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT) &&
!info.separateDepthStencil)
{
// This is a subresource of a depth and stencil image, and
// VK_KHR_separate_depth_stencil_layouts is not enabled, so the barrier needs to include
+6 -2
View File
@@ -1540,8 +1540,12 @@ struct ImageTransitionInfo
{
CaptureState capState;
uint32_t defaultQueueFamilyIndex;
inline ImageTransitionInfo(CaptureState capState, uint32_t defaultQueueFamilyIndex)
: capState(capState), defaultQueueFamilyIndex(defaultQueueFamilyIndex)
bool separateDepthStencil;
inline ImageTransitionInfo(CaptureState capState, uint32_t defaultQueueFamilyIndex,
bool separateDepthStencil)
: capState(capState),
defaultQueueFamilyIndex(defaultQueueFamilyIndex),
separateDepthStencil(separateDepthStencil)
{
}
inline FrameRefCompFunc GetFrameRefCompFunc()