From c6d44b47d43e18609e94beae4aeeddfc60fbb7d0 Mon Sep 17 00:00:00 2001 From: Jin Jung Date: Tue, 30 Sep 2025 14:52:05 -0700 Subject: [PATCH] Fix VulkanTest::CreateMappedStorage _WIN64 segfault (#1173) * Fix VulkanTest::CreateMappedStorage _WIN64 segfault * Fix Indentation --- .../catch/unit/vulkan_interop/vulkan_test.hh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/projects/hip-tests/catch/unit/vulkan_interop/vulkan_test.hh b/projects/hip-tests/catch/unit/vulkan_interop/vulkan_test.hh index a1fef6a694..df5bfa9d50 100644 --- a/projects/hip-tests/catch/unit/vulkan_interop/vulkan_test.hh +++ b/projects/hip-tests/catch/unit/vulkan_interop/vulkan_test.hh @@ -300,14 +300,16 @@ VulkanTest::MappedBuffer VulkanTest::CreateMappedStorage(uint32_t count, } VkExportMemoryAllocateInfoKHR vulkan_export_memory_allocate_info = {}; +#ifdef _WIN64 + WindowsSecurityAttributes winSecurityAttributes; + VkExportMemoryWin32HandleInfoKHR vulkanExportMemoryWin32HandleInfoKHR = {}; +#endif + if (external) { vulkan_export_memory_allocate_info.sType = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHR; vulkan_export_memory_allocate_info.handleTypes = _mem_handle_type; #ifdef _WIN64 - WindowsSecurityAttributes winSecurityAttributes; - - VkExportMemoryWin32HandleInfoKHR vulkanExportMemoryWin32HandleInfoKHR = {}; vulkanExportMemoryWin32HandleInfoKHR.sType = VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR; vulkanExportMemoryWin32HandleInfoKHR.pNext = NULL; @@ -321,6 +323,7 @@ VulkanTest::MappedBuffer VulkanTest::CreateMappedStorage(uint32_t count, ? &vulkanExportMemoryWin32HandleInfoKHR : NULL; #endif + allocate_info.pNext = &vulkan_export_memory_allocate_info; } @@ -338,4 +341,4 @@ VulkanTest::MappedBuffer VulkanTest::CreateMappedStorage(uint32_t count, // Sometimes in CUDA the stream is not immediately ready after a semaphore has been signaled void PollStream(hipStream_t stream, hipError_t expected, uint32_t num_iterations = 5); -hipExternalSemaphore_t ImportBinarySemaphore(VulkanTest& vkt); \ No newline at end of file +hipExternalSemaphore_t ImportBinarySemaphore(VulkanTest& vkt);