mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-22 07:09:03 +00:00
Import Vulkan resources via named NT handle (#1895)
Add coverage to import Vulkan resources (memory and semaphore) in Windows via named NT handles. If no name is given during resource creation, then use NT handles for import. If a name is given, have an option to either use that name or get the NT handle and use that for import. Resolves KhronosGroup/OpenCL-Docs#943
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#include "vulkan_list_map.hpp"
|
||||
#include "vulkan_api_list.hpp"
|
||||
#include <memory>
|
||||
#include <cassert>
|
||||
|
||||
class VulkanInstance {
|
||||
friend const VulkanInstance &getVulkanInstance();
|
||||
@@ -581,7 +582,7 @@ protected:
|
||||
VkDeviceMemory m_vkDeviceMemory;
|
||||
uint64_t m_size;
|
||||
bool m_isDedicated;
|
||||
|
||||
const std::wstring m_name;
|
||||
|
||||
VulkanDeviceMemory(const VulkanDeviceMemory &deviceMemory);
|
||||
|
||||
@@ -590,17 +591,17 @@ public:
|
||||
const VulkanMemoryType &memoryType,
|
||||
VulkanExternalMemoryHandleType externalMemoryHandleType =
|
||||
VULKAN_EXTERNAL_MEMORY_HANDLE_TYPE_NONE,
|
||||
const void *name = NULL);
|
||||
const std::wstring name = L"");
|
||||
VulkanDeviceMemory(const VulkanDevice &device, const VulkanImage &image,
|
||||
const VulkanMemoryType &memoryType,
|
||||
VulkanExternalMemoryHandleType externalMemoryHandleType =
|
||||
VULKAN_EXTERNAL_MEMORY_HANDLE_TYPE_NONE,
|
||||
const void *name = NULL);
|
||||
const std::wstring name = L"");
|
||||
VulkanDeviceMemory(const VulkanDevice &device, const VulkanBuffer &buffer,
|
||||
const VulkanMemoryType &memoryType,
|
||||
VulkanExternalMemoryHandleType externalMemoryHandleType =
|
||||
VULKAN_EXTERNAL_MEMORY_HANDLE_TYPE_NONE,
|
||||
const void *name = NULL);
|
||||
const std::wstring name = L"");
|
||||
virtual ~VulkanDeviceMemory();
|
||||
uint64_t getSize() const;
|
||||
#ifdef _WIN32
|
||||
@@ -615,6 +616,7 @@ public:
|
||||
void unmap();
|
||||
void bindBuffer(const VulkanBuffer &buffer, uint64_t offset = 0);
|
||||
void bindImage(const VulkanImage &image, uint64_t offset = 0);
|
||||
const std::wstring &getName() const;
|
||||
operator VkDeviceMemory() const;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user