STR(VK_ERROR_BUILDING_COMMAND_BUFFER);
STR(VK_ERROR_MEMORY_NOT_BOUND);
STR(VK_ERROR_INCOMPATIBLE_QUEUE);
- STR(VK_ERROR_NOT_SHAREABLE);
#undef STR
default: return "UNKNOWN_RESULT";
}
}
}
-static void app_gpu_dump_multi_compat(const struct app_gpu *gpu, const struct app_gpu *other,
- const VkPhysicalDeviceCompatibilityInfo *info)
-{
- printf("VkPhysicalDeviceCompatibilityInfo[GPU%d]\n", other->id);
-
-#define TEST(info, b) printf(#b " = %u\n", (bool) (info->compatibilityFlags & VK_PHYSICAL_DEVICE_COMPATIBILITY_ ##b## _BIT))
- TEST(info, FEATURES);
- TEST(info, IQ_MATCH);
- TEST(info, PEER_TRANSFER);
- TEST(info, SHARED_MEMORY);
- TEST(info, SHARED_SYNC);
- TEST(info, SHARED_DEVICE0_DISPLAY);
- TEST(info, SHARED_DEVICE1_DISPLAY);
-#undef TEST
-}
-
-static void app_gpu_multi_compat(struct app_gpu *gpus, uint32_t gpu_count)
-{
- VkResult err;
- uint32_t i, j;
-
- for (i = 0; i < gpu_count; i++) {
- for (j = 0; j < gpu_count; j++) {
- VkPhysicalDeviceCompatibilityInfo info;
-
- if (i == j)
- continue;
-
- err = vkGetMultiDeviceCompatibility(gpus[i].obj,
- gpus[j].obj, &info);
- if (err)
- ERR_EXIT(err);
-
- app_gpu_dump_multi_compat(&gpus[i], &gpus[j], &info);
- }
- }
-}
-
#ifdef _WIN32
#define PRINTF_SIZE_T_SPECIFIER "%Iu"
#else
printf("\n\n");
}
- app_gpu_multi_compat(gpus, gpu_count);
-
for (i = 0; i < gpu_count; i++)
app_gpu_destroy(&gpus[i]);
return VK_SUCCESS;
}
-ICD_EXPORT VkResult VKAPI vkGetMultiDeviceCompatibility(
- VkPhysicalDevice gpu0_,
- VkPhysicalDevice gpu1_,
- VkPhysicalDeviceCompatibilityInfo* pInfo)
-{
- NULLDRV_LOG_FUNC;
- return VK_SUCCESS;
-}
-
-ICD_EXPORT VkResult VKAPI vkOpenPeerImage(
- VkDevice device,
- const VkPeerImageOpenInfo* pOpenInfo,
- VkImage* pImage,
- VkDeviceMemory* pMem)
-{
- NULLDRV_LOG_FUNC;
- return VK_SUCCESS;
-}
-
ICD_EXPORT VkResult VKAPI vkCreateImage(
VkDevice device,
const VkImageCreateInfo* pCreateInfo,
return VK_SUCCESS;
}
-ICD_EXPORT VkResult VKAPI vkOpenSharedMemory(
- VkDevice device,
- const VkMemoryOpenInfo* pOpenInfo,
- VkDeviceMemory* pMem)
-{
- NULLDRV_LOG_FUNC;
- return VK_SUCCESS;
-}
-
-ICD_EXPORT VkResult VKAPI vkOpenPeerMemory(
- VkDevice device,
- const VkPeerMemoryOpenInfo* pOpenInfo,
- VkDeviceMemory* pMem)
-{
- NULLDRV_LOG_FUNC;
- return VK_SUCCESS;
-}
-
ICD_EXPORT VkResult VKAPI vkCreateInstance(
const VkInstanceCreateInfo* pCreateInfo,
VkInstance* pInstance)
return VK_SUCCESS;
}
-ICD_EXPORT VkResult VKAPI vkOpenSharedSemaphore(
- VkDevice device,
- const VkSemaphoreOpenInfo* pOpenInfo,
- VkSemaphore* pSemaphore)
-{
- NULLDRV_LOG_FUNC;
- return VK_SUCCESS;
-}
-
ICD_EXPORT VkResult VKAPI vkCreateSemaphore(
VkDevice device,
const VkSemaphoreCreateInfo* pCreateInfo,
PFN_vkUnmapMemory UnmapMemory;
PFN_vkFlushMappedMemoryRanges FlushMappedMemoryRanges;
PFN_vkInvalidateMappedMemoryRanges InvalidateMappedMemoryRanges;
- PFN_vkOpenSharedMemory OpenSharedMemory;
- PFN_vkOpenSharedSemaphore OpenSharedSemaphore;
- PFN_vkOpenPeerMemory OpenPeerMemory;
- PFN_vkOpenPeerImage OpenPeerImage;
PFN_vkDestroyObject DestroyObject;
PFN_vkGetObjectInfo GetObjectInfo;
PFN_vkBindObjectMemory BindObjectMemory;
PFN_vkCreateDevice CreateDevice;
/* PFN_vkGetGlobalExtensionInfo GetGlobalExtensionInfo; non-dispatchable */
PFN_vkGetPhysicalDeviceExtensionInfo GetPhysicalDeviceExtensionInfo;
- PFN_vkGetMultiDeviceCompatibility GetMultiDeviceCompatibility;
PFN_vkDbgCreateMsgCallback DbgCreateMsgCallback;
PFN_vkDbgDestroyMsgCallback DbgDestroyMsgCallback;
PFN_vkDbgStringCallback DbgStringCallback;
#include "vk_platform.h"
// Vulkan API version supported by this file
-#define VK_API_VERSION VK_MAKE_VERSION(0, 104, 0)
+#define VK_API_VERSION VK_MAKE_VERSION(0, 105, 0)
#ifdef __cplusplus
extern "C"
VK_STRUCTURE_TYPE_APPLICATION_INFO = 0,
VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 1,
VK_STRUCTURE_TYPE_MEMORY_ALLOC_INFO = 2,
- VK_STRUCTURE_TYPE_MEMORY_OPEN_INFO = 3,
- VK_STRUCTURE_TYPE_PEER_MEMORY_OPEN_INFO = 4,
-// VK_STRUCTURE_TYPE_BUFFER_VIEW_ATTACH_INFO = 5,
-// VK_STRUCTURE_TYPE_IMAGE_VIEW_ATTACH_INFO = 6,
- VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 7,
- VK_STRUCTURE_TYPE_COLOR_ATTACHMENT_VIEW_CREATE_INFO = 8,
- VK_STRUCTURE_TYPE_DEPTH_STENCIL_VIEW_CREATE_INFO = 9,
- VK_STRUCTURE_TYPE_SHADER_CREATE_INFO = 10,
- VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 11,
- VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 12,
- VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 13,
- VK_STRUCTURE_TYPE_DYNAMIC_VP_STATE_CREATE_INFO = 14,
- VK_STRUCTURE_TYPE_DYNAMIC_RS_STATE_CREATE_INFO = 15,
- VK_STRUCTURE_TYPE_DYNAMIC_CB_STATE_CREATE_INFO = 16,
- VK_STRUCTURE_TYPE_DYNAMIC_DS_STATE_CREATE_INFO = 17,
- VK_STRUCTURE_TYPE_CMD_BUFFER_CREATE_INFO = 18,
- VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 19,
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 20,
- VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 21,
- VK_STRUCTURE_TYPE_SEMAPHORE_OPEN_INFO = 22,
- VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 23,
- VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 24,
- VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 25,
- VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 26,
- VK_STRUCTURE_TYPE_PIPELINE_IA_STATE_CREATE_INFO = 27,
- VK_STRUCTURE_TYPE_PIPELINE_TESS_STATE_CREATE_INFO = 28,
- VK_STRUCTURE_TYPE_PIPELINE_VP_STATE_CREATE_INFO = 29,
- VK_STRUCTURE_TYPE_PIPELINE_RS_STATE_CREATE_INFO = 30,
- VK_STRUCTURE_TYPE_PIPELINE_MS_STATE_CREATE_INFO = 31,
- VK_STRUCTURE_TYPE_PIPELINE_CB_STATE_CREATE_INFO = 32,
- VK_STRUCTURE_TYPE_PIPELINE_DS_STATE_CREATE_INFO = 33,
- VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 34,
- VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 35,
- VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 36,
- VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 37,
- VK_STRUCTURE_TYPE_CMD_BUFFER_BEGIN_INFO = 38,
- VK_STRUCTURE_TYPE_CMD_BUFFER_GRAPHICS_BEGIN_INFO = 39,
- VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 40,
- VK_STRUCTURE_TYPE_MEMORY_BARRIER = 41,
- VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 42,
- VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 43,
- VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 44,
- VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 46,
- VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 47,
- VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 48,
- VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 49,
- VK_STRUCTURE_TYPE_EXTENSION_PROPERTIES = 50,
+// VK_STRUCTURE_TYPE_BUFFER_VIEW_ATTACH_INFO = 3,
+// VK_STRUCTURE_TYPE_IMAGE_VIEW_ATTACH_INFO = 4,
+ VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 5,
+ VK_STRUCTURE_TYPE_COLOR_ATTACHMENT_VIEW_CREATE_INFO = 6,
+ VK_STRUCTURE_TYPE_DEPTH_STENCIL_VIEW_CREATE_INFO = 7,
+ VK_STRUCTURE_TYPE_SHADER_CREATE_INFO = 8,
+ VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 9,
+ VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 10,
+ VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 11,
+ VK_STRUCTURE_TYPE_DYNAMIC_VP_STATE_CREATE_INFO = 12,
+ VK_STRUCTURE_TYPE_DYNAMIC_RS_STATE_CREATE_INFO = 13,
+ VK_STRUCTURE_TYPE_DYNAMIC_CB_STATE_CREATE_INFO = 14,
+ VK_STRUCTURE_TYPE_DYNAMIC_DS_STATE_CREATE_INFO = 15,
+ VK_STRUCTURE_TYPE_CMD_BUFFER_CREATE_INFO = 16,
+ VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 17,
+ VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 18,
+ VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 19,
+ VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 20,
+ VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 21,
+ VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 22,
+ VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 23,
+ VK_STRUCTURE_TYPE_PIPELINE_IA_STATE_CREATE_INFO = 24,
+ VK_STRUCTURE_TYPE_PIPELINE_TESS_STATE_CREATE_INFO = 25,
+ VK_STRUCTURE_TYPE_PIPELINE_VP_STATE_CREATE_INFO = 26,
+ VK_STRUCTURE_TYPE_PIPELINE_RS_STATE_CREATE_INFO = 27,
+ VK_STRUCTURE_TYPE_PIPELINE_MS_STATE_CREATE_INFO = 28,
+ VK_STRUCTURE_TYPE_PIPELINE_CB_STATE_CREATE_INFO = 29,
+ VK_STRUCTURE_TYPE_PIPELINE_DS_STATE_CREATE_INFO = 30,
+ VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 31,
+ VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 32,
+ VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 33,
+ VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 34,
+ VK_STRUCTURE_TYPE_CMD_BUFFER_BEGIN_INFO = 35,
+ VK_STRUCTURE_TYPE_CMD_BUFFER_GRAPHICS_BEGIN_INFO = 36,
+ VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 37,
+ VK_STRUCTURE_TYPE_MEMORY_BARRIER = 38,
+ VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 39,
+ VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 40,
+ VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 41,
+ VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 42,
+ VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 43,
+ VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 44,
+ VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 45,
+ VK_STRUCTURE_TYPE_EXTENSION_PROPERTIES = 46,
VK_ENUM_RANGE(STRUCTURE_TYPE, APPLICATION_INFO, EXTENSION_PROPERTIES)
} VkStructureType;
VK_ERROR_BUILDING_COMMAND_BUFFER = -(0x0000001E),
VK_ERROR_MEMORY_NOT_BOUND = -(0x0000001F),
VK_ERROR_INCOMPATIBLE_QUEUE = -(0x00000020),
- VK_ERROR_NOT_SHAREABLE = -(0x00000021),
- VK_ERROR_MISSING_EXTENSION_DEPENDENCY = -(0x00000022),
+ VK_ERROR_MISSING_EXTENSION_DEPENDENCY = -(0x00000021),
VK_MAX_ENUM(RESULT)
} VkResult;
// Device creation flags
typedef VkFlags VkDeviceCreateFlags;
-typedef enum VkDeviceCreateFlagBits_
-{
- VK_DEVICE_CREATE_MULTI_DEVICE_IQ_MATCH_BIT = VK_BIT(0),
-} VkDeviceCreateFlagBits;
// Queue capabilities
typedef VkFlags VkQueueFlags;
VK_MEMORY_PROPERTY_HOST_UNCACHED_BIT = VK_BIT(2), // Memory should not be cached by the host
VK_MEMORY_PROPERTY_HOST_WRITE_COMBINED_BIT = VK_BIT(3), // Memory should support host write combining
VK_MEMORY_PROPERTY_PREFER_HOST_LOCAL = VK_BIT(4), // If set, prefer host access
- VK_MEMORY_PROPERTY_SHAREABLE_BIT = VK_BIT(5),
} VkMemoryPropertyFlagBits;
// Memory output flags passed to resource transition commands
typedef VkFlags VkBufferCreateFlags;
typedef enum VkBufferCreateFlagBits_
{
- VK_BUFFER_CREATE_SHAREABLE_BIT = VK_BIT(0), // Buffer should be shareable
- VK_BUFFER_CREATE_SPARSE_BIT = VK_BIT(1), // Buffer should support sparse backing
+ VK_BUFFER_CREATE_SPARSE_BIT = VK_BIT(0), // Buffer should support sparse backing
} VkBufferCreateFlagBits;
// Shader stage flags
typedef enum VkImageCreateFlagBits_
{
VK_IMAGE_CREATE_INVARIANT_DATA_BIT = VK_BIT(0),
- VK_IMAGE_CREATE_SHAREABLE_BIT = VK_BIT(1), // Image should be shareable
- VK_IMAGE_CREATE_SPARSE_BIT = VK_BIT(2), // Image should support sparse backing
- VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = VK_BIT(3), // Allows image views to have different format than the base image
- VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT = VK_BIT(4), // Allows creating image views with cube type from the created image
+ VK_IMAGE_CREATE_SPARSE_BIT = VK_BIT(1), // Image should support sparse backing
+ VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = VK_BIT(2), // Allows image views to have different format than the base image
+ VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT = VK_BIT(3), // Allows creating image views with cube type from the created image
} VkImageCreateFlagBits;
// Depth-stencil view creation flags
// Semaphore creation flags
typedef VkFlags VkSemaphoreCreateFlags;
-typedef enum VkSemaphoreCreateFlagBits_
-{
- VK_SEMAPHORE_CREATE_SHAREABLE_BIT = VK_BIT(0),
-} VkSemaphoreCreateFlagBits;
// Format capability flags
typedef VkFlags VkFormatFeatureFlags;
VK_QUERY_RESULT_PARTIAL_BIT = VK_BIT(3), // Copy the partial results of the query even if the final results aren't available
} VkQueryResultFlagBits;
-// Physical device compatibility flags
-typedef VkFlags VkPhysicalDeviceCompatibilityFlags;
-typedef enum VkPhysicalDeviceCompatibilityFlagBits_
-{
- VK_PHYSICAL_DEVICE_COMPATIBILITY_FEATURES_BIT = VK_BIT(0),
- VK_PHYSICAL_DEVICE_COMPATIBILITY_IQ_MATCH_BIT = VK_BIT(1),
- VK_PHYSICAL_DEVICE_COMPATIBILITY_PEER_TRANSFER_BIT = VK_BIT(2),
- VK_PHYSICAL_DEVICE_COMPATIBILITY_SHARED_MEMORY_BIT = VK_BIT(3),
- VK_PHYSICAL_DEVICE_COMPATIBILITY_SHARED_SYNC_BIT = VK_BIT(4),
- VK_PHYSICAL_DEVICE_COMPATIBILITY_SHARED_DEVICE0_DISPLAY_BIT = VK_BIT(5),
- VK_PHYSICAL_DEVICE_COMPATIBILITY_SHARED_DEVICE1_DISPLAY_BIT = VK_BIT(6),
-} VkPhysicalDeviceCompatibilityFlagBits;
-
// Shader creation flags
typedef VkFlags VkShaderCreateFlags;
float pixelsPerClock;
} VkPhysicalDevicePerformance;
-typedef struct VkPhysicalDeviceCompatibilityInfo_
-{
- VkPhysicalDeviceCompatibilityFlags compatibilityFlags;
-} VkPhysicalDeviceCompatibilityInfo;
-
typedef struct VkExtensionProperties_
{
VkStructureType sType; // Type of structure. Should be VK_STRUCTURE_TYPE_EXTENSION_PROPERTIES
VkMemoryPropertyFlags memProps; // Memory property flags
} VkMemoryAllocInfo;
-typedef struct VkMemoryOpenInfo_
-{
- VkStructureType sType; // Must be VK_STRUCTURE_TYPE_MEMORY_OPEN_INFO
- const void* pNext; // Pointer to next structure
- VkDeviceMemory sharedMem;
-} VkMemoryOpenInfo;
-
-typedef struct VkPeerMemoryOpenInfo_
-{
- VkStructureType sType; // Must be VK_STRUCTURE_TYPE_PEER_MEMORY_OPEN_INFO
- const void* pNext; // Pointer to next structure
- VkDeviceMemory originalMem;
-} VkPeerMemoryOpenInfo;
-
typedef struct VkMemoryRequirements_
{
VkDeviceSize size; // Specified in bytes
VkImageCreateFlags flags; // Image creation flags
} VkImageCreateInfo;
-typedef struct VkPeerImageOpenInfo_
-{
- VkImage originalImage;
-} VkPeerImageOpenInfo;
-
typedef struct VkSubresourceLayout_
{
VkDeviceSize offset; // Specified in bytes
VkSemaphoreCreateFlags flags; // Semaphore creation flags
} VkSemaphoreCreateInfo;
-typedef struct VkSemaphoreOpenInfo_
-{
- VkStructureType sType; // Must be VK_STRUCTURE_TYPE_SEMAPHORE_OPEN_INFO
- const void* pNext; // Pointer to next structure
- VkSemaphore sharedSemaphore;
-} VkSemaphoreOpenInfo;
-
typedef struct VkQueryPoolCreateInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO
typedef VkResult (VKAPI *PFN_vkUnmapMemory)(VkDevice device, VkDeviceMemory mem);
typedef VkResult (VKAPI *PFN_vkFlushMappedMemoryRanges)(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges);
typedef VkResult (VKAPI *PFN_vkInvalidateMappedMemoryRanges)(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges);
-typedef VkResult (VKAPI *PFN_vkGetMultiDeviceCompatibility)(VkPhysicalDevice physicalDevice0, VkPhysicalDevice physicalDevice1, VkPhysicalDeviceCompatibilityInfo* pInfo);
-typedef VkResult (VKAPI *PFN_vkOpenSharedMemory)(VkDevice device, const VkMemoryOpenInfo* pOpenInfo, VkDeviceMemory* pMem);
-typedef VkResult (VKAPI *PFN_vkOpenSharedSemaphore)(VkDevice device, const VkSemaphoreOpenInfo* pOpenInfo, VkSemaphore* pSemaphore);
-typedef VkResult (VKAPI *PFN_vkOpenPeerMemory)(VkDevice device, const VkPeerMemoryOpenInfo* pOpenInfo, VkDeviceMemory* pMem);
-typedef VkResult (VKAPI *PFN_vkOpenPeerImage)(VkDevice device, const VkPeerImageOpenInfo* pOpenInfo, VkImage* pImage, VkDeviceMemory* pMem);
typedef VkResult (VKAPI *PFN_vkDestroyObject)(VkDevice device, VkObjectType objType, VkObject object);
typedef VkResult (VKAPI *PFN_vkGetObjectInfo)(VkDevice device, VkObjectType objType, VkObject object, VkObjectInfoType infoType, size_t* pDataSize, void* pData);
typedef VkResult (VKAPI *PFN_vkBindObjectMemory)(VkDevice device, VkObjectType objType, VkObject object, VkDeviceMemory mem, VkDeviceSize offset);
uint32_t memRangeCount,
const VkMappedMemoryRange* pMemRanges);
-// Multi-device functions
-
-VkResult VKAPI vkGetMultiDeviceCompatibility(
- VkPhysicalDevice physicalDevice0,
- VkPhysicalDevice physicalDevice1,
- VkPhysicalDeviceCompatibilityInfo* pInfo);
-
-VkResult VKAPI vkOpenSharedMemory(
- VkDevice device,
- const VkMemoryOpenInfo* pOpenInfo,
- VkDeviceMemory* pMem);
-
-VkResult VKAPI vkOpenSharedSemaphore(
- VkDevice device,
- const VkSemaphoreOpenInfo* pOpenInfo,
- VkSemaphore* pSemaphore);
-
-VkResult VKAPI vkOpenPeerMemory(
- VkDevice device,
- const VkPeerMemoryOpenInfo* pOpenInfo,
- VkDeviceMemory* pMem);
-
-VkResult VKAPI vkOpenPeerImage(
- VkDevice device,
- const VkPeerImageOpenInfo* pOpenInfo,
- VkImage* pImage,
- VkDeviceMemory* pMem);
-
// Generic API object functions
VkResult VKAPI vkDestroyObject(
return result;
}
-VK_LAYER_EXPORT VkResult VKAPI vkOpenSharedMemory(
- VkDevice device,
- const VkMemoryOpenInfo *pOpenInfo,
- VkDeviceMemory *pMem)
-{
- // TODO : Track this
- VkResult result = get_dispatch_table(mem_tracker_device_table_map, device)->OpenSharedMemory(device, pOpenInfo, pMem);
- return result;
-}
-
-VK_LAYER_EXPORT VkResult VKAPI vkOpenPeerMemory(
- VkDevice device,
- const VkPeerMemoryOpenInfo *pOpenInfo,
- VkDeviceMemory *pMem)
-{
- // TODO : Track this
- VkResult result = get_dispatch_table(mem_tracker_device_table_map, device)->OpenPeerMemory(device, pOpenInfo, pMem);
- return result;
-}
-
-VK_LAYER_EXPORT VkResult VKAPI vkOpenPeerImage(
- VkDevice device,
- const VkPeerImageOpenInfo *pOpenInfo,
- VkImage *pImage,
- VkDeviceMemory *pMem)
-{
- // TODO : Track this
- VkResult result = get_dispatch_table(mem_tracker_device_table_map, device)->OpenPeerImage(device, pOpenInfo, pImage, pMem);
- return result;
-}
-
VK_LAYER_EXPORT VkResult VKAPI vkDestroyObject(
VkDevice device,
VkObjectType objType,
return (void*) vkMapMemory;
if (!strcmp(funcName, "vkUnmapMemory"))
return (void*) vkUnmapMemory;
- if (!strcmp(funcName, "vkOpenSharedMemory"))
- return (void*) vkOpenSharedMemory;
- if (!strcmp(funcName, "vkOpenPeerMemory"))
- return (void*) vkOpenPeerMemory;
- if (!strcmp(funcName, "vkOpenPeerImage"))
- return (void*) vkOpenPeerImage;
if (!strcmp(funcName, "vkDestroyObject"))
return (void*) vkDestroyObject;
if (!strcmp(funcName, "vkGetObjectInfo"))
return result;
}
-VK_LAYER_EXPORT VkResult VKAPI vkGetMultiDeviceCompatibility(VkPhysicalDevice gpu0, VkPhysicalDevice gpu1, VkPhysicalDeviceCompatibilityInfo* pInfo)
-{
-
- VkResult result = instance_dispatch_table(gpu0)->GetMultiDeviceCompatibility(gpu0, gpu1, pInfo);
- return result;
-}
-
-VK_LAYER_EXPORT VkResult VKAPI vkOpenSharedMemory(VkDevice device, const VkMemoryOpenInfo* pOpenInfo, VkDeviceMemory* pMem)
-{
- char str[1024];
- if (!pOpenInfo) {
- sprintf(str, "Struct ptr parameter pOpenInfo to function OpenSharedMemory is NULL.");
- layerCbMsg(VK_DBG_REPORT_INFO_BIT, (VkObjectType) 0, NULL, 0, 1, "PARAMCHECK", str);
- }
- else if (!vk_validate_vkmemoryopeninfo(pOpenInfo)) {
- sprintf(str, "Parameter pOpenInfo to function OpenSharedMemory contains an invalid value.");
- layerCbMsg(VK_DBG_REPORT_ERROR_BIT, (VkObjectType) 0, NULL, 0, 1, "PARAMCHECK", str);
- }
- VkResult result = device_dispatch_table(device)->OpenSharedMemory(device, pOpenInfo, pMem);
- return result;
-}
-
-VK_LAYER_EXPORT VkResult VKAPI vkOpenSharedSemaphore(VkDevice device, const VkSemaphoreOpenInfo* pOpenInfo, VkSemaphore* pSemaphore)
-{
- char str[1024];
- if (!pOpenInfo) {
- sprintf(str, "Struct ptr parameter pOpenInfo to function OpenSharedSemaphore is NULL.");
- layerCbMsg(VK_DBG_REPORT_INFO_BIT, (VkObjectType) 0, NULL, 0, 1, "PARAMCHECK", str);
- }
- else if (!vk_validate_vksemaphoreopeninfo(pOpenInfo)) {
- sprintf(str, "Parameter pOpenInfo to function OpenSharedSemaphore contains an invalid value.");
- layerCbMsg(VK_DBG_REPORT_ERROR_BIT, (VkObjectType) 0, NULL, 0, 1, "PARAMCHECK", str);
- }
- VkResult result = device_dispatch_table(device)->OpenSharedSemaphore(device, pOpenInfo, pSemaphore);
- return result;
-}
-
-VK_LAYER_EXPORT VkResult VKAPI vkOpenPeerMemory(VkDevice device, const VkPeerMemoryOpenInfo* pOpenInfo, VkDeviceMemory* pMem)
-{
- char str[1024];
- if (!pOpenInfo) {
- sprintf(str, "Struct ptr parameter pOpenInfo to function OpenPeerMemory is NULL.");
- layerCbMsg(VK_DBG_REPORT_INFO_BIT, (VkObjectType) 0, NULL, 0, 1, "PARAMCHECK", str);
- }
- else if (!vk_validate_vkpeermemoryopeninfo(pOpenInfo)) {
- sprintf(str, "Parameter pOpenInfo to function OpenPeerMemory contains an invalid value.");
- layerCbMsg(VK_DBG_REPORT_ERROR_BIT, (VkObjectType) 0, NULL, 0, 1, "PARAMCHECK", str);
- }
- VkResult result = device_dispatch_table(device)->OpenPeerMemory(device, pOpenInfo, pMem);
- return result;
-}
-
-VK_LAYER_EXPORT VkResult VKAPI vkOpenPeerImage(VkDevice device, const VkPeerImageOpenInfo* pOpenInfo, VkImage* pImage, VkDeviceMemory* pMem)
-{
- char str[1024];
- if (!pOpenInfo) {
- sprintf(str, "Struct ptr parameter pOpenInfo to function OpenPeerImage is NULL.");
- layerCbMsg(VK_DBG_REPORT_INFO_BIT, (VkObjectType) 0, NULL, 0, 1, "PARAMCHECK", str);
- }
- else if (!vk_validate_vkpeerimageopeninfo(pOpenInfo)) {
- sprintf(str, "Parameter pOpenInfo to function OpenPeerImage contains an invalid value.");
- layerCbMsg(VK_DBG_REPORT_ERROR_BIT, (VkObjectType) 0, NULL, 0, 1, "PARAMCHECK", str);
- }
- VkResult result = device_dispatch_table(device)->OpenPeerImage(device, pOpenInfo, pImage, pMem);
- return result;
-}
-
VK_LAYER_EXPORT VkResult VKAPI vkDestroyObject(VkDevice device, VkObjectType objType, VkObject object)
{
VkResult result = device_dispatch_table(device)->DestroyObject(device, objType, object);
return (void*) vkFlushMappedMemoryRanges;
if (!strcmp(name, "InvalidateMappedMemoryRanges"))
return (void*) vkInvalidateMappedMemoryRanges;
- if (!strcmp(name, "OpenSharedMemory"))
- return (void*) vkOpenSharedMemory;
- if (!strcmp(name, "OpenSharedSemaphore"))
- return (void*) vkOpenSharedSemaphore;
- if (!strcmp(name, "OpenPeerMemory"))
- return (void*) vkOpenPeerMemory;
- if (!strcmp(name, "OpenPeerImage"))
- return (void*) vkOpenPeerImage;
if (!strcmp(name, "DestroyObject"))
return (void*) vkDestroyObject;
if (!strcmp(name, "GetObjectInfo"))
return (void*) vkGetGlobalExtensionInfo;
if (!strcmp(name, "GetPhysicalDeviceExtensionInfo"))
return (void*) vkGetPhysicalDeviceExtensionInfo;
- if (!strcmp(name, "GetMultiDeviceCompatibility"))
- return (void*) vkGetMultiDeviceCompatibility;
return NULL;
}
(VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT |
VK_MEMORY_PROPERTY_HOST_UNCACHED_BIT |
VK_MEMORY_PROPERTY_HOST_WRITE_COMBINED_BIT |
- VK_MEMORY_PROPERTY_PREFER_HOST_LOCAL |
- VK_MEMORY_PROPERTY_SHAREABLE_BIT)
+ VK_MEMORY_PROPERTY_PREFER_HOST_LOCAL)
};
const VkCmdBufferCreateInfo createCommandBufferInfo = {
VK_STRUCTURE_TYPE_CMD_BUFFER_CREATE_INFO,
return (void*) vkFlushMappedMemoryRanges;
if (!strcmp(name, "InvalidateMappedMemoryRanges"))
return (void*) vkInvalidateMappedMemoryRanges;
- if (!strcmp(name, "GetMultiDeviceCompatibility"))
- return (void*) vkGetMultiDeviceCompatibility;
- if (!strcmp(name, "OpenSharedMemory"))
- return (void*) vkOpenSharedMemory;
- if (!strcmp(name, "OpenSharedSemaphore"))
- return (void*) vkOpenSharedSemaphore;
- if (!strcmp(name, "OpenPeerMemory"))
- return (void*) vkOpenPeerMemory;
- if (!strcmp(name, "OpenPeerImage"))
- return (void*) vkOpenPeerImage;
if (!strcmp(name, "DestroyObject"))
return (void*) vkDestroyObject;
if (!strcmp(name, "GetObjectInfo"))
.GetPhysicalDeviceInfo = loader_GetPhysicalDeviceInfo,
.CreateDevice = loader_CreateDevice,
.GetPhysicalDeviceExtensionInfo = loader_GetPhysicalDeviceExtensionInfo,
- .GetMultiDeviceCompatibility = loader_GetMultiDeviceCompatibility,
.DbgCreateMsgCallback = loader_DbgCreateMsgCallback,
.DbgDestroyMsgCallback = loader_DbgDestroyMsgCallback,
};
LOOKUP(GetPhysicalDeviceInfo);
LOOKUP(CreateDevice);
LOOKUP(GetPhysicalDeviceExtensionInfo);
- LOOKUP(GetMultiDeviceCompatibility);
LOOKUP(DbgCreateMsgCallback);
LOOKUP(DbgDestroyMsgCallback);
#undef LOOKUP
return VK_SUCCESS;
}
-
-VkResult loader_GetMultiDeviceCompatibility(
- VkPhysicalDevice gpu0,
- VkPhysicalDevice gpu1,
- VkPhysicalDeviceCompatibilityInfo* pInfo)
-{
- uint32_t gpu_index;
- struct loader_icd *icd = loader_get_icd(gpu0, &gpu_index);
- VkResult res = VK_ERROR_INITIALIZATION_FAILED;
-
- if (icd->GetMultiDeviceCompatibility)
- res = icd->GetMultiDeviceCompatibility(gpu0, gpu1, pInfo);
-
- return res;
-}
PFN_vkGetPhysicalDeviceInfo GetPhysicalDeviceInfo;
PFN_vkCreateDevice CreateDevice;
PFN_vkGetPhysicalDeviceExtensionInfo GetPhysicalDeviceExtensionInfo;
- PFN_vkGetMultiDeviceCompatibility GetMultiDeviceCompatibility;
PFN_vkDbgCreateMsgCallback DbgCreateMsgCallback;
PFN_vkDbgDestroyMsgCallback DbgDestroyMsgCallback;
/*
const VkDeviceCreateInfo* pCreateInfo,
VkDevice* pDevice);
-VkResult loader_GetMultiDeviceCompatibility(
- VkPhysicalDevice gpu0,
- VkPhysicalDevice gpu1,
- VkPhysicalDeviceCompatibilityInfo* pInfo);
-
/* helper function definitions */
bool has_vk_extension_property(
const VkExtensionProperties *vk_ext_prop,
table->UnmapMemory = (PFN_vkUnmapMemory) gpa(dev, "vkUnmapMemory");
table->FlushMappedMemoryRanges = (PFN_vkFlushMappedMemoryRanges) gpa(dev, "vkFlushMappedMemoryRanges");
table->InvalidateMappedMemoryRanges = (PFN_vkInvalidateMappedMemoryRanges) gpa(dev, "vkInvalidateMappedMemoryRanges");
- table->OpenSharedMemory = (PFN_vkOpenSharedMemory) gpa(dev, "vkOpenSharedMemory");
- table->OpenSharedSemaphore = (PFN_vkOpenSharedSemaphore) gpa(dev, "vkOpenSharedSemaphore");
- table->OpenPeerMemory = (PFN_vkOpenPeerMemory) gpa(dev, "vkOpenPeerMemory");
- table->OpenPeerImage = (PFN_vkOpenPeerImage) gpa(dev, "vkOpenPeerImage");
table->DestroyObject = (PFN_vkDestroyObject) gpa(dev, "vkDestroyObject");
table->GetObjectInfo = (PFN_vkGetObjectInfo) gpa(dev, "vkGetObjectInfo");
table->BindObjectMemory = (PFN_vkBindObjectMemory) gpa(dev, "vkBindObjectMemory");
return (void *) table->FlushMappedMemoryRanges;
if (!strcmp(name, "InvalidateMappedMemoryRanges"))
return (void *) table->InvalidateMappedMemoryRanges;
- if (!strcmp(name, "OpenSharedMemory"))
- return (void *) table->OpenSharedMemory;
- if (!strcmp(name, "OpenSharedSemaphore"))
- return (void *) table->OpenSharedSemaphore;
- if (!strcmp(name, "OpenPeerMemory"))
- return (void *) table->OpenPeerMemory;
- if (!strcmp(name, "OpenPeerImage"))
- return (void *) table->OpenPeerImage;
if (!strcmp(name, "DestroyObject"))
return (void *) table->DestroyObject;
if (!strcmp(name, "GetObjectInfo"))
table->GetPhysicalDeviceInfo = (PFN_vkGetPhysicalDeviceInfo) gpa(inst, "vkGetPhysicalDeviceInfo");
table->CreateDevice = (PFN_vkCreateDevice) gpa(inst, "vkCreateDevice");
table->GetPhysicalDeviceExtensionInfo = (PFN_vkGetPhysicalDeviceExtensionInfo) gpa(inst, "vkGetPhysicalDeviceExtensionInfo");
- table->GetMultiDeviceCompatibility = (PFN_vkGetMultiDeviceCompatibility) gpa(inst, "vkGetMultiDeviceCompatibility");
}
static inline void loader_init_instance_extension_dispatch_table(
return (void *) table->CreateDevice;
if (!strcmp(name, "GetPhysicalDeviceExtensionInfo"))
return (void *) table->GetPhysicalDeviceExtensionInfo;
- if (!strcmp(name, "GetMultiDeviceCompatibility"))
- return (void *) table->GetMultiDeviceCompatibility;
if (!strcmp(name, "DbgCreateMsgCallback"))
return (void *) table->DbgCreateMsgCallback;
if (!strcmp(name, "DbgDestroyMsgCallback"))
return disp->InvalidateMappedMemoryRanges(device, memRangeCount, pMemRanges);
}
-LOADER_EXPORT VkResult VKAPI vkGetMultiDeviceCompatibility(VkPhysicalDevice gpu0, VkPhysicalDevice gpu1, VkPhysicalDeviceCompatibilityInfo* pInfo)
-{
- const VkLayerInstanceDispatchTable *disp;
- VkResult res;
-
- disp = loader_get_instance_dispatch(gpu0);
-
- loader_platform_thread_lock_mutex(&loader_lock);
- res = disp->GetMultiDeviceCompatibility(gpu0, gpu1, pInfo);
- loader_platform_thread_unlock_mutex(&loader_lock);
- return res;
-}
-
-LOADER_EXPORT VkResult VKAPI vkOpenSharedMemory(VkDevice device, const VkMemoryOpenInfo* pOpenInfo, VkDeviceMemory* pMem)
-{
- const VkLayerDispatchTable *disp;
-
- disp = loader_get_dispatch(device);
-
- return disp->OpenSharedMemory(device, pOpenInfo, pMem);
-}
-
-LOADER_EXPORT VkResult VKAPI vkOpenSharedSemaphore(VkDevice device, const VkSemaphoreOpenInfo* pOpenInfo, VkSemaphore* pSemaphore)
-{
- const VkLayerDispatchTable *disp;
-
- disp = loader_get_dispatch(device);
-
- return disp->OpenSharedSemaphore(device, pOpenInfo, pSemaphore);
-}
-
-LOADER_EXPORT VkResult VKAPI vkOpenPeerMemory(VkDevice device, const VkPeerMemoryOpenInfo* pOpenInfo, VkDeviceMemory* pMem)
-{
- const VkLayerDispatchTable *disp;
-
- disp = loader_get_dispatch(device);
-
- return disp->OpenPeerMemory(device, pOpenInfo, pMem);
-}
-
-LOADER_EXPORT VkResult VKAPI vkOpenPeerImage(VkDevice device, const VkPeerImageOpenInfo* pOpenInfo, VkImage* pImage, VkDeviceMemory* pMem)
-{
- const VkLayerDispatchTable *disp;
-
- disp = loader_get_dispatch(device);
-
- return disp->OpenPeerImage(device, pOpenInfo, pImage, pMem);
-}
-
LOADER_EXPORT VkResult VKAPI vkDestroyObject(VkDevice device, VkObjectType objType, VkObject object)
{
const VkLayerDispatchTable *disp;
Param("uint32_t", "memRangeCount"),
Param("const VkMappedMemoryRange*", "pMemRanges")]),
- Proto("VkResult", "GetMultiDeviceCompatibility",
- [Param("VkPhysicalDevice", "gpu0"),
- Param("VkPhysicalDevice", "gpu1"),
- Param("VkPhysicalDeviceCompatibilityInfo*", "pInfo")]),
-
- Proto("VkResult", "OpenSharedMemory",
- [Param("VkDevice", "device"),
- Param("const VkMemoryOpenInfo*", "pOpenInfo"),
- Param("VkDeviceMemory*", "pMem")]),
-
- Proto("VkResult", "OpenSharedSemaphore",
- [Param("VkDevice", "device"),
- Param("const VkSemaphoreOpenInfo*", "pOpenInfo"),
- Param("VkSemaphore*", "pSemaphore")]),
-
- Proto("VkResult", "OpenPeerMemory",
- [Param("VkDevice", "device"),
- Param("const VkPeerMemoryOpenInfo*", "pOpenInfo"),
- Param("VkDeviceMemory*", "pMem")]),
-
- Proto("VkResult", "OpenPeerImage",
- [Param("VkDevice", "device"),
- Param("const VkPeerImageOpenInfo*", "pOpenInfo"),
- Param("VkImage*", "pImage"),
- Param("VkDeviceMemory*", "pMem")]),
-
Proto("VkResult", "DestroyObject",
[Param("VkDevice", "device"),
Param("VkObjectType", "objType"),