From e0872e1f5fe04904e6fbab8555aa9819ad2c7b80 Mon Sep 17 00:00:00 2001 From: zackory137c-hash Date: Fri, 6 Mar 2026 01:31:31 -0800 Subject: [PATCH] Add and expose native handles and converter for NVidia Streamline Integration --- Graphics/GraphicsEngineVulkan/include/TextureVkImpl.hpp | 5 +++++ .../GraphicsEngineVulkan/include/VulkanTypeConversions.hpp | 2 ++ Graphics/GraphicsEngineVulkan/src/TextureVkImpl.cpp | 6 +++--- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Graphics/GraphicsEngineVulkan/include/TextureVkImpl.hpp b/Graphics/GraphicsEngineVulkan/include/TextureVkImpl.hpp index 149d09d768..e983588a46 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 f2a1f49a20..c162cefb5c 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 de997ee6f6..94a9fd72b6 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)