diff --git a/Graphics/GraphicsEngineVulkan/include/TextureVkImpl.hpp b/Graphics/GraphicsEngineVulkan/include/TextureVkImpl.hpp index 149d09d76..e983588a4 100644 --- a/Graphics/GraphicsEngineVulkan/include/TextureVkImpl.hpp +++ b/Graphics/GraphicsEngineVulkan/include/TextureVkImpl.hpp @@ -89,6 +89,11 @@ class TextureVkImpl final : public TextureBase return StagingDataCPUAddress; } + VulkanUtilities::MemoryAllocation& GetMemoryAllocation() + { + return m_MemoryAllocation; + } + void InvalidateStagingRange(VkDeviceSize Offset, VkDeviceSize Size); // For non-compressed color format buffer, the offset must be a multiple of the format's texel block size. diff --git a/Graphics/GraphicsEngineVulkan/include/VulkanTypeConversions.hpp b/Graphics/GraphicsEngineVulkan/include/VulkanTypeConversions.hpp index f2a1f49a2..c162cefb5 100644 --- a/Graphics/GraphicsEngineVulkan/include/VulkanTypeConversions.hpp +++ b/Graphics/GraphicsEngineVulkan/include/VulkanTypeConversions.hpp @@ -37,6 +37,8 @@ namespace Diligent { +struct RenderDeviceVkImpl; +VkImageCreateInfo TextureDescToVkImageCreateInfo(const TextureDesc& Desc, const RenderDeviceVkImpl* pRenderDeviceVk) noexcept; VkFormat TexFormatToVkFormat(TEXTURE_FORMAT TexFmt); TEXTURE_FORMAT VkFormatToTexFormat(VkFormat VkFmt); diff --git a/Graphics/GraphicsEngineVulkan/src/TextureVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/TextureVkImpl.cpp index de997ee6f..94a9fd72b 100644 --- a/Graphics/GraphicsEngineVulkan/src/TextureVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/TextureVkImpl.cpp @@ -38,9 +38,6 @@ namespace Diligent { -namespace -{ - VkImageCreateInfo TextureDescToVkImageCreateInfo(const TextureDesc& Desc, const RenderDeviceVkImpl* pRenderDeviceVk) noexcept { const bool IsMemoryless = (Desc.MiscFlags & MISC_TEXTURE_FLAG_MEMORYLESS) != 0; @@ -147,6 +144,9 @@ VkImageCreateInfo TextureDescToVkImageCreateInfo(const TextureDesc& Desc, const return ImageCI; } +namespace +{ + VkImageLayout VkImageLayoutFromUsage(VkImageUsageFlags Usage) { if ((Usage & (VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT)) != 0)