From eb0a492f513c18f210b52b44c475a85b76b77afb Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Thu, 19 Sep 2019 18:21:36 +0200 Subject: [PATCH] [dxvk] Add initial layout to initImage Allows us to initialize an image from the PREINITIALIZED layout. --- src/dxvk/dxvk_context.cpp | 5 +++-- src/dxvk/dxvk_context.h | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/dxvk/dxvk_context.cpp b/src/dxvk/dxvk_context.cpp index 2dafdd693..7a7a0fc2b 100644 --- a/src/dxvk/dxvk_context.cpp +++ b/src/dxvk/dxvk_context.cpp @@ -1610,9 +1610,10 @@ namespace dxvk { void DxvkContext::initImage( const Rc& image, - const VkImageSubresourceRange& subresources) { + const VkImageSubresourceRange& subresources, + VkImageLayout initialLayout) { m_execBarriers.accessImage(image, subresources, - VK_IMAGE_LAYOUT_UNDEFINED, 0, 0, + initialLayout, 0, 0, image->info().layout, image->info().stages, image->info().access); diff --git a/src/dxvk/dxvk_context.h b/src/dxvk/dxvk_context.h index 9299a6f9c..0ab86361c 100644 --- a/src/dxvk/dxvk_context.h +++ b/src/dxvk/dxvk_context.h @@ -627,10 +627,12 @@ namespace dxvk { * while discarding any previous contents. * \param [in] image The image to initialize * \param [in] subresources Image subresources + * \param [in] initialLayout Initial image layout */ void initImage( const Rc& image, - const VkImageSubresourceRange& subresources); + const VkImageSubresourceRange& subresources, + VkImageLayout initialLayout); /** * \brief Invalidates a buffer's contents