diff options
author | Mark Young <marky@lunarg.com> | 2017-02-28 09:58:04 -0700 |
---|---|---|
committer | Mark Young <marky@lunarg.com> | 2017-03-01 08:20:22 -0700 |
commit | 7b06221f2c4cb2205e0363afe1ce59b81aa144a1 (patch) | |
tree | 1055a135108d1608a1e22186d911ccfc2087060e | |
parent | a00917b8295326a0c0501aefe5ab4c12a501a4c5 (diff) |
vulkan: update to header 1.0.42
Updated all necessary files to 1.0.42. This includes the various
headers as well as the loader, and the parameter validation, object
tracking, and threading layers. Additionally, bump all layer JSON
files to 1.0.42.
Also, in this change:
- Enable loader extension automation so that the loader now
generates all extension entry-points automatically during build
to reduce likelihood of missing a critical piece on header
update.
- Enable layer dispatch table extension automation for the same
reason.
- Fixes from Mark Lobodzinski and Tony Barbour to resolve crash
in loader when working with Intel's Windows driver due to
GetInstanceProcAddr getting called on inappropriate command
names.
Change-Id: Ic18d3fac2e145c386c0192031deb5089c91a00d8
48 files changed, 12055 insertions, 3463 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 7c512267..826e56b5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,7 +38,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux") if (BUILD_WSI_WAYLAND_SUPPORT) find_package(Wayland REQUIRED) - include_directories(${WAYLAND_CLIENT_INCLUDE_DIR}) endif() if (BUILD_WSI_MIR_SUPPORT) @@ -272,21 +271,27 @@ endmacro() # Custom target for generated vulkan helper file dependencies add_custom_target(generate_helper_files DEPENDS - vk_dispatch_table_helper.h vk_enum_string_helper.h vk_struct_size_helper.h vk_struct_size_helper.c vk_safe_struct.h vk_safe_struct.cpp + vk_layer_dispatch_table.h + vk_dispatch_table_helper.h + vk_loader_extensions.h + vk_loader_extensions.c ) # Rules to build generated helper files +run_vk_xml_generate(loader_extension_generator.py vk_loader_extensions.c) +run_vk_xml_generate(loader_extension_generator.py vk_loader_extensions.h) +run_vk_xml_generate(loader_extension_generator.py vk_layer_dispatch_table.h) +run_vk_xml_generate(dispatch_table_helper_generator.py vk_dispatch_table_helper.h) run_vk_xml_generate(helper_file_generator.py vk_safe_struct.h) run_vk_xml_generate(helper_file_generator.py vk_safe_struct.cpp) run_vk_xml_generate(helper_file_generator.py vk_struct_size_helper.h) run_vk_xml_generate(helper_file_generator.py vk_struct_size_helper.c) run_vk_xml_generate(helper_file_generator.py vk_enum_string_helper.h) -run_vk_xml_generate(dispatch_table_generator.py vk_dispatch_table_helper.h) if(NOT WIN32) include(GNUInstallDirs) diff --git a/build-android/android-generate.bat b/build-android/android-generate.bat index 08892c74..fb5e393a 100644 --- a/build-android/android-generate.bat +++ b/build-android/android-generate.bat @@ -29,6 +29,7 @@ py -3 ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml vk_dispatc py -3 ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml thread_check.h
py -3 ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml parameter_validation.h
py -3 ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml unique_objects_wrappers.h
+py -3 ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml vk_layer_dispatch_table.h
cd ../..
copy /Y ..\layers\vk_layer_config.cpp generated\common\
diff --git a/build-android/android-generate.sh b/build-android/android-generate.sh index d53ae6f1..dcd61623 100755 --- a/build-android/android-generate.sh +++ b/build-android/android-generate.sh @@ -30,6 +30,9 @@ mkdir -p generated/include generated/common ( cd generated/include; python3 ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml thread_check.h ) ( cd generated/include; python3 ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml parameter_validation.h ) ( cd generated/include; python3 ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml unique_objects_wrappers.h ) +( cd generated/include; python3 ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml vk_loader_extensions.h ) +( cd generated/include; python3 ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml vk_loader_extensions.c ) +( cd generated/include; python3 ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml vk_layer_dispatch_table.h ) cp -f ../layers/vk_layer_config.cpp generated/common/ cp -f ../layers/vk_layer_extension_utils.cpp generated/common/ diff --git a/build-android/jni/Android.mk b/build-android/jni/Android.mk index 678133a5..0c8f10d4 100644 --- a/build-android/jni/Android.mk +++ b/build-android/jni/Android.mk @@ -24,6 +24,7 @@ LOCAL_SRC_FILES += $(LAYER_DIR)/common/vk_layer_config.cpp LOCAL_SRC_FILES += $(LAYER_DIR)/common/vk_layer_extension_utils.cpp LOCAL_SRC_FILES += $(LAYER_DIR)/common/vk_layer_utils.cpp LOCAL_C_INCLUDES += $(SRC_DIR)/include \ + $(LAYER_DIR)/include \ $(SRC_DIR)/layers \ $(SRC_DIR)/loader LOCAL_CPPFLAGS += -DVK_USE_PLATFORM_ANDROID_KHR -fvisibility=hidden @@ -177,6 +178,7 @@ LOCAL_SRC_FILES += $(SRC_DIR)/tests/layer_validation_tests.cpp \ $(SRC_DIR)/tests/vkrenderframework.cpp \ $(SRC_DIR)/common/vulkan_wrapper.cpp LOCAL_C_INCLUDES += $(SRC_DIR)/include \ + $(LAYER_DIR)/include \ $(SRC_DIR)/layers \ $(SRC_DIR)/libs \ $(SRC_DIR)/common \ @@ -199,6 +201,7 @@ LOCAL_SRC_FILES += $(SRC_DIR)/tests/layer_validation_tests.cpp \ $(SRC_DIR)/tests/vkrenderframework.cpp \ $(SRC_DIR)/common/vulkan_wrapper.cpp LOCAL_C_INCLUDES += $(SRC_DIR)/include \ + $(LAYER_DIR)/include \ $(SRC_DIR)/layers \ $(SRC_DIR)/libs \ $(SRC_DIR)/common \ diff --git a/include/vulkan/vk_layer.h b/include/vulkan/vk_layer.h index ebbb1980..4a502a33 100644 --- a/include/vulkan/vk_layer.h +++ b/include/vulkan/vk_layer.h @@ -2,9 +2,9 @@ // File: vk_layer.h // /* - * Copyright (c) 2015-2016 The Khronos Group Inc. - * Copyright (c) 2015-2016 Valve Corporation - * Copyright (c) 2015-2016 LunarG, Inc. + * Copyright (c) 2015-2017 The Khronos Group Inc. + * Copyright (c) 2015-2017 Valve Corporation + * Copyright (c) 2015-2017 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,6 +35,9 @@ #define VK_LAYER_EXPORT #endif +// Definition for VkLayerDispatchTable and VkLayerInstanceDispatchTable now appear in externally generated header +#include "vk_layer_dispatch_table.h" + #define MAX_NUM_UNKNOWN_EXTS 250 // Loader-Layer version negotiation API. Versions add the following features: @@ -45,9 +48,6 @@ #define CURRENT_LOADER_LAYER_INTERFACE_VERSION 2 #define MIN_SUPPORTED_LOADER_LAYER_INTERFACE_VERSION 1 - // Internal function -typedef PFN_vkVoidFunction (VKAPI_PTR *PFN_GetPhysicalDeviceProcAddr)(VkInstance instance, const char* pName); - // Version negotiation values typedef enum VkNegotiateLayerStructType { LAYER_NEGOTIATE_UNINTIALIZED = 0, @@ -70,263 +70,6 @@ typedef VkResult (VKAPI_PTR *PFN_vkNegotiateLoaderLayerInterfaceVersion)(VkNegot // Function prototype for unknown physical device extension command typedef VkResult(VKAPI_PTR *PFN_PhysDevExt)(VkPhysicalDevice phys_device, ...); -typedef struct VkLayerDispatchTable_ { - PFN_vkGetDeviceProcAddr GetDeviceProcAddr; - PFN_vkDestroyDevice DestroyDevice; - PFN_vkGetDeviceQueue GetDeviceQueue; - PFN_vkQueueSubmit QueueSubmit; - PFN_vkQueueWaitIdle QueueWaitIdle; - PFN_vkDeviceWaitIdle DeviceWaitIdle; - PFN_vkAllocateMemory AllocateMemory; - PFN_vkFreeMemory FreeMemory; - PFN_vkMapMemory MapMemory; - PFN_vkUnmapMemory UnmapMemory; - PFN_vkFlushMappedMemoryRanges FlushMappedMemoryRanges; - PFN_vkInvalidateMappedMemoryRanges InvalidateMappedMemoryRanges; - PFN_vkGetDeviceMemoryCommitment GetDeviceMemoryCommitment; - PFN_vkGetImageSparseMemoryRequirements GetImageSparseMemoryRequirements; - PFN_vkGetImageMemoryRequirements GetImageMemoryRequirements; - PFN_vkGetBufferMemoryRequirements GetBufferMemoryRequirements; - PFN_vkBindImageMemory BindImageMemory; - PFN_vkBindBufferMemory BindBufferMemory; - PFN_vkQueueBindSparse QueueBindSparse; - PFN_vkCreateFence CreateFence; - PFN_vkDestroyFence DestroyFence; - PFN_vkGetFenceStatus GetFenceStatus; - PFN_vkResetFences ResetFences; - PFN_vkWaitForFences WaitForFences; - PFN_vkCreateSemaphore CreateSemaphore; - PFN_vkDestroySemaphore DestroySemaphore; - PFN_vkCreateEvent CreateEvent; - PFN_vkDestroyEvent DestroyEvent; - PFN_vkGetEventStatus GetEventStatus; - PFN_vkSetEvent SetEvent; - PFN_vkResetEvent ResetEvent; - PFN_vkCreateQueryPool CreateQueryPool; - PFN_vkDestroyQueryPool DestroyQueryPool; - PFN_vkGetQueryPoolResults GetQueryPoolResults; - PFN_vkCreateBuffer CreateBuffer; - PFN_vkDestroyBuffer DestroyBuffer; - PFN_vkCreateBufferView CreateBufferView; - PFN_vkDestroyBufferView DestroyBufferView; - PFN_vkCreateImage CreateImage; - PFN_vkDestroyImage DestroyImage; - PFN_vkGetImageSubresourceLayout GetImageSubresourceLayout; - PFN_vkCreateImageView CreateImageView; - PFN_vkDestroyImageView DestroyImageView; - PFN_vkCreateShaderModule CreateShaderModule; - PFN_vkDestroyShaderModule DestroyShaderModule; - PFN_vkCreatePipelineCache CreatePipelineCache; - PFN_vkDestroyPipelineCache DestroyPipelineCache; - PFN_vkGetPipelineCacheData GetPipelineCacheData; - PFN_vkMergePipelineCaches MergePipelineCaches; - PFN_vkCreateGraphicsPipelines CreateGraphicsPipelines; - PFN_vkCreateComputePipelines CreateComputePipelines; - PFN_vkDestroyPipeline DestroyPipeline; - PFN_vkCreatePipelineLayout CreatePipelineLayout; - PFN_vkDestroyPipelineLayout DestroyPipelineLayout; - PFN_vkCreateSampler CreateSampler; - PFN_vkDestroySampler DestroySampler; - PFN_vkCreateDescriptorSetLayout CreateDescriptorSetLayout; - PFN_vkDestroyDescriptorSetLayout DestroyDescriptorSetLayout; - PFN_vkCreateDescriptorPool CreateDescriptorPool; - PFN_vkDestroyDescriptorPool DestroyDescriptorPool; - PFN_vkResetDescriptorPool ResetDescriptorPool; - PFN_vkAllocateDescriptorSets AllocateDescriptorSets; - PFN_vkFreeDescriptorSets FreeDescriptorSets; - PFN_vkUpdateDescriptorSets UpdateDescriptorSets; - PFN_vkCreateFramebuffer CreateFramebuffer; - PFN_vkDestroyFramebuffer DestroyFramebuffer; - PFN_vkCreateRenderPass CreateRenderPass; - PFN_vkDestroyRenderPass DestroyRenderPass; - PFN_vkGetRenderAreaGranularity GetRenderAreaGranularity; - PFN_vkCreateCommandPool CreateCommandPool; - PFN_vkDestroyCommandPool DestroyCommandPool; - PFN_vkResetCommandPool ResetCommandPool; - PFN_vkAllocateCommandBuffers AllocateCommandBuffers; - PFN_vkFreeCommandBuffers FreeCommandBuffers; - PFN_vkBeginCommandBuffer BeginCommandBuffer; - PFN_vkEndCommandBuffer EndCommandBuffer; - PFN_vkResetCommandBuffer ResetCommandBuffer; - PFN_vkCmdBindPipeline CmdBindPipeline; - PFN_vkCmdBindDescriptorSets CmdBindDescriptorSets; - PFN_vkCmdBindVertexBuffers CmdBindVertexBuffers; - PFN_vkCmdBindIndexBuffer CmdBindIndexBuffer; - PFN_vkCmdSetViewport CmdSetViewport; - PFN_vkCmdSetScissor CmdSetScissor; - PFN_vkCmdSetLineWidth CmdSetLineWidth; - PFN_vkCmdSetDepthBias CmdSetDepthBias; - PFN_vkCmdSetBlendConstants CmdSetBlendConstants; - PFN_vkCmdSetDepthBounds CmdSetDepthBounds; - PFN_vkCmdSetStencilCompareMask CmdSetStencilCompareMask; - PFN_vkCmdSetStencilWriteMask CmdSetStencilWriteMask; - PFN_vkCmdSetStencilReference CmdSetStencilReference; - PFN_vkCmdDraw CmdDraw; - PFN_vkCmdDrawIndexed CmdDrawIndexed; - PFN_vkCmdDrawIndirect CmdDrawIndirect; - PFN_vkCmdDrawIndexedIndirect CmdDrawIndexedIndirect; - PFN_vkCmdDispatch CmdDispatch; - PFN_vkCmdDispatchIndirect CmdDispatchIndirect; - PFN_vkCmdCopyBuffer CmdCopyBuffer; - PFN_vkCmdCopyImage CmdCopyImage; - PFN_vkCmdBlitImage CmdBlitImage; - PFN_vkCmdCopyBufferToImage CmdCopyBufferToImage; - PFN_vkCmdCopyImageToBuffer CmdCopyImageToBuffer; - PFN_vkCmdUpdateBuffer CmdUpdateBuffer; - PFN_vkCmdFillBuffer CmdFillBuffer; - PFN_vkCmdClearColorImage CmdClearColorImage; - PFN_vkCmdClearDepthStencilImage CmdClearDepthStencilImage; - PFN_vkCmdClearAttachments CmdClearAttachments; - PFN_vkCmdResolveImage CmdResolveImage; - PFN_vkCmdSetEvent CmdSetEvent; - PFN_vkCmdResetEvent CmdResetEvent; - PFN_vkCmdWaitEvents CmdWaitEvents; - PFN_vkCmdPipelineBarrier CmdPipelineBarrier; - PFN_vkCmdBeginQuery CmdBeginQuery; - PFN_vkCmdEndQuery CmdEndQuery; - PFN_vkCmdResetQueryPool CmdResetQueryPool; - PFN_vkCmdWriteTimestamp CmdWriteTimestamp; - PFN_vkCmdCopyQueryPoolResults CmdCopyQueryPoolResults; - PFN_vkCmdPushConstants CmdPushConstants; - PFN_vkCmdBeginRenderPass CmdBeginRenderPass; - PFN_vkCmdNextSubpass CmdNextSubpass; - PFN_vkCmdEndRenderPass CmdEndRenderPass; - PFN_vkCmdExecuteCommands CmdExecuteCommands; - PFN_vkCreateSwapchainKHR CreateSwapchainKHR; - PFN_vkDestroySwapchainKHR DestroySwapchainKHR; - PFN_vkGetSwapchainImagesKHR GetSwapchainImagesKHR; - PFN_vkAcquireNextImageKHR AcquireNextImageKHR; - PFN_vkQueuePresentKHR QueuePresentKHR; - PFN_vkCmdDrawIndirectCountAMD CmdDrawIndirectCountAMD; - PFN_vkCmdDrawIndexedIndirectCountAMD CmdDrawIndexedIndirectCountAMD; -#ifdef VK_USE_PLATFORM_WIN32_KHR - PFN_vkGetMemoryWin32HandleNV GetMemoryWin32HandleNV; -#endif - PFN_vkCreateSharedSwapchainsKHR CreateSharedSwapchainsKHR; - PFN_vkDebugMarkerSetObjectTagEXT DebugMarkerSetObjectTagEXT; - PFN_vkDebugMarkerSetObjectNameEXT DebugMarkerSetObjectNameEXT; - PFN_vkCmdDebugMarkerBeginEXT CmdDebugMarkerBeginEXT; - PFN_vkCmdDebugMarkerEndEXT CmdDebugMarkerEndEXT; - PFN_vkCmdDebugMarkerInsertEXT CmdDebugMarkerInsertEXT; - // KHR_maintenance1 - PFN_vkTrimCommandPoolKHR TrimCommandPoolKHR; - // EXT_display_control - PFN_vkDisplayPowerControlEXT DisplayPowerControlEXT; - PFN_vkRegisterDeviceEventEXT RegisterDeviceEventEXT; - PFN_vkRegisterDisplayEventEXT RegisterDisplayEventEXT; - PFN_vkGetSwapchainCounterEXT GetSwapchainCounterEXT; - // NVX_device_generated_commands - PFN_vkCmdProcessCommandsNVX CmdProcessCommandsNVX; - PFN_vkCmdReserveSpaceForCommandsNVX CmdReserveSpaceForCommandsNVX; - PFN_vkCreateIndirectCommandsLayoutNVX CreateIndirectCommandsLayoutNVX; - PFN_vkDestroyIndirectCommandsLayoutNVX DestroyIndirectCommandsLayoutNVX; - PFN_vkCreateObjectTableNVX CreateObjectTableNVX; - PFN_vkDestroyObjectTableNVX DestroyObjectTableNVX; - PFN_vkRegisterObjectsNVX RegisterObjectsNVX; - PFN_vkUnregisterObjectsNVX UnregisterObjectsNVX; -} VkLayerDispatchTable; - -typedef struct VkLayerInstanceDispatchTable_ { - PFN_vkGetInstanceProcAddr GetInstanceProcAddr; - PFN_GetPhysicalDeviceProcAddr GetPhysicalDeviceProcAddr; - PFN_vkDestroyInstance DestroyInstance; - PFN_vkEnumeratePhysicalDevices EnumeratePhysicalDevices; - PFN_vkGetPhysicalDeviceFeatures GetPhysicalDeviceFeatures; - PFN_vkGetPhysicalDeviceImageFormatProperties - GetPhysicalDeviceImageFormatProperties; - PFN_vkGetPhysicalDeviceFormatProperties GetPhysicalDeviceFormatProperties; - PFN_vkGetPhysicalDeviceSparseImageFormatProperties - GetPhysicalDeviceSparseImageFormatProperties; - PFN_vkGetPhysicalDeviceProperties GetPhysicalDeviceProperties; - PFN_vkGetPhysicalDeviceQueueFamilyProperties - GetPhysicalDeviceQueueFamilyProperties; - PFN_vkGetPhysicalDeviceMemoryProperties GetPhysicalDeviceMemoryProperties; - PFN_vkEnumerateDeviceExtensionProperties EnumerateDeviceExtensionProperties; - PFN_vkEnumerateDeviceLayerProperties EnumerateDeviceLayerProperties; - PFN_vkDestroySurfaceKHR DestroySurfaceKHR; - PFN_vkGetPhysicalDeviceSurfaceSupportKHR GetPhysicalDeviceSurfaceSupportKHR; - PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR - GetPhysicalDeviceSurfaceCapabilitiesKHR; - PFN_vkGetPhysicalDeviceSurfaceFormatsKHR GetPhysicalDeviceSurfaceFormatsKHR; - PFN_vkGetPhysicalDeviceSurfacePresentModesKHR - GetPhysicalDeviceSurfacePresentModesKHR; -#ifdef VK_USE_PLATFORM_MIR_KHR - PFN_vkCreateMirSurfaceKHR CreateMirSurfaceKHR; - PFN_vkGetPhysicalDeviceMirPresentationSupportKHR - GetPhysicalDeviceMirPresentationSupportKHR; -#endif -#ifdef VK_USE_PLATFORM_WAYLAND_KHR - PFN_vkCreateWaylandSurfaceKHR CreateWaylandSurfaceKHR; - PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR - GetPhysicalDeviceWaylandPresentationSupportKHR; -#endif -#ifdef VK_USE_PLATFORM_WIN32_KHR - PFN_vkCreateWin32SurfaceKHR CreateWin32SurfaceKHR; - PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR - GetPhysicalDeviceWin32PresentationSupportKHR; -#endif -#ifdef VK_USE_PLATFORM_XCB_KHR - PFN_vkCreateXcbSurfaceKHR CreateXcbSurfaceKHR; - PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR - GetPhysicalDeviceXcbPresentationSupportKHR; -#endif -#ifdef VK_USE_PLATFORM_XLIB_KHR - PFN_vkCreateXlibSurfaceKHR CreateXlibSurfaceKHR; - PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR - GetPhysicalDeviceXlibPresentationSupportKHR; -#endif -#ifdef VK_USE_PLATFORM_ANDROID_KHR - PFN_vkCreateAndroidSurfaceKHR CreateAndroidSurfaceKHR; -#endif - PFN_vkGetPhysicalDeviceDisplayPropertiesKHR - GetPhysicalDeviceDisplayPropertiesKHR; - PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR - GetPhysicalDeviceDisplayPlanePropertiesKHR; - PFN_vkGetDisplayPlaneSupportedDisplaysKHR - GetDisplayPlaneSupportedDisplaysKHR; - PFN_vkGetDisplayModePropertiesKHR - GetDisplayModePropertiesKHR; - PFN_vkCreateDisplayModeKHR - CreateDisplayModeKHR; - PFN_vkGetDisplayPlaneCapabilitiesKHR - GetDisplayPlaneCapabilitiesKHR; - PFN_vkCreateDisplayPlaneSurfaceKHR - CreateDisplayPlaneSurfaceKHR; - // KHR_get_physical_device_properties2 - PFN_vkGetPhysicalDeviceFeatures2KHR GetPhysicalDeviceFeatures2KHR; - PFN_vkGetPhysicalDeviceProperties2KHR GetPhysicalDeviceProperties2KHR; - PFN_vkGetPhysicalDeviceFormatProperties2KHR - GetPhysicalDeviceFormatProperties2KHR; - PFN_vkGetPhysicalDeviceImageFormatProperties2KHR - GetPhysicalDeviceImageFormatProperties2KHR; - PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR - GetPhysicalDeviceQueueFamilyProperties2KHR; - PFN_vkGetPhysicalDeviceMemoryProperties2KHR - GetPhysicalDeviceMemoryProperties2KHR; - PFN_vkGetPhysicalDeviceSparseImageFormatProperties2KHR - GetPhysicalDeviceSparseImageFormatProperties2KHR; -#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT - // EXT_acquire_xlib_display - PFN_vkAcquireXlibDisplayEXT AcquireXlibDisplayEXT; - PFN_vkGetRandROutputDisplayEXT GetRandROutputDisplayEXT; -#endif - // EXT_debug_report - PFN_vkCreateDebugReportCallbackEXT CreateDebugReportCallbackEXT; - PFN_vkDestroyDebugReportCallbackEXT DestroyDebugReportCallbackEXT; - PFN_vkDebugReportMessageEXT DebugReportMessageEXT; - // EXT_direct_mode_display - PFN_vkReleaseDisplayEXT ReleaseDisplayEXT; - // EXT_display_surface_counter - PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT - GetPhysicalDeviceSurfaceCapabilities2EXT; - // NV_external_memory_capabilities - PFN_vkGetPhysicalDeviceExternalImageFormatPropertiesNV - GetPhysicalDeviceExternalImageFormatPropertiesNV; - // NVX_device_generated_commands (phys dev commands) - PFN_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX - GetPhysicalDeviceGeneratedCommandsPropertiesNVX; -} VkLayerInstanceDispatchTable; - // ------------------------------------------------------------------------------------------------ // CreateInstance and CreateDevice support structures diff --git a/include/vulkan/vulkan.h b/include/vulkan/vulkan.h index e4113eb6..d3f2b7e8 100644 --- a/include/vulkan/vulkan.h +++ b/include/vulkan/vulkan.h @@ -43,7 +43,7 @@ extern "C" { #define VK_VERSION_MINOR(version) (((uint32_t)(version) >> 12) & 0x3ff) #define VK_VERSION_PATCH(version) ((uint32_t)(version) & 0xfff) // Version of this file -#define VK_HEADER_VERSION 41 +#define VK_HEADER_VERSION 42 #define VK_NULL_HANDLE 0 @@ -146,6 +146,7 @@ typedef enum VkResult { VK_ERROR_VALIDATION_FAILED_EXT = -1000011001, VK_ERROR_INVALID_SHADER_NV = -1000012000, VK_ERROR_OUT_OF_POOL_MEMORY_KHR = -1000069000, + VK_ERROR_INVALID_EXTERNAL_HANDLE_KHX = -1000072003, VK_RESULT_BEGIN_RANGE = VK_ERROR_FRAGMENTED_POOL, VK_RESULT_END_RANGE = VK_INCOMPLETE, VK_RESULT_RANGE_SIZE = (VK_INCOMPLETE - VK_ERROR_FRAGMENTED_POOL + 1), @@ -221,6 +222,9 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV = 1000026000, VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV = 1000026001, VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV = 1000026002, + VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO_KHX = 1000053000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES_KHX = 1000053001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES_KHX = 1000053002, VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV = 1000056000, VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV = 1000056001, VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057000, @@ -235,19 +239,67 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR = 1000059006, VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2_KHR = 1000059007, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2_KHR = 1000059008, + VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO_KHX = 1000060000, + VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO_KHX = 1000060001, + VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHX = 1000060002, + VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO_KHX = 1000060003, + VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO_KHX = 1000060004, + VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO_KHX = 1000060005, + VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO_KHX = 1000060006, + VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHX = 1000060007, + VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHX = 1000060008, + VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHX = 1000060009, + VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHX = 1000060010, + VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHX = 1000060011, + VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHX = 1000060012, VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT = 1000061000, VK_STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN = 1000062000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES_KHX = 1000070000, + VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO_KHX = 1000070001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO_KHX = 1000071000, + VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES_KHX = 1000071001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO_KHX = 1000071002, + VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES_KHX = 1000071003, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES_KHX = 1000071004, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHX = 1000071005, + VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHX = 1000071006, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHX = 1000071007, + VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO_KHX = 1000072000, + VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_KHX = 1000072001, + VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHX = 1000072002, + VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHX = 1000073000, + VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHX = 1000073001, + VK_STRUCTURE_TYPE_MEMORY_WIN32_HANDLE_PROPERTIES_KHX = 1000073002, + VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHX = 1000074000, + VK_STRUCTURE_TYPE_MEMORY_FD_PROPERTIES_KHX = 1000074001, + VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHX = 1000075000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO_KHX = 1000076000, + VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES_KHX = 1000076001, + VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO_KHX = 1000077000, + VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHX = 1000078000, + VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHX = 1000078001, + VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHX = 1000078002, + VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHX = 1000079000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR = 1000080000, + VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHR = 1000085000, VK_STRUCTURE_TYPE_OBJECT_TABLE_CREATE_INFO_NVX = 1000086000, VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NVX = 1000086001, VK_STRUCTURE_TYPE_CMD_PROCESS_COMMANDS_INFO_NVX = 1000086002, VK_STRUCTURE_TYPE_CMD_RESERVE_SPACE_FOR_COMMANDS_INFO_NVX = 1000086003, VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_LIMITS_NVX = 1000086004, VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_FEATURES_NVX = 1000086005, + VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV = 1000087000, VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES2_EXT = 1000090000, VK_STRUCTURE_TYPE_DISPLAY_POWER_INFO_EXT = 1000091000, VK_STRUCTURE_TYPE_DEVICE_EVENT_INFO_EXT = 1000091001, VK_STRUCTURE_TYPE_DISPLAY_EVENT_INFO_EXT = 1000091002, VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT = 1000091003, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX = 1000097000, + VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV = 1000098000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT = 1000099000, + VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT = 1000099001, + VK_STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK = 1000122000, + VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK = 1000123000, VK_STRUCTURE_TYPE_BEGIN_RANGE = VK_STRUCTURE_TYPE_APPLICATION_INFO, VK_STRUCTURE_TYPE_END_RANGE = VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO, VK_STRUCTURE_TYPE_RANGE_SIZE = (VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO - VK_STRUCTURE_TYPE_APPLICATION_INFO + 1), @@ -716,6 +768,8 @@ typedef enum VkDynamicState { VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 6, VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 7, VK_DYNAMIC_STATE_STENCIL_REFERENCE = 8, + VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV = 1000087000, + VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT = 1000099000, VK_DYNAMIC_STATE_BEGIN_RANGE = VK_DYNAMIC_STATE_VIEWPORT, VK_DYNAMIC_STATE_END_RANGE = VK_DYNAMIC_STATE_STENCIL_REFERENCE, VK_DYNAMIC_STATE_RANGE_SIZE = (VK_DYNAMIC_STATE_STENCIL_REFERENCE - VK_DYNAMIC_STATE_VIEWPORT + 1), @@ -881,6 +935,7 @@ typedef enum VkImageCreateFlagBits { VK_IMAGE_CREATE_SPARSE_ALIASED_BIT = 0x00000004, VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000008, VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT = 0x00000010, + VK_IMAGE_CREATE_BIND_SFR_BIT_KHX = 0x00000040, VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR = 0x00000020, VK_IMAGE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkImageCreateFlagBits; @@ -919,6 +974,7 @@ typedef VkFlags VkMemoryPropertyFlags; typedef enum VkMemoryHeapFlagBits { VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 0x00000001, + VK_MEMORY_HEAP_MULTI_INSTANCE_BIT_KHX = 0x00000002, VK_MEMORY_HEAP_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkMemoryHeapFlagBits; typedef VkFlags VkMemoryHeapFlags; @@ -1036,6 +1092,8 @@ typedef enum VkPipelineCreateFlagBits { VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 0x00000001, VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = 0x00000002, VK_PIPELINE_CREATE_DERIVATIVE_BIT = 0x00000004, + VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT_KHX = 0x00000008, + VK_PIPELINE_CREATE_DISPATCH_BASE_KHX = 0x00000010, VK_PIPELINE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkPipelineCreateFlagBits; typedef VkFlags VkPipelineCreateFlags; @@ -1082,6 +1140,11 @@ typedef VkFlags VkPipelineDynamicStateCreateFlags; typedef VkFlags VkPipelineLayoutCreateFlags; typedef VkFlags VkShaderStageFlags; typedef VkFlags VkSamplerCreateFlags; + +typedef enum VkDescriptorSetLayoutCreateFlagBits { + VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR = 0x00000001, + VK_DESCRIPTOR_SET_LAYOUT_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkDescriptorSetLayoutCreateFlagBits; typedef VkFlags VkDescriptorSetLayoutCreateFlags; typedef enum VkDescriptorPoolCreateFlagBits { @@ -1098,6 +1161,12 @@ typedef enum VkAttachmentDescriptionFlagBits { VK_ATTACHMENT_DESCRIPTION_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkAttachmentDescriptionFlagBits; typedef VkFlags VkAttachmentDescriptionFlags; + +typedef enum VkSubpassDescriptionFlagBits { + VK_SUBPASS_DESCRIPTION_PER_VIEW_ATTRIBUTES_BIT_NVX = 0x00000001, + VK_SUBPASS_DESCRIPTION_PER_VIEW_POSITION_X_ONLY_BIT_NVX = 0x00000002, + VK_SUBPASS_DESCRIPTION_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkSubpassDescriptionFlagBits; typedef VkFlags VkSubpassDescriptionFlags; typedef enum VkAccessFlagBits { @@ -1126,6 +1195,8 @@ typedef VkFlags VkAccessFlags; typedef enum VkDependencyFlagBits { VK_DEPENDENCY_BY_REGION_BIT = 0x00000001, + VK_DEPENDENCY_VIEW_LOCAL_BIT_KHX = 0x00000002, + VK_DEPENDENCY_DEVICE_GROUP_BIT_KHX = 0x00000004, VK_DEPENDENCY_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkDependencyFlagBits; typedef VkFlags VkDependencyFlags; @@ -2388,7 +2459,7 @@ typedef void (VKAPI_PTR *PFN_vkCmdDraw)(VkCommandBuffer commandBuffer, uint32_t typedef void (VKAPI_PTR *PFN_vkCmdDrawIndexed)(VkCommandBuffer commandBuffer, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance); typedef void (VKAPI_PTR *PFN_vkCmdDrawIndirect)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); typedef void (VKAPI_PTR *PFN_vkCmdDrawIndexedIndirect)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); -typedef void (VKAPI_PTR *PFN_vkCmdDispatch)(VkCommandBuffer commandBuffer, uint32_t x, uint32_t y, uint32_t z); +typedef void (VKAPI_PTR *PFN_vkCmdDispatch)(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); typedef void (VKAPI_PTR *PFN_vkCmdDispatchIndirect)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset); typedef void (VKAPI_PTR *PFN_vkCmdCopyBuffer)(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferCopy* pRegions); typedef void (VKAPI_PTR *PFN_vkCmdCopyImage)(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageCopy* pRegions); @@ -3024,9 +3095,9 @@ VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndexedIndirect( VKAPI_ATTR void VKAPI_CALL vkCmdDispatch( VkCommandBuffer commandBuffer, - uint32_t x, - uint32_t y, - uint32_t z); + uint32_t groupCountX, + uint32_t groupCountY, + uint32_t groupCountZ); VKAPI_ATTR void VKAPI_CALL vkCmdDispatchIndirect( VkCommandBuffer commandBuffer, @@ -3327,6 +3398,11 @@ VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSwapchainKHR) #define VK_KHR_SWAPCHAIN_SPEC_VERSION 68 #define VK_KHR_SWAPCHAIN_EXTENSION_NAME "VK_KHR_swapchain" + +typedef enum VkSwapchainCreateFlagBitsKHR { + VK_SWAPCHAIN_CREATE_BIND_SFR_BIT_KHX = 0x00000001, + VK_SWAPCHAIN_CREATE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkSwapchainCreateFlagBitsKHR; typedef VkFlags VkSwapchainCreateFlagsKHR; typedef struct VkSwapchainCreateInfoKHR { @@ -3890,6 +3966,101 @@ VKAPI_ATTR void VKAPI_CALL vkTrimCommandPoolKHR( VkCommandPoolTrimFlagsKHR flags); #endif +#define VK_KHR_push_descriptor 1 +#define VK_KHR_PUSH_DESCRIPTOR_SPEC_VERSION 1 +#define VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME "VK_KHR_push_descriptor" + +typedef struct VkPhysicalDevicePushDescriptorPropertiesKHR { + VkStructureType sType; + void* pNext; + uint32_t maxPushDescriptors; +} VkPhysicalDevicePushDescriptorPropertiesKHR; + + +typedef void (VKAPI_PTR *PFN_vkCmdPushDescriptorSetKHR)(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdPushDescriptorSetKHR( + VkCommandBuffer commandBuffer, + VkPipelineBindPoint pipelineBindPoint, + VkPipelineLayout layout, + uint32_t set, + uint32_t descriptorWriteCount, + const VkWriteDescriptorSet* pDescriptorWrites); +#endif + +#define VK_KHR_descriptor_update_template 1 +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorUpdateTemplateKHR) + +#define VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_SPEC_VERSION 1 +#define VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME "VK_KHR_descriptor_update_template" + + +typedef enum VkDescriptorUpdateTemplateTypeKHR { + VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR = 0, + VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR = 1, + VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_BEGIN_RANGE_KHR = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR, + VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_END_RANGE_KHR = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR, + VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_RANGE_SIZE_KHR = (VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR - VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR + 1), + VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_MAX_ENUM_KHR = 0x7FFFFFFF +} VkDescriptorUpdateTemplateTypeKHR; + +typedef VkFlags VkDescriptorUpdateTemplateCreateFlagsKHR; + +typedef struct VkDescriptorUpdateTemplateEntryKHR { + uint32_t dstBinding; + uint32_t dstArrayElement; + uint32_t descriptorCount; + VkDescriptorType descriptorType; + size_t offset; + size_t stride; +} VkDescriptorUpdateTemplateEntryKHR; + +typedef struct VkDescriptorUpdateTemplateCreateInfoKHR { + VkStructureType sType; + void* pNext; + VkDescriptorUpdateTemplateCreateFlagsKHR flags; + uint32_t descriptorUpdateEntryCount; + const VkDescriptorUpdateTemplateEntryKHR* pDescriptorUpdateEntries; + VkDescriptorUpdateTemplateTypeKHR templateType; + VkDescriptorSetLayout descriptorSetLayout; + VkPipelineBindPoint pipelineBindPoint; + VkPipelineLayout pipelineLayout; + uint32_t set; +} VkDescriptorUpdateTemplateCreateInfoKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateDescriptorUpdateTemplateKHR)(VkDevice device, const VkDescriptorUpdateTemplateCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorUpdateTemplateKHR* pDescriptorUpdateTemplate); +typedef void (VKAPI_PTR *PFN_vkDestroyDescriptorUpdateTemplateKHR)(VkDevice device, VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, const VkAllocationCallbacks* pAllocator); +typedef void (VKAPI_PTR *PFN_vkUpdateDescriptorSetWithTemplateKHR)(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, const void* pData); +typedef void (VKAPI_PTR *PFN_vkCmdPushDescriptorSetWithTemplateKHR)(VkCommandBuffer commandBuffer, VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, VkPipelineLayout layout, uint32_t set, const void* pData); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateDescriptorUpdateTemplateKHR( + VkDevice device, + const VkDescriptorUpdateTemplateCreateInfoKHR* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkDescriptorUpdateTemplateKHR* pDescriptorUpdateTemplate); + +VKAPI_ATTR void VKAPI_CALL vkDestroyDescriptorUpdateTemplateKHR( + VkDevice device, + VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR void VKAPI_CALL vkUpdateDescriptorSetWithTemplateKHR( + VkDevice device, + VkDescriptorSet descriptorSet, + VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, + const void* pData); + +VKAPI_ATTR void VKAPI_CALL vkCmdPushDescriptorSetWithTemplateKHR( + VkCommandBuffer commandBuffer, + VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, + VkPipelineLayout layout, + uint32_t set, + const void* pData); +#endif + #define VK_EXT_debug_report 1 VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDebugReportCallbackEXT) @@ -4176,6 +4347,38 @@ VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndexedIndirectCountAMD( #define VK_AMD_SHADER_BALLOT_EXTENSION_NAME "VK_AMD_shader_ballot" +#define VK_KHX_multiview 1 +#define VK_KHX_MULTIVIEW_SPEC_VERSION 1 +#define VK_KHX_MULTIVIEW_EXTENSION_NAME "VK_KHX_multiview" + +typedef struct VkRenderPassMultiviewCreateInfoKHX { + VkStructureType sType; + const void* pNext; + uint32_t subpassCount; + const uint32_t* pViewMasks; + uint32_t dependencyCount; + const int32_t* pViewOffsets; + uint32_t correlationMaskCount; + const uint32_t* pCorrelationMasks; +} VkRenderPassMultiviewCreateInfoKHX; + +typedef struct VkPhysicalDeviceMultiviewFeaturesKHX { + VkStructureType sType; + void* pNext; + VkBool32 multiview; + VkBool32 multiviewGeometryShader; + VkBool32 multiviewTessellationShader; +} VkPhysicalDeviceMultiviewFeaturesKHX; + +typedef struct VkPhysicalDeviceMultiviewPropertiesKHX { + VkStructureType sType; + void* pNext; + uint32_t maxMultiviewViewCount; + uint32_t maxMultiviewInstanceIndex; +} VkPhysicalDeviceMultiviewPropertiesKHX; + + + #define VK_IMG_format_pvrtc 1 #define VK_IMG_FORMAT_PVRTC_SPEC_VERSION 1 #define VK_IMG_FORMAT_PVRTC_EXTENSION_NAME "VK_IMG_format_pvrtc" @@ -4294,6 +4497,204 @@ typedef struct VkWin32KeyedMutexAcquireReleaseInfoNV { #endif /* VK_USE_PLATFORM_WIN32_KHR */ +#define VK_KHX_device_group 1 +#define VK_MAX_DEVICE_GROUP_SIZE_KHX 32 +#define VK_KHX_DEVICE_GROUP_SPEC_VERSION 1 +#define VK_KHX_DEVICE_GROUP_EXTENSION_NAME "VK_KHX_device_group" + + +typedef enum VkPeerMemoryFeatureFlagBitsKHX { + VK_PEER_MEMORY_FEATURE_COPY_SRC_BIT_KHX = 0x00000001, + VK_PEER_MEMORY_FEATURE_COPY_DST_BIT_KHX = 0x00000002, + VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT_KHX = 0x00000004, + VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT_KHX = 0x00000008, + VK_PEER_MEMORY_FEATURE_FLAG_BITS_MAX_ENUM_KHX = 0x7FFFFFFF +} VkPeerMemoryFeatureFlagBitsKHX; +typedef VkFlags VkPeerMemoryFeatureFlagsKHX; + +typedef enum VkMemoryAllocateFlagBitsKHX { + VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT_KHX = 0x00000001, + VK_MEMORY_ALLOCATE_FLAG_BITS_MAX_ENUM_KHX = 0x7FFFFFFF +} VkMemoryAllocateFlagBitsKHX; +typedef VkFlags VkMemoryAllocateFlagsKHX; + +typedef enum VkDeviceGroupPresentModeFlagBitsKHX { + VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHX = 0x00000001, + VK_DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHX = 0x00000002, + VK_DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHX = 0x00000004, + VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHX = 0x00000008, + VK_DEVICE_GROUP_PRESENT_MODE_FLAG_BITS_MAX_ENUM_KHX = 0x7FFFFFFF +} VkDeviceGroupPresentModeFlagBitsKHX; +typedef VkFlags VkDeviceGroupPresentModeFlagsKHX; + +typedef struct VkMemoryAllocateFlagsInfoKHX { + VkStructureType sType; + const void* pNext; + VkMemoryAllocateFlagsKHX flags; + uint32_t deviceMask; +} VkMemoryAllocateFlagsInfoKHX; + +typedef struct VkBindBufferMemoryInfoKHX { + VkStructureType sType; + const void* pNext; + VkBuffer buffer; + VkDeviceMemory memory; + VkDeviceSize memoryOffset; + uint32_t deviceIndexCount; + const uint32_t* pDeviceIndices; +} VkBindBufferMemoryInfoKHX; + +typedef struct VkBindImageMemoryInfoKHX { + VkStructureType sType; + const void* pNext; + VkImage image; + VkDeviceMemory memory; + VkDeviceSize memoryOffset; + uint32_t deviceIndexCount; + const uint32_t* pDeviceIndices; + uint32_t SFRRectCount; + const VkRect2D* pSFRRects; +} VkBindImageMemoryInfoKHX; + +typedef struct VkDeviceGroupRenderPassBeginInfoKHX { + VkStructureType sType; + const void* pNext; + uint32_t deviceMask; + uint32_t deviceRenderAreaCount; + const VkRect2D* pDeviceRenderAreas; +} VkDeviceGroupRenderPassBeginInfoKHX; + +typedef struct VkDeviceGroupCommandBufferBeginInfoKHX { + VkStructureType sType; + const void* pNext; + uint32_t deviceMask; +} VkDeviceGroupCommandBufferBeginInfoKHX; + +typedef struct VkDeviceGroupSubmitInfoKHX { + VkStructureType sType; + const void* pNext; + uint32_t waitSemaphoreCount; + const uint32_t* pWaitSemaphoreDeviceIndices; + uint32_t commandBufferCount; + const uint32_t* pCommandBufferDeviceMasks; + uint32_t signalSemaphoreCount; + const uint32_t* pSignalSemaphoreDeviceIndices; +} VkDeviceGroupSubmitInfoKHX; + +typedef struct VkDeviceGroupBindSparseInfoKHX { + VkStructureType sType; + const void* pNext; + uint32_t resourceDeviceIndex; + uint32_t memoryDeviceIndex; +} VkDeviceGroupBindSparseInfoKHX; + +typedef struct VkDeviceGroupPresentCapabilitiesKHX { + VkStructureType sType; + const void* pNext; + uint32_t presentMask[VK_MAX_DEVICE_GROUP_SIZE_KHX]; + VkDeviceGroupPresentModeFlagsKHX modes; +} VkDeviceGroupPresentCapabilitiesKHX; + +typedef struct VkImageSwapchainCreateInfoKHX { + VkStructureType sType; + const void* pNext; + VkSwapchainKHR swapchain; +} VkImageSwapchainCreateInfoKHX; + +typedef struct VkBindImageMemorySwapchainInfoKHX { + VkStructureType sType; + const void* pNext; + VkSwapchainKHR swapchain; + uint32_t imageIndex; +} VkBindImageMemorySwapchainInfoKHX; + +typedef struct VkAcquireNextImageInfoKHX { + VkStructureType sType; + const void* pNext; + VkSwapchainKHR swapchain; + uint64_t timeout; + VkSemaphore semaphore; + VkFence fence; + uint32_t deviceMask; +} VkAcquireNextImageInfoKHX; + +typedef struct VkDeviceGroupPresentInfoKHX { + VkStructureType sType; + const void* pNext; + uint32_t swapchainCount; + const uint32_t* pDeviceMasks; + VkDeviceGroupPresentModeFlagBitsKHX mode; +} VkDeviceGroupPresentInfoKHX; + +typedef struct VkDeviceGroupSwapchainCreateInfoKHX { + VkStructureType sType; + const void* pNext; + VkDeviceGroupPresentModeFlagsKHX modes; +} VkDeviceGroupSwapchainCreateInfoKHX; + + +typedef void (VKAPI_PTR *PFN_vkGetDeviceGroupPeerMemoryFeaturesKHX)(VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, VkPeerMemoryFeatureFlagsKHX* pPeerMemoryFeatures); +typedef VkResult (VKAPI_PTR *PFN_vkBindBufferMemory2KHX)(VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfoKHX* pBindInfos); +typedef VkResult (VKAPI_PTR *PFN_vkBindImageMemory2KHX)(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfoKHX* pBindInfos); +typedef void (VKAPI_PTR *PFN_vkCmdSetDeviceMaskKHX)(VkCommandBuffer commandBuffer, uint32_t deviceMask); +typedef VkResult (VKAPI_PTR *PFN_vkGetDeviceGroupPresentCapabilitiesKHX)(VkDevice device, VkDeviceGroupPresentCapabilitiesKHX* pDeviceGroupPresentCapabilities); +typedef VkResult (VKAPI_PTR *PFN_vkGetDeviceGroupSurfacePresentModesKHX)(VkDevice device, VkSurfaceKHR surface, VkDeviceGroupPresentModeFlagsKHX* pModes); +typedef VkResult (VKAPI_PTR *PFN_vkAcquireNextImage2KHX)(VkDevice device, const VkAcquireNextImageInfoKHX* pAcquireInfo, uint32_t* pImageIndex); +typedef void (VKAPI_PTR *PFN_vkCmdDispatchBaseKHX)(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDevicePresentRectanglesKHX)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pRectCount, VkRect2D* pRects); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkGetDeviceGroupPeerMemoryFeaturesKHX( + VkDevice device, + uint32_t heapIndex, + uint32_t localDeviceIndex, + uint32_t remoteDeviceIndex, + VkPeerMemoryFeatureFlagsKHX* pPeerMemoryFeatures); + +VKAPI_ATTR VkResult VKAPI_CALL vkBindBufferMemory2KHX( + VkDevice device, + uint32_t bindInfoCount, + const VkBindBufferMemoryInfoKHX* pBindInfos); + +VKAPI_ATTR VkResult VKAPI_CALL vkBindImageMemory2KHX( + VkDevice device, + uint32_t bindInfoCount, + const VkBindImageMemoryInfoKHX* pBindInfos); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetDeviceMaskKHX( + VkCommandBuffer commandBuffer, + uint32_t deviceMask); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetDeviceGroupPresentCapabilitiesKHX( + VkDevice device, + VkDeviceGroupPresentCapabilitiesKHX* pDeviceGroupPresentCapabilities); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetDeviceGroupSurfacePresentModesKHX( + VkDevice device, + VkSurfaceKHR surface, + VkDeviceGroupPresentModeFlagsKHX* pModes); + +VKAPI_ATTR VkResult VKAPI_CALL vkAcquireNextImage2KHX( + VkDevice device, + const VkAcquireNextImageInfoKHX* pAcquireInfo, + uint32_t* pImageIndex); + +VKAPI_ATTR void VKAPI_CALL vkCmdDispatchBaseKHX( + VkCommandBuffer commandBuffer, + uint32_t baseGroupX, + uint32_t baseGroupY, + uint32_t baseGroupZ, + uint32_t groupCountX, + uint32_t groupCountY, + uint32_t groupCountZ); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDevicePresentRectanglesKHX( + VkPhysicalDevice physicalDevice, + VkSurfaceKHR surface, + uint32_t* pRectCount, + VkRect2D* pRects); +#endif + #define VK_EXT_validation_flags 1 #define VK_EXT_VALIDATION_FLAGS_SPEC_VERSION 1 #define VK_EXT_VALIDATION_FLAGS_EXTENSION_NAME "VK_EXT_validation_flags" @@ -4352,6 +4753,403 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateViSurfaceNN( #define VK_EXT_SHADER_SUBGROUP_VOTE_EXTENSION_NAME "VK_EXT_shader_subgroup_vote" +#define VK_KHX_device_group_creation 1 +#define VK_KHX_DEVICE_GROUP_CREATION_SPEC_VERSION 1 +#define VK_KHX_DEVICE_GROUP_CREATION_EXTENSION_NAME "VK_KHX_device_group_creation" + +typedef struct VkPhysicalDeviceGroupPropertiesKHX { + VkStructureType sType; + const void* pNext; + uint32_t physicalDeviceCount; + VkPhysicalDevice physicalDevices[VK_MAX_DEVICE_GROUP_SIZE_KHX]; + VkBool32 subsetAllocation; +} VkPhysicalDeviceGroupPropertiesKHX; + +typedef struct VkDeviceGroupDeviceCreateInfoKHX { + VkStructureType sType; + const void* pNext; + uint32_t physicalDeviceCount; + const VkPhysicalDevice* pPhysicalDevices; +} VkDeviceGroupDeviceCreateInfoKHX; + + +typedef VkResult (VKAPI_PTR *PFN_vkEnumeratePhysicalDeviceGroupsKHX)(VkInstance instance, uint32_t* pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupPropertiesKHX* pPhysicalDeviceGroupProperties); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkEnumeratePhysicalDeviceGroupsKHX( + VkInstance instance, + uint32_t* pPhysicalDeviceGroupCount, + VkPhysicalDeviceGroupPropertiesKHX* pPhysicalDeviceGroupProperties); +#endif + +#define VK_KHX_external_memory_capabilities 1 +#define VK_LUID_SIZE_KHX 8 +#define VK_KHX_EXTERNAL_MEMORY_CAPABILITIES_SPEC_VERSION 1 +#define VK_KHX_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME "VK_KHX_external_memory_capabilities" + + +typedef enum VkExternalMemoryHandleTypeFlagBitsKHX { + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHX = 0x00000001, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHX = 0x00000002, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHX = 0x00000004, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT_KHX = 0x00000008, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT_KHX = 0x00000010, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT_KHX = 0x00000020, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT_KHX = 0x00000040, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_FLAG_BITS_MAX_ENUM_KHX = 0x7FFFFFFF +} VkExternalMemoryHandleTypeFlagBitsKHX; +typedef VkFlags VkExternalMemoryHandleTypeFlagsKHX; + +typedef enum VkExternalMemoryFeatureFlagBitsKHX { + VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_KHX = 0x00000001, + VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_KHX = 0x00000002, + VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_KHX = 0x00000004, + VK_EXTERNAL_MEMORY_FEATURE_FLAG_BITS_MAX_ENUM_KHX = 0x7FFFFFFF +} VkExternalMemoryFeatureFlagBitsKHX; +typedef VkFlags VkExternalMemoryFeatureFlagsKHX; + +typedef struct VkExternalMemoryPropertiesKHX { + VkExternalMemoryFeatureFlagsKHX externalMemoryFeatures; + VkExternalMemoryHandleTypeFlagsKHX exportFromImportedHandleTypes; + VkExternalMemoryHandleTypeFlagsKHX compatibleHandleTypes; +} VkExternalMemoryPropertiesKHX; + +typedef struct VkPhysicalDeviceExternalImageFormatInfoKHX { + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlagBitsKHX handleType; +} VkPhysicalDeviceExternalImageFormatInfoKHX; + +typedef struct VkExternalImageFormatPropertiesKHX { + VkStructureType sType; + void* pNext; + VkExternalMemoryPropertiesKHX externalMemoryProperties; +} VkExternalImageFormatPropertiesKHX; + +typedef struct VkPhysicalDeviceExternalBufferInfoKHX { + VkStructureType sType; + const void* pNext; + VkBufferCreateFlags flags; + VkBufferUsageFlags usage; + VkExternalMemoryHandleTypeFlagBitsKHX handleType; +} VkPhysicalDeviceExternalBufferInfoKHX; + +typedef struct VkExternalBufferPropertiesKHX { + VkStructureType sType; + void* pNext; + VkExternalMemoryPropertiesKHX externalMemoryProperties; +} VkExternalBufferPropertiesKHX; + +typedef struct VkPhysicalDeviceIDPropertiesKHX { + VkStructureType sType; + void* pNext; + uint8_t deviceUUID[VK_UUID_SIZE]; + uint8_t driverUUID[VK_UUID_SIZE]; + uint8_t deviceLUID[VK_LUID_SIZE_KHX]; + VkBool32 deviceLUIDValid; +} VkPhysicalDeviceIDPropertiesKHX; + +typedef struct VkPhysicalDeviceProperties2KHX { + VkStructureType sType; + void* pNext; + VkPhysicalDeviceProperties properties; +} VkPhysicalDeviceProperties2KHX; + +typedef struct VkImageFormatProperties2KHX { + VkStructureType sType; + void* pNext; + VkImageFormatProperties imageFormatProperties; +} VkImageFormatProperties2KHX; + +typedef struct VkPhysicalDeviceImageFormatInfo2KHX { + VkStructureType sType; + const void* pNext; + VkFormat format; + VkImageType type; + VkImageTiling tiling; + VkImageUsageFlags usage; + VkImageCreateFlags flags; +} VkPhysicalDeviceImageFormatInfo2KHX; + + +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalBufferPropertiesKHX)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfoKHX* pExternalBufferInfo, VkExternalBufferPropertiesKHX* pExternalBufferProperties); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceProperties2KHX)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2KHX* pProperties); +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceImageFormatProperties2KHX)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2KHX* pImageFormatInfo, VkImageFormatProperties2KHX* pImageFormatProperties); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalBufferPropertiesKHX( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceExternalBufferInfoKHX* pExternalBufferInfo, + VkExternalBufferPropertiesKHX* pExternalBufferProperties); + +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceProperties2KHX( + VkPhysicalDevice physicalDevice, + VkPhysicalDeviceProperties2KHX* pProperties); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceImageFormatProperties2KHX( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceImageFormatInfo2KHX* pImageFormatInfo, + VkImageFormatProperties2KHX* pImageFormatProperties); +#endif + +#define VK_KHX_external_memory 1 +#define VK_KHX_EXTERNAL_MEMORY_SPEC_VERSION 1 +#define VK_KHX_EXTERNAL_MEMORY_EXTENSION_NAME "VK_KHX_external_memory" +#define VK_QUEUE_FAMILY_EXTERNAL_KHX (~0U-1) + +typedef struct VkExternalMemoryImageCreateInfoKHX { + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlagsKHX handleTypes; +} VkExternalMemoryImageCreateInfoKHX; + +typedef struct VkExternalMemoryBufferCreateInfoKHX { + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlagsKHX handleTypes; +} VkExternalMemoryBufferCreateInfoKHX; + +typedef struct VkExportMemoryAllocateInfoKHX { + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlagsKHX handleTypes; +} VkExportMemoryAllocateInfoKHX; + + + +#ifdef VK_USE_PLATFORM_WIN32_KHR +#define VK_KHX_external_memory_win32 1 +#define VK_KHX_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1 +#define VK_KHX_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_KHX_external_memory_win32" + +typedef struct VkImportMemoryWin32HandleInfoKHX { + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlagBitsKHX handleType; + HANDLE handle; +} VkImportMemoryWin32HandleInfoKHX; + +typedef struct VkExportMemoryWin32HandleInfoKHX { + VkStructureType sType; + const void* pNext; + const SECURITY_ATTRIBUTES* pAttributes; + DWORD dwAccess; + LPCWSTR name; +} VkExportMemoryWin32HandleInfoKHX; + +typedef struct VkMemoryWin32HandlePropertiesKHX { + VkStructureType sType; + void* pNext; + uint32_t memoryTypeBits; +} VkMemoryWin32HandlePropertiesKHX; + + +typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandleKHX)(VkDevice device, VkDeviceMemory memory, VkExternalMemoryHandleTypeFlagBitsKHX handleType, HANDLE* pHandle); +typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandlePropertiesKHX)(VkDevice device, VkExternalMemoryHandleTypeFlagBitsKHX handleType, HANDLE handle, VkMemoryWin32HandlePropertiesKHX* pMemoryWin32HandleProperties); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandleKHX( + VkDevice device, + VkDeviceMemory memory, + VkExternalMemoryHandleTypeFlagBitsKHX handleType, + HANDLE* pHandle); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandlePropertiesKHX( + VkDevice device, + VkExternalMemoryHandleTypeFlagBitsKHX handleType, + HANDLE handle, + VkMemoryWin32HandlePropertiesKHX* pMemoryWin32HandleProperties); +#endif +#endif /* VK_USE_PLATFORM_WIN32_KHR */ + +#define VK_KHX_external_memory_fd 1 +#define VK_KHX_EXTERNAL_MEMORY_FD_SPEC_VERSION 1 +#define VK_KHX_EXTERNAL_MEMORY_FD_EXTENSION_NAME "VK_KHX_external_memory_fd" + +typedef struct VkImportMemoryFdInfoKHX { + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlagBitsKHX handleType; + int fd; +} VkImportMemoryFdInfoKHX; + +typedef struct VkMemoryFdPropertiesKHX { + VkStructureType sType; + void* pNext; + uint32_t memoryTypeBits; +} VkMemoryFdPropertiesKHX; + + +typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryFdKHX)(VkDevice device, VkDeviceMemory memory, VkExternalMemoryHandleTypeFlagBitsKHX handleType, int* pFd); +typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryFdPropertiesKHX)(VkDevice device, VkExternalMemoryHandleTypeFlagBitsKHX handleType, int fd, VkMemoryFdPropertiesKHX* pMemoryFdProperties); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryFdKHX( + VkDevice device, + VkDeviceMemory memory, + VkExternalMemoryHandleTypeFlagBitsKHX handleType, + int* pFd); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryFdPropertiesKHX( + VkDevice device, + VkExternalMemoryHandleTypeFlagBitsKHX handleType, + int fd, + VkMemoryFdPropertiesKHX* pMemoryFdProperties); +#endif + +#ifdef VK_USE_PLATFORM_WIN32_KHR +#define VK_KHX_win32_keyed_mutex 1 +#define VK_KHX_WIN32_KEYED_MUTEX_SPEC_VERSION 1 +#define VK_KHX_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_KHX_win32_keyed_mutex" + +typedef struct VkWin32KeyedMutexAcquireReleaseInfoKHX { + VkStructureType sType; + const void* pNext; + uint32_t acquireCount; + const VkDeviceMemory* pAcquireSyncs; + const uint64_t* pAcquireKeys; + const uint32_t* pAcquireTimeouts; + uint32_t releaseCount; + const VkDeviceMemory* pReleaseSyncs; + const uint64_t* pReleaseKeys; +} VkWin32KeyedMutexAcquireReleaseInfoKHX; + + +#endif /* VK_USE_PLATFORM_WIN32_KHR */ + +#define VK_KHX_external_semaphore_capabilities 1 +#define VK_KHX_EXTERNAL_SEMAPHORE_CAPABILITIES_SPEC_VERSION 1 +#define VK_KHX_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME "VK_KHX_external_semaphore_capabilities" + + +typedef enum VkExternalSemaphoreHandleTypeFlagBitsKHX { + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT_KHX = 0x00000001, + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHX = 0x00000002, + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHX = 0x00000004, + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT_KHX = 0x00000008, + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_FENCE_FD_BIT_KHX = 0x00000010, + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_FLAG_BITS_MAX_ENUM_KHX = 0x7FFFFFFF +} VkExternalSemaphoreHandleTypeFlagBitsKHX; +typedef VkFlags VkExternalSemaphoreHandleTypeFlagsKHX; + +typedef enum VkExternalSemaphoreFeatureFlagBitsKHX { + VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT_KHX = 0x00000001, + VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT_KHX = 0x00000002, + VK_EXTERNAL_SEMAPHORE_FEATURE_FLAG_BITS_MAX_ENUM_KHX = 0x7FFFFFFF +} VkExternalSemaphoreFeatureFlagBitsKHX; +typedef VkFlags VkExternalSemaphoreFeatureFlagsKHX; + +typedef struct VkPhysicalDeviceExternalSemaphoreInfoKHX { + VkStructureType sType; + const void* pNext; + VkExternalSemaphoreHandleTypeFlagBitsKHX handleType; +} VkPhysicalDeviceExternalSemaphoreInfoKHX; + +typedef struct VkExternalSemaphorePropertiesKHX { + VkStructureType sType; + void* pNext; + VkExternalSemaphoreHandleTypeFlagsKHX exportFromImportedHandleTypes; + VkExternalSemaphoreHandleTypeFlagsKHX compatibleHandleTypes; + VkExternalSemaphoreFeatureFlagsKHX externalSemaphoreFeatures; +} VkExternalSemaphorePropertiesKHX; + + +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalSemaphorePropertiesKHX)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfoKHX* pExternalSemaphoreInfo, VkExternalSemaphorePropertiesKHX* pExternalSemaphoreProperties); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalSemaphorePropertiesKHX( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceExternalSemaphoreInfoKHX* pExternalSemaphoreInfo, + VkExternalSemaphorePropertiesKHX* pExternalSemaphoreProperties); +#endif + +#define VK_KHX_external_semaphore 1 +#define VK_KHX_EXTERNAL_SEMAPHORE_SPEC_VERSION 1 +#define VK_KHX_EXTERNAL_SEMAPHORE_EXTENSION_NAME "VK_KHX_external_semaphore" + +typedef struct VkExportSemaphoreCreateInfoKHX { + VkStructureType sType; + const void* pNext; + VkExternalSemaphoreHandleTypeFlagsKHX handleTypes; +} VkExportSemaphoreCreateInfoKHX; + + + +#ifdef VK_USE_PLATFORM_WIN32_KHX +#define VK_KHX_external_semaphore_win32 1 +#define VK_KHX_EXTERNAL_SEMAPHORE_WIN32_SPEC_VERSION 1 +#define VK_KHX_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME "VK_KHX_external_semaphore_win32" + +typedef struct VkImportSemaphoreWin32HandleInfoKHX { + VkStructureType sType; + const void* pNext; + VkSemaphore semaphore; + VkExternalSemaphoreHandleTypeFlagsKHX handleType; + HANDLE handle; +} VkImportSemaphoreWin32HandleInfoKHX; + +typedef struct VkExportSemaphoreWin32HandleInfoKHX { + VkStructureType sType; + const void* pNext; + const SECURITY_ATTRIBUTES* pAttributes; + DWORD dwAccess; + LPCWSTR name; +} VkExportSemaphoreWin32HandleInfoKHX; + +typedef struct VkD3D12FenceSubmitInfoKHX { + VkStructureType sType; + const void* pNext; + uint32_t waitSemaphoreValuesCount; + const uint64_t* pWaitSemaphoreValues; + uint32_t signalSemaphoreValuesCount; + const uint64_t* pSignalSemaphoreValues; +} VkD3D12FenceSubmitInfoKHX; + + +typedef VkResult (VKAPI_PTR *PFN_vkImportSemaphoreWin32HandleKHX)(VkDevice device, const VkImportSemaphoreWin32HandleInfoKHX* pImportSemaphoreWin32HandleInfo); +typedef VkResult (VKAPI_PTR *PFN_vkGetSemaphoreWin32HandleKHX)(VkDevice device, VkSemaphore semaphore, VkExternalSemaphoreHandleTypeFlagBitsKHX handleType, HANDLE* pHandle); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkImportSemaphoreWin32HandleKHX( + VkDevice device, + const VkImportSemaphoreWin32HandleInfoKHX* pImportSemaphoreWin32HandleInfo); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreWin32HandleKHX( + VkDevice device, + VkSemaphore semaphore, + VkExternalSemaphoreHandleTypeFlagBitsKHX handleType, + HANDLE* pHandle); +#endif +#endif /* VK_USE_PLATFORM_WIN32_KHX */ + +#define VK_KHX_external_semaphore_fd 1 +#define VK_KHX_EXTERNAL_SEMAPHORE_FD_SPEC_VERSION 1 +#define VK_KHX_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME "VK_KHX_external_semaphore_fd" + +typedef struct VkImportSemaphoreFdInfoKHX { + VkStructureType sType; + const void* pNext; + VkSemaphore semaphore; + VkExternalSemaphoreHandleTypeFlagBitsKHX handleType; + int fd; +} VkImportSemaphoreFdInfoKHX; + + +typedef VkResult (VKAPI_PTR *PFN_vkImportSemaphoreFdKHX)(VkDevice device, const VkImportSemaphoreFdInfoKHX* pImportSemaphoreFdInfo); +typedef VkResult (VKAPI_PTR *PFN_vkGetSemaphoreFdKHX)(VkDevice device, VkSemaphore semaphore, VkExternalSemaphoreHandleTypeFlagBitsKHX handleType, int* pFd); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkImportSemaphoreFdKHX( + VkDevice device, + const VkImportSemaphoreFdInfoKHX* pImportSemaphoreFdInfo); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreFdKHX( + VkDevice device, + VkSemaphore semaphore, + VkExternalSemaphoreHandleTypeFlagBitsKHX handleType, + int* pFd); +#endif + #define VK_NVX_device_generated_commands 1 VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkObjectTableNVX) VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkIndirectCommandsLayoutNVX) @@ -4579,6 +5377,34 @@ VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX( VkDeviceGeneratedCommandsLimitsNVX* pLimits); #endif +#define VK_NV_clip_space_w_scaling 1 +#define VK_NV_CLIP_SPACE_W_SCALING_SPEC_VERSION 1 +#define VK_NV_CLIP_SPACE_W_SCALING_EXTENSION_NAME "VK_NV_clip_space_w_scaling" + +typedef struct VkViewportWScalingNV { + float xcoeff; + float ycoeff; +} VkViewportWScalingNV; + +typedef struct VkPipelineViewportWScalingStateCreateInfoNV { + VkStructureType sType; + const void* pNext; + VkBool32 viewportWScalingEnable; + uint32_t viewportCount; + const VkViewportWScalingNV* pViewportWScalings; +} VkPipelineViewportWScalingStateCreateInfoNV; + + +typedef void (VKAPI_PTR *PFN_vkCmdSetViewportWScalingNV)(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewportWScalingNV* pViewportWScalings); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdSetViewportWScalingNV( + VkCommandBuffer commandBuffer, + uint32_t firstViewport, + uint32_t viewportCount, + const VkViewportWScalingNV* pViewportWScalings); +#endif + #define VK_EXT_direct_mode_display 1 #define VK_EXT_DIRECT_MODE_DISPLAY_SPEC_VERSION 1 #define VK_EXT_DIRECT_MODE_DISPLAY_EXTENSION_NAME "VK_EXT_direct_mode_display" @@ -4739,6 +5565,166 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetSwapchainCounterEXT( uint64_t* pCounterValue); #endif +#define VK_NV_sample_mask_override_coverage 1 +#define VK_NV_SAMPLE_MASK_OVERRIDE_COVERAGE_SPEC_VERSION 1 +#define VK_NV_SAMPLE_MASK_OVERRIDE_COVERAGE_EXTENSION_NAME "VK_NV_sample_mask_override_coverage" + + +#define VK_NV_geometry_shader_passthrough 1 +#define VK_NV_GEOMETRY_SHADER_PASSTHROUGH_SPEC_VERSION 1 +#define VK_NV_GEOMETRY_SHADER_PASSTHROUGH_EXTENSION_NAME "VK_NV_geometry_shader_passthrough" + + +#define VK_NV_viewport_array2 1 +#define VK_NV_VIEWPORT_ARRAY2_SPEC_VERSION 1 +#define VK_NV_VIEWPORT_ARRAY2_EXTENSION_NAME "VK_NV_viewport_array2" + + +#define VK_NVX_multiview_per_view_attributes 1 +#define VK_NVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_SPEC_VERSION 1 +#define VK_NVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_EXTENSION_NAME "VK_NVX_multiview_per_view_attributes" + +typedef struct VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX { + VkStructureType sType; + void* pNext; + VkBool32 perViewPositionAllComponents; +} VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX; + + + +#define VK_NV_viewport_swizzle 1 +#define VK_NV_VIEWPORT_SWIZZLE_SPEC_VERSION 1 +#define VK_NV_VIEWPORT_SWIZZLE_EXTENSION_NAME "VK_NV_viewport_swizzle" + + +typedef enum VkViewportCoordinateSwizzleNV { + VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_X_NV = 0, + VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_X_NV = 1, + VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_Y_NV = 2, + VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_Y_NV = 3, + VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_Z_NV = 4, + VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_Z_NV = 5, + VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_W_NV = 6, + VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_W_NV = 7, + VK_VIEWPORT_COORDINATE_SWIZZLE_BEGIN_RANGE_NV = VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_X_NV, + VK_VIEWPORT_COORDINATE_SWIZZLE_END_RANGE_NV = VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_W_NV, + VK_VIEWPORT_COORDINATE_SWIZZLE_RANGE_SIZE_NV = (VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_W_NV - VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_X_NV + 1), + VK_VIEWPORT_COORDINATE_SWIZZLE_MAX_ENUM_NV = 0x7FFFFFFF +} VkViewportCoordinateSwizzleNV; + +typedef VkFlags VkPipelineViewportSwizzleStateCreateFlagsNV; + +typedef struct VkViewportSwizzleNV { + VkViewportCoordinateSwizzleNV x; + VkViewportCoordinateSwizzleNV y; + VkViewportCoordinateSwizzleNV z; + VkViewportCoordinateSwizzleNV w; +} VkViewportSwizzleNV; + +typedef struct VkPipelineViewportSwizzleStateCreateInfoNV { + VkStructureType sType; + const void* pNext; + VkPipelineViewportSwizzleStateCreateFlagsNV flags; + uint32_t viewportCount; + const VkViewportSwizzleNV* pViewportSwizzles; +} VkPipelineViewportSwizzleStateCreateInfoNV; + + + +#define VK_EXT_discard_rectangles 1 +#define VK_EXT_DISCARD_RECTANGLES_SPEC_VERSION 1 +#define VK_EXT_DISCARD_RECTANGLES_EXTENSION_NAME "VK_EXT_discard_rectangles" + + +typedef enum VkDiscardRectangleModeEXT { + VK_DISCARD_RECTANGLE_MODE_INCLUSIVE_EXT = 0, + VK_DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT = 1, + VK_DISCARD_RECTANGLE_MODE_BEGIN_RANGE_EXT = VK_DISCARD_RECTANGLE_MODE_INCLUSIVE_EXT, + VK_DISCARD_RECTANGLE_MODE_END_RANGE_EXT = VK_DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT, + VK_DISCARD_RECTANGLE_MODE_RANGE_SIZE_EXT = (VK_DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT - VK_DISCARD_RECTANGLE_MODE_INCLUSIVE_EXT + 1), + VK_DISCARD_RECTANGLE_MODE_MAX_ENUM_EXT = 0x7FFFFFFF +} VkDiscardRectangleModeEXT; + +typedef VkFlags VkPipelineDiscardRectangleStateCreateFlagsEXT; + +typedef struct VkPhysicalDeviceDiscardRectanglePropertiesEXT { + VkStructureType sType; + const void* pNext; + uint32_t maxDiscardRectangles; +} VkPhysicalDeviceDiscardRectanglePropertiesEXT; + +typedef struct VkPipelineDiscardRectangleStateCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkPipelineDiscardRectangleStateCreateFlagsEXT flags; + VkDiscardRectangleModeEXT discardRectangleMode; + uint32_t discardRectangleCount; + const VkRect2D* pDiscardRectangles; +} VkPipelineDiscardRectangleStateCreateInfoEXT; + + +typedef void (VKAPI_PTR *PFN_vkCmdSetDiscardRectangleEXT)(VkCommandBuffer commandBuffer, uint32_t firstDiscardRectangle, uint32_t discardRectangleCount, const VkRect2D* pDiscardRectangles); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdSetDiscardRectangleEXT( + VkCommandBuffer commandBuffer, + uint32_t firstDiscardRectangle, + uint32_t discardRectangleCount, + const VkRect2D* pDiscardRectangles); +#endif + +#ifdef VK_USE_PLATFORM_IOS_MVK +#define VK_MVK_ios_surface 1 +#define VK_MVK_IOS_SURFACE_SPEC_VERSION 1 +#define VK_MVK_IOS_SURFACE_EXTENSION_NAME "VK_MVK_ios_surface" + +typedef VkFlags VkIOSSurfaceCreateFlagsMVK; + +typedef struct VkIOSSurfaceCreateInfoMVK { + VkStructureType sType; + const void* pNext; + VkIOSSurfaceCreateFlagsMVK flags; + const void* pView; +} VkIOSSurfaceCreateInfoMVK; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateIOSSurfaceMVK)(VkInstance instance, const VkIOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateIOSSurfaceMVK( + VkInstance instance, + const VkIOSSurfaceCreateInfoMVK* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSurfaceKHR* pSurface); +#endif +#endif /* VK_USE_PLATFORM_IOS_MVK */ + +#ifdef VK_USE_PLATFORM_MACOS_MVK +#define VK_MVK_macos_surface 1 +#define VK_MVK_MACOS_SURFACE_SPEC_VERSION 1 +#define VK_MVK_MACOS_SURFACE_EXTENSION_NAME "VK_MVK_macos_surface" + +typedef VkFlags VkMacOSSurfaceCreateFlagsMVK; + +typedef struct VkMacOSSurfaceCreateInfoMVK { + VkStructureType sType; + const void* pNext; + VkMacOSSurfaceCreateFlagsMVK flags; + const void* pView; +} VkMacOSSurfaceCreateInfoMVK; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateMacOSSurfaceMVK)(VkInstance instance, const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateMacOSSurfaceMVK( + VkInstance instance, + const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSurfaceKHR* pSurface); +#endif +#endif /* VK_USE_PLATFORM_MACOS_MVK */ + #ifdef __cplusplus } #endif diff --git a/include/vulkan/vulkan.hpp b/include/vulkan/vulkan.hpp index 3c6e8b2e..6a967aa3 100644 --- a/include/vulkan/vulkan.hpp +++ b/include/vulkan/vulkan.hpp @@ -42,7 +42,7 @@ # include <vector> #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -static_assert( VK_HEADER_VERSION == 41 , "Wrong VK_HEADER_VERSION!" ); +static_assert( VK_HEADER_VERSION == 42 , "Wrong VK_HEADER_VERSION!" ); // 32-bit vulkan is not typesafe for handles, so don't allow copy constructors on this platform by default. // To enable this feature on 32-bit platforms please define VULKAN_HPP_TYPESAFE_CONVERSION @@ -461,7 +461,8 @@ namespace vk eErrorIncompatibleDisplayKHR = VK_ERROR_INCOMPATIBLE_DISPLAY_KHR, eErrorValidationFailedEXT = VK_ERROR_VALIDATION_FAILED_EXT, eErrorInvalidShaderNV = VK_ERROR_INVALID_SHADER_NV, - eErrorOutOfPoolMemoryKHR = VK_ERROR_OUT_OF_POOL_MEMORY_KHR + eErrorOutOfPoolMemoryKHR = VK_ERROR_OUT_OF_POOL_MEMORY_KHR, + eErrorInvalidExternalHandleKHX = VK_ERROR_INVALID_EXTERNAL_HANDLE_KHX }; VULKAN_HPP_INLINE std::string to_string(Result value) @@ -494,6 +495,7 @@ namespace vk case Result::eErrorValidationFailedEXT: return "ErrorValidationFailedEXT"; case Result::eErrorInvalidShaderNV: return "ErrorInvalidShaderNV"; case Result::eErrorOutOfPoolMemoryKHR: return "ErrorOutOfPoolMemoryKHR"; + case Result::eErrorInvalidExternalHandleKHX: return "ErrorInvalidExternalHandleKHX"; default: return "invalid"; } } @@ -810,17 +812,6 @@ namespace vk return PipelineShaderStageCreateFlags( bit0 ) | bit1; } - enum class DescriptorSetLayoutCreateFlagBits - { - }; - - using DescriptorSetLayoutCreateFlags = Flags<DescriptorSetLayoutCreateFlagBits, VkDescriptorSetLayoutCreateFlags>; - - VULKAN_HPP_INLINE DescriptorSetLayoutCreateFlags operator|( DescriptorSetLayoutCreateFlagBits bit0, DescriptorSetLayoutCreateFlagBits bit1 ) - { - return DescriptorSetLayoutCreateFlags( bit0 ) | bit1; - } - enum class BufferViewCreateFlagBits { }; @@ -920,17 +911,6 @@ namespace vk return MemoryMapFlags( bit0 ) | bit1; } - enum class SubpassDescriptionFlagBits - { - }; - - using SubpassDescriptionFlags = Flags<SubpassDescriptionFlagBits, VkSubpassDescriptionFlags>; - - VULKAN_HPP_INLINE SubpassDescriptionFlags operator|( SubpassDescriptionFlagBits bit0, SubpassDescriptionFlagBits bit1 ) - { - return SubpassDescriptionFlags( bit0 ) | bit1; - } - enum class DescriptorPoolResetFlagBits { }; @@ -942,15 +922,15 @@ namespace vk return DescriptorPoolResetFlags( bit0 ) | bit1; } - enum class SwapchainCreateFlagBitsKHR + enum class DescriptorUpdateTemplateCreateFlagBitsKHR { }; - using SwapchainCreateFlagsKHR = Flags<SwapchainCreateFlagBitsKHR, VkSwapchainCreateFlagsKHR>; + using DescriptorUpdateTemplateCreateFlagsKHR = Flags<DescriptorUpdateTemplateCreateFlagBitsKHR, VkDescriptorUpdateTemplateCreateFlagsKHR>; - VULKAN_HPP_INLINE SwapchainCreateFlagsKHR operator|( SwapchainCreateFlagBitsKHR bit0, SwapchainCreateFlagBitsKHR bit1 ) + VULKAN_HPP_INLINE DescriptorUpdateTemplateCreateFlagsKHR operator|( DescriptorUpdateTemplateCreateFlagBitsKHR bit0, DescriptorUpdateTemplateCreateFlagBitsKHR bit1 ) { - return SwapchainCreateFlagsKHR( bit0 ) | bit1; + return DescriptorUpdateTemplateCreateFlagsKHR( bit0 ) | bit1; } enum class DisplayModeCreateFlagBitsKHR @@ -1080,6 +1060,36 @@ namespace vk } #endif /*VK_USE_PLATFORM_XCB_KHR*/ +#ifdef VK_USE_PLATFORM_IOS_MVK + enum class IOSSurfaceCreateFlagBitsMVK + { + }; +#endif /*VK_USE_PLATFORM_IOS_MVK*/ + +#ifdef VK_USE_PLATFORM_IOS_MVK + using IOSSurfaceCreateFlagsMVK = Flags<IOSSurfaceCreateFlagBitsMVK, VkIOSSurfaceCreateFlagsMVK>; + + VULKAN_HPP_INLINE IOSSurfaceCreateFlagsMVK operator|( IOSSurfaceCreateFlagBitsMVK bit0, IOSSurfaceCreateFlagBitsMVK bit1 ) + { + return IOSSurfaceCreateFlagsMVK( bit0 ) | bit1; + } +#endif /*VK_USE_PLATFORM_IOS_MVK*/ + +#ifdef VK_USE_PLATFORM_MACOS_MVK + enum class MacOSSurfaceCreateFlagBitsMVK + { + }; +#endif /*VK_USE_PLATFORM_MACOS_MVK*/ + +#ifdef VK_USE_PLATFORM_MACOS_MVK + using MacOSSurfaceCreateFlagsMVK = Flags<MacOSSurfaceCreateFlagBitsMVK, VkMacOSSurfaceCreateFlagsMVK>; + + VULKAN_HPP_INLINE MacOSSurfaceCreateFlagsMVK operator|( MacOSSurfaceCreateFlagBitsMVK bit0, MacOSSurfaceCreateFlagBitsMVK bit1 ) + { + return MacOSSurfaceCreateFlagsMVK( bit0 ) | bit1; + } +#endif /*VK_USE_PLATFORM_MACOS_MVK*/ + enum class CommandPoolTrimFlagBitsKHR { }; @@ -1091,6 +1101,28 @@ namespace vk return CommandPoolTrimFlagsKHR( bit0 ) | bit1; } + enum class PipelineViewportSwizzleStateCreateFlagBitsNV + { + }; + + using PipelineViewportSwizzleStateCreateFlagsNV = Flags<PipelineViewportSwizzleStateCreateFlagBitsNV, VkPipelineViewportSwizzleStateCreateFlagsNV>; + + VULKAN_HPP_INLINE PipelineViewportSwizzleStateCreateFlagsNV operator|( PipelineViewportSwizzleStateCreateFlagBitsNV bit0, PipelineViewportSwizzleStateCreateFlagBitsNV bit1 ) + { + return PipelineViewportSwizzleStateCreateFlagsNV( bit0 ) | bit1; + } + + enum class PipelineDiscardRectangleStateCreateFlagBitsEXT + { + }; + + using PipelineDiscardRectangleStateCreateFlagsEXT = Flags<PipelineDiscardRectangleStateCreateFlagBitsEXT, VkPipelineDiscardRectangleStateCreateFlagsEXT>; + + VULKAN_HPP_INLINE PipelineDiscardRectangleStateCreateFlagsEXT operator|( PipelineDiscardRectangleStateCreateFlagBitsEXT bit0, PipelineDiscardRectangleStateCreateFlagBitsEXT bit1 ) + { + return PipelineDiscardRectangleStateCreateFlagsEXT( bit0 ) | bit1; + } + class DeviceMemory { public: @@ -2499,6 +2531,70 @@ namespace vk }; static_assert( sizeof( IndirectCommandsLayoutNVX ) == sizeof( VkIndirectCommandsLayoutNVX ), "handle and wrapper have different size!" ); + class DescriptorUpdateTemplateKHR + { + public: + DescriptorUpdateTemplateKHR() + : m_descriptorUpdateTemplateKHR(VK_NULL_HANDLE) + {} + + DescriptorUpdateTemplateKHR( std::nullptr_t ) + : m_descriptorUpdateTemplateKHR(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT DescriptorUpdateTemplateKHR(VkDescriptorUpdateTemplateKHR descriptorUpdateTemplateKHR) + : m_descriptorUpdateTemplateKHR(descriptorUpdateTemplateKHR) + {} + +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) + DescriptorUpdateTemplateKHR& operator=(VkDescriptorUpdateTemplateKHR descriptorUpdateTemplateKHR) + { + m_descriptorUpdateTemplateKHR = descriptorUpdateTemplateKHR; + return *this; + } +#endif + + DescriptorUpdateTemplateKHR& operator=( std::nullptr_t ) + { + m_descriptorUpdateTemplateKHR = VK_NULL_HANDLE; + return *this; + } + + bool operator==(DescriptorUpdateTemplateKHR const &rhs) const + { + return m_descriptorUpdateTemplateKHR == rhs.m_descriptorUpdateTemplateKHR; + } + + bool operator!=(DescriptorUpdateTemplateKHR const &rhs) const + { + return m_descriptorUpdateTemplateKHR != rhs.m_descriptorUpdateTemplateKHR; + } + + bool operator<(DescriptorUpdateTemplateKHR const &rhs) const + { + return m_descriptorUpdateTemplateKHR < rhs.m_descriptorUpdateTemplateKHR; + } + + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkDescriptorUpdateTemplateKHR() const + { + return m_descriptorUpdateTemplateKHR; + } + + explicit operator bool() const + { + return m_descriptorUpdateTemplateKHR != VK_NULL_HANDLE; + } + + bool operator!() const + { + return m_descriptorUpdateTemplateKHR == VK_NULL_HANDLE; + } + + private: + VkDescriptorUpdateTemplateKHR m_descriptorUpdateTemplateKHR; + }; + static_assert( sizeof( DescriptorUpdateTemplateKHR ) == sizeof( VkDescriptorUpdateTemplateKHR ), "handle and wrapper have different size!" ); + class DisplayKHR { public: @@ -4692,6 +4788,58 @@ namespace vk }; static_assert( sizeof( DisplayModePropertiesKHR ) == sizeof( VkDisplayModePropertiesKHR ), "struct and wrapper have different size!" ); + struct ViewportWScalingNV + { + ViewportWScalingNV( float xcoeff_ = 0, float ycoeff_ = 0 ) + : xcoeff( xcoeff_ ) + , ycoeff( ycoeff_ ) + { + } + + ViewportWScalingNV( VkViewportWScalingNV const & rhs ) + { + memcpy( this, &rhs, sizeof(ViewportWScalingNV) ); + } + + ViewportWScalingNV& operator=( VkViewportWScalingNV const & rhs ) + { + memcpy( this, &rhs, sizeof(ViewportWScalingNV) ); + return *this; + } + + ViewportWScalingNV& setXcoeff( float xcoeff_ ) + { + xcoeff = xcoeff_; + return *this; + } + + ViewportWScalingNV& setYcoeff( float ycoeff_ ) + { + ycoeff = ycoeff_; + return *this; + } + + operator const VkViewportWScalingNV&() const + { + return *reinterpret_cast<const VkViewportWScalingNV*>(this); + } + + bool operator==( ViewportWScalingNV const& rhs ) const + { + return ( xcoeff == rhs.xcoeff ) + && ( ycoeff == rhs.ycoeff ); + } + + bool operator!=( ViewportWScalingNV const& rhs ) const + { + return !operator==( rhs ); + } + + float xcoeff; + float ycoeff; + }; + static_assert( sizeof( ViewportWScalingNV ) == sizeof( VkViewportWScalingNV ), "struct and wrapper have different size!" ); + enum class ImageLayout { eUndefined = VK_IMAGE_LAYOUT_UNDEFINED, @@ -5010,152 +5158,116 @@ namespace vk }; static_assert( sizeof( DescriptorPoolSize ) == sizeof( VkDescriptorPoolSize ), "struct and wrapper have different size!" ); - enum class QueryType - { - eOcclusion = VK_QUERY_TYPE_OCCLUSION, - ePipelineStatistics = VK_QUERY_TYPE_PIPELINE_STATISTICS, - eTimestamp = VK_QUERY_TYPE_TIMESTAMP - }; - - enum class BorderColor - { - eFloatTransparentBlack = VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK, - eIntTransparentBlack = VK_BORDER_COLOR_INT_TRANSPARENT_BLACK, - eFloatOpaqueBlack = VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK, - eIntOpaqueBlack = VK_BORDER_COLOR_INT_OPAQUE_BLACK, - eFloatOpaqueWhite = VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE, - eIntOpaqueWhite = VK_BORDER_COLOR_INT_OPAQUE_WHITE - }; - - enum class PipelineBindPoint - { - eGraphics = VK_PIPELINE_BIND_POINT_GRAPHICS, - eCompute = VK_PIPELINE_BIND_POINT_COMPUTE - }; - - struct SubpassDescription + struct DescriptorUpdateTemplateEntryKHR { - SubpassDescription( SubpassDescriptionFlags flags_ = SubpassDescriptionFlags(), PipelineBindPoint pipelineBindPoint_ = PipelineBindPoint::eGraphics, uint32_t inputAttachmentCount_ = 0, const AttachmentReference* pInputAttachments_ = nullptr, uint32_t colorAttachmentCount_ = 0, const AttachmentReference* pColorAttachments_ = nullptr, const AttachmentReference* pResolveAttachments_ = nullptr, const AttachmentReference* pDepthStencilAttachment_ = nullptr, uint32_t preserveAttachmentCount_ = 0, const uint32_t* pPreserveAttachments_ = nullptr ) - : flags( flags_ ) - , pipelineBindPoint( pipelineBindPoint_ ) - , inputAttachmentCount( inputAttachmentCount_ ) - , pInputAttachments( pInputAttachments_ ) - , colorAttachmentCount( colorAttachmentCount_ ) - , pColorAttachments( pColorAttachments_ ) - , pResolveAttachments( pResolveAttachments_ ) - , pDepthStencilAttachment( pDepthStencilAttachment_ ) - , preserveAttachmentCount( preserveAttachmentCount_ ) - , pPreserveAttachments( pPreserveAttachments_ ) - { - } - - SubpassDescription( VkSubpassDescription const & rhs ) + DescriptorUpdateTemplateEntryKHR( uint32_t dstBinding_ = 0, uint32_t dstArrayElement_ = 0, uint32_t descriptorCount_ = 0, DescriptorType descriptorType_ = DescriptorType::eSampler, size_t offset_ = 0, size_t stride_ = 0 ) + : dstBinding( dstBinding_ ) + , dstArrayElement( dstArrayElement_ ) + , descriptorCount( descriptorCount_ ) + , descriptorType( descriptorType_ ) + , offset( offset_ ) + , stride( stride_ ) { - memcpy( this, &rhs, sizeof(SubpassDescription) ); } - SubpassDescription& operator=( VkSubpassDescription const & rhs ) + DescriptorUpdateTemplateEntryKHR( VkDescriptorUpdateTemplateEntryKHR const & rhs ) { - memcpy( this, &rhs, sizeof(SubpassDescription) ); - return *this; + memcpy( this, &rhs, sizeof(DescriptorUpdateTemplateEntryKHR) ); } - SubpassDescription& setFlags( SubpassDescriptionFlags flags_ ) + DescriptorUpdateTemplateEntryKHR& operator=( VkDescriptorUpdateTemplateEntryKHR const & rhs ) { - flags = flags_; + memcpy( this, &rhs, sizeof(DescriptorUpdateTemplateEntryKHR) ); return *this; } - SubpassDescription& setPipelineBindPoint( PipelineBindPoint pipelineBindPoint_ ) + DescriptorUpdateTemplateEntryKHR& setDstBinding( uint32_t dstBinding_ ) { - pipelineBindPoint = pipelineBindPoint_; + dstBinding = dstBinding_; return *this; } - SubpassDescription& setInputAttachmentCount( uint32_t inputAttachmentCount_ ) + DescriptorUpdateTemplateEntryKHR& setDstArrayElement( uint32_t dstArrayElement_ ) { - inputAttachmentCount = inputAttachmentCount_; + dstArrayElement = dstArrayElement_; return *this; } - SubpassDescription& setPInputAttachments( const AttachmentReference* pInputAttachments_ ) + DescriptorUpdateTemplateEntryKHR& setDescriptorCount( uint32_t descriptorCount_ ) { - pInputAttachments = pInputAttachments_; + descriptorCount = descriptorCount_; return *this; } - SubpassDescription& setColorAttachmentCount( uint32_t colorAttachmentCount_ ) + DescriptorUpdateTemplateEntryKHR& setDescriptorType( DescriptorType descriptorType_ ) { - colorAttachmentCount = colorAttachmentCount_; + descriptorType = descriptorType_; return *this; } - SubpassDescription& setPColorAttachments( const AttachmentReference* pColorAttachments_ ) + DescriptorUpdateTemplateEntryKHR& setOffset( size_t offset_ ) { - pColorAttachments = pColorAttachments_; + offset = offset_; return *this; } - SubpassDescription& setPResolveAttachments( const AttachmentReference* pResolveAttachments_ ) + DescriptorUpdateTemplateEntryKHR& setStride( size_t stride_ ) { - pResolveAttachments = pResolveAttachments_; + stride = stride_; return *this; } - SubpassDescription& setPDepthStencilAttachment( const AttachmentReference* pDepthStencilAttachment_ ) + operator const VkDescriptorUpdateTemplateEntryKHR&() const { - pDepthStencilAttachment = pDepthStencilAttachment_; - return *this; + return *reinterpret_cast<const VkDescriptorUpdateTemplateEntryKHR*>(this); } - SubpassDescription& setPreserveAttachmentCount( uint32_t preserveAttachmentCount_ ) + bool operator==( DescriptorUpdateTemplateEntryKHR const& rhs ) const { - preserveAttachmentCount = preserveAttachmentCount_; - return *this; + return ( dstBinding == rhs.dstBinding ) + && ( dstArrayElement == rhs.dstArrayElement ) + && ( descriptorCount == rhs.descriptorCount ) + && ( descriptorType == rhs.descriptorType ) + && ( offset == rhs.offset ) + && ( stride == rhs.stride ); } - SubpassDescription& setPPreserveAttachments( const uint32_t* pPreserveAttachments_ ) + bool operator!=( DescriptorUpdateTemplateEntryKHR const& rhs ) const { - pPreserveAttachments = pPreserveAttachments_; - return *this; + return !operator==( rhs ); } - operator const VkSubpassDescription&() const - { - return *reinterpret_cast<const VkSubpassDescription*>(this); - } + uint32_t dstBinding; + uint32_t dstArrayElement; + uint32_t descriptorCount; + DescriptorType descriptorType; + size_t offset; + size_t stride; + }; + static_assert( sizeof( DescriptorUpdateTemplateEntryKHR ) == sizeof( VkDescriptorUpdateTemplateEntryKHR ), "struct and wrapper have different size!" ); - bool operator==( SubpassDescription const& rhs ) const - { - return ( flags == rhs.flags ) - && ( pipelineBindPoint == rhs.pipelineBindPoint ) - && ( inputAttachmentCount == rhs.inputAttachmentCount ) - && ( pInputAttachments == rhs.pInputAttachments ) - && ( colorAttachmentCount == rhs.colorAttachmentCount ) - && ( pColorAttachments == rhs.pColorAttachments ) - && ( pResolveAttachments == rhs.pResolveAttachments ) - && ( pDepthStencilAttachment == rhs.pDepthStencilAttachment ) - && ( preserveAttachmentCount == rhs.preserveAttachmentCount ) - && ( pPreserveAttachments == rhs.pPreserveAttachments ); - } + enum class QueryType + { + eOcclusion = VK_QUERY_TYPE_OCCLUSION, + ePipelineStatistics = VK_QUERY_TYPE_PIPELINE_STATISTICS, + eTimestamp = VK_QUERY_TYPE_TIMESTAMP + }; - bool operator!=( SubpassDescription const& rhs ) const - { - return !operator==( rhs ); - } + enum class BorderColor + { + eFloatTransparentBlack = VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK, + eIntTransparentBlack = VK_BORDER_COLOR_INT_TRANSPARENT_BLACK, + eFloatOpaqueBlack = VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK, + eIntOpaqueBlack = VK_BORDER_COLOR_INT_OPAQUE_BLACK, + eFloatOpaqueWhite = VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE, + eIntOpaqueWhite = VK_BORDER_COLOR_INT_OPAQUE_WHITE + }; - SubpassDescriptionFlags flags; - PipelineBindPoint pipelineBindPoint; - uint32_t inputAttachmentCount; - const AttachmentReference* pInputAttachments; - uint32_t colorAttachmentCount; - const AttachmentReference* pColorAttachments; - const AttachmentReference* pResolveAttachments; - const AttachmentReference* pDepthStencilAttachment; - uint32_t preserveAttachmentCount; - const uint32_t* pPreserveAttachments; + enum class PipelineBindPoint + { + eGraphics = VK_PIPELINE_BIND_POINT_GRAPHICS, + eCompute = VK_PIPELINE_BIND_POINT_COMPUTE }; - static_assert( sizeof( SubpassDescription ) == sizeof( VkSubpassDescription ), "struct and wrapper have different size!" ); enum class PipelineCacheHeaderVersion { @@ -5852,6 +5964,9 @@ namespace vk eDedicatedAllocationImageCreateInfoNV = VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV, eDedicatedAllocationBufferCreateInfoNV = VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV, eDedicatedAllocationMemoryAllocateInfoNV = VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV, + eRenderPassMultiviewCreateInfoKHX = VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO_KHX, + ePhysicalDeviceMultiviewFeaturesKHX = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES_KHX, + ePhysicalDeviceMultiviewPropertiesKHX = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES_KHX, eExternalMemoryImageCreateInfoNV = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV, eExportMemoryAllocateInfoNV = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV, eImportMemoryWin32HandleInfoNV = VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV, @@ -5866,19 +5981,67 @@ namespace vk ePhysicalDeviceMemoryProperties2KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR, eSparseImageFormatProperties2KHR = VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2_KHR, ePhysicalDeviceSparseImageFormatInfo2KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2_KHR, + eMemoryAllocateFlagsInfoKHX = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO_KHX, + eBindBufferMemoryInfoKHX = VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO_KHX, + eBindImageMemoryInfoKHX = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHX, + eDeviceGroupRenderPassBeginInfoKHX = VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO_KHX, + eDeviceGroupCommandBufferBeginInfoKHX = VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO_KHX, + eDeviceGroupSubmitInfoKHX = VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO_KHX, + eDeviceGroupBindSparseInfoKHX = VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO_KHX, + eDeviceGroupPresentCapabilitiesKHX = VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHX, + eImageSwapchainCreateInfoKHX = VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHX, + eBindImageMemorySwapchainInfoKHX = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHX, + eAcquireNextImageInfoKHX = VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHX, + eDeviceGroupPresentInfoKHX = VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHX, + eDeviceGroupSwapchainCreateInfoKHX = VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHX, eValidationFlagsEXT = VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT, eViSurfaceCreateInfoNN = VK_STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN, + ePhysicalDeviceGroupPropertiesKHX = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES_KHX, + eDeviceGroupDeviceCreateInfoKHX = VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO_KHX, + ePhysicalDeviceExternalImageFormatInfoKHX = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO_KHX, + eExternalImageFormatPropertiesKHX = VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES_KHX, + ePhysicalDeviceExternalBufferInfoKHX = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO_KHX, + eExternalBufferPropertiesKHX = VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES_KHX, + ePhysicalDeviceIdPropertiesKHX = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES_KHX, + ePhysicalDeviceProperties2KHX = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHX, + eImageFormatProperties2KHX = VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHX, + ePhysicalDeviceImageFormatInfo2KHX = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHX, + eExternalMemoryBufferCreateInfoKHX = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO_KHX, + eExternalMemoryImageCreateInfoKHX = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_KHX, + eExportMemoryAllocateInfoKHX = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHX, + eImportMemoryWin32HandleInfoKHX = VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHX, + eExportMemoryWin32HandleInfoKHX = VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHX, + eMemoryWin32HandlePropertiesKHX = VK_STRUCTURE_TYPE_MEMORY_WIN32_HANDLE_PROPERTIES_KHX, + eImportMemoryFdInfoKHX = VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHX, + eMemoryFdPropertiesKHX = VK_STRUCTURE_TYPE_MEMORY_FD_PROPERTIES_KHX, + eWin32KeyedMutexAcquireReleaseInfoKHX = VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHX, + ePhysicalDeviceExternalSemaphoreInfoKHX = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO_KHX, + eExternalSemaphorePropertiesKHX = VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES_KHX, + eExportSemaphoreCreateInfoKHX = VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO_KHX, + eImportSemaphoreWin32HandleInfoKHX = VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHX, + eExportSemaphoreWin32HandleInfoKHX = VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHX, + eD3D12FenceSubmitInfoKHX = VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHX, + eImportSemaphoreFdInfoKHX = VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHX, + ePhysicalDevicePushDescriptorPropertiesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR, + eDescriptorUpdateTemplateCreateInfoKHR = VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHR, eObjectTableCreateInfoNVX = VK_STRUCTURE_TYPE_OBJECT_TABLE_CREATE_INFO_NVX, eIndirectCommandsLayoutCreateInfoNVX = VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NVX, eCmdProcessCommandsInfoNVX = VK_STRUCTURE_TYPE_CMD_PROCESS_COMMANDS_INFO_NVX, eCmdReserveSpaceForCommandsInfoNVX = VK_STRUCTURE_TYPE_CMD_RESERVE_SPACE_FOR_COMMANDS_INFO_NVX, eDeviceGeneratedCommandsLimitsNVX = VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_LIMITS_NVX, eDeviceGeneratedCommandsFeaturesNVX = VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_FEATURES_NVX, + ePipelineViewportWScalingStateCreateInfoNV = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV, eSurfaceCapabilities2EXT = VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES2_EXT, eDisplayPowerInfoEXT = VK_STRUCTURE_TYPE_DISPLAY_POWER_INFO_EXT, eDeviceEventInfoEXT = VK_STRUCTURE_TYPE_DEVICE_EVENT_INFO_EXT, eDisplayEventInfoEXT = VK_STRUCTURE_TYPE_DISPLAY_EVENT_INFO_EXT, - eSwapchainCounterCreateInfoEXT = VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT + eSwapchainCounterCreateInfoEXT = VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT, + ePhysicalDeviceMultiviewPerViewAttributesPropertiesNVX = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX, + ePipelineViewportSwizzleStateCreateInfoNV = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV, + ePhysicalDeviceDiscardRectanglePropertiesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT, + ePipelineDiscardRectangleStateCreateInfoEXT = VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT, + eIosSurfaceCreateInfoMVK = VK_STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK, + eMacosSurfaceCreateInfoMVK = VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK }; struct ApplicationInfo @@ -9581,6 +9744,1751 @@ namespace vk }; static_assert( sizeof( PhysicalDeviceFeatures2KHR ) == sizeof( VkPhysicalDeviceFeatures2KHR ), "struct and wrapper have different size!" ); + struct PhysicalDevicePushDescriptorPropertiesKHR + { + PhysicalDevicePushDescriptorPropertiesKHR( uint32_t maxPushDescriptors_ = 0 ) + : sType( StructureType::ePhysicalDevicePushDescriptorPropertiesKHR ) + , pNext( nullptr ) + , maxPushDescriptors( maxPushDescriptors_ ) + { + } + + PhysicalDevicePushDescriptorPropertiesKHR( VkPhysicalDevicePushDescriptorPropertiesKHR const & rhs ) + { + memcpy( this, &rhs, sizeof(PhysicalDevicePushDescriptorPropertiesKHR) ); + } + + PhysicalDevicePushDescriptorPropertiesKHR& operator=( VkPhysicalDevicePushDescriptorPropertiesKHR const & rhs ) + { + memcpy( this, &rhs, sizeof(PhysicalDevicePushDescriptorPropertiesKHR) ); + return *this; + } + + PhysicalDevicePushDescriptorPropertiesKHR& setPNext( void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + PhysicalDevicePushDescriptorPropertiesKHR& setMaxPushDescriptors( uint32_t maxPushDescriptors_ ) + { + maxPushDescriptors = maxPushDescriptors_; + return *this; + } + + operator const VkPhysicalDevicePushDescriptorPropertiesKHR&() const + { + return *reinterpret_cast<const VkPhysicalDevicePushDescriptorPropertiesKHR*>(this); + } + + bool operator==( PhysicalDevicePushDescriptorPropertiesKHR const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( maxPushDescriptors == rhs.maxPushDescriptors ); + } + + bool operator!=( PhysicalDevicePushDescriptorPropertiesKHR const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + void* pNext; + uint32_t maxPushDescriptors; + }; + static_assert( sizeof( PhysicalDevicePushDescriptorPropertiesKHR ) == sizeof( VkPhysicalDevicePushDescriptorPropertiesKHR ), "struct and wrapper have different size!" ); + + struct PhysicalDeviceIDPropertiesKHX + { + operator const VkPhysicalDeviceIDPropertiesKHX&() const + { + return *reinterpret_cast<const VkPhysicalDeviceIDPropertiesKHX*>(this); + } + + bool operator==( PhysicalDeviceIDPropertiesKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( memcmp( deviceUUID, rhs.deviceUUID, VK_UUID_SIZE * sizeof( uint8_t ) ) == 0 ) + && ( memcmp( driverUUID, rhs.driverUUID, VK_UUID_SIZE * sizeof( uint8_t ) ) == 0 ) + && ( memcmp( deviceLUID, rhs.deviceLUID, VK_LUID_SIZE_KHX * sizeof( uint8_t ) ) == 0 ) + && ( deviceLUIDValid == rhs.deviceLUIDValid ); + } + + bool operator!=( PhysicalDeviceIDPropertiesKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + void* pNext; + uint8_t deviceUUID[VK_UUID_SIZE]; + uint8_t driverUUID[VK_UUID_SIZE]; + uint8_t deviceLUID[VK_LUID_SIZE_KHX]; + Bool32 deviceLUIDValid; + }; + static_assert( sizeof( PhysicalDeviceIDPropertiesKHX ) == sizeof( VkPhysicalDeviceIDPropertiesKHX ), "struct and wrapper have different size!" ); + +#ifdef VK_USE_PLATFORM_WIN32_KHR + struct ExportMemoryWin32HandleInfoKHX + { + ExportMemoryWin32HandleInfoKHX( const SECURITY_ATTRIBUTES* pAttributes_ = nullptr, DWORD dwAccess_ = 0, LPCWSTR name_ = 0 ) + : sType( StructureType::eExportMemoryWin32HandleInfoKHX ) + , pNext( nullptr ) + , pAttributes( pAttributes_ ) + , dwAccess( dwAccess_ ) + , name( name_ ) + { + } + + ExportMemoryWin32HandleInfoKHX( VkExportMemoryWin32HandleInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ExportMemoryWin32HandleInfoKHX) ); + } + + ExportMemoryWin32HandleInfoKHX& operator=( VkExportMemoryWin32HandleInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ExportMemoryWin32HandleInfoKHX) ); + return *this; + } + + ExportMemoryWin32HandleInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + ExportMemoryWin32HandleInfoKHX& setPAttributes( const SECURITY_ATTRIBUTES* pAttributes_ ) + { + pAttributes = pAttributes_; + return *this; + } + + ExportMemoryWin32HandleInfoKHX& setDwAccess( DWORD dwAccess_ ) + { + dwAccess = dwAccess_; + return *this; + } + + ExportMemoryWin32HandleInfoKHX& setName( LPCWSTR name_ ) + { + name = name_; + return *this; + } + + operator const VkExportMemoryWin32HandleInfoKHX&() const + { + return *reinterpret_cast<const VkExportMemoryWin32HandleInfoKHX*>(this); + } + + bool operator==( ExportMemoryWin32HandleInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( pAttributes == rhs.pAttributes ) + && ( dwAccess == rhs.dwAccess ) + && ( name == rhs.name ); + } + + bool operator!=( ExportMemoryWin32HandleInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + const SECURITY_ATTRIBUTES* pAttributes; + DWORD dwAccess; + LPCWSTR name; + }; + static_assert( sizeof( ExportMemoryWin32HandleInfoKHX ) == sizeof( VkExportMemoryWin32HandleInfoKHX ), "struct and wrapper have different size!" ); +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + +#ifdef VK_USE_PLATFORM_WIN32_KHR + struct MemoryWin32HandlePropertiesKHX + { + operator const VkMemoryWin32HandlePropertiesKHX&() const + { + return *reinterpret_cast<const VkMemoryWin32HandlePropertiesKHX*>(this); + } + + bool operator==( MemoryWin32HandlePropertiesKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( memoryTypeBits == rhs.memoryTypeBits ); + } + + bool operator!=( MemoryWin32HandlePropertiesKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + void* pNext; + uint32_t memoryTypeBits; + }; + static_assert( sizeof( MemoryWin32HandlePropertiesKHX ) == sizeof( VkMemoryWin32HandlePropertiesKHX ), "struct and wrapper have different size!" ); +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + + struct MemoryFdPropertiesKHX + { + operator const VkMemoryFdPropertiesKHX&() const + { + return *reinterpret_cast<const VkMemoryFdPropertiesKHX*>(this); + } + + bool operator==( MemoryFdPropertiesKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( memoryTypeBits == rhs.memoryTypeBits ); + } + + bool operator!=( MemoryFdPropertiesKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + void* pNext; + uint32_t memoryTypeBits; + }; + static_assert( sizeof( MemoryFdPropertiesKHX ) == sizeof( VkMemoryFdPropertiesKHX ), "struct and wrapper have different size!" ); + +#ifdef VK_USE_PLATFORM_WIN32_KHR + struct Win32KeyedMutexAcquireReleaseInfoKHX + { + Win32KeyedMutexAcquireReleaseInfoKHX( uint32_t acquireCount_ = 0, const DeviceMemory* pAcquireSyncs_ = nullptr, const uint64_t* pAcquireKeys_ = nullptr, const uint32_t* pAcquireTimeouts_ = nullptr, uint32_t releaseCount_ = 0, const DeviceMemory* pReleaseSyncs_ = nullptr, const uint64_t* pReleaseKeys_ = nullptr ) + : sType( StructureType::eWin32KeyedMutexAcquireReleaseInfoKHX ) + , pNext( nullptr ) + , acquireCount( acquireCount_ ) + , pAcquireSyncs( pAcquireSyncs_ ) + , pAcquireKeys( pAcquireKeys_ ) + , pAcquireTimeouts( pAcquireTimeouts_ ) + , releaseCount( releaseCount_ ) + , pReleaseSyncs( pReleaseSyncs_ ) + , pReleaseKeys( pReleaseKeys_ ) + { + } + + Win32KeyedMutexAcquireReleaseInfoKHX( VkWin32KeyedMutexAcquireReleaseInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(Win32KeyedMutexAcquireReleaseInfoKHX) ); + } + + Win32KeyedMutexAcquireReleaseInfoKHX& operator=( VkWin32KeyedMutexAcquireReleaseInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(Win32KeyedMutexAcquireReleaseInfoKHX) ); + return *this; + } + + Win32KeyedMutexAcquireReleaseInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + Win32KeyedMutexAcquireReleaseInfoKHX& setAcquireCount( uint32_t acquireCount_ ) + { + acquireCount = acquireCount_; + return *this; + } + + Win32KeyedMutexAcquireReleaseInfoKHX& setPAcquireSyncs( const DeviceMemory* pAcquireSyncs_ ) + { + pAcquireSyncs = pAcquireSyncs_; + return *this; + } + + Win32KeyedMutexAcquireReleaseInfoKHX& setPAcquireKeys( const uint64_t* pAcquireKeys_ ) + { + pAcquireKeys = pAcquireKeys_; + return *this; + } + + Win32KeyedMutexAcquireReleaseInfoKHX& setPAcquireTimeouts( const uint32_t* pAcquireTimeouts_ ) + { + pAcquireTimeouts = pAcquireTimeouts_; + return *this; + } + + Win32KeyedMutexAcquireReleaseInfoKHX& setReleaseCount( uint32_t releaseCount_ ) + { + releaseCount = releaseCount_; + return *this; + } + + Win32KeyedMutexAcquireReleaseInfoKHX& setPReleaseSyncs( const DeviceMemory* pReleaseSyncs_ ) + { + pReleaseSyncs = pReleaseSyncs_; + return *this; + } + + Win32KeyedMutexAcquireReleaseInfoKHX& setPReleaseKeys( const uint64_t* pReleaseKeys_ ) + { + pReleaseKeys = pReleaseKeys_; + return *this; + } + + operator const VkWin32KeyedMutexAcquireReleaseInfoKHX&() const + { + return *reinterpret_cast<const VkWin32KeyedMutexAcquireReleaseInfoKHX*>(this); + } + + bool operator==( Win32KeyedMutexAcquireReleaseInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( acquireCount == rhs.acquireCount ) + && ( pAcquireSyncs == rhs.pAcquireSyncs ) + && ( pAcquireKeys == rhs.pAcquireKeys ) + && ( pAcquireTimeouts == rhs.pAcquireTimeouts ) + && ( releaseCount == rhs.releaseCount ) + && ( pReleaseSyncs == rhs.pReleaseSyncs ) + && ( pReleaseKeys == rhs.pReleaseKeys ); + } + + bool operator!=( Win32KeyedMutexAcquireReleaseInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + uint32_t acquireCount; + const DeviceMemory* pAcquireSyncs; + const uint64_t* pAcquireKeys; + const uint32_t* pAcquireTimeouts; + uint32_t releaseCount; + const DeviceMemory* pReleaseSyncs; + const uint64_t* pReleaseKeys; + }; + static_assert( sizeof( Win32KeyedMutexAcquireReleaseInfoKHX ) == sizeof( VkWin32KeyedMutexAcquireReleaseInfoKHX ), "struct and wrapper have different size!" ); +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + +#ifdef VK_USE_PLATFORM_WIN32_KHX + struct ExportSemaphoreWin32HandleInfoKHX + { + ExportSemaphoreWin32HandleInfoKHX( const SECURITY_ATTRIBUTES* pAttributes_ = nullptr, DWORD dwAccess_ = 0, LPCWSTR name_ = 0 ) + : sType( StructureType::eExportSemaphoreWin32HandleInfoKHX ) + , pNext( nullptr ) + , pAttributes( pAttributes_ ) + , dwAccess( dwAccess_ ) + , name( name_ ) + { + } + + ExportSemaphoreWin32HandleInfoKHX( VkExportSemaphoreWin32HandleInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ExportSemaphoreWin32HandleInfoKHX) ); + } + + ExportSemaphoreWin32HandleInfoKHX& operator=( VkExportSemaphoreWin32HandleInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ExportSemaphoreWin32HandleInfoKHX) ); + return *this; + } + + ExportSemaphoreWin32HandleInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + ExportSemaphoreWin32HandleInfoKHX& setPAttributes( const SECURITY_ATTRIBUTES* pAttributes_ ) + { + pAttributes = pAttributes_; + return *this; + } + + ExportSemaphoreWin32HandleInfoKHX& setDwAccess( DWORD dwAccess_ ) + { + dwAccess = dwAccess_; + return *this; + } + + ExportSemaphoreWin32HandleInfoKHX& setName( LPCWSTR name_ ) + { + name = name_; + return *this; + } + + operator const VkExportSemaphoreWin32HandleInfoKHX&() const + { + return *reinterpret_cast<const VkExportSemaphoreWin32HandleInfoKHX*>(this); + } + + bool operator==( ExportSemaphoreWin32HandleInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( pAttributes == rhs.pAttributes ) + && ( dwAccess == rhs.dwAccess ) + && ( name == rhs.name ); + } + + bool operator!=( ExportSemaphoreWin32HandleInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + const SECURITY_ATTRIBUTES* pAttributes; + DWORD dwAccess; + LPCWSTR name; + }; + static_assert( sizeof( ExportSemaphoreWin32HandleInfoKHX ) == sizeof( VkExportSemaphoreWin32HandleInfoKHX ), "struct and wrapper have different size!" ); +#endif /*VK_USE_PLATFORM_WIN32_KHX*/ + +#ifdef VK_USE_PLATFORM_WIN32_KHX + struct D3D12FenceSubmitInfoKHX + { + D3D12FenceSubmitInfoKHX( uint32_t waitSemaphoreValuesCount_ = 0, const uint64_t* pWaitSemaphoreValues_ = nullptr, uint32_t signalSemaphoreValuesCount_ = 0, const uint64_t* pSignalSemaphoreValues_ = nullptr ) + : sType( StructureType::eD3D12FenceSubmitInfoKHX ) + , pNext( nullptr ) + , waitSemaphoreValuesCount( waitSemaphoreValuesCount_ ) + , pWaitSemaphoreValues( pWaitSemaphoreValues_ ) + , signalSemaphoreValuesCount( signalSemaphoreValuesCount_ ) + , pSignalSemaphoreValues( pSignalSemaphoreValues_ ) + { + } + + D3D12FenceSubmitInfoKHX( VkD3D12FenceSubmitInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(D3D12FenceSubmitInfoKHX) ); + } + + D3D12FenceSubmitInfoKHX& operator=( VkD3D12FenceSubmitInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(D3D12FenceSubmitInfoKHX) ); + return *this; + } + + D3D12FenceSubmitInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + D3D12FenceSubmitInfoKHX& setWaitSemaphoreValuesCount( uint32_t waitSemaphoreValuesCount_ ) + { + waitSemaphoreValuesCount = waitSemaphoreValuesCount_; + return *this; + } + + D3D12FenceSubmitInfoKHX& setPWaitSemaphoreValues( const uint64_t* pWaitSemaphoreValues_ ) + { + pWaitSemaphoreValues = pWaitSemaphoreValues_; + return *this; + } + + D3D12FenceSubmitInfoKHX& setSignalSemaphoreValuesCount( uint32_t signalSemaphoreValuesCount_ ) + { + signalSemaphoreValuesCount = signalSemaphoreValuesCount_; + return *this; + } + + D3D12FenceSubmitInfoKHX& setPSignalSemaphoreValues( const uint64_t* pSignalSemaphoreValues_ ) + { + pSignalSemaphoreValues = pSignalSemaphoreValues_; + return *this; + } + + operator const VkD3D12FenceSubmitInfoKHX&() const + { + return *reinterpret_cast<const VkD3D12FenceSubmitInfoKHX*>(this); + } + + bool operator==( D3D12FenceSubmitInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( waitSemaphoreValuesCount == rhs.waitSemaphoreValuesCount ) + && ( pWaitSemaphoreValues == rhs.pWaitSemaphoreValues ) + && ( signalSemaphoreValuesCount == rhs.signalSemaphoreValuesCount ) + && ( pSignalSemaphoreValues == rhs.pSignalSemaphoreValues ); + } + + bool operator!=( D3D12FenceSubmitInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + uint32_t waitSemaphoreValuesCount; + const uint64_t* pWaitSemaphoreValues; + uint32_t signalSemaphoreValuesCount; + const uint64_t* pSignalSemaphoreValues; + }; + static_assert( sizeof( D3D12FenceSubmitInfoKHX ) == sizeof( VkD3D12FenceSubmitInfoKHX ), "struct and wrapper have different size!" ); +#endif /*VK_USE_PLATFORM_WIN32_KHX*/ + + struct PhysicalDeviceMultiviewFeaturesKHX + { + PhysicalDeviceMultiviewFeaturesKHX( Bool32 multiview_ = 0, Bool32 multiviewGeometryShader_ = 0, Bool32 multiviewTessellationShader_ = 0 ) + : sType( StructureType::ePhysicalDeviceMultiviewFeaturesKHX ) + , pNext( nullptr ) + , multiview( multiview_ ) + , multiviewGeometryShader( multiviewGeometryShader_ ) + , multiviewTessellationShader( multiviewTessellationShader_ ) + { + } + + PhysicalDeviceMultiviewFeaturesKHX( VkPhysicalDeviceMultiviewFeaturesKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(PhysicalDeviceMultiviewFeaturesKHX) ); + } + + PhysicalDeviceMultiviewFeaturesKHX& operator=( VkPhysicalDeviceMultiviewFeaturesKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(PhysicalDeviceMultiviewFeaturesKHX) ); + return *this; + } + + PhysicalDeviceMultiviewFeaturesKHX& setPNext( void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + PhysicalDeviceMultiviewFeaturesKHX& setMultiview( Bool32 multiview_ ) + { + multiview = multiview_; + return *this; + } + + PhysicalDeviceMultiviewFeaturesKHX& setMultiviewGeometryShader( Bool32 multiviewGeometryShader_ ) + { + multiviewGeometryShader = multiviewGeometryShader_; + return *this; + } + + PhysicalDeviceMultiviewFeaturesKHX& setMultiviewTessellationShader( Bool32 multiviewTessellationShader_ ) + { + multiviewTessellationShader = multiviewTessellationShader_; + return *this; + } + + operator const VkPhysicalDeviceMultiviewFeaturesKHX&() const + { + return *reinterpret_cast<const VkPhysicalDeviceMultiviewFeaturesKHX*>(this); + } + + bool operator==( PhysicalDeviceMultiviewFeaturesKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( multiview == rhs.multiview ) + && ( multiviewGeometryShader == rhs.multiviewGeometryShader ) + && ( multiviewTessellationShader == rhs.multiviewTessellationShader ); + } + + bool operator!=( PhysicalDeviceMultiviewFeaturesKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + void* pNext; + Bool32 multiview; + Bool32 multiviewGeometryShader; + Bool32 multiviewTessellationShader; + }; + static_assert( sizeof( PhysicalDeviceMultiviewFeaturesKHX ) == sizeof( VkPhysicalDeviceMultiviewFeaturesKHX ), "struct and wrapper have different size!" ); + + struct PhysicalDeviceMultiviewPropertiesKHX + { + operator const VkPhysicalDeviceMultiviewPropertiesKHX&() const + { + return *reinterpret_cast<const VkPhysicalDeviceMultiviewPropertiesKHX*>(this); + } + + bool operator==( PhysicalDeviceMultiviewPropertiesKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( maxMultiviewViewCount == rhs.maxMultiviewViewCount ) + && ( maxMultiviewInstanceIndex == rhs.maxMultiviewInstanceIndex ); + } + + bool operator!=( PhysicalDeviceMultiviewPropertiesKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + void* pNext; + uint32_t maxMultiviewViewCount; + uint32_t maxMultiviewInstanceIndex; + }; + static_assert( sizeof( PhysicalDeviceMultiviewPropertiesKHX ) == sizeof( VkPhysicalDeviceMultiviewPropertiesKHX ), "struct and wrapper have different size!" ); + + struct RenderPassMultiviewCreateInfoKHX + { + RenderPassMultiviewCreateInfoKHX( uint32_t subpassCount_ = 0, const uint32_t* pViewMasks_ = nullptr, uint32_t dependencyCount_ = 0, const int32_t* pViewOffsets_ = nullptr, uint32_t correlationMaskCount_ = 0, const uint32_t* pCorrelationMasks_ = nullptr ) + : sType( StructureType::eRenderPassMultiviewCreateInfoKHX ) + , pNext( nullptr ) + , subpassCount( subpassCount_ ) + , pViewMasks( pViewMasks_ ) + , dependencyCount( dependencyCount_ ) + , pViewOffsets( pViewOffsets_ ) + , correlationMaskCount( correlationMaskCount_ ) + , pCorrelationMasks( pCorrelationMasks_ ) + { + } + + RenderPassMultiviewCreateInfoKHX( VkRenderPassMultiviewCreateInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(RenderPassMultiviewCreateInfoKHX) ); + } + + RenderPassMultiviewCreateInfoKHX& operator=( VkRenderPassMultiviewCreateInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(RenderPassMultiviewCreateInfoKHX) ); + return *this; + } + + RenderPassMultiviewCreateInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + RenderPassMultiviewCreateInfoKHX& setSubpassCount( uint32_t subpassCount_ ) + { + subpassCount = subpassCount_; + return *this; + } + + RenderPassMultiviewCreateInfoKHX& setPViewMasks( const uint32_t* pViewMasks_ ) + { + pViewMasks = pViewMasks_; + return *this; + } + + RenderPassMultiviewCreateInfoKHX& setDependencyCount( uint32_t dependencyCount_ ) + { + dependencyCount = dependencyCount_; + return *this; + } + + RenderPassMultiviewCreateInfoKHX& setPViewOffsets( const int32_t* pViewOffsets_ ) + { + pViewOffsets = pViewOffsets_; + return *this; + } + + RenderPassMultiviewCreateInfoKHX& setCorrelationMaskCount( uint32_t correlationMaskCount_ ) + { + correlationMaskCount = correlationMaskCount_; + return *this; + } + + RenderPassMultiviewCreateInfoKHX& setPCorrelationMasks( const uint32_t* pCorrelationMasks_ ) + { + pCorrelationMasks = pCorrelationMasks_; + return *this; + } + + operator const VkRenderPassMultiviewCreateInfoKHX&() const + { + return *reinterpret_cast<const VkRenderPassMultiviewCreateInfoKHX*>(this); + } + + bool operator==( RenderPassMultiviewCreateInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( subpassCount == rhs.subpassCount ) + && ( pViewMasks == rhs.pViewMasks ) + && ( dependencyCount == rhs.dependencyCount ) + && ( pViewOffsets == rhs.pViewOffsets ) + && ( correlationMaskCount == rhs.correlationMaskCount ) + && ( pCorrelationMasks == rhs.pCorrelationMasks ); + } + + bool operator!=( RenderPassMultiviewCreateInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + uint32_t subpassCount; + const uint32_t* pViewMasks; + uint32_t dependencyCount; + const int32_t* pViewOffsets; + uint32_t correlationMaskCount; + const uint32_t* pCorrelationMasks; + }; + static_assert( sizeof( RenderPassMultiviewCreateInfoKHX ) == sizeof( VkRenderPassMultiviewCreateInfoKHX ), "struct and wrapper have different size!" ); + + struct BindBufferMemoryInfoKHX + { + BindBufferMemoryInfoKHX( Buffer buffer_ = Buffer(), DeviceMemory memory_ = DeviceMemory(), DeviceSize memoryOffset_ = 0, uint32_t deviceIndexCount_ = 0, const uint32_t* pDeviceIndices_ = nullptr ) + : sType( StructureType::eBindBufferMemoryInfoKHX ) + , pNext( nullptr ) + , buffer( buffer_ ) + , memory( memory_ ) + , memoryOffset( memoryOffset_ ) + , deviceIndexCount( deviceIndexCount_ ) + , pDeviceIndices( pDeviceIndices_ ) + { + } + + BindBufferMemoryInfoKHX( VkBindBufferMemoryInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(BindBufferMemoryInfoKHX) ); + } + + BindBufferMemoryInfoKHX& operator=( VkBindBufferMemoryInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(BindBufferMemoryInfoKHX) ); + return *this; + } + + BindBufferMemoryInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + BindBufferMemoryInfoKHX& setBuffer( Buffer buffer_ ) + { + buffer = buffer_; + return *this; + } + + BindBufferMemoryInfoKHX& setMemory( DeviceMemory memory_ ) + { + memory = memory_; + return *this; + } + + BindBufferMemoryInfoKHX& setMemoryOffset( DeviceSize memoryOffset_ ) + { + memoryOffset = memoryOffset_; + return *this; + } + + BindBufferMemoryInfoKHX& setDeviceIndexCount( uint32_t deviceIndexCount_ ) + { + deviceIndexCount = deviceIndexCount_; + return *this; + } + + BindBufferMemoryInfoKHX& setPDeviceIndices( const uint32_t* pDeviceIndices_ ) + { + pDeviceIndices = pDeviceIndices_; + return *this; + } + + operator const VkBindBufferMemoryInfoKHX&() const + { + return *reinterpret_cast<const VkBindBufferMemoryInfoKHX*>(this); + } + + bool operator==( BindBufferMemoryInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( buffer == rhs.buffer ) + && ( memory == rhs.memory ) + && ( memoryOffset == rhs.memoryOffset ) + && ( deviceIndexCount == rhs.deviceIndexCount ) + && ( pDeviceIndices == rhs.pDeviceIndices ); + } + + bool operator!=( BindBufferMemoryInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + Buffer buffer; + DeviceMemory memory; + DeviceSize memoryOffset; + uint32_t deviceIndexCount; + const uint32_t* pDeviceIndices; + }; + static_assert( sizeof( BindBufferMemoryInfoKHX ) == sizeof( VkBindBufferMemoryInfoKHX ), "struct and wrapper have different size!" ); + + struct BindImageMemoryInfoKHX + { + BindImageMemoryInfoKHX( Image image_ = Image(), DeviceMemory memory_ = DeviceMemory(), DeviceSize memoryOffset_ = 0, uint32_t deviceIndexCount_ = 0, const uint32_t* pDeviceIndices_ = nullptr, uint32_t SFRRectCount_ = 0, const Rect2D* pSFRRects_ = nullptr ) + : sType( StructureType::eBindImageMemoryInfoKHX ) + , pNext( nullptr ) + , image( image_ ) + , memory( memory_ ) + , memoryOffset( memoryOffset_ ) + , deviceIndexCount( deviceIndexCount_ ) + , pDeviceIndices( pDeviceIndices_ ) + , SFRRectCount( SFRRectCount_ ) + , pSFRRects( pSFRRects_ ) + { + } + + BindImageMemoryInfoKHX( VkBindImageMemoryInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(BindImageMemoryInfoKHX) ); + } + + BindImageMemoryInfoKHX& operator=( VkBindImageMemoryInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(BindImageMemoryInfoKHX) ); + return *this; + } + + BindImageMemoryInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + BindImageMemoryInfoKHX& setImage( Image image_ ) + { + image = image_; + return *this; + } + + BindImageMemoryInfoKHX& setMemory( DeviceMemory memory_ ) + { + memory = memory_; + return *this; + } + + BindImageMemoryInfoKHX& setMemoryOffset( DeviceSize memoryOffset_ ) + { + memoryOffset = memoryOffset_; + return *this; + } + + BindImageMemoryInfoKHX& setDeviceIndexCount( uint32_t deviceIndexCount_ ) + { + deviceIndexCount = deviceIndexCount_; + return *this; + } + + BindImageMemoryInfoKHX& setPDeviceIndices( const uint32_t* pDeviceIndices_ ) + { + pDeviceIndices = pDeviceIndices_; + return *this; + } + + BindImageMemoryInfoKHX& setSFRRectCount( uint32_t SFRRectCount_ ) + { + SFRRectCount = SFRRectCount_; + return *this; + } + + BindImageMemoryInfoKHX& setPSFRRects( const Rect2D* pSFRRects_ ) + { + pSFRRects = pSFRRects_; + return *this; + } + + operator const VkBindImageMemoryInfoKHX&() const + { + return *reinterpret_cast<const VkBindImageMemoryInfoKHX*>(this); + } + + bool operator==( BindImageMemoryInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( image == rhs.image ) + && ( memory == rhs.memory ) + && ( memoryOffset == rhs.memoryOffset ) + && ( deviceIndexCount == rhs.deviceIndexCount ) + && ( pDeviceIndices == rhs.pDeviceIndices ) + && ( SFRRectCount == rhs.SFRRectCount ) + && ( pSFRRects == rhs.pSFRRects ); + } + + bool operator!=( BindImageMemoryInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + Image image; + DeviceMemory memory; + DeviceSize memoryOffset; + uint32_t deviceIndexCount; + const uint32_t* pDeviceIndices; + uint32_t SFRRectCount; + const Rect2D* pSFRRects; + }; + static_assert( sizeof( BindImageMemoryInfoKHX ) == sizeof( VkBindImageMemoryInfoKHX ), "struct and wrapper have different size!" ); + + struct DeviceGroupRenderPassBeginInfoKHX + { + DeviceGroupRenderPassBeginInfoKHX( uint32_t deviceMask_ = 0, uint32_t deviceRenderAreaCount_ = 0, const Rect2D* pDeviceRenderAreas_ = nullptr ) + : sType( StructureType::eDeviceGroupRenderPassBeginInfoKHX ) + , pNext( nullptr ) + , deviceMask( deviceMask_ ) + , deviceRenderAreaCount( deviceRenderAreaCount_ ) + , pDeviceRenderAreas( pDeviceRenderAreas_ ) + { + } + + DeviceGroupRenderPassBeginInfoKHX( VkDeviceGroupRenderPassBeginInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(DeviceGroupRenderPassBeginInfoKHX) ); + } + + DeviceGroupRenderPassBeginInfoKHX& operator=( VkDeviceGroupRenderPassBeginInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(DeviceGroupRenderPassBeginInfoKHX) ); + return *this; + } + + DeviceGroupRenderPassBeginInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + DeviceGroupRenderPassBeginInfoKHX& setDeviceMask( uint32_t deviceMask_ ) + { + deviceMask = deviceMask_; + return *this; + } + + DeviceGroupRenderPassBeginInfoKHX& setDeviceRenderAreaCount( uint32_t deviceRenderAreaCount_ ) + { + deviceRenderAreaCount = deviceRenderAreaCount_; + return *this; + } + + DeviceGroupRenderPassBeginInfoKHX& setPDeviceRenderAreas( const Rect2D* pDeviceRenderAreas_ ) + { + pDeviceRenderAreas = pDeviceRenderAreas_; + return *this; + } + + operator const VkDeviceGroupRenderPassBeginInfoKHX&() const + { + return *reinterpret_cast<const VkDeviceGroupRenderPassBeginInfoKHX*>(this); + } + + bool operator==( DeviceGroupRenderPassBeginInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( deviceMask == rhs.deviceMask ) + && ( deviceRenderAreaCount == rhs.deviceRenderAreaCount ) + && ( pDeviceRenderAreas == rhs.pDeviceRenderAreas ); + } + + bool operator!=( DeviceGroupRenderPassBeginInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + uint32_t deviceMask; + uint32_t deviceRenderAreaCount; + const Rect2D* pDeviceRenderAreas; + }; + static_assert( sizeof( DeviceGroupRenderPassBeginInfoKHX ) == sizeof( VkDeviceGroupRenderPassBeginInfoKHX ), "struct and wrapper have different size!" ); + + struct DeviceGroupCommandBufferBeginInfoKHX + { + DeviceGroupCommandBufferBeginInfoKHX( uint32_t deviceMask_ = 0 ) + : sType( StructureType::eDeviceGroupCommandBufferBeginInfoKHX ) + , pNext( nullptr ) + , deviceMask( deviceMask_ ) + { + } + + DeviceGroupCommandBufferBeginInfoKHX( VkDeviceGroupCommandBufferBeginInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(DeviceGroupCommandBufferBeginInfoKHX) ); + } + + DeviceGroupCommandBufferBeginInfoKHX& operator=( VkDeviceGroupCommandBufferBeginInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(DeviceGroupCommandBufferBeginInfoKHX) ); + return *this; + } + + DeviceGroupCommandBufferBeginInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + DeviceGroupCommandBufferBeginInfoKHX& setDeviceMask( uint32_t deviceMask_ ) + { + deviceMask = deviceMask_; + return *this; + } + + operator const VkDeviceGroupCommandBufferBeginInfoKHX&() const + { + return *reinterpret_cast<const VkDeviceGroupCommandBufferBeginInfoKHX*>(this); + } + + bool operator==( DeviceGroupCommandBufferBeginInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( deviceMask == rhs.deviceMask ); + } + + bool operator!=( DeviceGroupCommandBufferBeginInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + uint32_t deviceMask; + }; + static_assert( sizeof( DeviceGroupCommandBufferBeginInfoKHX ) == sizeof( VkDeviceGroupCommandBufferBeginInfoKHX ), "struct and wrapper have different size!" ); + + struct DeviceGroupSubmitInfoKHX + { + DeviceGroupSubmitInfoKHX( uint32_t waitSemaphoreCount_ = 0, const uint32_t* pWaitSemaphoreDeviceIndices_ = nullptr, uint32_t commandBufferCount_ = 0, const uint32_t* pCommandBufferDeviceMasks_ = nullptr, uint32_t signalSemaphoreCount_ = 0, const uint32_t* pSignalSemaphoreDeviceIndices_ = nullptr ) + : sType( StructureType::eDeviceGroupSubmitInfoKHX ) + , pNext( nullptr ) + , waitSemaphoreCount( waitSemaphoreCount_ ) + , pWaitSemaphoreDeviceIndices( pWaitSemaphoreDeviceIndices_ ) + , commandBufferCount( commandBufferCount_ ) + , pCommandBufferDeviceMasks( pCommandBufferDeviceMasks_ ) + , signalSemaphoreCount( signalSemaphoreCount_ ) + , pSignalSemaphoreDeviceIndices( pSignalSemaphoreDeviceIndices_ ) + { + } + + DeviceGroupSubmitInfoKHX( VkDeviceGroupSubmitInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(DeviceGroupSubmitInfoKHX) ); + } + + DeviceGroupSubmitInfoKHX& operator=( VkDeviceGroupSubmitInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(DeviceGroupSubmitInfoKHX) ); + return *this; + } + + DeviceGroupSubmitInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + DeviceGroupSubmitInfoKHX& setWaitSemaphoreCount( uint32_t waitSemaphoreCount_ ) + { + waitSemaphoreCount = waitSemaphoreCount_; + return *this; + } + + DeviceGroupSubmitInfoKHX& setPWaitSemaphoreDeviceIndices( const uint32_t* pWaitSemaphoreDeviceIndices_ ) + { + pWaitSemaphoreDeviceIndices = pWaitSemaphoreDeviceIndices_; + return *this; + } + + DeviceGroupSubmitInfoKHX& setCommandBufferCount( uint32_t commandBufferCount_ ) + { + commandBufferCount = commandBufferCount_; + return *this; + } + + DeviceGroupSubmitInfoKHX& setPCommandBufferDeviceMasks( const uint32_t* pCommandBufferDeviceMasks_ ) + { + pCommandBufferDeviceMasks = pCommandBufferDeviceMasks_; + return *this; + } + + DeviceGroupSubmitInfoKHX& setSignalSemaphoreCount( uint32_t signalSemaphoreCount_ ) + { + signalSemaphoreCount = signalSemaphoreCount_; + return *this; + } + + DeviceGroupSubmitInfoKHX& setPSignalSemaphoreDeviceIndices( const uint32_t* pSignalSemaphoreDeviceIndices_ ) + { + pSignalSemaphoreDeviceIndices = pSignalSemaphoreDeviceIndices_; + return *this; + } + + operator const VkDeviceGroupSubmitInfoKHX&() const + { + return *reinterpret_cast<const VkDeviceGroupSubmitInfoKHX*>(this); + } + + bool operator==( DeviceGroupSubmitInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( waitSemaphoreCount == rhs.waitSemaphoreCount ) + && ( pWaitSemaphoreDeviceIndices == rhs.pWaitSemaphoreDeviceIndices ) + && ( commandBufferCount == rhs.commandBufferCount ) + && ( pCommandBufferDeviceMasks == rhs.pCommandBufferDeviceMasks ) + && ( signalSemaphoreCount == rhs.signalSemaphoreCount ) + && ( pSignalSemaphoreDeviceIndices == rhs.pSignalSemaphoreDeviceIndices ); + } + + bool operator!=( DeviceGroupSubmitInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + uint32_t waitSemaphoreCount; + const uint32_t* pWaitSemaphoreDeviceIndices; + uint32_t commandBufferCount; + const uint32_t* pCommandBufferDeviceMasks; + uint32_t signalSemaphoreCount; + const uint32_t* pSignalSemaphoreDeviceIndices; + }; + static_assert( sizeof( DeviceGroupSubmitInfoKHX ) == sizeof( VkDeviceGroupSubmitInfoKHX ), "struct and wrapper have different size!" ); + + struct DeviceGroupBindSparseInfoKHX + { + DeviceGroupBindSparseInfoKHX( uint32_t resourceDeviceIndex_ = 0, uint32_t memoryDeviceIndex_ = 0 ) + : sType( StructureType::eDeviceGroupBindSparseInfoKHX ) + , pNext( nullptr ) + , resourceDeviceIndex( resourceDeviceIndex_ ) + , memoryDeviceIndex( memoryDeviceIndex_ ) + { + } + + DeviceGroupBindSparseInfoKHX( VkDeviceGroupBindSparseInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(DeviceGroupBindSparseInfoKHX) ); + } + + DeviceGroupBindSparseInfoKHX& operator=( VkDeviceGroupBindSparseInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(DeviceGroupBindSparseInfoKHX) ); + return *this; + } + + DeviceGroupBindSparseInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + DeviceGroupBindSparseInfoKHX& setResourceDeviceIndex( uint32_t resourceDeviceIndex_ ) + { + resourceDeviceIndex = resourceDeviceIndex_; + return *this; + } + + DeviceGroupBindSparseInfoKHX& setMemoryDeviceIndex( uint32_t memoryDeviceIndex_ ) + { + memoryDeviceIndex = memoryDeviceIndex_; + return *this; + } + + operator const VkDeviceGroupBindSparseInfoKHX&() const + { + return *reinterpret_cast<const VkDeviceGroupBindSparseInfoKHX*>(this); + } + + bool operator==( DeviceGroupBindSparseInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( resourceDeviceIndex == rhs.resourceDeviceIndex ) + && ( memoryDeviceIndex == rhs.memoryDeviceIndex ); + } + + bool operator!=( DeviceGroupBindSparseInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + uint32_t resourceDeviceIndex; + uint32_t memoryDeviceIndex; + }; + static_assert( sizeof( DeviceGroupBindSparseInfoKHX ) == sizeof( VkDeviceGroupBindSparseInfoKHX ), "struct and wrapper have different size!" ); + + struct ImageSwapchainCreateInfoKHX + { + ImageSwapchainCreateInfoKHX( SwapchainKHR swapchain_ = SwapchainKHR() ) + : sType( StructureType::eImageSwapchainCreateInfoKHX ) + , pNext( nullptr ) + , swapchain( swapchain_ ) + { + } + + ImageSwapchainCreateInfoKHX( VkImageSwapchainCreateInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ImageSwapchainCreateInfoKHX) ); + } + + ImageSwapchainCreateInfoKHX& operator=( VkImageSwapchainCreateInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ImageSwapchainCreateInfoKHX) ); + return *this; + } + + ImageSwapchainCreateInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + ImageSwapchainCreateInfoKHX& setSwapchain( SwapchainKHR swapchain_ ) + { + swapchain = swapchain_; + return *this; + } + + operator const VkImageSwapchainCreateInfoKHX&() const + { + return *reinterpret_cast<const VkImageSwapchainCreateInfoKHX*>(this); + } + + bool operator==( ImageSwapchainCreateInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( swapchain == rhs.swapchain ); + } + + bool operator!=( ImageSwapchainCreateInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + SwapchainKHR swapchain; + }; + static_assert( sizeof( ImageSwapchainCreateInfoKHX ) == sizeof( VkImageSwapchainCreateInfoKHX ), "struct and wrapper have different size!" ); + + struct BindImageMemorySwapchainInfoKHX + { + BindImageMemorySwapchainInfoKHX( SwapchainKHR swapchain_ = SwapchainKHR(), uint32_t imageIndex_ = 0 ) + : sType( StructureType::eBindImageMemorySwapchainInfoKHX ) + , pNext( nullptr ) + , swapchain( swapchain_ ) + , imageIndex( imageIndex_ ) + { + } + + BindImageMemorySwapchainInfoKHX( VkBindImageMemorySwapchainInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(BindImageMemorySwapchainInfoKHX) ); + } + + BindImageMemorySwapchainInfoKHX& operator=( VkBindImageMemorySwapchainInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(BindImageMemorySwapchainInfoKHX) ); + return *this; + } + + BindImageMemorySwapchainInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + BindImageMemorySwapchainInfoKHX& setSwapchain( SwapchainKHR swapchain_ ) + { + swapchain = swapchain_; + return *this; + } + + BindImageMemorySwapchainInfoKHX& setImageIndex( uint32_t imageIndex_ ) + { + imageIndex = imageIndex_; + return *this; + } + + operator const VkBindImageMemorySwapchainInfoKHX&() const + { + return *reinterpret_cast<const VkBindImageMemorySwapchainInfoKHX*>(this); + } + + bool operator==( BindImageMemorySwapchainInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( swapchain == rhs.swapchain ) + && ( imageIndex == rhs.imageIndex ); + } + + bool operator!=( BindImageMemorySwapchainInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + SwapchainKHR swapchain; + uint32_t imageIndex; + }; + static_assert( sizeof( BindImageMemorySwapchainInfoKHX ) == sizeof( VkBindImageMemorySwapchainInfoKHX ), "struct and wrapper have different size!" ); + + struct AcquireNextImageInfoKHX + { + AcquireNextImageInfoKHX( SwapchainKHR swapchain_ = SwapchainKHR(), uint64_t timeout_ = 0, Semaphore semaphore_ = Semaphore(), Fence fence_ = Fence(), uint32_t deviceMask_ = 0 ) + : sType( StructureType::eAcquireNextImageInfoKHX ) + , pNext( nullptr ) + , swapchain( swapchain_ ) + , timeout( timeout_ ) + , semaphore( semaphore_ ) + , fence( fence_ ) + , deviceMask( deviceMask_ ) + { + } + + AcquireNextImageInfoKHX( VkAcquireNextImageInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(AcquireNextImageInfoKHX) ); + } + + AcquireNextImageInfoKHX& operator=( VkAcquireNextImageInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(AcquireNextImageInfoKHX) ); + return *this; + } + + AcquireNextImageInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + AcquireNextImageInfoKHX& setSwapchain( SwapchainKHR swapchain_ ) + { + swapchain = swapchain_; + return *this; + } + + AcquireNextImageInfoKHX& setTimeout( uint64_t timeout_ ) + { + timeout = timeout_; + return *this; + } + + AcquireNextImageInfoKHX& setSemaphore( Semaphore semaphore_ ) + { + semaphore = semaphore_; + return *this; + } + + AcquireNextImageInfoKHX& setFence( Fence fence_ ) + { + fence = fence_; + return *this; + } + + AcquireNextImageInfoKHX& setDeviceMask( uint32_t deviceMask_ ) + { + deviceMask = deviceMask_; + return *this; + } + + operator const VkAcquireNextImageInfoKHX&() const + { + return *reinterpret_cast<const VkAcquireNextImageInfoKHX*>(this); + } + + bool operator==( AcquireNextImageInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( swapchain == rhs.swapchain ) + && ( timeout == rhs.timeout ) + && ( semaphore == rhs.semaphore ) + && ( fence == rhs.fence ) + && ( deviceMask == rhs.deviceMask ); + } + + bool operator!=( AcquireNextImageInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + SwapchainKHR swapchain; + uint64_t timeout; + Semaphore semaphore; + Fence fence; + uint32_t deviceMask; + }; + static_assert( sizeof( AcquireNextImageInfoKHX ) == sizeof( VkAcquireNextImageInfoKHX ), "struct and wrapper have different size!" ); + +#ifdef VK_USE_PLATFORM_IOS_MVK + struct IOSSurfaceCreateInfoMVK + { + IOSSurfaceCreateInfoMVK( IOSSurfaceCreateFlagsMVK flags_ = IOSSurfaceCreateFlagsMVK(), const void* pView_ = nullptr ) + : sType( StructureType::eIOSSurfaceCreateInfoMVK ) + , pNext( nullptr ) + , flags( flags_ ) + , pView( pView_ ) + { + } + + IOSSurfaceCreateInfoMVK( VkIOSSurfaceCreateInfoMVK const & rhs ) + { + memcpy( this, &rhs, sizeof(IOSSurfaceCreateInfoMVK) ); + } + + IOSSurfaceCreateInfoMVK& operator=( VkIOSSurfaceCreateInfoMVK const & rhs ) + { + memcpy( this, &rhs, sizeof(IOSSurfaceCreateInfoMVK) ); + return *this; + } + + IOSSurfaceCreateInfoMVK& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + IOSSurfaceCreateInfoMVK& setFlags( IOSSurfaceCreateFlagsMVK flags_ ) + { + flags = flags_; + return *this; + } + + IOSSurfaceCreateInfoMVK& setPView( const void* pView_ ) + { + pView = pView_; + return *this; + } + + operator const VkIOSSurfaceCreateInfoMVK&() const + { + return *reinterpret_cast<const VkIOSSurfaceCreateInfoMVK*>(this); + } + + bool operator==( IOSSurfaceCreateInfoMVK const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( flags == rhs.flags ) + && ( pView == rhs.pView ); + } + + bool operator!=( IOSSurfaceCreateInfoMVK const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + IOSSurfaceCreateFlagsMVK flags; + const void* pView; + }; + static_assert( sizeof( IOSSurfaceCreateInfoMVK ) == sizeof( VkIOSSurfaceCreateInfoMVK ), "struct and wrapper have different size!" ); +#endif /*VK_USE_PLATFORM_IOS_MVK*/ + +#ifdef VK_USE_PLATFORM_MACOS_MVK + struct MacOSSurfaceCreateInfoMVK + { + MacOSSurfaceCreateInfoMVK( MacOSSurfaceCreateFlagsMVK flags_ = MacOSSurfaceCreateFlagsMVK(), const void* pView_ = nullptr ) + : sType( StructureType::eMacOSSurfaceCreateInfoMVK ) + , pNext( nullptr ) + , flags( flags_ ) + , pView( pView_ ) + { + } + + MacOSSurfaceCreateInfoMVK( VkMacOSSurfaceCreateInfoMVK const & rhs ) + { + memcpy( this, &rhs, sizeof(MacOSSurfaceCreateInfoMVK) ); + } + + MacOSSurfaceCreateInfoMVK& operator=( VkMacOSSurfaceCreateInfoMVK const & rhs ) + { + memcpy( this, &rhs, sizeof(MacOSSurfaceCreateInfoMVK) ); + return *this; + } + + MacOSSurfaceCreateInfoMVK& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + MacOSSurfaceCreateInfoMVK& setFlags( MacOSSurfaceCreateFlagsMVK flags_ ) + { + flags = flags_; + return *this; + } + + MacOSSurfaceCreateInfoMVK& setPView( const void* pView_ ) + { + pView = pView_; + return *this; + } + + operator const VkMacOSSurfaceCreateInfoMVK&() const + { + return *reinterpret_cast<const VkMacOSSurfaceCreateInfoMVK*>(this); + } + + bool operator==( MacOSSurfaceCreateInfoMVK const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( flags == rhs.flags ) + && ( pView == rhs.pView ); + } + + bool operator!=( MacOSSurfaceCreateInfoMVK const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + MacOSSurfaceCreateFlagsMVK flags; + const void* pView; + }; + static_assert( sizeof( MacOSSurfaceCreateInfoMVK ) == sizeof( VkMacOSSurfaceCreateInfoMVK ), "struct and wrapper have different size!" ); +#endif /*VK_USE_PLATFORM_MACOS_MVK*/ + + struct PipelineViewportWScalingStateCreateInfoNV + { + PipelineViewportWScalingStateCreateInfoNV( Bool32 viewportWScalingEnable_ = 0, uint32_t viewportCount_ = 0, const ViewportWScalingNV* pViewportWScalings_ = nullptr ) + : sType( StructureType::ePipelineViewportWScalingStateCreateInfoNV ) + , pNext( nullptr ) + , viewportWScalingEnable( viewportWScalingEnable_ ) + , viewportCount( viewportCount_ ) + , pViewportWScalings( pViewportWScalings_ ) + { + } + + PipelineViewportWScalingStateCreateInfoNV( VkPipelineViewportWScalingStateCreateInfoNV const & rhs ) + { + memcpy( this, &rhs, sizeof(PipelineViewportWScalingStateCreateInfoNV) ); + } + + PipelineViewportWScalingStateCreateInfoNV& operator=( VkPipelineViewportWScalingStateCreateInfoNV const & rhs ) + { + memcpy( this, &rhs, sizeof(PipelineViewportWScalingStateCreateInfoNV) ); + return *this; + } + + PipelineViewportWScalingStateCreateInfoNV& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + PipelineViewportWScalingStateCreateInfoNV& setViewportWScalingEnable( Bool32 viewportWScalingEnable_ ) + { + viewportWScalingEnable = viewportWScalingEnable_; + return *this; + } + + PipelineViewportWScalingStateCreateInfoNV& setViewportCount( uint32_t viewportCount_ ) + { + viewportCount = viewportCount_; + return *this; + } + + PipelineViewportWScalingStateCreateInfoNV& setPViewportWScalings( const ViewportWScalingNV* pViewportWScalings_ ) + { + pViewportWScalings = pViewportWScalings_; + return *this; + } + + operator const VkPipelineViewportWScalingStateCreateInfoNV&() const + { + return *reinterpret_cast<const VkPipelineViewportWScalingStateCreateInfoNV*>(this); + } + + bool operator==( PipelineViewportWScalingStateCreateInfoNV const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( viewportWScalingEnable == rhs.viewportWScalingEnable ) + && ( viewportCount == rhs.viewportCount ) + && ( pViewportWScalings == rhs.pViewportWScalings ); + } + + bool operator!=( PipelineViewportWScalingStateCreateInfoNV const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + Bool32 viewportWScalingEnable; + uint32_t viewportCount; + const ViewportWScalingNV* pViewportWScalings; + }; + static_assert( sizeof( PipelineViewportWScalingStateCreateInfoNV ) == sizeof( VkPipelineViewportWScalingStateCreateInfoNV ), "struct and wrapper have different size!" ); + + struct PhysicalDeviceDiscardRectanglePropertiesEXT + { + PhysicalDeviceDiscardRectanglePropertiesEXT( uint32_t maxDiscardRectangles_ = 0 ) + : sType( StructureType::ePhysicalDeviceDiscardRectanglePropertiesEXT ) + , pNext( nullptr ) + , maxDiscardRectangles( maxDiscardRectangles_ ) + { + } + + PhysicalDeviceDiscardRectanglePropertiesEXT( VkPhysicalDeviceDiscardRectanglePropertiesEXT const & rhs ) + { + memcpy( this, &rhs, sizeof(PhysicalDeviceDiscardRectanglePropertiesEXT) ); + } + + PhysicalDeviceDiscardRectanglePropertiesEXT& operator=( VkPhysicalDeviceDiscardRectanglePropertiesEXT const & rhs ) + { + memcpy( this, &rhs, sizeof(PhysicalDeviceDiscardRectanglePropertiesEXT) ); + return *this; + } + + PhysicalDeviceDiscardRectanglePropertiesEXT& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + PhysicalDeviceDiscardRectanglePropertiesEXT& setMaxDiscardRectangles( uint32_t maxDiscardRectangles_ ) + { + maxDiscardRectangles = maxDiscardRectangles_; + return *this; + } + + operator const VkPhysicalDeviceDiscardRectanglePropertiesEXT&() const + { + return *reinterpret_cast<const VkPhysicalDeviceDiscardRectanglePropertiesEXT*>(this); + } + + bool operator==( PhysicalDeviceDiscardRectanglePropertiesEXT const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( maxDiscardRectangles == rhs.maxDiscardRectangles ); + } + + bool operator!=( PhysicalDeviceDiscardRectanglePropertiesEXT const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + uint32_t maxDiscardRectangles; + }; + static_assert( sizeof( PhysicalDeviceDiscardRectanglePropertiesEXT ) == sizeof( VkPhysicalDeviceDiscardRectanglePropertiesEXT ), "struct and wrapper have different size!" ); + + struct PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX + { + operator const VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX&() const + { + return *reinterpret_cast<const VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX*>(this); + } + + bool operator==( PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( perViewPositionAllComponents == rhs.perViewPositionAllComponents ); + } + + bool operator!=( PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + void* pNext; + Bool32 perViewPositionAllComponents; + }; + static_assert( sizeof( PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX ) == sizeof( VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX ), "struct and wrapper have different size!" ); + enum class SubpassContents { eInline = VK_SUBPASS_CONTENTS_INLINE, @@ -9700,7 +11608,9 @@ namespace vk eDepthBounds = VK_DYNAMIC_STATE_DEPTH_BOUNDS, eStencilCompareMask = VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK, eStencilWriteMask = VK_DYNAMIC_STATE_STENCIL_WRITE_MASK, - eStencilReference = VK_DYNAMIC_STATE_STENCIL_REFERENCE + eStencilReference = VK_DYNAMIC_STATE_STENCIL_REFERENCE, + eViewportWScalingNV = VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV, + eDiscardRectangleEXT = VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT }; struct PipelineDynamicStateCreateInfo @@ -9779,6 +11689,133 @@ namespace vk }; static_assert( sizeof( PipelineDynamicStateCreateInfo ) == sizeof( VkPipelineDynamicStateCreateInfo ), "struct and wrapper have different size!" ); + enum class DescriptorUpdateTemplateTypeKHR + { + eDescriptorSet = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR, + ePushDescriptors = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR + }; + + struct DescriptorUpdateTemplateCreateInfoKHR + { + DescriptorUpdateTemplateCreateInfoKHR( DescriptorUpdateTemplateCreateFlagsKHR flags_ = DescriptorUpdateTemplateCreateFlagsKHR(), uint32_t descriptorUpdateEntryCount_ = 0, const DescriptorUpdateTemplateEntryKHR* pDescriptorUpdateEntries_ = nullptr, DescriptorUpdateTemplateTypeKHR templateType_ = DescriptorUpdateTemplateTypeKHR::eDescriptorSet, DescriptorSetLayout descriptorSetLayout_ = DescriptorSetLayout(), PipelineBindPoint pipelineBindPoint_ = PipelineBindPoint::eGraphics, PipelineLayout pipelineLayout_ = PipelineLayout(), uint32_t set_ = 0 ) + : sType( StructureType::eDescriptorUpdateTemplateCreateInfoKHR ) + , pNext( nullptr ) + , flags( flags_ ) + , descriptorUpdateEntryCount( descriptorUpdateEntryCount_ ) + , pDescriptorUpdateEntries( pDescriptorUpdateEntries_ ) + , templateType( templateType_ ) + , descriptorSetLayout( descriptorSetLayout_ ) + , pipelineBindPoint( pipelineBindPoint_ ) + , pipelineLayout( pipelineLayout_ ) + , set( set_ ) + { + } + + DescriptorUpdateTemplateCreateInfoKHR( VkDescriptorUpdateTemplateCreateInfoKHR const & rhs ) + { + memcpy( this, &rhs, sizeof(DescriptorUpdateTemplateCreateInfoKHR) ); + } + + DescriptorUpdateTemplateCreateInfoKHR& operator=( VkDescriptorUpdateTemplateCreateInfoKHR const & rhs ) + { + memcpy( this, &rhs, sizeof(DescriptorUpdateTemplateCreateInfoKHR) ); + return *this; + } + + DescriptorUpdateTemplateCreateInfoKHR& setPNext( void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + DescriptorUpdateTemplateCreateInfoKHR& setFlags( DescriptorUpdateTemplateCreateFlagsKHR flags_ ) + { + flags = flags_; + return *this; + } + + DescriptorUpdateTemplateCreateInfoKHR& setDescriptorUpdateEntryCount( uint32_t descriptorUpdateEntryCount_ ) + { + descriptorUpdateEntryCount = descriptorUpdateEntryCount_; + return *this; + } + + DescriptorUpdateTemplateCreateInfoKHR& setPDescriptorUpdateEntries( const DescriptorUpdateTemplateEntryKHR* pDescriptorUpdateEntries_ ) + { + pDescriptorUpdateEntries = pDescriptorUpdateEntries_; + return *this; + } + + DescriptorUpdateTemplateCreateInfoKHR& setTemplateType( DescriptorUpdateTemplateTypeKHR templateType_ ) + { + templateType = templateType_; + return *this; + } + + DescriptorUpdateTemplateCreateInfoKHR& setDescriptorSetLayout( DescriptorSetLayout descriptorSetLayout_ ) + { + descriptorSetLayout = descriptorSetLayout_; + return *this; + } + + DescriptorUpdateTemplateCreateInfoKHR& setPipelineBindPoint( PipelineBindPoint pipelineBindPoint_ ) + { + pipelineBindPoint = pipelineBindPoint_; + return *this; + } + + DescriptorUpdateTemplateCreateInfoKHR& setPipelineLayout( PipelineLayout pipelineLayout_ ) + { + pipelineLayout = pipelineLayout_; + return *this; + } + + DescriptorUpdateTemplateCreateInfoKHR& setSet( uint32_t set_ ) + { + set = set_; + return *this; + } + + operator const VkDescriptorUpdateTemplateCreateInfoKHR&() const + { + return *reinterpret_cast<const VkDescriptorUpdateTemplateCreateInfoKHR*>(this); + } + + bool operator==( DescriptorUpdateTemplateCreateInfoKHR const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( flags == rhs.flags ) + && ( descriptorUpdateEntryCount == rhs.descriptorUpdateEntryCount ) + && ( pDescriptorUpdateEntries == rhs.pDescriptorUpdateEntries ) + && ( templateType == rhs.templateType ) + && ( descriptorSetLayout == rhs.descriptorSetLayout ) + && ( pipelineBindPoint == rhs.pipelineBindPoint ) + && ( pipelineLayout == rhs.pipelineLayout ) + && ( set == rhs.set ); + } + + bool operator!=( DescriptorUpdateTemplateCreateInfoKHR const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + void* pNext; + DescriptorUpdateTemplateCreateFlagsKHR flags; + uint32_t descriptorUpdateEntryCount; + const DescriptorUpdateTemplateEntryKHR* pDescriptorUpdateEntries; + DescriptorUpdateTemplateTypeKHR templateType; + DescriptorSetLayout descriptorSetLayout; + PipelineBindPoint pipelineBindPoint; + PipelineLayout pipelineLayout; + uint32_t set; + }; + static_assert( sizeof( DescriptorUpdateTemplateCreateInfoKHR ) == sizeof( VkDescriptorUpdateTemplateCreateInfoKHR ), "struct and wrapper have different size!" ); + enum class QueueFlagBits { eGraphics = VK_QUEUE_GRAPHICS_BIT, @@ -9916,7 +11953,8 @@ namespace vk enum class MemoryHeapFlagBits { - eDeviceLocal = VK_MEMORY_HEAP_DEVICE_LOCAL_BIT + eDeviceLocal = VK_MEMORY_HEAP_DEVICE_LOCAL_BIT, + eMultiInstanceKHX = VK_MEMORY_HEAP_MULTI_INSTANCE_BIT_KHX }; using MemoryHeapFlags = Flags<MemoryHeapFlagBits, VkMemoryHeapFlags>; @@ -9935,7 +11973,7 @@ namespace vk { enum { - allFlags = VkFlags(MemoryHeapFlagBits::eDeviceLocal) + allFlags = VkFlags(MemoryHeapFlagBits::eDeviceLocal) | VkFlags(MemoryHeapFlagBits::eMultiInstanceKHX) }; }; @@ -10513,82 +12551,6 @@ namespace vk }; static_assert( sizeof( DescriptorSetLayoutBinding ) == sizeof( VkDescriptorSetLayoutBinding ), "struct and wrapper have different size!" ); - struct DescriptorSetLayoutCreateInfo - { - DescriptorSetLayoutCreateInfo( DescriptorSetLayoutCreateFlags flags_ = DescriptorSetLayoutCreateFlags(), uint32_t bindingCount_ = 0, const DescriptorSetLayoutBinding* pBindings_ = nullptr ) - : sType( StructureType::eDescriptorSetLayoutCreateInfo ) - , pNext( nullptr ) - , flags( flags_ ) - , bindingCount( bindingCount_ ) - , pBindings( pBindings_ ) - { - } - - DescriptorSetLayoutCreateInfo( VkDescriptorSetLayoutCreateInfo const & rhs ) - { - memcpy( this, &rhs, sizeof(DescriptorSetLayoutCreateInfo) ); - } - - DescriptorSetLayoutCreateInfo& operator=( VkDescriptorSetLayoutCreateInfo const & rhs ) - { - memcpy( this, &rhs, sizeof(DescriptorSetLayoutCreateInfo) ); - return *this; - } - - DescriptorSetLayoutCreateInfo& setPNext( const void* pNext_ ) - { - pNext = pNext_; - return *this; - } - - DescriptorSetLayoutCreateInfo& setFlags( DescriptorSetLayoutCreateFlags flags_ ) - { - flags = flags_; - return *this; - } - - DescriptorSetLayoutCreateInfo& setBindingCount( uint32_t bindingCount_ ) - { - bindingCount = bindingCount_; - return *this; - } - - DescriptorSetLayoutCreateInfo& setPBindings( const DescriptorSetLayoutBinding* pBindings_ ) - { - pBindings = pBindings_; - return *this; - } - - operator const VkDescriptorSetLayoutCreateInfo&() const - { - return *reinterpret_cast<const VkDescriptorSetLayoutCreateInfo*>(this); - } - - bool operator==( DescriptorSetLayoutCreateInfo const& rhs ) const - { - return ( sType == rhs.sType ) - && ( pNext == rhs.pNext ) - && ( flags == rhs.flags ) - && ( bindingCount == rhs.bindingCount ) - && ( pBindings == rhs.pBindings ); - } - - bool operator!=( DescriptorSetLayoutCreateInfo const& rhs ) const - { - return !operator==( rhs ); - } - - private: - StructureType sType; - - public: - const void* pNext; - DescriptorSetLayoutCreateFlags flags; - uint32_t bindingCount; - const DescriptorSetLayoutBinding* pBindings; - }; - static_assert( sizeof( DescriptorSetLayoutCreateInfo ) == sizeof( VkDescriptorSetLayoutCreateInfo ), "struct and wrapper have different size!" ); - struct PipelineShaderStageCreateInfo { PipelineShaderStageCreateInfo( PipelineShaderStageCreateFlags flags_ = PipelineShaderStageCreateFlags(), ShaderStageFlagBits stage_ = ShaderStageFlagBits::eVertex, ShaderModule module_ = ShaderModule(), const char* pName_ = nullptr, const SpecializationInfo* pSpecializationInfo_ = nullptr ) @@ -10877,6 +12839,7 @@ namespace vk eSparseAliased = VK_IMAGE_CREATE_SPARSE_ALIASED_BIT, eMutableFormat = VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT, eCubeCompatible = VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, + eBindSfrKHX = VK_IMAGE_CREATE_BIND_SFR_BIT_KHX, e2DArrayCompatibleKHR = VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR }; @@ -10896,7 +12859,7 @@ namespace vk { enum { - allFlags = VkFlags(ImageCreateFlagBits::eSparseBinding) | VkFlags(ImageCreateFlagBits::eSparseResidency) | VkFlags(ImageCreateFlagBits::eSparseAliased) | VkFlags(ImageCreateFlagBits::eMutableFormat) | VkFlags(ImageCreateFlagBits::eCubeCompatible) | VkFlags(ImageCreateFlagBits::e2DArrayCompatibleKHR) + allFlags = VkFlags(ImageCreateFlagBits::eSparseBinding) | VkFlags(ImageCreateFlagBits::eSparseResidency) | VkFlags(ImageCreateFlagBits::eSparseAliased) | VkFlags(ImageCreateFlagBits::eMutableFormat) | VkFlags(ImageCreateFlagBits::eCubeCompatible) | VkFlags(ImageCreateFlagBits::eBindSfrKHX) | VkFlags(ImageCreateFlagBits::e2DArrayCompatibleKHR) }; }; @@ -10994,11 +12957,107 @@ namespace vk }; static_assert( sizeof( PhysicalDeviceImageFormatInfo2KHR ) == sizeof( VkPhysicalDeviceImageFormatInfo2KHR ), "struct and wrapper have different size!" ); + struct PhysicalDeviceImageFormatInfo2KHX + { + PhysicalDeviceImageFormatInfo2KHX( Format format_ = Format::eUndefined, ImageType type_ = ImageType::e1D, ImageTiling tiling_ = ImageTiling::eOptimal, ImageUsageFlags usage_ = ImageUsageFlags(), ImageCreateFlags flags_ = ImageCreateFlags() ) + : sType( StructureType::ePhysicalDeviceImageFormatInfo2KHX ) + , pNext( nullptr ) + , format( format_ ) + , type( type_ ) + , tiling( tiling_ ) + , usage( usage_ ) + , flags( flags_ ) + { + } + + PhysicalDeviceImageFormatInfo2KHX( VkPhysicalDeviceImageFormatInfo2KHX const & rhs ) + { + memcpy( this, &rhs, sizeof(PhysicalDeviceImageFormatInfo2KHX) ); + } + + PhysicalDeviceImageFormatInfo2KHX& operator=( VkPhysicalDeviceImageFormatInfo2KHX const & rhs ) + { + memcpy( this, &rhs, sizeof(PhysicalDeviceImageFormatInfo2KHX) ); + return *this; + } + + PhysicalDeviceImageFormatInfo2KHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + PhysicalDeviceImageFormatInfo2KHX& setFormat( Format format_ ) + { + format = format_; + return *this; + } + + PhysicalDeviceImageFormatInfo2KHX& setType( ImageType type_ ) + { + type = type_; + return *this; + } + + PhysicalDeviceImageFormatInfo2KHX& setTiling( ImageTiling tiling_ ) + { + tiling = tiling_; + return *this; + } + + PhysicalDeviceImageFormatInfo2KHX& setUsage( ImageUsageFlags usage_ ) + { + usage = usage_; + return *this; + } + + PhysicalDeviceImageFormatInfo2KHX& setFlags( ImageCreateFlags flags_ ) + { + flags = flags_; + return *this; + } + + operator const VkPhysicalDeviceImageFormatInfo2KHX&() const + { + return *reinterpret_cast<const VkPhysicalDeviceImageFormatInfo2KHX*>(this); + } + + bool operator==( PhysicalDeviceImageFormatInfo2KHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( format == rhs.format ) + && ( type == rhs.type ) + && ( tiling == rhs.tiling ) + && ( usage == rhs.usage ) + && ( flags == rhs.flags ); + } + + bool operator!=( PhysicalDeviceImageFormatInfo2KHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + Format format; + ImageType type; + ImageTiling tiling; + ImageUsageFlags usage; + ImageCreateFlags flags; + }; + static_assert( sizeof( PhysicalDeviceImageFormatInfo2KHX ) == sizeof( VkPhysicalDeviceImageFormatInfo2KHX ), "struct and wrapper have different size!" ); + enum class PipelineCreateFlagBits { eDisableOptimization = VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT, eAllowDerivatives = VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT, - eDerivative = VK_PIPELINE_CREATE_DERIVATIVE_BIT + eDerivative = VK_PIPELINE_CREATE_DERIVATIVE_BIT, + eViewIndexFromDeviceIndexKHX = VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT_KHX, + eDispatchBaseKHX = VK_PIPELINE_CREATE_DISPATCH_BASE_KHX }; using PipelineCreateFlags = Flags<PipelineCreateFlagBits, VkPipelineCreateFlags>; @@ -11017,7 +13076,7 @@ namespace vk { enum { - allFlags = VkFlags(PipelineCreateFlagBits::eDisableOptimization) | VkFlags(PipelineCreateFlagBits::eAllowDerivatives) | VkFlags(PipelineCreateFlagBits::eDerivative) + allFlags = VkFlags(PipelineCreateFlagBits::eDisableOptimization) | VkFlags(PipelineCreateFlagBits::eAllowDerivatives) | VkFlags(PipelineCreateFlagBits::eDerivative) | VkFlags(PipelineCreateFlagBits::eViewIndexFromDeviceIndexKHX) | VkFlags(PipelineCreateFlagBits::eDispatchBaseKHX) }; }; @@ -14491,6 +16550,62 @@ namespace vk }; static_assert( sizeof( PhysicalDeviceSparseImageFormatInfo2KHR ) == sizeof( VkPhysicalDeviceSparseImageFormatInfo2KHR ), "struct and wrapper have different size!" ); + struct PhysicalDeviceProperties2KHX + { + operator const VkPhysicalDeviceProperties2KHX&() const + { + return *reinterpret_cast<const VkPhysicalDeviceProperties2KHX*>(this); + } + + bool operator==( PhysicalDeviceProperties2KHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( properties == rhs.properties ); + } + + bool operator!=( PhysicalDeviceProperties2KHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + void* pNext; + PhysicalDeviceProperties properties; + }; + static_assert( sizeof( PhysicalDeviceProperties2KHX ) == sizeof( VkPhysicalDeviceProperties2KHX ), "struct and wrapper have different size!" ); + + struct ImageFormatProperties2KHX + { + operator const VkImageFormatProperties2KHX&() const + { + return *reinterpret_cast<const VkImageFormatProperties2KHX*>(this); + } + + bool operator==( ImageFormatProperties2KHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( imageFormatProperties == rhs.imageFormatProperties ); + } + + bool operator!=( ImageFormatProperties2KHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + void* pNext; + ImageFormatProperties imageFormatProperties; + }; + static_assert( sizeof( ImageFormatProperties2KHX ) == sizeof( VkImageFormatProperties2KHX ), "struct and wrapper have different size!" ); + enum class AttachmentDescriptionFlagBits { eMayAlias = VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT @@ -14770,7 +16885,9 @@ namespace vk enum class DependencyFlagBits { - eByRegion = VK_DEPENDENCY_BY_REGION_BIT + eByRegion = VK_DEPENDENCY_BY_REGION_BIT, + eViewLocalKHX = VK_DEPENDENCY_VIEW_LOCAL_BIT_KHX, + eDeviceGroupKHX = VK_DEPENDENCY_DEVICE_GROUP_BIT_KHX }; using DependencyFlags = Flags<DependencyFlagBits, VkDependencyFlags>; @@ -14789,7 +16906,7 @@ namespace vk { enum { - allFlags = VkFlags(DependencyFlagBits::eByRegion) + allFlags = VkFlags(DependencyFlagBits::eByRegion) | VkFlags(DependencyFlagBits::eViewLocalKHX) | VkFlags(DependencyFlagBits::eDeviceGroupKHX) }; }; @@ -14890,118 +17007,6 @@ namespace vk }; static_assert( sizeof( SubpassDependency ) == sizeof( VkSubpassDependency ), "struct and wrapper have different size!" ); - struct RenderPassCreateInfo - { - RenderPassCreateInfo( RenderPassCreateFlags flags_ = RenderPassCreateFlags(), uint32_t attachmentCount_ = 0, const AttachmentDescription* pAttachments_ = nullptr, uint32_t subpassCount_ = 0, const SubpassDescription* pSubpasses_ = nullptr, uint32_t dependencyCount_ = 0, const SubpassDependency* pDependencies_ = nullptr ) - : sType( StructureType::eRenderPassCreateInfo ) - , pNext( nullptr ) - , flags( flags_ ) - , attachmentCount( attachmentCount_ ) - , pAttachments( pAttachments_ ) - , subpassCount( subpassCount_ ) - , pSubpasses( pSubpasses_ ) - , dependencyCount( dependencyCount_ ) - , pDependencies( pDependencies_ ) - { - } - - RenderPassCreateInfo( VkRenderPassCreateInfo const & rhs ) - { - memcpy( this, &rhs, sizeof(RenderPassCreateInfo) ); - } - - RenderPassCreateInfo& operator=( VkRenderPassCreateInfo const & rhs ) - { - memcpy( this, &rhs, sizeof(RenderPassCreateInfo) ); - return *this; - } - - RenderPassCreateInfo& setPNext( const void* pNext_ ) - { - pNext = pNext_; - return *this; - } - - RenderPassCreateInfo& setFlags( RenderPassCreateFlags flags_ ) - { - flags = flags_; - return *this; - } - - RenderPassCreateInfo& setAttachmentCount( uint32_t attachmentCount_ ) - { - attachmentCount = attachmentCount_; - return *this; - } - - RenderPassCreateInfo& setPAttachments( const AttachmentDescription* pAttachments_ ) - { - pAttachments = pAttachments_; - return *this; - } - - RenderPassCreateInfo& setSubpassCount( uint32_t subpassCount_ ) - { - subpassCount = subpassCount_; - return *this; - } - - RenderPassCreateInfo& setPSubpasses( const SubpassDescription* pSubpasses_ ) - { - pSubpasses = pSubpasses_; - return *this; - } - - RenderPassCreateInfo& setDependencyCount( uint32_t dependencyCount_ ) - { - dependencyCount = dependencyCount_; - return *this; - } - - RenderPassCreateInfo& setPDependencies( const SubpassDependency* pDependencies_ ) - { - pDependencies = pDependencies_; - return *this; - } - - operator const VkRenderPassCreateInfo&() const - { - return *reinterpret_cast<const VkRenderPassCreateInfo*>(this); - } - - bool operator==( RenderPassCreateInfo const& rhs ) const - { - return ( sType == rhs.sType ) - && ( pNext == rhs.pNext ) - && ( flags == rhs.flags ) - && ( attachmentCount == rhs.attachmentCount ) - && ( pAttachments == rhs.pAttachments ) - && ( subpassCount == rhs.subpassCount ) - && ( pSubpasses == rhs.pSubpasses ) - && ( dependencyCount == rhs.dependencyCount ) - && ( pDependencies == rhs.pDependencies ); - } - - bool operator!=( RenderPassCreateInfo const& rhs ) const - { - return !operator==( rhs ); - } - - private: - StructureType sType; - - public: - const void* pNext; - RenderPassCreateFlags flags; - uint32_t attachmentCount; - const AttachmentDescription* pAttachments; - uint32_t subpassCount; - const SubpassDescription* pSubpasses; - uint32_t dependencyCount; - const SubpassDependency* pDependencies; - }; - static_assert( sizeof( RenderPassCreateInfo ) == sizeof( VkRenderPassCreateInfo ), "struct and wrapper have different size!" ); - enum class PresentModeKHR { eImmediate = VK_PRESENT_MODE_IMMEDIATE_KHR, @@ -15357,199 +17362,6 @@ namespace vk }; static_assert( sizeof( SurfaceCapabilitiesKHR ) == sizeof( VkSurfaceCapabilitiesKHR ), "struct and wrapper have different size!" ); - struct SwapchainCreateInfoKHR - { - SwapchainCreateInfoKHR( SwapchainCreateFlagsKHR flags_ = SwapchainCreateFlagsKHR(), SurfaceKHR surface_ = SurfaceKHR(), uint32_t minImageCount_ = 0, Format imageFormat_ = Format::eUndefined, ColorSpaceKHR imageColorSpace_ = ColorSpaceKHR::eSrgbNonlinear, Extent2D imageExtent_ = Extent2D(), uint32_t imageArrayLayers_ = 0, ImageUsageFlags imageUsage_ = ImageUsageFlags(), SharingMode imageSharingMode_ = SharingMode::eExclusive, uint32_t queueFamilyIndexCount_ = 0, const uint32_t* pQueueFamilyIndices_ = nullptr, SurfaceTransformFlagBitsKHR preTransform_ = SurfaceTransformFlagBitsKHR::eIdentity, CompositeAlphaFlagBitsKHR compositeAlpha_ = CompositeAlphaFlagBitsKHR::eOpaque, PresentModeKHR presentMode_ = PresentModeKHR::eImmediate, Bool32 clipped_ = 0, SwapchainKHR oldSwapchain_ = SwapchainKHR() ) - : sType( StructureType::eSwapchainCreateInfoKHR ) - , pNext( nullptr ) - , flags( flags_ ) - , surface( surface_ ) - , minImageCount( minImageCount_ ) - , imageFormat( imageFormat_ ) - , imageColorSpace( imageColorSpace_ ) - , imageExtent( imageExtent_ ) - , imageArrayLayers( imageArrayLayers_ ) - , imageUsage( imageUsage_ ) - , imageSharingMode( imageSharingMode_ ) - , queueFamilyIndexCount( queueFamilyIndexCount_ ) - , pQueueFamilyIndices( pQueueFamilyIndices_ ) - , preTransform( preTransform_ ) - , compositeAlpha( compositeAlpha_ ) - , presentMode( presentMode_ ) - , clipped( clipped_ ) - , oldSwapchain( oldSwapchain_ ) - { - } - - SwapchainCreateInfoKHR( VkSwapchainCreateInfoKHR const & rhs ) - { - memcpy( this, &rhs, sizeof(SwapchainCreateInfoKHR) ); - } - - SwapchainCreateInfoKHR& operator=( VkSwapchainCreateInfoKHR const & rhs ) - { - memcpy( this, &rhs, sizeof(SwapchainCreateInfoKHR) ); - return *this; - } - - SwapchainCreateInfoKHR& setPNext( const void* pNext_ ) - { - pNext = pNext_; - return *this; - } - - SwapchainCreateInfoKHR& setFlags( SwapchainCreateFlagsKHR flags_ ) - { - flags = flags_; - return *this; - } - - SwapchainCreateInfoKHR& setSurface( SurfaceKHR surface_ ) - { - surface = surface_; - return *this; - } - - SwapchainCreateInfoKHR& setMinImageCount( uint32_t minImageCount_ ) - { - minImageCount = minImageCount_; - return *this; - } - - SwapchainCreateInfoKHR& setImageFormat( Format imageFormat_ ) - { - imageFormat = imageFormat_; - return *this; - } - - SwapchainCreateInfoKHR& setImageColorSpace( ColorSpaceKHR imageColorSpace_ ) - { - imageColorSpace = imageColorSpace_; - return *this; - } - - SwapchainCreateInfoKHR& setImageExtent( Extent2D imageExtent_ ) - { - imageExtent = imageExtent_; - return *this; - } - - SwapchainCreateInfoKHR& setImageArrayLayers( uint32_t imageArrayLayers_ ) - { - imageArrayLayers = imageArrayLayers_; - return *this; - } - - SwapchainCreateInfoKHR& setImageUsage( ImageUsageFlags imageUsage_ ) - { - imageUsage = imageUsage_; - return *this; - } - - SwapchainCreateInfoKHR& setImageSharingMode( SharingMode imageSharingMode_ ) - { - imageSharingMode = imageSharingMode_; - return *this; - } - - SwapchainCreateInfoKHR& setQueueFamilyIndexCount( uint32_t queueFamilyIndexCount_ ) - { - queueFamilyIndexCount = queueFamilyIndexCount_; - return *this; - } - - SwapchainCreateInfoKHR& setPQueueFamilyIndices( const uint32_t* pQueueFamilyIndices_ ) - { - pQueueFamilyIndices = pQueueFamilyIndices_; - return *this; - } - - SwapchainCreateInfoKHR& setPreTransform( SurfaceTransformFlagBitsKHR preTransform_ ) - { - preTransform = preTransform_; - return *this; - } - - SwapchainCreateInfoKHR& setCompositeAlpha( CompositeAlphaFlagBitsKHR compositeAlpha_ ) - { - compositeAlpha = compositeAlpha_; - return *this; - } - - SwapchainCreateInfoKHR& setPresentMode( PresentModeKHR presentMode_ ) - { - presentMode = presentMode_; - return *this; - } - - SwapchainCreateInfoKHR& setClipped( Bool32 clipped_ ) - { - clipped = clipped_; - return *this; - } - - SwapchainCreateInfoKHR& setOldSwapchain( SwapchainKHR oldSwapchain_ ) - { - oldSwapchain = oldSwapchain_; - return *this; - } - - operator const VkSwapchainCreateInfoKHR&() const - { - return *reinterpret_cast<const VkSwapchainCreateInfoKHR*>(this); - } - - bool operator==( SwapchainCreateInfoKHR const& rhs ) const - { - return ( sType == rhs.sType ) - && ( pNext == rhs.pNext ) - && ( flags == rhs.flags ) - && ( surface == rhs.surface ) - && ( minImageCount == rhs.minImageCount ) - && ( imageFormat == rhs.imageFormat ) - && ( imageColorSpace == rhs.imageColorSpace ) - && ( imageExtent == rhs.imageExtent ) - && ( imageArrayLayers == rhs.imageArrayLayers ) - && ( imageUsage == rhs.imageUsage ) - && ( imageSharingMode == rhs.imageSharingMode ) - && ( queueFamilyIndexCount == rhs.queueFamilyIndexCount ) - && ( pQueueFamilyIndices == rhs.pQueueFamilyIndices ) - && ( preTransform == rhs.preTransform ) - && ( compositeAlpha == rhs.compositeAlpha ) - && ( presentMode == rhs.presentMode ) - && ( clipped == rhs.clipped ) - && ( oldSwapchain == rhs.oldSwapchain ); - } - - bool operator!=( SwapchainCreateInfoKHR const& rhs ) const - { - return !operator==( rhs ); - } - - private: - StructureType sType; - - public: - const void* pNext; - SwapchainCreateFlagsKHR flags; - SurfaceKHR surface; - uint32_t minImageCount; - Format imageFormat; - ColorSpaceKHR imageColorSpace; - Extent2D imageExtent; - uint32_t imageArrayLayers; - ImageUsageFlags imageUsage; - SharingMode imageSharingMode; - uint32_t queueFamilyIndexCount; - const uint32_t* pQueueFamilyIndices; - SurfaceTransformFlagBitsKHR preTransform; - CompositeAlphaFlagBitsKHR compositeAlpha; - PresentModeKHR presentMode; - Bool32 clipped; - SwapchainKHR oldSwapchain; - }; - static_assert( sizeof( SwapchainCreateInfoKHR ) == sizeof( VkSwapchainCreateInfoKHR ), "struct and wrapper have different size!" ); - enum class DebugReportFlagBitsEXT { eInformation = VK_DEBUG_REPORT_INFORMATION_BIT_EXT, @@ -17076,6 +18888,1047 @@ namespace vk }; static_assert( sizeof( ObjectTablePushConstantEntryNVX ) == sizeof( VkObjectTablePushConstantEntryNVX ), "struct and wrapper have different size!" ); + enum class DescriptorSetLayoutCreateFlagBits + { + ePushDescriptorKHR = VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR + }; + + using DescriptorSetLayoutCreateFlags = Flags<DescriptorSetLayoutCreateFlagBits, VkDescriptorSetLayoutCreateFlags>; + + VULKAN_HPP_INLINE DescriptorSetLayoutCreateFlags operator|( DescriptorSetLayoutCreateFlagBits bit0, DescriptorSetLayoutCreateFlagBits bit1 ) + { + return DescriptorSetLayoutCreateFlags( bit0 ) | bit1; + } + + VULKAN_HPP_INLINE DescriptorSetLayoutCreateFlags operator~( DescriptorSetLayoutCreateFlagBits bits ) + { + return ~( DescriptorSetLayoutCreateFlags( bits ) ); + } + + template <> struct FlagTraits<DescriptorSetLayoutCreateFlagBits> + { + enum + { + allFlags = VkFlags(DescriptorSetLayoutCreateFlagBits::ePushDescriptorKHR) + }; + }; + + struct DescriptorSetLayoutCreateInfo + { + DescriptorSetLayoutCreateInfo( DescriptorSetLayoutCreateFlags flags_ = DescriptorSetLayoutCreateFlags(), uint32_t bindingCount_ = 0, const DescriptorSetLayoutBinding* pBindings_ = nullptr ) + : sType( StructureType::eDescriptorSetLayoutCreateInfo ) + , pNext( nullptr ) + , flags( flags_ ) + , bindingCount( bindingCount_ ) + , pBindings( pBindings_ ) + { + } + + DescriptorSetLayoutCreateInfo( VkDescriptorSetLayoutCreateInfo const & rhs ) + { + memcpy( this, &rhs, sizeof(DescriptorSetLayoutCreateInfo) ); + } + + DescriptorSetLayoutCreateInfo& operator=( VkDescriptorSetLayoutCreateInfo const & rhs ) + { + memcpy( this, &rhs, sizeof(DescriptorSetLayoutCreateInfo) ); + return *this; + } + + DescriptorSetLayoutCreateInfo& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + DescriptorSetLayoutCreateInfo& setFlags( DescriptorSetLayoutCreateFlags flags_ ) + { + flags = flags_; + return *this; + } + + DescriptorSetLayoutCreateInfo& setBindingCount( uint32_t bindingCount_ ) + { + bindingCount = bindingCount_; + return *this; + } + + DescriptorSetLayoutCreateInfo& setPBindings( const DescriptorSetLayoutBinding* pBindings_ ) + { + pBindings = pBindings_; + return *this; + } + + operator const VkDescriptorSetLayoutCreateInfo&() const + { + return *reinterpret_cast<const VkDescriptorSetLayoutCreateInfo*>(this); + } + + bool operator==( DescriptorSetLayoutCreateInfo const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( flags == rhs.flags ) + && ( bindingCount == rhs.bindingCount ) + && ( pBindings == rhs.pBindings ); + } + + bool operator!=( DescriptorSetLayoutCreateInfo const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + DescriptorSetLayoutCreateFlags flags; + uint32_t bindingCount; + const DescriptorSetLayoutBinding* pBindings; + }; + static_assert( sizeof( DescriptorSetLayoutCreateInfo ) == sizeof( VkDescriptorSetLayoutCreateInfo ), "struct and wrapper have different size!" ); + + enum class ExternalMemoryHandleTypeFlagBitsKHX + { + eOpaqueFd = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHX, + eOpaqueWin32 = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHX, + eOpaqueWin32Kmt = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHX, + eD3D11Texture = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT_KHX, + eD3D11TextureKmt = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT_KHX, + eD3D12Heap = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT_KHX, + eD3D12Resource = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT_KHX + }; + + using ExternalMemoryHandleTypeFlagsKHX = Flags<ExternalMemoryHandleTypeFlagBitsKHX, VkExternalMemoryHandleTypeFlagsKHX>; + + VULKAN_HPP_INLINE ExternalMemoryHandleTypeFlagsKHX operator|( ExternalMemoryHandleTypeFlagBitsKHX bit0, ExternalMemoryHandleTypeFlagBitsKHX bit1 ) + { + return ExternalMemoryHandleTypeFlagsKHX( bit0 ) | bit1; + } + + VULKAN_HPP_INLINE ExternalMemoryHandleTypeFlagsKHX operator~( ExternalMemoryHandleTypeFlagBitsKHX bits ) + { + return ~( ExternalMemoryHandleTypeFlagsKHX( bits ) ); + } + + template <> struct FlagTraits<ExternalMemoryHandleTypeFlagBitsKHX> + { + enum + { + allFlags = VkFlags(ExternalMemoryHandleTypeFlagBitsKHX::eOpaqueFd) | VkFlags(ExternalMemoryHandleTypeFlagBitsKHX::eOpaqueWin32) | VkFlags(ExternalMemoryHandleTypeFlagBitsKHX::eOpaqueWin32Kmt) | VkFlags(ExternalMemoryHandleTypeFlagBitsKHX::eD3D11Texture) | VkFlags(ExternalMemoryHandleTypeFlagBitsKHX::eD3D11TextureKmt) | VkFlags(ExternalMemoryHandleTypeFlagBitsKHX::eD3D12Heap) | VkFlags(ExternalMemoryHandleTypeFlagBitsKHX::eD3D12Resource) + }; + }; + + struct PhysicalDeviceExternalImageFormatInfoKHX + { + PhysicalDeviceExternalImageFormatInfoKHX( ExternalMemoryHandleTypeFlagBitsKHX handleType_ = ExternalMemoryHandleTypeFlagBitsKHX::eOpaqueFd ) + : sType( StructureType::ePhysicalDeviceExternalImageFormatInfoKHX ) + , pNext( nullptr ) + , handleType( handleType_ ) + { + } + + PhysicalDeviceExternalImageFormatInfoKHX( VkPhysicalDeviceExternalImageFormatInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(PhysicalDeviceExternalImageFormatInfoKHX) ); + } + + PhysicalDeviceExternalImageFormatInfoKHX& operator=( VkPhysicalDeviceExternalImageFormatInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(PhysicalDeviceExternalImageFormatInfoKHX) ); + return *this; + } + + PhysicalDeviceExternalImageFormatInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + PhysicalDeviceExternalImageFormatInfoKHX& setHandleType( ExternalMemoryHandleTypeFlagBitsKHX handleType_ ) + { + handleType = handleType_; + return *this; + } + + operator const VkPhysicalDeviceExternalImageFormatInfoKHX&() const + { + return *reinterpret_cast<const VkPhysicalDeviceExternalImageFormatInfoKHX*>(this); + } + + bool operator==( PhysicalDeviceExternalImageFormatInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( handleType == rhs.handleType ); + } + + bool operator!=( PhysicalDeviceExternalImageFormatInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + ExternalMemoryHandleTypeFlagBitsKHX handleType; + }; + static_assert( sizeof( PhysicalDeviceExternalImageFormatInfoKHX ) == sizeof( VkPhysicalDeviceExternalImageFormatInfoKHX ), "struct and wrapper have different size!" ); + + struct PhysicalDeviceExternalBufferInfoKHX + { + PhysicalDeviceExternalBufferInfoKHX( BufferCreateFlags flags_ = BufferCreateFlags(), BufferUsageFlags usage_ = BufferUsageFlags(), ExternalMemoryHandleTypeFlagBitsKHX handleType_ = ExternalMemoryHandleTypeFlagBitsKHX::eOpaqueFd ) + : sType( StructureType::ePhysicalDeviceExternalBufferInfoKHX ) + , pNext( nullptr ) + , flags( flags_ ) + , usage( usage_ ) + , handleType( handleType_ ) + { + } + + PhysicalDeviceExternalBufferInfoKHX( VkPhysicalDeviceExternalBufferInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(PhysicalDeviceExternalBufferInfoKHX) ); + } + + PhysicalDeviceExternalBufferInfoKHX& operator=( VkPhysicalDeviceExternalBufferInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(PhysicalDeviceExternalBufferInfoKHX) ); + return *this; + } + + PhysicalDeviceExternalBufferInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + PhysicalDeviceExternalBufferInfoKHX& setFlags( BufferCreateFlags flags_ ) + { + flags = flags_; + return *this; + } + + PhysicalDeviceExternalBufferInfoKHX& setUsage( BufferUsageFlags usage_ ) + { + usage = usage_; + return *this; + } + + PhysicalDeviceExternalBufferInfoKHX& setHandleType( ExternalMemoryHandleTypeFlagBitsKHX handleType_ ) + { + handleType = handleType_; + return *this; + } + + operator const VkPhysicalDeviceExternalBufferInfoKHX&() const + { + return *reinterpret_cast<const VkPhysicalDeviceExternalBufferInfoKHX*>(this); + } + + bool operator==( PhysicalDeviceExternalBufferInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( flags == rhs.flags ) + && ( usage == rhs.usage ) + && ( handleType == rhs.handleType ); + } + + bool operator!=( PhysicalDeviceExternalBufferInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + BufferCreateFlags flags; + BufferUsageFlags usage; + ExternalMemoryHandleTypeFlagBitsKHX handleType; + }; + static_assert( sizeof( PhysicalDeviceExternalBufferInfoKHX ) == sizeof( VkPhysicalDeviceExternalBufferInfoKHX ), "struct and wrapper have different size!" ); + + struct ExternalMemoryImageCreateInfoKHX + { + ExternalMemoryImageCreateInfoKHX( ExternalMemoryHandleTypeFlagsKHX handleTypes_ = ExternalMemoryHandleTypeFlagsKHX() ) + : sType( StructureType::eExternalMemoryImageCreateInfoKHX ) + , pNext( nullptr ) + , handleTypes( handleTypes_ ) + { + } + + ExternalMemoryImageCreateInfoKHX( VkExternalMemoryImageCreateInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ExternalMemoryImageCreateInfoKHX) ); + } + + ExternalMemoryImageCreateInfoKHX& operator=( VkExternalMemoryImageCreateInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ExternalMemoryImageCreateInfoKHX) ); + return *this; + } + + ExternalMemoryImageCreateInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + ExternalMemoryImageCreateInfoKHX& setHandleTypes( ExternalMemoryHandleTypeFlagsKHX handleTypes_ ) + { + handleTypes = handleTypes_; + return *this; + } + + operator const VkExternalMemoryImageCreateInfoKHX&() const + { + return *reinterpret_cast<const VkExternalMemoryImageCreateInfoKHX*>(this); + } + + bool operator==( ExternalMemoryImageCreateInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( handleTypes == rhs.handleTypes ); + } + + bool operator!=( ExternalMemoryImageCreateInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + ExternalMemoryHandleTypeFlagsKHX handleTypes; + }; + static_assert( sizeof( ExternalMemoryImageCreateInfoKHX ) == sizeof( VkExternalMemoryImageCreateInfoKHX ), "struct and wrapper have different size!" ); + + struct ExternalMemoryBufferCreateInfoKHX + { + ExternalMemoryBufferCreateInfoKHX( ExternalMemoryHandleTypeFlagsKHX handleTypes_ = ExternalMemoryHandleTypeFlagsKHX() ) + : sType( StructureType::eExternalMemoryBufferCreateInfoKHX ) + , pNext( nullptr ) + , handleTypes( handleTypes_ ) + { + } + + ExternalMemoryBufferCreateInfoKHX( VkExternalMemoryBufferCreateInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ExternalMemoryBufferCreateInfoKHX) ); + } + + ExternalMemoryBufferCreateInfoKHX& operator=( VkExternalMemoryBufferCreateInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ExternalMemoryBufferCreateInfoKHX) ); + return *this; + } + + ExternalMemoryBufferCreateInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + ExternalMemoryBufferCreateInfoKHX& setHandleTypes( ExternalMemoryHandleTypeFlagsKHX handleTypes_ ) + { + handleTypes = handleTypes_; + return *this; + } + + operator const VkExternalMemoryBufferCreateInfoKHX&() const + { + return *reinterpret_cast<const VkExternalMemoryBufferCreateInfoKHX*>(this); + } + + bool operator==( ExternalMemoryBufferCreateInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( handleTypes == rhs.handleTypes ); + } + + bool operator!=( ExternalMemoryBufferCreateInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + ExternalMemoryHandleTypeFlagsKHX handleTypes; + }; + static_assert( sizeof( ExternalMemoryBufferCreateInfoKHX ) == sizeof( VkExternalMemoryBufferCreateInfoKHX ), "struct and wrapper have different size!" ); + + struct ExportMemoryAllocateInfoKHX + { + ExportMemoryAllocateInfoKHX( ExternalMemoryHandleTypeFlagsKHX handleTypes_ = ExternalMemoryHandleTypeFlagsKHX() ) + : sType( StructureType::eExportMemoryAllocateInfoKHX ) + , pNext( nullptr ) + , handleTypes( handleTypes_ ) + { + } + + ExportMemoryAllocateInfoKHX( VkExportMemoryAllocateInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ExportMemoryAllocateInfoKHX) ); + } + + ExportMemoryAllocateInfoKHX& operator=( VkExportMemoryAllocateInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ExportMemoryAllocateInfoKHX) ); + return *this; + } + + ExportMemoryAllocateInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + ExportMemoryAllocateInfoKHX& setHandleTypes( ExternalMemoryHandleTypeFlagsKHX handleTypes_ ) + { + handleTypes = handleTypes_; + return *this; + } + + operator const VkExportMemoryAllocateInfoKHX&() const + { + return *reinterpret_cast<const VkExportMemoryAllocateInfoKHX*>(this); + } + + bool operator==( ExportMemoryAllocateInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( handleTypes == rhs.handleTypes ); + } + + bool operator!=( ExportMemoryAllocateInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + ExternalMemoryHandleTypeFlagsKHX handleTypes; + }; + static_assert( sizeof( ExportMemoryAllocateInfoKHX ) == sizeof( VkExportMemoryAllocateInfoKHX ), "struct and wrapper have different size!" ); + +#ifdef VK_USE_PLATFORM_WIN32_KHR + struct ImportMemoryWin32HandleInfoKHX + { + ImportMemoryWin32HandleInfoKHX( ExternalMemoryHandleTypeFlagBitsKHX handleType_ = ExternalMemoryHandleTypeFlagBitsKHX::eOpaqueFd, HANDLE handle_ = 0 ) + : sType( StructureType::eImportMemoryWin32HandleInfoKHX ) + , pNext( nullptr ) + , handleType( handleType_ ) + , handle( handle_ ) + { + } + + ImportMemoryWin32HandleInfoKHX( VkImportMemoryWin32HandleInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ImportMemoryWin32HandleInfoKHX) ); + } + + ImportMemoryWin32HandleInfoKHX& operator=( VkImportMemoryWin32HandleInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ImportMemoryWin32HandleInfoKHX) ); + return *this; + } + + ImportMemoryWin32HandleInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + ImportMemoryWin32HandleInfoKHX& setHandleType( ExternalMemoryHandleTypeFlagBitsKHX handleType_ ) + { + handleType = handleType_; + return *this; + } + + ImportMemoryWin32HandleInfoKHX& setHandle( HANDLE handle_ ) + { + handle = handle_; + return *this; + } + + operator const VkImportMemoryWin32HandleInfoKHX&() const + { + return *reinterpret_cast<const VkImportMemoryWin32HandleInfoKHX*>(this); + } + + bool operator==( ImportMemoryWin32HandleInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( handleType == rhs.handleType ) + && ( handle == rhs.handle ); + } + + bool operator!=( ImportMemoryWin32HandleInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + ExternalMemoryHandleTypeFlagBitsKHX handleType; + HANDLE handle; + }; + static_assert( sizeof( ImportMemoryWin32HandleInfoKHX ) == sizeof( VkImportMemoryWin32HandleInfoKHX ), "struct and wrapper have different size!" ); +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + + struct ImportMemoryFdInfoKHX + { + ImportMemoryFdInfoKHX( ExternalMemoryHandleTypeFlagBitsKHX handleType_ = ExternalMemoryHandleTypeFlagBitsKHX::eOpaqueFd, int fd_ = 0 ) + : sType( StructureType::eImportMemoryFdInfoKHX ) + , pNext( nullptr ) + , handleType( handleType_ ) + , fd( fd_ ) + { + } + + ImportMemoryFdInfoKHX( VkImportMemoryFdInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ImportMemoryFdInfoKHX) ); + } + + ImportMemoryFdInfoKHX& operator=( VkImportMemoryFdInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ImportMemoryFdInfoKHX) ); + return *this; + } + + ImportMemoryFdInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + ImportMemoryFdInfoKHX& setHandleType( ExternalMemoryHandleTypeFlagBitsKHX handleType_ ) + { + handleType = handleType_; + return *this; + } + + ImportMemoryFdInfoKHX& setFd( int fd_ ) + { + fd = fd_; + return *this; + } + + operator const VkImportMemoryFdInfoKHX&() const + { + return *reinterpret_cast<const VkImportMemoryFdInfoKHX*>(this); + } + + bool operator==( ImportMemoryFdInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( handleType == rhs.handleType ) + && ( fd == rhs.fd ); + } + + bool operator!=( ImportMemoryFdInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + ExternalMemoryHandleTypeFlagBitsKHX handleType; + int fd; + }; + static_assert( sizeof( ImportMemoryFdInfoKHX ) == sizeof( VkImportMemoryFdInfoKHX ), "struct and wrapper have different size!" ); + + enum class ExternalMemoryFeatureFlagBitsKHX + { + eDedicatedOnly = VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_KHX, + eExportable = VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_KHX, + eImportable = VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_KHX + }; + + using ExternalMemoryFeatureFlagsKHX = Flags<ExternalMemoryFeatureFlagBitsKHX, VkExternalMemoryFeatureFlagsKHX>; + + VULKAN_HPP_INLINE ExternalMemoryFeatureFlagsKHX operator|( ExternalMemoryFeatureFlagBitsKHX bit0, ExternalMemoryFeatureFlagBitsKHX bit1 ) + { + return ExternalMemoryFeatureFlagsKHX( bit0 ) | bit1; + } + + VULKAN_HPP_INLINE ExternalMemoryFeatureFlagsKHX operator~( ExternalMemoryFeatureFlagBitsKHX bits ) + { + return ~( ExternalMemoryFeatureFlagsKHX( bits ) ); + } + + template <> struct FlagTraits<ExternalMemoryFeatureFlagBitsKHX> + { + enum + { + allFlags = VkFlags(ExternalMemoryFeatureFlagBitsKHX::eDedicatedOnly) | VkFlags(ExternalMemoryFeatureFlagBitsKHX::eExportable) | VkFlags(ExternalMemoryFeatureFlagBitsKHX::eImportable) + }; + }; + + struct ExternalMemoryPropertiesKHX + { + operator const VkExternalMemoryPropertiesKHX&() const + { + return *reinterpret_cast<const VkExternalMemoryPropertiesKHX*>(this); + } + + bool operator==( ExternalMemoryPropertiesKHX const& rhs ) const + { + return ( externalMemoryFeatures == rhs.externalMemoryFeatures ) + && ( exportFromImportedHandleTypes == rhs.exportFromImportedHandleTypes ) + && ( compatibleHandleTypes == rhs.compatibleHandleTypes ); + } + + bool operator!=( ExternalMemoryPropertiesKHX const& rhs ) const + { + return !operator==( rhs ); + } + + ExternalMemoryFeatureFlagsKHX externalMemoryFeatures; + ExternalMemoryHandleTypeFlagsKHX exportFromImportedHandleTypes; + ExternalMemoryHandleTypeFlagsKHX compatibleHandleTypes; + }; + static_assert( sizeof( ExternalMemoryPropertiesKHX ) == sizeof( VkExternalMemoryPropertiesKHX ), "struct and wrapper have different size!" ); + + struct ExternalImageFormatPropertiesKHX + { + operator const VkExternalImageFormatPropertiesKHX&() const + { + return *reinterpret_cast<const VkExternalImageFormatPropertiesKHX*>(this); + } + + bool operator==( ExternalImageFormatPropertiesKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( externalMemoryProperties == rhs.externalMemoryProperties ); + } + + bool operator!=( ExternalImageFormatPropertiesKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + void* pNext; + ExternalMemoryPropertiesKHX externalMemoryProperties; + }; + static_assert( sizeof( ExternalImageFormatPropertiesKHX ) == sizeof( VkExternalImageFormatPropertiesKHX ), "struct and wrapper have different size!" ); + + struct ExternalBufferPropertiesKHX + { + operator const VkExternalBufferPropertiesKHX&() const + { + return *reinterpret_cast<const VkExternalBufferPropertiesKHX*>(this); + } + + bool operator==( ExternalBufferPropertiesKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( externalMemoryProperties == rhs.externalMemoryProperties ); + } + + bool operator!=( ExternalBufferPropertiesKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + void* pNext; + ExternalMemoryPropertiesKHX externalMemoryProperties; + }; + static_assert( sizeof( ExternalBufferPropertiesKHX ) == sizeof( VkExternalBufferPropertiesKHX ), "struct and wrapper have different size!" ); + + enum class ExternalSemaphoreHandleTypeFlagBitsKHX + { + eOpaqueFd = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT_KHX, + eOpaqueWin32 = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHX, + eOpaqueWin32Kmt = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHX, + eD3D12Fence = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT_KHX, + eFenceFd = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_FENCE_FD_BIT_KHX + }; + + using ExternalSemaphoreHandleTypeFlagsKHX = Flags<ExternalSemaphoreHandleTypeFlagBitsKHX, VkExternalSemaphoreHandleTypeFlagsKHX>; + + VULKAN_HPP_INLINE ExternalSemaphoreHandleTypeFlagsKHX operator|( ExternalSemaphoreHandleTypeFlagBitsKHX bit0, ExternalSemaphoreHandleTypeFlagBitsKHX bit1 ) + { + return ExternalSemaphoreHandleTypeFlagsKHX( bit0 ) | bit1; + } + + VULKAN_HPP_INLINE ExternalSemaphoreHandleTypeFlagsKHX operator~( ExternalSemaphoreHandleTypeFlagBitsKHX bits ) + { + return ~( ExternalSemaphoreHandleTypeFlagsKHX( bits ) ); + } + + template <> struct FlagTraits<ExternalSemaphoreHandleTypeFlagBitsKHX> + { + enum + { + allFlags = VkFlags(ExternalSemaphoreHandleTypeFlagBitsKHX::eOpaqueFd) | VkFlags(ExternalSemaphoreHandleTypeFlagBitsKHX::eOpaqueWin32) | VkFlags(ExternalSemaphoreHandleTypeFlagBitsKHX::eOpaqueWin32Kmt) | VkFlags(ExternalSemaphoreHandleTypeFlagBitsKHX::eD3D12Fence) | VkFlags(ExternalSemaphoreHandleTypeFlagBitsKHX::eFenceFd) + }; + }; + + struct PhysicalDeviceExternalSemaphoreInfoKHX + { + PhysicalDeviceExternalSemaphoreInfoKHX( ExternalSemaphoreHandleTypeFlagBitsKHX handleType_ = ExternalSemaphoreHandleTypeFlagBitsKHX::eOpaqueFd ) + : sType( StructureType::ePhysicalDeviceExternalSemaphoreInfoKHX ) + , pNext( nullptr ) + , handleType( handleType_ ) + { + } + + PhysicalDeviceExternalSemaphoreInfoKHX( VkPhysicalDeviceExternalSemaphoreInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(PhysicalDeviceExternalSemaphoreInfoKHX) ); + } + + PhysicalDeviceExternalSemaphoreInfoKHX& operator=( VkPhysicalDeviceExternalSemaphoreInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(PhysicalDeviceExternalSemaphoreInfoKHX) ); + return *this; + } + + PhysicalDeviceExternalSemaphoreInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + PhysicalDeviceExternalSemaphoreInfoKHX& setHandleType( ExternalSemaphoreHandleTypeFlagBitsKHX handleType_ ) + { + handleType = handleType_; + return *this; + } + + operator const VkPhysicalDeviceExternalSemaphoreInfoKHX&() const + { + return *reinterpret_cast<const VkPhysicalDeviceExternalSemaphoreInfoKHX*>(this); + } + + bool operator==( PhysicalDeviceExternalSemaphoreInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( handleType == rhs.handleType ); + } + + bool operator!=( PhysicalDeviceExternalSemaphoreInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + ExternalSemaphoreHandleTypeFlagBitsKHX handleType; + }; + static_assert( sizeof( PhysicalDeviceExternalSemaphoreInfoKHX ) == sizeof( VkPhysicalDeviceExternalSemaphoreInfoKHX ), "struct and wrapper have different size!" ); + + struct ExportSemaphoreCreateInfoKHX + { + ExportSemaphoreCreateInfoKHX( ExternalSemaphoreHandleTypeFlagsKHX handleTypes_ = ExternalSemaphoreHandleTypeFlagsKHX() ) + : sType( StructureType::eExportSemaphoreCreateInfoKHX ) + , pNext( nullptr ) + , handleTypes( handleTypes_ ) + { + } + + ExportSemaphoreCreateInfoKHX( VkExportSemaphoreCreateInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ExportSemaphoreCreateInfoKHX) ); + } + + ExportSemaphoreCreateInfoKHX& operator=( VkExportSemaphoreCreateInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ExportSemaphoreCreateInfoKHX) ); + return *this; + } + + ExportSemaphoreCreateInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + ExportSemaphoreCreateInfoKHX& setHandleTypes( ExternalSemaphoreHandleTypeFlagsKHX handleTypes_ ) + { + handleTypes = handleTypes_; + return *this; + } + + operator const VkExportSemaphoreCreateInfoKHX&() const + { + return *reinterpret_cast<const VkExportSemaphoreCreateInfoKHX*>(this); + } + + bool operator==( ExportSemaphoreCreateInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( handleTypes == rhs.handleTypes ); + } + + bool operator!=( ExportSemaphoreCreateInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + ExternalSemaphoreHandleTypeFlagsKHX handleTypes; + }; + static_assert( sizeof( ExportSemaphoreCreateInfoKHX ) == sizeof( VkExportSemaphoreCreateInfoKHX ), "struct and wrapper have different size!" ); + +#ifdef VK_USE_PLATFORM_WIN32_KHX + struct ImportSemaphoreWin32HandleInfoKHX + { + ImportSemaphoreWin32HandleInfoKHX( Semaphore semaphore_ = Semaphore(), ExternalSemaphoreHandleTypeFlagsKHX handleType_ = ExternalSemaphoreHandleTypeFlagsKHX(), HANDLE handle_ = 0 ) + : sType( StructureType::eImportSemaphoreWin32HandleInfoKHX ) + , pNext( nullptr ) + , semaphore( semaphore_ ) + , handleType( handleType_ ) + , handle( handle_ ) + { + } + + ImportSemaphoreWin32HandleInfoKHX( VkImportSemaphoreWin32HandleInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ImportSemaphoreWin32HandleInfoKHX) ); + } + + ImportSemaphoreWin32HandleInfoKHX& operator=( VkImportSemaphoreWin32HandleInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ImportSemaphoreWin32HandleInfoKHX) ); + return *this; + } + + ImportSemaphoreWin32HandleInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + ImportSemaphoreWin32HandleInfoKHX& setSemaphore( Semaphore semaphore_ ) + { + semaphore = semaphore_; + return *this; + } + + ImportSemaphoreWin32HandleInfoKHX& setHandleType( ExternalSemaphoreHandleTypeFlagsKHX handleType_ ) + { + handleType = handleType_; + return *this; + } + + ImportSemaphoreWin32HandleInfoKHX& setHandle( HANDLE handle_ ) + { + handle = handle_; + return *this; + } + + operator const VkImportSemaphoreWin32HandleInfoKHX&() const + { + return *reinterpret_cast<const VkImportSemaphoreWin32HandleInfoKHX*>(this); + } + + bool operator==( ImportSemaphoreWin32HandleInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( semaphore == rhs.semaphore ) + && ( handleType == rhs.handleType ) + && ( handle == rhs.handle ); + } + + bool operator!=( ImportSemaphoreWin32HandleInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + Semaphore semaphore; + ExternalSemaphoreHandleTypeFlagsKHX handleType; + HANDLE handle; + }; + static_assert( sizeof( ImportSemaphoreWin32HandleInfoKHX ) == sizeof( VkImportSemaphoreWin32HandleInfoKHX ), "struct and wrapper have different size!" ); +#endif /*VK_USE_PLATFORM_WIN32_KHX*/ + + struct ImportSemaphoreFdInfoKHX + { + ImportSemaphoreFdInfoKHX( Semaphore semaphore_ = Semaphore(), ExternalSemaphoreHandleTypeFlagBitsKHX handleType_ = ExternalSemaphoreHandleTypeFlagBitsKHX::eOpaqueFd, int fd_ = 0 ) + : sType( StructureType::eImportSemaphoreFdInfoKHX ) + , pNext( nullptr ) + , semaphore( semaphore_ ) + , handleType( handleType_ ) + , fd( fd_ ) + { + } + + ImportSemaphoreFdInfoKHX( VkImportSemaphoreFdInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ImportSemaphoreFdInfoKHX) ); + } + + ImportSemaphoreFdInfoKHX& operator=( VkImportSemaphoreFdInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ImportSemaphoreFdInfoKHX) ); + return *this; + } + + ImportSemaphoreFdInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + ImportSemaphoreFdInfoKHX& setSemaphore( Semaphore semaphore_ ) + { + semaphore = semaphore_; + return *this; + } + + ImportSemaphoreFdInfoKHX& setHandleType( ExternalSemaphoreHandleTypeFlagBitsKHX handleType_ ) + { + handleType = handleType_; + return *this; + } + + ImportSemaphoreFdInfoKHX& setFd( int fd_ ) + { + fd = fd_; + return *this; + } + + operator const VkImportSemaphoreFdInfoKHX&() const + { + return *reinterpret_cast<const VkImportSemaphoreFdInfoKHX*>(this); + } + + bool operator==( ImportSemaphoreFdInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( semaphore == rhs.semaphore ) + && ( handleType == rhs.handleType ) + && ( fd == rhs.fd ); + } + + bool operator!=( ImportSemaphoreFdInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + Semaphore semaphore; + ExternalSemaphoreHandleTypeFlagBitsKHX handleType; + int fd; + }; + static_assert( sizeof( ImportSemaphoreFdInfoKHX ) == sizeof( VkImportSemaphoreFdInfoKHX ), "struct and wrapper have different size!" ); + + enum class ExternalSemaphoreFeatureFlagBitsKHX + { + eExportable = VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT_KHX, + eImportable = VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT_KHX + }; + + using ExternalSemaphoreFeatureFlagsKHX = Flags<ExternalSemaphoreFeatureFlagBitsKHX, VkExternalSemaphoreFeatureFlagsKHX>; + + VULKAN_HPP_INLINE ExternalSemaphoreFeatureFlagsKHX operator|( ExternalSemaphoreFeatureFlagBitsKHX bit0, ExternalSemaphoreFeatureFlagBitsKHX bit1 ) + { + return ExternalSemaphoreFeatureFlagsKHX( bit0 ) | bit1; + } + + VULKAN_HPP_INLINE ExternalSemaphoreFeatureFlagsKHX operator~( ExternalSemaphoreFeatureFlagBitsKHX bits ) + { + return ~( ExternalSemaphoreFeatureFlagsKHX( bits ) ); + } + + template <> struct FlagTraits<ExternalSemaphoreFeatureFlagBitsKHX> + { + enum + { + allFlags = VkFlags(ExternalSemaphoreFeatureFlagBitsKHX::eExportable) | VkFlags(ExternalSemaphoreFeatureFlagBitsKHX::eImportable) + }; + }; + + struct ExternalSemaphorePropertiesKHX + { + operator const VkExternalSemaphorePropertiesKHX&() const + { + return *reinterpret_cast<const VkExternalSemaphorePropertiesKHX*>(this); + } + + bool operator==( ExternalSemaphorePropertiesKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( exportFromImportedHandleTypes == rhs.exportFromImportedHandleTypes ) + && ( compatibleHandleTypes == rhs.compatibleHandleTypes ) + && ( externalSemaphoreFeatures == rhs.externalSemaphoreFeatures ); + } + + bool operator!=( ExternalSemaphorePropertiesKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + void* pNext; + ExternalSemaphoreHandleTypeFlagsKHX exportFromImportedHandleTypes; + ExternalSemaphoreHandleTypeFlagsKHX compatibleHandleTypes; + ExternalSemaphoreFeatureFlagsKHX externalSemaphoreFeatures; + }; + static_assert( sizeof( ExternalSemaphorePropertiesKHX ) == sizeof( VkExternalSemaphorePropertiesKHX ), "struct and wrapper have different size!" ); + enum class SurfaceCounterFlagBitsEXT { eVblankExt = VK_SURFACE_COUNTER_VBLANK_EXT @@ -17398,6 +20251,1047 @@ namespace vk }; static_assert( sizeof( DisplayEventInfoEXT ) == sizeof( VkDisplayEventInfoEXT ), "struct and wrapper have different size!" ); + enum class PeerMemoryFeatureFlagBitsKHX + { + eCopySrc = VK_PEER_MEMORY_FEATURE_COPY_SRC_BIT_KHX, + eCopyDst = VK_PEER_MEMORY_FEATURE_COPY_DST_BIT_KHX, + eGenericSrc = VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT_KHX, + eGenericDst = VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT_KHX + }; + + using PeerMemoryFeatureFlagsKHX = Flags<PeerMemoryFeatureFlagBitsKHX, VkPeerMemoryFeatureFlagsKHX>; + + VULKAN_HPP_INLINE PeerMemoryFeatureFlagsKHX operator|( PeerMemoryFeatureFlagBitsKHX bit0, PeerMemoryFeatureFlagBitsKHX bit1 ) + { + return PeerMemoryFeatureFlagsKHX( bit0 ) | bit1; + } + + VULKAN_HPP_INLINE PeerMemoryFeatureFlagsKHX operator~( PeerMemoryFeatureFlagBitsKHX bits ) + { + return ~( PeerMemoryFeatureFlagsKHX( bits ) ); + } + + template <> struct FlagTraits<PeerMemoryFeatureFlagBitsKHX> + { + enum + { + allFlags = VkFlags(PeerMemoryFeatureFlagBitsKHX::eCopySrc) | VkFlags(PeerMemoryFeatureFlagBitsKHX::eCopyDst) | VkFlags(PeerMemoryFeatureFlagBitsKHX::eGenericSrc) | VkFlags(PeerMemoryFeatureFlagBitsKHX::eGenericDst) + }; + }; + + enum class MemoryAllocateFlagBitsKHX + { + eDeviceMask = VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT_KHX + }; + + using MemoryAllocateFlagsKHX = Flags<MemoryAllocateFlagBitsKHX, VkMemoryAllocateFlagsKHX>; + + VULKAN_HPP_INLINE MemoryAllocateFlagsKHX operator|( MemoryAllocateFlagBitsKHX bit0, MemoryAllocateFlagBitsKHX bit1 ) + { + return MemoryAllocateFlagsKHX( bit0 ) | bit1; + } + + VULKAN_HPP_INLINE MemoryAllocateFlagsKHX operator~( MemoryAllocateFlagBitsKHX bits ) + { + return ~( MemoryAllocateFlagsKHX( bits ) ); + } + + template <> struct FlagTraits<MemoryAllocateFlagBitsKHX> + { + enum + { + allFlags = VkFlags(MemoryAllocateFlagBitsKHX::eDeviceMask) + }; + }; + + struct MemoryAllocateFlagsInfoKHX + { + MemoryAllocateFlagsInfoKHX( MemoryAllocateFlagsKHX flags_ = MemoryAllocateFlagsKHX(), uint32_t deviceMask_ = 0 ) + : sType( StructureType::eMemoryAllocateFlagsInfoKHX ) + , pNext( nullptr ) + , flags( flags_ ) + , deviceMask( deviceMask_ ) + { + } + + MemoryAllocateFlagsInfoKHX( VkMemoryAllocateFlagsInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(MemoryAllocateFlagsInfoKHX) ); + } + + MemoryAllocateFlagsInfoKHX& operator=( VkMemoryAllocateFlagsInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(MemoryAllocateFlagsInfoKHX) ); + return *this; + } + + MemoryAllocateFlagsInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + MemoryAllocateFlagsInfoKHX& setFlags( MemoryAllocateFlagsKHX flags_ ) + { + flags = flags_; + return *this; + } + + MemoryAllocateFlagsInfoKHX& setDeviceMask( uint32_t deviceMask_ ) + { + deviceMask = deviceMask_; + return *this; + } + + operator const VkMemoryAllocateFlagsInfoKHX&() const + { + return *reinterpret_cast<const VkMemoryAllocateFlagsInfoKHX*>(this); + } + + bool operator==( MemoryAllocateFlagsInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( flags == rhs.flags ) + && ( deviceMask == rhs.deviceMask ); + } + + bool operator!=( MemoryAllocateFlagsInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + MemoryAllocateFlagsKHX flags; + uint32_t deviceMask; + }; + static_assert( sizeof( MemoryAllocateFlagsInfoKHX ) == sizeof( VkMemoryAllocateFlagsInfoKHX ), "struct and wrapper have different size!" ); + + enum class DeviceGroupPresentModeFlagBitsKHX + { + eLocal = VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHX, + eRemote = VK_DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHX, + eSum = VK_DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHX, + eLocalMultiDevice = VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHX + }; + + using DeviceGroupPresentModeFlagsKHX = Flags<DeviceGroupPresentModeFlagBitsKHX, VkDeviceGroupPresentModeFlagsKHX>; + + VULKAN_HPP_INLINE DeviceGroupPresentModeFlagsKHX operator|( DeviceGroupPresentModeFlagBitsKHX bit0, DeviceGroupPresentModeFlagBitsKHX bit1 ) + { + return DeviceGroupPresentModeFlagsKHX( bit0 ) | bit1; + } + + VULKAN_HPP_INLINE DeviceGroupPresentModeFlagsKHX operator~( DeviceGroupPresentModeFlagBitsKHX bits ) + { + return ~( DeviceGroupPresentModeFlagsKHX( bits ) ); + } + + template <> struct FlagTraits<DeviceGroupPresentModeFlagBitsKHX> + { + enum + { + allFlags = VkFlags(DeviceGroupPresentModeFlagBitsKHX::eLocal) | VkFlags(DeviceGroupPresentModeFlagBitsKHX::eRemote) | VkFlags(DeviceGroupPresentModeFlagBitsKHX::eSum) | VkFlags(DeviceGroupPresentModeFlagBitsKHX::eLocalMultiDevice) + }; + }; + + struct DeviceGroupPresentCapabilitiesKHX + { + operator const VkDeviceGroupPresentCapabilitiesKHX&() const + { + return *reinterpret_cast<const VkDeviceGroupPresentCapabilitiesKHX*>(this); + } + + bool operator==( DeviceGroupPresentCapabilitiesKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( memcmp( presentMask, rhs.presentMask, VK_MAX_DEVICE_GROUP_SIZE_KHX * sizeof( uint32_t ) ) == 0 ) + && ( modes == rhs.modes ); + } + + bool operator!=( DeviceGroupPresentCapabilitiesKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + uint32_t presentMask[VK_MAX_DEVICE_GROUP_SIZE_KHX]; + DeviceGroupPresentModeFlagsKHX modes; + }; + static_assert( sizeof( DeviceGroupPresentCapabilitiesKHX ) == sizeof( VkDeviceGroupPresentCapabilitiesKHX ), "struct and wrapper have different size!" ); + + struct DeviceGroupPresentInfoKHX + { + DeviceGroupPresentInfoKHX( uint32_t swapchainCount_ = 0, const uint32_t* pDeviceMasks_ = nullptr, DeviceGroupPresentModeFlagBitsKHX mode_ = DeviceGroupPresentModeFlagBitsKHX::eLocal ) + : sType( StructureType::eDeviceGroupPresentInfoKHX ) + , pNext( nullptr ) + , swapchainCount( swapchainCount_ ) + , pDeviceMasks( pDeviceMasks_ ) + , mode( mode_ ) + { + } + + DeviceGroupPresentInfoKHX( VkDeviceGroupPresentInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(DeviceGroupPresentInfoKHX) ); + } + + DeviceGroupPresentInfoKHX& operator=( VkDeviceGroupPresentInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(DeviceGroupPresentInfoKHX) ); + return *this; + } + + DeviceGroupPresentInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + DeviceGroupPresentInfoKHX& setSwapchainCount( uint32_t swapchainCount_ ) + { + swapchainCount = swapchainCount_; + return *this; + } + + DeviceGroupPresentInfoKHX& setPDeviceMasks( const uint32_t* pDeviceMasks_ ) + { + pDeviceMasks = pDeviceMasks_; + return *this; + } + + DeviceGroupPresentInfoKHX& setMode( DeviceGroupPresentModeFlagBitsKHX mode_ ) + { + mode = mode_; + return *this; + } + + operator const VkDeviceGroupPresentInfoKHX&() const + { + return *reinterpret_cast<const VkDeviceGroupPresentInfoKHX*>(this); + } + + bool operator==( DeviceGroupPresentInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( swapchainCount == rhs.swapchainCount ) + && ( pDeviceMasks == rhs.pDeviceMasks ) + && ( mode == rhs.mode ); + } + + bool operator!=( DeviceGroupPresentInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + uint32_t swapchainCount; + const uint32_t* pDeviceMasks; + DeviceGroupPresentModeFlagBitsKHX mode; + }; + static_assert( sizeof( DeviceGroupPresentInfoKHX ) == sizeof( VkDeviceGroupPresentInfoKHX ), "struct and wrapper have different size!" ); + + struct DeviceGroupSwapchainCreateInfoKHX + { + DeviceGroupSwapchainCreateInfoKHX( DeviceGroupPresentModeFlagsKHX modes_ = DeviceGroupPresentModeFlagsKHX() ) + : sType( StructureType::eDeviceGroupSwapchainCreateInfoKHX ) + , pNext( nullptr ) + , modes( modes_ ) + { + } + + DeviceGroupSwapchainCreateInfoKHX( VkDeviceGroupSwapchainCreateInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(DeviceGroupSwapchainCreateInfoKHX) ); + } + + DeviceGroupSwapchainCreateInfoKHX& operator=( VkDeviceGroupSwapchainCreateInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(DeviceGroupSwapchainCreateInfoKHX) ); + return *this; + } + + DeviceGroupSwapchainCreateInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + DeviceGroupSwapchainCreateInfoKHX& setModes( DeviceGroupPresentModeFlagsKHX modes_ ) + { + modes = modes_; + return *this; + } + + operator const VkDeviceGroupSwapchainCreateInfoKHX&() const + { + return *reinterpret_cast<const VkDeviceGroupSwapchainCreateInfoKHX*>(this); + } + + bool operator==( DeviceGroupSwapchainCreateInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( modes == rhs.modes ); + } + + bool operator!=( DeviceGroupSwapchainCreateInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + DeviceGroupPresentModeFlagsKHX modes; + }; + static_assert( sizeof( DeviceGroupSwapchainCreateInfoKHX ) == sizeof( VkDeviceGroupSwapchainCreateInfoKHX ), "struct and wrapper have different size!" ); + + enum class SwapchainCreateFlagBitsKHR + { + eBindSfrKHX = VK_SWAPCHAIN_CREATE_BIND_SFR_BIT_KHX + }; + + using SwapchainCreateFlagsKHR = Flags<SwapchainCreateFlagBitsKHR, VkSwapchainCreateFlagsKHR>; + + VULKAN_HPP_INLINE SwapchainCreateFlagsKHR operator|( SwapchainCreateFlagBitsKHR bit0, SwapchainCreateFlagBitsKHR bit1 ) + { + return SwapchainCreateFlagsKHR( bit0 ) | bit1; + } + + VULKAN_HPP_INLINE SwapchainCreateFlagsKHR operator~( SwapchainCreateFlagBitsKHR bits ) + { + return ~( SwapchainCreateFlagsKHR( bits ) ); + } + + template <> struct FlagTraits<SwapchainCreateFlagBitsKHR> + { + enum + { + allFlags = VkFlags(SwapchainCreateFlagBitsKHR::eBindSfrKHX) + }; + }; + + struct SwapchainCreateInfoKHR + { + SwapchainCreateInfoKHR( SwapchainCreateFlagsKHR flags_ = SwapchainCreateFlagsKHR(), SurfaceKHR surface_ = SurfaceKHR(), uint32_t minImageCount_ = 0, Format imageFormat_ = Format::eUndefined, ColorSpaceKHR imageColorSpace_ = ColorSpaceKHR::eSrgbNonlinear, Extent2D imageExtent_ = Extent2D(), uint32_t imageArrayLayers_ = 0, ImageUsageFlags imageUsage_ = ImageUsageFlags(), SharingMode imageSharingMode_ = SharingMode::eExclusive, uint32_t queueFamilyIndexCount_ = 0, const uint32_t* pQueueFamilyIndices_ = nullptr, SurfaceTransformFlagBitsKHR preTransform_ = SurfaceTransformFlagBitsKHR::eIdentity, CompositeAlphaFlagBitsKHR compositeAlpha_ = CompositeAlphaFlagBitsKHR::eOpaque, PresentModeKHR presentMode_ = PresentModeKHR::eImmediate, Bool32 clipped_ = 0, SwapchainKHR oldSwapchain_ = SwapchainKHR() ) + : sType( StructureType::eSwapchainCreateInfoKHR ) + , pNext( nullptr ) + , flags( flags_ ) + , surface( surface_ ) + , minImageCount( minImageCount_ ) + , imageFormat( imageFormat_ ) + , imageColorSpace( imageColorSpace_ ) + , imageExtent( imageExtent_ ) + , imageArrayLayers( imageArrayLayers_ ) + , imageUsage( imageUsage_ ) + , imageSharingMode( imageSharingMode_ ) + , queueFamilyIndexCount( queueFamilyIndexCount_ ) + , pQueueFamilyIndices( pQueueFamilyIndices_ ) + , preTransform( preTransform_ ) + , compositeAlpha( compositeAlpha_ ) + , presentMode( presentMode_ ) + , clipped( clipped_ ) + , oldSwapchain( oldSwapchain_ ) + { + } + + SwapchainCreateInfoKHR( VkSwapchainCreateInfoKHR const & rhs ) + { + memcpy( this, &rhs, sizeof(SwapchainCreateInfoKHR) ); + } + + SwapchainCreateInfoKHR& operator=( VkSwapchainCreateInfoKHR const & rhs ) + { + memcpy( this, &rhs, sizeof(SwapchainCreateInfoKHR) ); + return *this; + } + + SwapchainCreateInfoKHR& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + SwapchainCreateInfoKHR& setFlags( SwapchainCreateFlagsKHR flags_ ) + { + flags = flags_; + return *this; + } + + SwapchainCreateInfoKHR& setSurface( SurfaceKHR surface_ ) + { + surface = surface_; + return *this; + } + + SwapchainCreateInfoKHR& setMinImageCount( uint32_t minImageCount_ ) + { + minImageCount = minImageCount_; + return *this; + } + + SwapchainCreateInfoKHR& setImageFormat( Format imageFormat_ ) + { + imageFormat = imageFormat_; + return *this; + } + + SwapchainCreateInfoKHR& setImageColorSpace( ColorSpaceKHR imageColorSpace_ ) + { + imageColorSpace = imageColorSpace_; + return *this; + } + + SwapchainCreateInfoKHR& setImageExtent( Extent2D imageExtent_ ) + { + imageExtent = imageExtent_; + return *this; + } + + SwapchainCreateInfoKHR& setImageArrayLayers( uint32_t imageArrayLayers_ ) + { + imageArrayLayers = imageArrayLayers_; + return *this; + } + + SwapchainCreateInfoKHR& setImageUsage( ImageUsageFlags imageUsage_ ) + { + imageUsage = imageUsage_; + return *this; + } + + SwapchainCreateInfoKHR& setImageSharingMode( SharingMode imageSharingMode_ ) + { + imageSharingMode = imageSharingMode_; + return *this; + } + + SwapchainCreateInfoKHR& setQueueFamilyIndexCount( uint32_t queueFamilyIndexCount_ ) + { + queueFamilyIndexCount = queueFamilyIndexCount_; + return *this; + } + + SwapchainCreateInfoKHR& setPQueueFamilyIndices( const uint32_t* pQueueFamilyIndices_ ) + { + pQueueFamilyIndices = pQueueFamilyIndices_; + return *this; + } + + SwapchainCreateInfoKHR& setPreTransform( SurfaceTransformFlagBitsKHR preTransform_ ) + { + preTransform = preTransform_; + return *this; + } + + SwapchainCreateInfoKHR& setCompositeAlpha( CompositeAlphaFlagBitsKHR compositeAlpha_ ) + { + compositeAlpha = compositeAlpha_; + return *this; + } + + SwapchainCreateInfoKHR& setPresentMode( PresentModeKHR presentMode_ ) + { + presentMode = presentMode_; + return *this; + } + + SwapchainCreateInfoKHR& setClipped( Bool32 clipped_ ) + { + clipped = clipped_; + return *this; + } + + SwapchainCreateInfoKHR& setOldSwapchain( SwapchainKHR oldSwapchain_ ) + { + oldSwapchain = oldSwapchain_; + return *this; + } + + operator const VkSwapchainCreateInfoKHR&() const + { + return *reinterpret_cast<const VkSwapchainCreateInfoKHR*>(this); + } + + bool operator==( SwapchainCreateInfoKHR const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( flags == rhs.flags ) + && ( surface == rhs.surface ) + && ( minImageCount == rhs.minImageCount ) + && ( imageFormat == rhs.imageFormat ) + && ( imageColorSpace == rhs.imageColorSpace ) + && ( imageExtent == rhs.imageExtent ) + && ( imageArrayLayers == rhs.imageArrayLayers ) + && ( imageUsage == rhs.imageUsage ) + && ( imageSharingMode == rhs.imageSharingMode ) + && ( queueFamilyIndexCount == rhs.queueFamilyIndexCount ) + && ( pQueueFamilyIndices == rhs.pQueueFamilyIndices ) + && ( preTransform == rhs.preTransform ) + && ( compositeAlpha == rhs.compositeAlpha ) + && ( presentMode == rhs.presentMode ) + && ( clipped == rhs.clipped ) + && ( oldSwapchain == rhs.oldSwapchain ); + } + + bool operator!=( SwapchainCreateInfoKHR const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + SwapchainCreateFlagsKHR flags; + SurfaceKHR surface; + uint32_t minImageCount; + Format imageFormat; + ColorSpaceKHR imageColorSpace; + Extent2D imageExtent; + uint32_t imageArrayLayers; + ImageUsageFlags imageUsage; + SharingMode imageSharingMode; + uint32_t queueFamilyIndexCount; + const uint32_t* pQueueFamilyIndices; + SurfaceTransformFlagBitsKHR preTransform; + CompositeAlphaFlagBitsKHR compositeAlpha; + PresentModeKHR presentMode; + Bool32 clipped; + SwapchainKHR oldSwapchain; + }; + static_assert( sizeof( SwapchainCreateInfoKHR ) == sizeof( VkSwapchainCreateInfoKHR ), "struct and wrapper have different size!" ); + + enum class ViewportCoordinateSwizzleNV + { + ePositiveX = VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_X_NV, + eNegativeX = VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_X_NV, + ePositiveY = VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_Y_NV, + eNegativeY = VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_Y_NV, + ePositiveZ = VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_Z_NV, + eNegativeZ = VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_Z_NV, + ePositiveW = VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_W_NV, + eNegativeW = VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_W_NV + }; + + struct ViewportSwizzleNV + { + ViewportSwizzleNV( ViewportCoordinateSwizzleNV x_ = ViewportCoordinateSwizzleNV::ePositiveX, ViewportCoordinateSwizzleNV y_ = ViewportCoordinateSwizzleNV::ePositiveX, ViewportCoordinateSwizzleNV z_ = ViewportCoordinateSwizzleNV::ePositiveX, ViewportCoordinateSwizzleNV w_ = ViewportCoordinateSwizzleNV::ePositiveX ) + : x( x_ ) + , y( y_ ) + , z( z_ ) + , w( w_ ) + { + } + + ViewportSwizzleNV( VkViewportSwizzleNV const & rhs ) + { + memcpy( this, &rhs, sizeof(ViewportSwizzleNV) ); + } + + ViewportSwizzleNV& operator=( VkViewportSwizzleNV const & rhs ) + { + memcpy( this, &rhs, sizeof(ViewportSwizzleNV) ); + return *this; + } + + ViewportSwizzleNV& setX( ViewportCoordinateSwizzleNV x_ ) + { + x = x_; + return *this; + } + + ViewportSwizzleNV& setY( ViewportCoordinateSwizzleNV y_ ) + { + y = y_; + return *this; + } + + ViewportSwizzleNV& setZ( ViewportCoordinateSwizzleNV z_ ) + { + z = z_; + return *this; + } + + ViewportSwizzleNV& setW( ViewportCoordinateSwizzleNV w_ ) + { + w = w_; + return *this; + } + + operator const VkViewportSwizzleNV&() const + { + return *reinterpret_cast<const VkViewportSwizzleNV*>(this); + } + + bool operator==( ViewportSwizzleNV const& rhs ) const + { + return ( x == rhs.x ) + && ( y == rhs.y ) + && ( z == rhs.z ) + && ( w == rhs.w ); + } + + bool operator!=( ViewportSwizzleNV const& rhs ) const + { + return !operator==( rhs ); + } + + ViewportCoordinateSwizzleNV x; + ViewportCoordinateSwizzleNV y; + ViewportCoordinateSwizzleNV z; + ViewportCoordinateSwizzleNV w; + }; + static_assert( sizeof( ViewportSwizzleNV ) == sizeof( VkViewportSwizzleNV ), "struct and wrapper have different size!" ); + + struct PipelineViewportSwizzleStateCreateInfoNV + { + PipelineViewportSwizzleStateCreateInfoNV( PipelineViewportSwizzleStateCreateFlagsNV flags_ = PipelineViewportSwizzleStateCreateFlagsNV(), uint32_t viewportCount_ = 0, const ViewportSwizzleNV* pViewportSwizzles_ = nullptr ) + : sType( StructureType::ePipelineViewportSwizzleStateCreateInfoNV ) + , pNext( nullptr ) + , flags( flags_ ) + , viewportCount( viewportCount_ ) + , pViewportSwizzles( pViewportSwizzles_ ) + { + } + + PipelineViewportSwizzleStateCreateInfoNV( VkPipelineViewportSwizzleStateCreateInfoNV const & rhs ) + { + memcpy( this, &rhs, sizeof(PipelineViewportSwizzleStateCreateInfoNV) ); + } + + PipelineViewportSwizzleStateCreateInfoNV& operator=( VkPipelineViewportSwizzleStateCreateInfoNV const & rhs ) + { + memcpy( this, &rhs, sizeof(PipelineViewportSwizzleStateCreateInfoNV) ); + return *this; + } + + PipelineViewportSwizzleStateCreateInfoNV& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + PipelineViewportSwizzleStateCreateInfoNV& setFlags( PipelineViewportSwizzleStateCreateFlagsNV flags_ ) + { + flags = flags_; + return *this; + } + + PipelineViewportSwizzleStateCreateInfoNV& setViewportCount( uint32_t viewportCount_ ) + { + viewportCount = viewportCount_; + return *this; + } + + PipelineViewportSwizzleStateCreateInfoNV& setPViewportSwizzles( const ViewportSwizzleNV* pViewportSwizzles_ ) + { + pViewportSwizzles = pViewportSwizzles_; + return *this; + } + + operator const VkPipelineViewportSwizzleStateCreateInfoNV&() const + { + return *reinterpret_cast<const VkPipelineViewportSwizzleStateCreateInfoNV*>(this); + } + + bool operator==( PipelineViewportSwizzleStateCreateInfoNV const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( flags == rhs.flags ) + && ( viewportCount == rhs.viewportCount ) + && ( pViewportSwizzles == rhs.pViewportSwizzles ); + } + + bool operator!=( PipelineViewportSwizzleStateCreateInfoNV const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + PipelineViewportSwizzleStateCreateFlagsNV flags; + uint32_t viewportCount; + const ViewportSwizzleNV* pViewportSwizzles; + }; + static_assert( sizeof( PipelineViewportSwizzleStateCreateInfoNV ) == sizeof( VkPipelineViewportSwizzleStateCreateInfoNV ), "struct and wrapper have different size!" ); + + enum class DiscardRectangleModeEXT + { + eInclusive = VK_DISCARD_RECTANGLE_MODE_INCLUSIVE_EXT, + eExclusive = VK_DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT + }; + + struct PipelineDiscardRectangleStateCreateInfoEXT + { + PipelineDiscardRectangleStateCreateInfoEXT( PipelineDiscardRectangleStateCreateFlagsEXT flags_ = PipelineDiscardRectangleStateCreateFlagsEXT(), DiscardRectangleModeEXT discardRectangleMode_ = DiscardRectangleModeEXT::eInclusive, uint32_t discardRectangleCount_ = 0, const Rect2D* pDiscardRectangles_ = nullptr ) + : sType( StructureType::ePipelineDiscardRectangleStateCreateInfoEXT ) + , pNext( nullptr ) + , flags( flags_ ) + , discardRectangleMode( discardRectangleMode_ ) + , discardRectangleCount( discardRectangleCount_ ) + , pDiscardRectangles( pDiscardRectangles_ ) + { + } + + PipelineDiscardRectangleStateCreateInfoEXT( VkPipelineDiscardRectangleStateCreateInfoEXT const & rhs ) + { + memcpy( this, &rhs, sizeof(PipelineDiscardRectangleStateCreateInfoEXT) ); + } + + PipelineDiscardRectangleStateCreateInfoEXT& operator=( VkPipelineDiscardRectangleStateCreateInfoEXT const & rhs ) + { + memcpy( this, &rhs, sizeof(PipelineDiscardRectangleStateCreateInfoEXT) ); + return *this; + } + + PipelineDiscardRectangleStateCreateInfoEXT& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + PipelineDiscardRectangleStateCreateInfoEXT& setFlags( PipelineDiscardRectangleStateCreateFlagsEXT flags_ ) + { + flags = flags_; + return *this; + } + + PipelineDiscardRectangleStateCreateInfoEXT& setDiscardRectangleMode( DiscardRectangleModeEXT discardRectangleMode_ ) + { + discardRectangleMode = discardRectangleMode_; + return *this; + } + + PipelineDiscardRectangleStateCreateInfoEXT& setDiscardRectangleCount( uint32_t discardRectangleCount_ ) + { + discardRectangleCount = discardRectangleCount_; + return *this; + } + + PipelineDiscardRectangleStateCreateInfoEXT& setPDiscardRectangles( const Rect2D* pDiscardRectangles_ ) + { + pDiscardRectangles = pDiscardRectangles_; + return *this; + } + + operator const VkPipelineDiscardRectangleStateCreateInfoEXT&() const + { + return *reinterpret_cast<const VkPipelineDiscardRectangleStateCreateInfoEXT*>(this); + } + + bool operator==( PipelineDiscardRectangleStateCreateInfoEXT const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( flags == rhs.flags ) + && ( discardRectangleMode == rhs.discardRectangleMode ) + && ( discardRectangleCount == rhs.discardRectangleCount ) + && ( pDiscardRectangles == rhs.pDiscardRectangles ); + } + + bool operator!=( PipelineDiscardRectangleStateCreateInfoEXT const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + PipelineDiscardRectangleStateCreateFlagsEXT flags; + DiscardRectangleModeEXT discardRectangleMode; + uint32_t discardRectangleCount; + const Rect2D* pDiscardRectangles; + }; + static_assert( sizeof( PipelineDiscardRectangleStateCreateInfoEXT ) == sizeof( VkPipelineDiscardRectangleStateCreateInfoEXT ), "struct and wrapper have different size!" ); + + enum class SubpassDescriptionFlagBits + { + ePerViewAttributesNVX = VK_SUBPASS_DESCRIPTION_PER_VIEW_ATTRIBUTES_BIT_NVX, + ePerViewPositionXOnlyNVX = VK_SUBPASS_DESCRIPTION_PER_VIEW_POSITION_X_ONLY_BIT_NVX + }; + + using SubpassDescriptionFlags = Flags<SubpassDescriptionFlagBits, VkSubpassDescriptionFlags>; + + VULKAN_HPP_INLINE SubpassDescriptionFlags operator|( SubpassDescriptionFlagBits bit0, SubpassDescriptionFlagBits bit1 ) + { + return SubpassDescriptionFlags( bit0 ) | bit1; + } + + VULKAN_HPP_INLINE SubpassDescriptionFlags operator~( SubpassDescriptionFlagBits bits ) + { + return ~( SubpassDescriptionFlags( bits ) ); + } + + template <> struct FlagTraits<SubpassDescriptionFlagBits> + { + enum + { + allFlags = VkFlags(SubpassDescriptionFlagBits::ePerViewAttributesNVX) | VkFlags(SubpassDescriptionFlagBits::ePerViewPositionXOnlyNVX) + }; + }; + + struct SubpassDescription + { + SubpassDescription( SubpassDescriptionFlags flags_ = SubpassDescriptionFlags(), PipelineBindPoint pipelineBindPoint_ = PipelineBindPoint::eGraphics, uint32_t inputAttachmentCount_ = 0, const AttachmentReference* pInputAttachments_ = nullptr, uint32_t colorAttachmentCount_ = 0, const AttachmentReference* pColorAttachments_ = nullptr, const AttachmentReference* pResolveAttachments_ = nullptr, const AttachmentReference* pDepthStencilAttachment_ = nullptr, uint32_t preserveAttachmentCount_ = 0, const uint32_t* pPreserveAttachments_ = nullptr ) + : flags( flags_ ) + , pipelineBindPoint( pipelineBindPoint_ ) + , inputAttachmentCount( inputAttachmentCount_ ) + , pInputAttachments( pInputAttachments_ ) + , colorAttachmentCount( colorAttachmentCount_ ) + , pColorAttachments( pColorAttachments_ ) + , pResolveAttachments( pResolveAttachments_ ) + , pDepthStencilAttachment( pDepthStencilAttachment_ ) + , preserveAttachmentCount( preserveAttachmentCount_ ) + , pPreserveAttachments( pPreserveAttachments_ ) + { + } + + SubpassDescription( VkSubpassDescription const & rhs ) + { + memcpy( this, &rhs, sizeof(SubpassDescription) ); + } + + SubpassDescription& operator=( VkSubpassDescription const & rhs ) + { + memcpy( this, &rhs, sizeof(SubpassDescription) ); + return *this; + } + + SubpassDescription& setFlags( SubpassDescriptionFlags flags_ ) + { + flags = flags_; + return *this; + } + + SubpassDescription& setPipelineBindPoint( PipelineBindPoint pipelineBindPoint_ ) + { + pipelineBindPoint = pipelineBindPoint_; + return *this; + } + + SubpassDescription& setInputAttachmentCount( uint32_t inputAttachmentCount_ ) + { + inputAttachmentCount = inputAttachmentCount_; + return *this; + } + + SubpassDescription& setPInputAttachments( const AttachmentReference* pInputAttachments_ ) + { + pInputAttachments = pInputAttachments_; + return *this; + } + + SubpassDescription& setColorAttachmentCount( uint32_t colorAttachmentCount_ ) + { + colorAttachmentCount = colorAttachmentCount_; + return *this; + } + + SubpassDescription& setPColorAttachments( const AttachmentReference* pColorAttachments_ ) + { + pColorAttachments = pColorAttachments_; + return *this; + } + + SubpassDescription& setPResolveAttachments( const AttachmentReference* pResolveAttachments_ ) + { + pResolveAttachments = pResolveAttachments_; + return *this; + } + + SubpassDescription& setPDepthStencilAttachment( const AttachmentReference* pDepthStencilAttachment_ ) + { + pDepthStencilAttachment = pDepthStencilAttachment_; + return *this; + } + + SubpassDescription& setPreserveAttachmentCount( uint32_t preserveAttachmentCount_ ) + { + preserveAttachmentCount = preserveAttachmentCount_; + return *this; + } + + SubpassDescription& setPPreserveAttachments( const uint32_t* pPreserveAttachments_ ) + { + pPreserveAttachments = pPreserveAttachments_; + return *this; + } + + operator const VkSubpassDescription&() const + { + return *reinterpret_cast<const VkSubpassDescription*>(this); + } + + bool operator==( SubpassDescription const& rhs ) const + { + return ( flags == rhs.flags ) + && ( pipelineBindPoint == rhs.pipelineBindPoint ) + && ( inputAttachmentCount == rhs.inputAttachmentCount ) + && ( pInputAttachments == rhs.pInputAttachments ) + && ( colorAttachmentCount == rhs.colorAttachmentCount ) + && ( pColorAttachments == rhs.pColorAttachments ) + && ( pResolveAttachments == rhs.pResolveAttachments ) + && ( pDepthStencilAttachment == rhs.pDepthStencilAttachment ) + && ( preserveAttachmentCount == rhs.preserveAttachmentCount ) + && ( pPreserveAttachments == rhs.pPreserveAttachments ); + } + + bool operator!=( SubpassDescription const& rhs ) const + { + return !operator==( rhs ); + } + + SubpassDescriptionFlags flags; + PipelineBindPoint pipelineBindPoint; + uint32_t inputAttachmentCount; + const AttachmentReference* pInputAttachments; + uint32_t colorAttachmentCount; + const AttachmentReference* pColorAttachments; + const AttachmentReference* pResolveAttachments; + const AttachmentReference* pDepthStencilAttachment; + uint32_t preserveAttachmentCount; + const uint32_t* pPreserveAttachments; + }; + static_assert( sizeof( SubpassDescription ) == sizeof( VkSubpassDescription ), "struct and wrapper have different size!" ); + + struct RenderPassCreateInfo + { + RenderPassCreateInfo( RenderPassCreateFlags flags_ = RenderPassCreateFlags(), uint32_t attachmentCount_ = 0, const AttachmentDescription* pAttachments_ = nullptr, uint32_t subpassCount_ = 0, const SubpassDescription* pSubpasses_ = nullptr, uint32_t dependencyCount_ = 0, const SubpassDependency* pDependencies_ = nullptr ) + : sType( StructureType::eRenderPassCreateInfo ) + , pNext( nullptr ) + , flags( flags_ ) + , attachmentCount( attachmentCount_ ) + , pAttachments( pAttachments_ ) + , subpassCount( subpassCount_ ) + , pSubpasses( pSubpasses_ ) + , dependencyCount( dependencyCount_ ) + , pDependencies( pDependencies_ ) + { + } + + RenderPassCreateInfo( VkRenderPassCreateInfo const & rhs ) + { + memcpy( this, &rhs, sizeof(RenderPassCreateInfo) ); + } + + RenderPassCreateInfo& operator=( VkRenderPassCreateInfo const & rhs ) + { + memcpy( this, &rhs, sizeof(RenderPassCreateInfo) ); + return *this; + } + + RenderPassCreateInfo& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + RenderPassCreateInfo& setFlags( RenderPassCreateFlags flags_ ) + { + flags = flags_; + return *this; + } + + RenderPassCreateInfo& setAttachmentCount( uint32_t attachmentCount_ ) + { + attachmentCount = attachmentCount_; + return *this; + } + + RenderPassCreateInfo& setPAttachments( const AttachmentDescription* pAttachments_ ) + { + pAttachments = pAttachments_; + return *this; + } + + RenderPassCreateInfo& setSubpassCount( uint32_t subpassCount_ ) + { + subpassCount = subpassCount_; + return *this; + } + + RenderPassCreateInfo& setPSubpasses( const SubpassDescription* pSubpasses_ ) + { + pSubpasses = pSubpasses_; + return *this; + } + + RenderPassCreateInfo& setDependencyCount( uint32_t dependencyCount_ ) + { + dependencyCount = dependencyCount_; + return *this; + } + + RenderPassCreateInfo& setPDependencies( const SubpassDependency* pDependencies_ ) + { + pDependencies = pDependencies_; + return *this; + } + + operator const VkRenderPassCreateInfo&() const + { + return *reinterpret_cast<const VkRenderPassCreateInfo*>(this); + } + + bool operator==( RenderPassCreateInfo const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( flags == rhs.flags ) + && ( attachmentCount == rhs.attachmentCount ) + && ( pAttachments == rhs.pAttachments ) + && ( subpassCount == rhs.subpassCount ) + && ( pSubpasses == rhs.pSubpasses ) + && ( dependencyCount == rhs.dependencyCount ) + && ( pDependencies == rhs.pDependencies ); + } + + bool operator!=( RenderPassCreateInfo const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + RenderPassCreateFlags flags; + uint32_t attachmentCount; + const AttachmentDescription* pAttachments; + uint32_t subpassCount; + const SubpassDescription* pSubpasses; + uint32_t dependencyCount; + const SubpassDependency* pDependencies; + }; + static_assert( sizeof( RenderPassCreateInfo ) == sizeof( VkRenderPassCreateInfo ), "struct and wrapper have different size!" ); + Result enumerateInstanceLayerProperties( uint32_t* pPropertyCount, LayerProperties* pProperties ); #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE template <typename Allocator = std::allocator<LayerProperties>> @@ -17572,7 +21466,7 @@ namespace vk void drawIndexedIndirect( Buffer buffer, DeviceSize offset, uint32_t drawCount, uint32_t stride ) const; - void dispatch( uint32_t x, uint32_t y, uint32_t z ) const; + void dispatch( uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ ) const; void dispatchIndirect( Buffer buffer, DeviceSize offset ) const; @@ -17699,6 +21593,27 @@ namespace vk void reserveSpaceForCommandsNVX( const CmdReserveSpaceForCommandsInfoNVX & reserveSpaceInfo ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + void pushDescriptorSetKHR( PipelineBindPoint pipelineBindPoint, PipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const WriteDescriptorSet* pDescriptorWrites ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + void pushDescriptorSetKHR( PipelineBindPoint pipelineBindPoint, PipelineLayout layout, uint32_t set, ArrayProxy<const WriteDescriptorSet> descriptorWrites ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + void setDeviceMaskKHX( uint32_t deviceMask ) const; + + void dispatchBaseKHX( uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ ) const; + + void pushDescriptorSetWithTemplateKHR( DescriptorUpdateTemplateKHR descriptorUpdateTemplate, PipelineLayout layout, uint32_t set, const void* pData ) const; + + void setViewportWScalingNV( uint32_t firstViewport, uint32_t viewportCount, const ViewportWScalingNV* pViewportWScalings ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + void setViewportWScalingNV( uint32_t firstViewport, ArrayProxy<const ViewportWScalingNV> viewportWScalings ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + void setDiscardRectangleEXT( uint32_t firstDiscardRectangle, uint32_t discardRectangleCount, const Rect2D* pDiscardRectangles ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + void setDiscardRectangleEXT( uint32_t firstDiscardRectangle, ArrayProxy<const Rect2D> discardRectangles ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkCommandBuffer() const { return m_commandBuffer; @@ -17874,9 +21789,9 @@ namespace vk vkCmdDrawIndexedIndirect( m_commandBuffer, static_cast<VkBuffer>( buffer ), offset, drawCount, stride ); } - VULKAN_HPP_INLINE void CommandBuffer::dispatch( uint32_t x, uint32_t y, uint32_t z ) const + VULKAN_HPP_INLINE void CommandBuffer::dispatch( uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ ) const { - vkCmdDispatch( m_commandBuffer, x, y, z ); + vkCmdDispatch( m_commandBuffer, groupCountX, groupCountY, groupCountZ ); } VULKAN_HPP_INLINE void CommandBuffer::dispatchIndirect( Buffer buffer, DeviceSize offset ) const @@ -18163,6 +22078,54 @@ namespace vk vkCmdReserveSpaceForCommandsNVX( m_commandBuffer, reinterpret_cast<const VkCmdReserveSpaceForCommandsInfoNVX*>( &reserveSpaceInfo ) ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void CommandBuffer::pushDescriptorSetKHR( PipelineBindPoint pipelineBindPoint, PipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const WriteDescriptorSet* pDescriptorWrites ) const + { + vkCmdPushDescriptorSetKHR( m_commandBuffer, static_cast<VkPipelineBindPoint>( pipelineBindPoint ), static_cast<VkPipelineLayout>( layout ), set, descriptorWriteCount, reinterpret_cast<const VkWriteDescriptorSet*>( pDescriptorWrites ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void CommandBuffer::pushDescriptorSetKHR( PipelineBindPoint pipelineBindPoint, PipelineLayout layout, uint32_t set, ArrayProxy<const WriteDescriptorSet> descriptorWrites ) const + { + vkCmdPushDescriptorSetKHR( m_commandBuffer, static_cast<VkPipelineBindPoint>( pipelineBindPoint ), static_cast<VkPipelineLayout>( layout ), set, descriptorWrites.size() , reinterpret_cast<const VkWriteDescriptorSet*>( descriptorWrites.data() ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void CommandBuffer::setDeviceMaskKHX( uint32_t deviceMask ) const + { + vkCmdSetDeviceMaskKHX( m_commandBuffer, deviceMask ); + } + + VULKAN_HPP_INLINE void CommandBuffer::dispatchBaseKHX( uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ ) const + { + vkCmdDispatchBaseKHX( m_commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, groupCountZ ); + } + + VULKAN_HPP_INLINE void CommandBuffer::pushDescriptorSetWithTemplateKHR( DescriptorUpdateTemplateKHR descriptorUpdateTemplate, PipelineLayout layout, uint32_t set, const void* pData ) const + { + vkCmdPushDescriptorSetWithTemplateKHR( m_commandBuffer, static_cast<VkDescriptorUpdateTemplateKHR>( descriptorUpdateTemplate ), static_cast<VkPipelineLayout>( layout ), set, pData ); + } + + VULKAN_HPP_INLINE void CommandBuffer::setViewportWScalingNV( uint32_t firstViewport, uint32_t viewportCount, const ViewportWScalingNV* pViewportWScalings ) const + { + vkCmdSetViewportWScalingNV( m_commandBuffer, firstViewport, viewportCount, reinterpret_cast<const VkViewportWScalingNV*>( pViewportWScalings ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void CommandBuffer::setViewportWScalingNV( uint32_t firstViewport, ArrayProxy<const ViewportWScalingNV> viewportWScalings ) const + { + vkCmdSetViewportWScalingNV( m_commandBuffer, firstViewport, viewportWScalings.size() , reinterpret_cast<const VkViewportWScalingNV*>( viewportWScalings.data() ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void CommandBuffer::setDiscardRectangleEXT( uint32_t firstDiscardRectangle, uint32_t discardRectangleCount, const Rect2D* pDiscardRectangles ) const + { + vkCmdSetDiscardRectangleEXT( m_commandBuffer, firstDiscardRectangle, discardRectangleCount, reinterpret_cast<const VkRect2D*>( pDiscardRectangles ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void CommandBuffer::setDiscardRectangleEXT( uint32_t firstDiscardRectangle, ArrayProxy<const Rect2D> discardRectangles ) const + { + vkCmdSetDiscardRectangleEXT( m_commandBuffer, firstDiscardRectangle, discardRectangles.size() , reinterpret_cast<const VkRect2D*>( discardRectangles.data() ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ struct SubmitInfo { SubmitInfo( uint32_t waitSemaphoreCount_ = 0, const Semaphore* pWaitSemaphores_ = nullptr, const PipelineStageFlags* pWaitDstStageMask_ = nullptr, uint32_t commandBufferCount_ = 0, const CommandBuffer* pCommandBuffers_ = nullptr, uint32_t signalSemaphoreCount_ = 0, const Semaphore* pSignalSemaphores_ = nullptr ) @@ -18423,6 +22386,8 @@ namespace vk using UniqueDescriptorSet = UniqueHandle<DescriptorSet, DescriptorSetDeleter>; class DescriptorSetLayoutDeleter; using UniqueDescriptorSetLayout = UniqueHandle<DescriptorSetLayout, DescriptorSetLayoutDeleter>; + class DescriptorUpdateTemplateKHRDeleter; + using UniqueDescriptorUpdateTemplateKHR = UniqueHandle<DescriptorUpdateTemplateKHR, DescriptorUpdateTemplateKHRDeleter>; class DeviceMemoryDeleter; using UniqueDeviceMemory = UniqueHandle<DeviceMemory, DeviceMemoryDeleter>; class EventDeleter; @@ -19036,6 +23001,54 @@ namespace vk void trimCommandPoolKHR( CommandPool commandPool, CommandPoolTrimFlagsKHR flags ) const; +#ifdef VK_USE_PLATFORM_WIN32_KHR + Result getMemoryWin32HandleKHX( DeviceMemory memory, ExternalMemoryHandleTypeFlagBitsKHX handleType, HANDLE* pHandle ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType<HANDLE>::type getMemoryWin32HandleKHX( DeviceMemory memory, ExternalMemoryHandleTypeFlagBitsKHX handleType ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + +#ifdef VK_USE_PLATFORM_WIN32_KHR + Result getMemoryWin32HandlePropertiesKHX( ExternalMemoryHandleTypeFlagBitsKHX handleType, HANDLE handle, MemoryWin32HandlePropertiesKHX* pMemoryWin32HandleProperties ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType<MemoryWin32HandlePropertiesKHX>::type getMemoryWin32HandlePropertiesKHX( ExternalMemoryHandleTypeFlagBitsKHX handleType, HANDLE handle ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + + Result getMemoryFdKHX( DeviceMemory memory, ExternalMemoryHandleTypeFlagBitsKHX handleType, int* pFd ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType<int>::type getMemoryFdKHX( DeviceMemory memory, ExternalMemoryHandleTypeFlagBitsKHX handleType ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + Result getMemoryFdPropertiesKHX( ExternalMemoryHandleTypeFlagBitsKHX handleType, int fd, MemoryFdPropertiesKHX* pMemoryFdProperties ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType<MemoryFdPropertiesKHX>::type getMemoryFdPropertiesKHX( ExternalMemoryHandleTypeFlagBitsKHX handleType, int fd ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifdef VK_USE_PLATFORM_WIN32_KHX + Result getSemaphoreWin32HandleKHX( Semaphore semaphore, ExternalSemaphoreHandleTypeFlagBitsKHX handleType, HANDLE* pHandle ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType<HANDLE>::type getSemaphoreWin32HandleKHX( Semaphore semaphore, ExternalSemaphoreHandleTypeFlagBitsKHX handleType ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_WIN32_KHX*/ + +#ifdef VK_USE_PLATFORM_WIN32_KHX + Result importSemaphoreWin32HandleKHX( const ImportSemaphoreWin32HandleInfoKHX* pImportSemaphoreWin32HandleInfo ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType<void>::type importSemaphoreWin32HandleKHX( const ImportSemaphoreWin32HandleInfoKHX & importSemaphoreWin32HandleInfo ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_WIN32_KHX*/ + + Result getSemaphoreFdKHX( Semaphore semaphore, ExternalSemaphoreHandleTypeFlagBitsKHX handleType, int* pFd ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType<int>::type getSemaphoreFdKHX( Semaphore semaphore, ExternalSemaphoreHandleTypeFlagBitsKHX handleType ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + Result importSemaphoreFdKHX( const ImportSemaphoreFdInfoKHX* pImportSemaphoreFdInfo ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType<void>::type importSemaphoreFdKHX( const ImportSemaphoreFdInfoKHX & importSemaphoreFdInfo ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + Result displayPowerControlEXT( DisplayKHR display, const DisplayPowerInfoEXT* pDisplayPowerInfo ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE ResultValueType<void>::type displayPowerControlEXT( DisplayKHR display, const DisplayPowerInfoEXT & displayPowerInfo ) const; @@ -19056,6 +23069,51 @@ namespace vk ResultValue<uint64_t> getSwapchainCounterEXT( SwapchainKHR swapchain, SurfaceCounterFlagBitsEXT counter ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + void getGroupPeerMemoryFeaturesKHX( uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, PeerMemoryFeatureFlagsKHX* pPeerMemoryFeatures ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + PeerMemoryFeatureFlagsKHX getGroupPeerMemoryFeaturesKHX( uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + Result bindBufferMemory2KHX( uint32_t bindInfoCount, const BindBufferMemoryInfoKHX* pBindInfos ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType<void>::type bindBufferMemory2KHX( ArrayProxy<const BindBufferMemoryInfoKHX> bindInfos ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + Result bindImageMemory2KHX( uint32_t bindInfoCount, const BindImageMemoryInfoKHX* pBindInfos ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType<void>::type bindImageMemory2KHX( ArrayProxy<const BindImageMemoryInfoKHX> bindInfos ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + Result getGroupPresentCapabilitiesKHX( DeviceGroupPresentCapabilitiesKHX* pDeviceGroupPresentCapabilities ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType<DeviceGroupPresentCapabilitiesKHX>::type getGroupPresentCapabilitiesKHX() const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + Result getGroupSurfacePresentModesKHX( SurfaceKHR surface, DeviceGroupPresentModeFlagsKHX* pModes ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType<DeviceGroupPresentModeFlagsKHX>::type getGroupSurfacePresentModesKHX( SurfaceKHR surface ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + Result acquireNextImage2KHX( const AcquireNextImageInfoKHX* pAcquireInfo, uint32_t* pImageIndex ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValue<uint32_t> acquireNextImage2KHX( const AcquireNextImageInfoKHX & acquireInfo ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + Result createDescriptorUpdateTemplateKHR( const DescriptorUpdateTemplateCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, DescriptorUpdateTemplateKHR* pDescriptorUpdateTemplate ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType<DescriptorUpdateTemplateKHR>::type createDescriptorUpdateTemplateKHR( const DescriptorUpdateTemplateCreateInfoKHR & createInfo, Optional<const AllocationCallbacks> allocator = nullptr ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + UniqueDescriptorUpdateTemplateKHR createDescriptorUpdateTemplateKHRUnique( const DescriptorUpdateTemplateCreateInfoKHR & createInfo, Optional<const AllocationCallbacks> allocator = nullptr ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + void destroyDescriptorUpdateTemplateKHR( DescriptorUpdateTemplateKHR descriptorUpdateTemplate, const AllocationCallbacks* pAllocator ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + void destroyDescriptorUpdateTemplateKHR( DescriptorUpdateTemplateKHR descriptorUpdateTemplate, Optional<const AllocationCallbacks> allocator = nullptr ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + void updateDescriptorSetWithTemplateKHR( DescriptorSet descriptorSet, DescriptorUpdateTemplateKHR descriptorUpdateTemplate, const void* pData ) const; + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkDevice() const { return m_device; @@ -19203,6 +23261,24 @@ namespace vk Optional<const AllocationCallbacks> m_allocator; }; + class DescriptorUpdateTemplateKHRDeleter + { + public: + DescriptorUpdateTemplateKHRDeleter( Device device = Device(), Optional<const AllocationCallbacks> allocator = nullptr ) + : m_device( device ) + , m_allocator( allocator ) + {} + + void operator()( DescriptorUpdateTemplateKHR descriptorUpdateTemplateKHR ) + { + m_device.destroyDescriptorUpdateTemplateKHR( descriptorUpdateTemplateKHR, m_allocator ); + } + + private: + Device m_device; + Optional<const AllocationCallbacks> m_allocator; + }; + class DeviceMemoryDeleter { public: @@ -20860,6 +24936,116 @@ namespace vk vkTrimCommandPoolKHR( m_device, static_cast<VkCommandPool>( commandPool ), static_cast<VkCommandPoolTrimFlagsKHR>( flags ) ); } +#ifdef VK_USE_PLATFORM_WIN32_KHR + VULKAN_HPP_INLINE Result Device::getMemoryWin32HandleKHX( DeviceMemory memory, ExternalMemoryHandleTypeFlagBitsKHX handleType, HANDLE* pHandle ) const + { + return static_cast<Result>( vkGetMemoryWin32HandleKHX( m_device, static_cast<VkDeviceMemory>( memory ), static_cast<VkExternalMemoryHandleTypeFlagBitsKHX>( handleType ), pHandle ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType<HANDLE>::type Device::getMemoryWin32HandleKHX( DeviceMemory memory, ExternalMemoryHandleTypeFlagBitsKHX handleType ) const + { + HANDLE handle; + Result result = static_cast<Result>( vkGetMemoryWin32HandleKHX( m_device, static_cast<VkDeviceMemory>( memory ), static_cast<VkExternalMemoryHandleTypeFlagBitsKHX>( handleType ), &handle ) ); + return createResultValue( result, handle, "vk::Device::getMemoryWin32HandleKHX" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + +#ifdef VK_USE_PLATFORM_WIN32_KHR + VULKAN_HPP_INLINE Result Device::getMemoryWin32HandlePropertiesKHX( ExternalMemoryHandleTypeFlagBitsKHX handleType, HANDLE handle, MemoryWin32HandlePropertiesKHX* pMemoryWin32HandleProperties ) const + { + return static_cast<Result>( vkGetMemoryWin32HandlePropertiesKHX( m_device, static_cast<VkExternalMemoryHandleTypeFlagBitsKHX>( handleType ), handle, reinterpret_cast<VkMemoryWin32HandlePropertiesKHX*>( pMemoryWin32HandleProperties ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType<MemoryWin32HandlePropertiesKHX>::type Device::getMemoryWin32HandlePropertiesKHX( ExternalMemoryHandleTypeFlagBitsKHX handleType, HANDLE handle ) const + { + MemoryWin32HandlePropertiesKHX memoryWin32HandleProperties; + Result result = static_cast<Result>( vkGetMemoryWin32HandlePropertiesKHX( m_device, static_cast<VkExternalMemoryHandleTypeFlagBitsKHX>( handleType ), handle, reinterpret_cast<VkMemoryWin32HandlePropertiesKHX*>( &memoryWin32HandleProperties ) ) ); + return createResultValue( result, memoryWin32HandleProperties, "vk::Device::getMemoryWin32HandlePropertiesKHX" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + + VULKAN_HPP_INLINE Result Device::getMemoryFdKHX( DeviceMemory memory, ExternalMemoryHandleTypeFlagBitsKHX handleType, int* pFd ) const + { + return static_cast<Result>( vkGetMemoryFdKHX( m_device, static_cast<VkDeviceMemory>( memory ), static_cast<VkExternalMemoryHandleTypeFlagBitsKHX>( handleType ), pFd ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType<int>::type Device::getMemoryFdKHX( DeviceMemory memory, ExternalMemoryHandleTypeFlagBitsKHX handleType ) const + { + int fd; + Result result = static_cast<Result>( vkGetMemoryFdKHX( m_device, static_cast<VkDeviceMemory>( memory ), static_cast<VkExternalMemoryHandleTypeFlagBitsKHX>( handleType ), &fd ) ); + return createResultValue( result, fd, "vk::Device::getMemoryFdKHX" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::getMemoryFdPropertiesKHX( ExternalMemoryHandleTypeFlagBitsKHX handleType, int fd, MemoryFdPropertiesKHX* pMemoryFdProperties ) const + { + return static_cast<Result>( vkGetMemoryFdPropertiesKHX( m_device, static_cast<VkExternalMemoryHandleTypeFlagBitsKHX>( handleType ), fd, reinterpret_cast<VkMemoryFdPropertiesKHX*>( pMemoryFdProperties ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType<MemoryFdPropertiesKHX>::type Device::getMemoryFdPropertiesKHX( ExternalMemoryHandleTypeFlagBitsKHX handleType, int fd ) const + { + MemoryFdPropertiesKHX memoryFdProperties; + Result result = static_cast<Result>( vkGetMemoryFdPropertiesKHX( m_device, static_cast<VkExternalMemoryHandleTypeFlagBitsKHX>( handleType ), fd, reinterpret_cast<VkMemoryFdPropertiesKHX*>( &memoryFdProperties ) ) ); + return createResultValue( result, memoryFdProperties, "vk::Device::getMemoryFdPropertiesKHX" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifdef VK_USE_PLATFORM_WIN32_KHX + VULKAN_HPP_INLINE Result Device::getSemaphoreWin32HandleKHX( Semaphore semaphore, ExternalSemaphoreHandleTypeFlagBitsKHX handleType, HANDLE* pHandle ) const + { + return static_cast<Result>( vkGetSemaphoreWin32HandleKHX( m_device, static_cast<VkSemaphore>( semaphore ), static_cast<VkExternalSemaphoreHandleTypeFlagBitsKHX>( handleType ), pHandle ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType<HANDLE>::type Device::getSemaphoreWin32HandleKHX( Semaphore semaphore, ExternalSemaphoreHandleTypeFlagBitsKHX handleType ) const + { + HANDLE handle; + Result result = static_cast<Result>( vkGetSemaphoreWin32HandleKHX( m_device, static_cast<VkSemaphore>( semaphore ), static_cast<VkExternalSemaphoreHandleTypeFlagBitsKHX>( handleType ), &handle ) ); + return createResultValue( result, handle, "vk::Device::getSemaphoreWin32HandleKHX" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_WIN32_KHX*/ + +#ifdef VK_USE_PLATFORM_WIN32_KHX + VULKAN_HPP_INLINE Result Device::importSemaphoreWin32HandleKHX( const ImportSemaphoreWin32HandleInfoKHX* pImportSemaphoreWin32HandleInfo ) const + { + return static_cast<Result>( vkImportSemaphoreWin32HandleKHX( m_device, reinterpret_cast<const VkImportSemaphoreWin32HandleInfoKHX*>( pImportSemaphoreWin32HandleInfo ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType<void>::type Device::importSemaphoreWin32HandleKHX( const ImportSemaphoreWin32HandleInfoKHX & importSemaphoreWin32HandleInfo ) const + { + Result result = static_cast<Result>( vkImportSemaphoreWin32HandleKHX( m_device, reinterpret_cast<const VkImportSemaphoreWin32HandleInfoKHX*>( &importSemaphoreWin32HandleInfo ) ) ); + return createResultValue( result, "vk::Device::importSemaphoreWin32HandleKHX" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_WIN32_KHX*/ + + VULKAN_HPP_INLINE Result Device::getSemaphoreFdKHX( Semaphore semaphore, ExternalSemaphoreHandleTypeFlagBitsKHX handleType, int* pFd ) const + { + return static_cast<Result>( vkGetSemaphoreFdKHX( m_device, static_cast<VkSemaphore>( semaphore ), static_cast<VkExternalSemaphoreHandleTypeFlagBitsKHX>( handleType ), pFd ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType<int>::type Device::getSemaphoreFdKHX( Semaphore semaphore, ExternalSemaphoreHandleTypeFlagBitsKHX handleType ) const + { + int fd; + Result result = static_cast<Result>( vkGetSemaphoreFdKHX( m_device, static_cast<VkSemaphore>( semaphore ), static_cast<VkExternalSemaphoreHandleTypeFlagBitsKHX>( handleType ), &fd ) ); + return createResultValue( result, fd, "vk::Device::getSemaphoreFdKHX" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::importSemaphoreFdKHX( const ImportSemaphoreFdInfoKHX* pImportSemaphoreFdInfo ) const + { + return static_cast<Result>( vkImportSemaphoreFdKHX( m_device, reinterpret_cast<const VkImportSemaphoreFdInfoKHX*>( pImportSemaphoreFdInfo ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType<void>::type Device::importSemaphoreFdKHX( const ImportSemaphoreFdInfoKHX & importSemaphoreFdInfo ) const + { + Result result = static_cast<Result>( vkImportSemaphoreFdKHX( m_device, reinterpret_cast<const VkImportSemaphoreFdInfoKHX*>( &importSemaphoreFdInfo ) ) ); + return createResultValue( result, "vk::Device::importSemaphoreFdKHX" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + VULKAN_HPP_INLINE Result Device::displayPowerControlEXT( DisplayKHR display, const DisplayPowerInfoEXT* pDisplayPowerInfo ) const { return static_cast<Result>( vkDisplayPowerControlEXT( m_device, static_cast<VkDisplayKHR>( display ), reinterpret_cast<const VkDisplayPowerInfoEXT*>( pDisplayPowerInfo ) ) ); @@ -20910,6 +25096,118 @@ namespace vk return createResultValue( result, counterValue, "vk::Device::getSwapchainCounterEXT", { Result::eSuccess, Result::eErrorDeviceLost, Result::eErrorOutOfDateKHR } ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Device::getGroupPeerMemoryFeaturesKHX( uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, PeerMemoryFeatureFlagsKHX* pPeerMemoryFeatures ) const + { + vkGetDeviceGroupPeerMemoryFeaturesKHX( m_device, heapIndex, localDeviceIndex, remoteDeviceIndex, reinterpret_cast<VkPeerMemoryFeatureFlagsKHX*>( pPeerMemoryFeatures ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE PeerMemoryFeatureFlagsKHX Device::getGroupPeerMemoryFeaturesKHX( uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex ) const + { + PeerMemoryFeatureFlagsKHX peerMemoryFeatures; + vkGetDeviceGroupPeerMemoryFeaturesKHX( m_device, heapIndex, localDeviceIndex, remoteDeviceIndex, reinterpret_cast<VkPeerMemoryFeatureFlagsKHX*>( &peerMemoryFeatures ) ); + return peerMemoryFeatures; + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::bindBufferMemory2KHX( uint32_t bindInfoCount, const BindBufferMemoryInfoKHX* pBindInfos ) const + { + return static_cast<Result>( vkBindBufferMemory2KHX( m_device, bindInfoCount, reinterpret_cast<const VkBindBufferMemoryInfoKHX*>( pBindInfos ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType<void>::type Device::bindBufferMemory2KHX( ArrayProxy<const BindBufferMemoryInfoKHX> bindInfos ) const + { + Result result = static_cast<Result>( vkBindBufferMemory2KHX( m_device, bindInfos.size() , reinterpret_cast<const VkBindBufferMemoryInfoKHX*>( bindInfos.data() ) ) ); + return createResultValue( result, "vk::Device::bindBufferMemory2KHX" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::bindImageMemory2KHX( uint32_t bindInfoCount, const BindImageMemoryInfoKHX* pBindInfos ) const + { + return static_cast<Result>( vkBindImageMemory2KHX( m_device, bindInfoCount, reinterpret_cast<const VkBindImageMemoryInfoKHX*>( pBindInfos ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType<void>::type Device::bindImageMemory2KHX( ArrayProxy<const BindImageMemoryInfoKHX> bindInfos ) const + { + Result result = static_cast<Result>( vkBindImageMemory2KHX( m_device, bindInfos.size() , reinterpret_cast<const VkBindImageMemoryInfoKHX*>( bindInfos.data() ) ) ); + return createResultValue( result, "vk::Device::bindImageMemory2KHX" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::getGroupPresentCapabilitiesKHX( DeviceGroupPresentCapabilitiesKHX* pDeviceGroupPresentCapabilities ) const + { + return static_cast<Result>( vkGetDeviceGroupPresentCapabilitiesKHX( m_device, reinterpret_cast<VkDeviceGroupPresentCapabilitiesKHX*>( pDeviceGroupPresentCapabilities ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType<DeviceGroupPresentCapabilitiesKHX>::type Device::getGroupPresentCapabilitiesKHX() const + { + DeviceGroupPresentCapabilitiesKHX deviceGroupPresentCapabilities; + Result result = static_cast<Result>( vkGetDeviceGroupPresentCapabilitiesKHX( m_device, reinterpret_cast<VkDeviceGroupPresentCapabilitiesKHX*>( &deviceGroupPresentCapabilities ) ) ); + return createResultValue( result, deviceGroupPresentCapabilities, "vk::Device::getGroupPresentCapabilitiesKHX" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::getGroupSurfacePresentModesKHX( SurfaceKHR surface, DeviceGroupPresentModeFlagsKHX* pModes ) const + { + return static_cast<Result>( vkGetDeviceGroupSurfacePresentModesKHX( m_device, static_cast<VkSurfaceKHR>( surface ), reinterpret_cast<VkDeviceGroupPresentModeFlagsKHX*>( pModes ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType<DeviceGroupPresentModeFlagsKHX>::type Device::getGroupSurfacePresentModesKHX( SurfaceKHR surface ) const + { + DeviceGroupPresentModeFlagsKHX modes; + Result result = static_cast<Result>( vkGetDeviceGroupSurfacePresentModesKHX( m_device, static_cast<VkSurfaceKHR>( surface ), reinterpret_cast<VkDeviceGroupPresentModeFlagsKHX*>( &modes ) ) ); + return createResultValue( result, modes, "vk::Device::getGroupSurfacePresentModesKHX" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::acquireNextImage2KHX( const AcquireNextImageInfoKHX* pAcquireInfo, uint32_t* pImageIndex ) const + { + return static_cast<Result>( vkAcquireNextImage2KHX( m_device, reinterpret_cast<const VkAcquireNextImageInfoKHX*>( pAcquireInfo ), pImageIndex ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValue<uint32_t> Device::acquireNextImage2KHX( const AcquireNextImageInfoKHX & acquireInfo ) const + { + uint32_t imageIndex; + Result result = static_cast<Result>( vkAcquireNextImage2KHX( m_device, reinterpret_cast<const VkAcquireNextImageInfoKHX*>( &acquireInfo ), &imageIndex ) ); + return createResultValue( result, imageIndex, "vk::Device::acquireNextImage2KHX", { Result::eSuccess, Result::eTimeout, Result::eNotReady, Result::eSuboptimalKHR } ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::createDescriptorUpdateTemplateKHR( const DescriptorUpdateTemplateCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, DescriptorUpdateTemplateKHR* pDescriptorUpdateTemplate ) const + { + return static_cast<Result>( vkCreateDescriptorUpdateTemplateKHR( m_device, reinterpret_cast<const VkDescriptorUpdateTemplateCreateInfoKHR*>( pCreateInfo ), reinterpret_cast<const VkAllocationCallbacks*>( pAllocator ), reinterpret_cast<VkDescriptorUpdateTemplateKHR*>( pDescriptorUpdateTemplate ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType<DescriptorUpdateTemplateKHR>::type Device::createDescriptorUpdateTemplateKHR( const DescriptorUpdateTemplateCreateInfoKHR & createInfo, Optional<const AllocationCallbacks> allocator ) const + { + DescriptorUpdateTemplateKHR descriptorUpdateTemplate; + Result result = static_cast<Result>( vkCreateDescriptorUpdateTemplateKHR( m_device, reinterpret_cast<const VkDescriptorUpdateTemplateCreateInfoKHR*>( &createInfo ), reinterpret_cast<const VkAllocationCallbacks*>( static_cast<const AllocationCallbacks*>( allocator)), reinterpret_cast<VkDescriptorUpdateTemplateKHR*>( &descriptorUpdateTemplate ) ) ); + return createResultValue( result, descriptorUpdateTemplate, "vk::Device::createDescriptorUpdateTemplateKHR" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + VULKAN_HPP_INLINE UniqueDescriptorUpdateTemplateKHR Device::createDescriptorUpdateTemplateKHRUnique( const DescriptorUpdateTemplateCreateInfoKHR & createInfo, Optional<const AllocationCallbacks> allocator ) const + { + DescriptorUpdateTemplateKHRDeleter deleter( *this, allocator ); + return UniqueDescriptorUpdateTemplateKHR( createDescriptorUpdateTemplateKHR( createInfo, allocator ), deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Device::destroyDescriptorUpdateTemplateKHR( DescriptorUpdateTemplateKHR descriptorUpdateTemplate, const AllocationCallbacks* pAllocator ) const + { + vkDestroyDescriptorUpdateTemplateKHR( m_device, static_cast<VkDescriptorUpdateTemplateKHR>( descriptorUpdateTemplate ), reinterpret_cast<const VkAllocationCallbacks*>( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void Device::destroyDescriptorUpdateTemplateKHR( DescriptorUpdateTemplateKHR descriptorUpdateTemplate, Optional<const AllocationCallbacks> allocator ) const + { + vkDestroyDescriptorUpdateTemplateKHR( m_device, static_cast<VkDescriptorUpdateTemplateKHR>( descriptorUpdateTemplate ), reinterpret_cast<const VkAllocationCallbacks*>( static_cast<const AllocationCallbacks*>( allocator)) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Device::updateDescriptorSetWithTemplateKHR( DescriptorSet descriptorSet, DescriptorUpdateTemplateKHR descriptorUpdateTemplate, const void* pData ) const + { + vkUpdateDescriptorSetWithTemplateKHR( m_device, static_cast<VkDescriptorSet>( descriptorSet ), static_cast<VkDescriptorUpdateTemplateKHR>( descriptorUpdateTemplate ), pData ); + } #ifndef VULKAN_HPP_NO_SMART_HANDLE class DeviceDeleter; using UniqueDevice = UniqueHandle<Device, DeviceDeleter>; @@ -21151,6 +25449,26 @@ namespace vk std::vector<SparseImageFormatProperties2KHR,Allocator> getSparseImageFormatProperties2KHR( const PhysicalDeviceSparseImageFormatInfo2KHR & formatInfo ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + void getProperties2KHX( PhysicalDeviceProperties2KHX* pProperties ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + PhysicalDeviceProperties2KHX getProperties2KHX() const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + Result getImageFormatProperties2KHX( const PhysicalDeviceImageFormatInfo2KHX* pImageFormatInfo, ImageFormatProperties2KHX* pImageFormatProperties ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType<ImageFormatProperties2KHX>::type getImageFormatProperties2KHX( const PhysicalDeviceImageFormatInfo2KHX & imageFormatInfo ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + void getExternalBufferPropertiesKHX( const PhysicalDeviceExternalBufferInfoKHX* pExternalBufferInfo, ExternalBufferPropertiesKHX* pExternalBufferProperties ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ExternalBufferPropertiesKHX getExternalBufferPropertiesKHX( const PhysicalDeviceExternalBufferInfoKHX & externalBufferInfo ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + void getExternalSemaphorePropertiesKHX( const PhysicalDeviceExternalSemaphoreInfoKHX* pExternalSemaphoreInfo, ExternalSemaphorePropertiesKHX* pExternalSemaphoreProperties ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ExternalSemaphorePropertiesKHX getExternalSemaphorePropertiesKHX( const PhysicalDeviceExternalSemaphoreInfoKHX & externalSemaphoreInfo ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + #ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE Result releaseDisplayEXT( DisplayKHR display ) const; #else @@ -21176,6 +25494,12 @@ namespace vk ResultValueType<SurfaceCapabilities2EXT>::type getSurfaceCapabilities2EXT( SurfaceKHR surface ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + Result getPresentRectanglesKHX( SurfaceKHR surface, uint32_t* pRectCount, Rect2D* pRects ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template <typename Allocator = std::allocator<Rect2D>> + typename ResultValueType<std::vector<Rect2D,Allocator>>::type getPresentRectanglesKHX( SurfaceKHR surface ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkPhysicalDevice() const { return m_physicalDevice; @@ -21777,6 +26101,58 @@ namespace vk } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + VULKAN_HPP_INLINE void PhysicalDevice::getProperties2KHX( PhysicalDeviceProperties2KHX* pProperties ) const + { + vkGetPhysicalDeviceProperties2KHX( m_physicalDevice, reinterpret_cast<VkPhysicalDeviceProperties2KHX*>( pProperties ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE PhysicalDeviceProperties2KHX PhysicalDevice::getProperties2KHX() const + { + PhysicalDeviceProperties2KHX properties; + vkGetPhysicalDeviceProperties2KHX( m_physicalDevice, reinterpret_cast<VkPhysicalDeviceProperties2KHX*>( &properties ) ); + return properties; + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result PhysicalDevice::getImageFormatProperties2KHX( const PhysicalDeviceImageFormatInfo2KHX* pImageFormatInfo, ImageFormatProperties2KHX* pImageFormatProperties ) const + { + return static_cast<Result>( vkGetPhysicalDeviceImageFormatProperties2KHX( m_physicalDevice, reinterpret_cast<const VkPhysicalDeviceImageFormatInfo2KHX*>( pImageFormatInfo ), reinterpret_cast<VkImageFormatProperties2KHX*>( pImageFormatProperties ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType<ImageFormatProperties2KHX>::type PhysicalDevice::getImageFormatProperties2KHX( const PhysicalDeviceImageFormatInfo2KHX & imageFormatInfo ) const + { + ImageFormatProperties2KHX imageFormatProperties; + Result result = static_cast<Result>( vkGetPhysicalDeviceImageFormatProperties2KHX( m_physicalDevice, reinterpret_cast<const VkPhysicalDeviceImageFormatInfo2KHX*>( &imageFormatInfo ), reinterpret_cast<VkImageFormatProperties2KHX*>( &imageFormatProperties ) ) ); + return createResultValue( result, imageFormatProperties, "vk::PhysicalDevice::getImageFormatProperties2KHX" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void PhysicalDevice::getExternalBufferPropertiesKHX( const PhysicalDeviceExternalBufferInfoKHX* pExternalBufferInfo, ExternalBufferPropertiesKHX* pExternalBufferProperties ) const + { + vkGetPhysicalDeviceExternalBufferPropertiesKHX( m_physicalDevice, reinterpret_cast<const VkPhysicalDeviceExternalBufferInfoKHX*>( pExternalBufferInfo ), reinterpret_cast<VkExternalBufferPropertiesKHX*>( pExternalBufferProperties ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ExternalBufferPropertiesKHX PhysicalDevice::getExternalBufferPropertiesKHX( const PhysicalDeviceExternalBufferInfoKHX & externalBufferInfo ) const + { + ExternalBufferPropertiesKHX externalBufferProperties; + vkGetPhysicalDeviceExternalBufferPropertiesKHX( m_physicalDevice, reinterpret_cast<const VkPhysicalDeviceExternalBufferInfoKHX*>( &externalBufferInfo ), reinterpret_cast<VkExternalBufferPropertiesKHX*>( &externalBufferProperties ) ); + return externalBufferProperties; + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void PhysicalDevice::getExternalSemaphorePropertiesKHX( const PhysicalDeviceExternalSemaphoreInfoKHX* pExternalSemaphoreInfo, ExternalSemaphorePropertiesKHX* pExternalSemaphoreProperties ) const + { + vkGetPhysicalDeviceExternalSemaphorePropertiesKHX( m_physicalDevice, reinterpret_cast<const VkPhysicalDeviceExternalSemaphoreInfoKHX*>( pExternalSemaphoreInfo ), reinterpret_cast<VkExternalSemaphorePropertiesKHX*>( pExternalSemaphoreProperties ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ExternalSemaphorePropertiesKHX PhysicalDevice::getExternalSemaphorePropertiesKHX( const PhysicalDeviceExternalSemaphoreInfoKHX & externalSemaphoreInfo ) const + { + ExternalSemaphorePropertiesKHX externalSemaphoreProperties; + vkGetPhysicalDeviceExternalSemaphorePropertiesKHX( m_physicalDevice, reinterpret_cast<const VkPhysicalDeviceExternalSemaphoreInfoKHX*>( &externalSemaphoreInfo ), reinterpret_cast<VkExternalSemaphorePropertiesKHX*>( &externalSemaphoreProperties ) ); + return externalSemaphoreProperties; + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + #ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE VULKAN_HPP_INLINE Result PhysicalDevice::releaseDisplayEXT( DisplayKHR display ) const { @@ -21832,6 +26208,203 @@ namespace vk return createResultValue( result, surfaceCapabilities, "vk::PhysicalDevice::getSurfaceCapabilities2EXT" ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result PhysicalDevice::getPresentRectanglesKHX( SurfaceKHR surface, uint32_t* pRectCount, Rect2D* pRects ) const + { + return static_cast<Result>( vkGetPhysicalDevicePresentRectanglesKHX( m_physicalDevice, static_cast<VkSurfaceKHR>( surface ), pRectCount, reinterpret_cast<VkRect2D*>( pRects ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template <typename Allocator> + VULKAN_HPP_INLINE typename ResultValueType<std::vector<Rect2D,Allocator>>::type PhysicalDevice::getPresentRectanglesKHX( SurfaceKHR surface ) const + { + std::vector<Rect2D,Allocator> rects; + uint32_t rectCount; + Result result; + do + { + result = static_cast<Result>( vkGetPhysicalDevicePresentRectanglesKHX( m_physicalDevice, static_cast<VkSurfaceKHR>( surface ), &rectCount, nullptr ) ); + if ( ( result == Result::eSuccess ) && rectCount ) + { + rects.resize( rectCount ); + result = static_cast<Result>( vkGetPhysicalDevicePresentRectanglesKHX( m_physicalDevice, static_cast<VkSurfaceKHR>( surface ), &rectCount, reinterpret_cast<VkRect2D*>( rects.data() ) ) ); + } + } while ( result == Result::eIncomplete ); + assert( rectCount <= rects.size() ); + rects.resize( rectCount ); + return createResultValue( result, rects, "vk::PhysicalDevice::getPresentRectanglesKHX" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + struct CmdProcessCommandsInfoNVX + { + CmdProcessCommandsInfoNVX( ObjectTableNVX objectTable_ = ObjectTableNVX(), IndirectCommandsLayoutNVX indirectCommandsLayout_ = IndirectCommandsLayoutNVX(), uint32_t indirectCommandsTokenCount_ = 0, const IndirectCommandsTokenNVX* pIndirectCommandsTokens_ = nullptr, uint32_t maxSequencesCount_ = 0, CommandBuffer targetCommandBuffer_ = CommandBuffer(), Buffer sequencesCountBuffer_ = Buffer(), DeviceSize sequencesCountOffset_ = 0, Buffer sequencesIndexBuffer_ = Buffer(), DeviceSize sequencesIndexOffset_ = 0 ) + : sType( StructureType::eCmdProcessCommandsInfoNVX ) + , pNext( nullptr ) + , objectTable( objectTable_ ) + , indirectCommandsLayout( indirectCommandsLayout_ ) + , indirectCommandsTokenCount( indirectCommandsTokenCount_ ) + , pIndirectCommandsTokens( pIndirectCommandsTokens_ ) + , maxSequencesCount( maxSequencesCount_ ) + , targetCommandBuffer( targetCommandBuffer_ ) + , sequencesCountBuffer( sequencesCountBuffer_ ) + , sequencesCountOffset( sequencesCountOffset_ ) + , sequencesIndexBuffer( sequencesIndexBuffer_ ) + , sequencesIndexOffset( sequencesIndexOffset_ ) + { + } + + CmdProcessCommandsInfoNVX( VkCmdProcessCommandsInfoNVX const & rhs ) + { + memcpy( this, &rhs, sizeof(CmdProcessCommandsInfoNVX) ); + } + + CmdProcessCommandsInfoNVX& operator=( VkCmdProcessCommandsInfoNVX const & rhs ) + { + memcpy( this, &rhs, sizeof(CmdProcessCommandsInfoNVX) ); + return *this; + } + + CmdProcessCommandsInfoNVX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + CmdProcessCommandsInfoNVX& setObjectTable( ObjectTableNVX objectTable_ ) + { + objectTable = objectTable_; + return *this; + } + + CmdProcessCommandsInfoNVX& setIndirectCommandsLayout( IndirectCommandsLayoutNVX indirectCommandsLayout_ ) + { + indirectCommandsLayout = indirectCommandsLayout_; + return *this; + } + + CmdProcessCommandsInfoNVX& setIndirectCommandsTokenCount( uint32_t indirectCommandsTokenCount_ ) + { + indirectCommandsTokenCount = indirectCommandsTokenCount_; + return *this; + } + + CmdProcessCommandsInfoNVX& setPIndirectCommandsTokens( const IndirectCommandsTokenNVX* pIndirectCommandsTokens_ ) + { + pIndirectCommandsTokens = pIndirectCommandsTokens_; + return *this; + } + + CmdProcessCommandsInfoNVX& setMaxSequencesCount( uint32_t maxSequencesCount_ ) + { + maxSequencesCount = maxSequencesCount_; + return *this; + } + + CmdProcessCommandsInfoNVX& setTargetCommandBuffer( CommandBuffer targetCommandBuffer_ ) + { + targetCommandBuffer = targetCommandBuffer_; + return *this; + } + + CmdProcessCommandsInfoNVX& setSequencesCountBuffer( Buffer sequencesCountBuffer_ ) + { + sequencesCountBuffer = sequencesCountBuffer_; + return *this; + } + + CmdProcessCommandsInfoNVX& setSequencesCountOffset( DeviceSize sequencesCountOffset_ ) + { + sequencesCountOffset = sequencesCountOffset_; + return *this; + } + + CmdProcessCommandsInfoNVX& setSequencesIndexBuffer( Buffer sequencesIndexBuffer_ ) + { + sequencesIndexBuffer = sequencesIndexBuffer_; + return *this; + } + + CmdProcessCommandsInfoNVX& setSequencesIndexOffset( DeviceSize sequencesIndexOffset_ ) + { + sequencesIndexOffset = sequencesIndexOffset_; + return *this; + } + + operator const VkCmdProcessCommandsInfoNVX&() const + { + return *reinterpret_cast<const VkCmdProcessCommandsInfoNVX*>(this); + } + + bool operator==( CmdProcessCommandsInfoNVX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( objectTable == rhs.objectTable ) + && ( indirectCommandsLayout == rhs.indirectCommandsLayout ) + && ( indirectCommandsTokenCount == rhs.indirectCommandsTokenCount ) + && ( pIndirectCommandsTokens == rhs.pIndirectCommandsTokens ) + && ( maxSequencesCount == rhs.maxSequencesCount ) + && ( targetCommandBuffer == rhs.targetCommandBuffer ) + && ( sequencesCountBuffer == rhs.sequencesCountBuffer ) + && ( sequencesCountOffset == rhs.sequencesCountOffset ) + && ( sequencesIndexBuffer == rhs.sequencesIndexBuffer ) + && ( sequencesIndexOffset == rhs.sequencesIndexOffset ); + } + + bool operator!=( CmdProcessCommandsInfoNVX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + ObjectTableNVX objectTable; + IndirectCommandsLayoutNVX indirectCommandsLayout; + uint32_t indirectCommandsTokenCount; + const IndirectCommandsTokenNVX* pIndirectCommandsTokens; + uint32_t maxSequencesCount; + CommandBuffer targetCommandBuffer; + Buffer sequencesCountBuffer; + DeviceSize sequencesCountOffset; + Buffer sequencesIndexBuffer; + DeviceSize sequencesIndexOffset; + }; + static_assert( sizeof( CmdProcessCommandsInfoNVX ) == sizeof( VkCmdProcessCommandsInfoNVX ), "struct and wrapper have different size!" ); + + struct PhysicalDeviceGroupPropertiesKHX + { + operator const VkPhysicalDeviceGroupPropertiesKHX&() const + { + return *reinterpret_cast<const VkPhysicalDeviceGroupPropertiesKHX*>(this); + } + + bool operator==( PhysicalDeviceGroupPropertiesKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( physicalDeviceCount == rhs.physicalDeviceCount ) + && ( memcmp( physicalDevices, rhs.physicalDevices, VK_MAX_DEVICE_GROUP_SIZE_KHX * sizeof( PhysicalDevice ) ) == 0 ) + && ( subsetAllocation == rhs.subsetAllocation ); + } + + bool operator!=( PhysicalDeviceGroupPropertiesKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + uint32_t physicalDeviceCount; + PhysicalDevice physicalDevices[VK_MAX_DEVICE_GROUP_SIZE_KHX]; + Bool32 subsetAllocation; + }; + static_assert( sizeof( PhysicalDeviceGroupPropertiesKHX ) == sizeof( VkPhysicalDeviceGroupPropertiesKHX ), "struct and wrapper have different size!" ); + #ifndef VULKAN_HPP_NO_SMART_HANDLE class DebugReportCallbackEXTDeleter; using UniqueDebugReportCallbackEXT = UniqueHandle<DebugReportCallbackEXT, DebugReportCallbackEXTDeleter>; @@ -22000,6 +26573,32 @@ namespace vk void debugReportMessageEXT( DebugReportFlagsEXT flags, DebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const std::string & layerPrefix, const std::string & message ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + Result enumeratePhysicalDeviceGroupsKHX( uint32_t* pPhysicalDeviceGroupCount, PhysicalDeviceGroupPropertiesKHX* pPhysicalDeviceGroupProperties ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template <typename Allocator = std::allocator<PhysicalDeviceGroupPropertiesKHX>> + typename ResultValueType<std::vector<PhysicalDeviceGroupPropertiesKHX,Allocator>>::type enumeratePhysicalDeviceGroupsKHX() const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifdef VK_USE_PLATFORM_IOS_MVK + Result createIOSSurfaceMVK( const IOSSurfaceCreateInfoMVK* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType<SurfaceKHR>::type createIOSSurfaceMVK( const IOSSurfaceCreateInfoMVK & createInfo, Optional<const AllocationCallbacks> allocator = nullptr ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + UniqueSurfaceKHR createIOSSurfaceMVKUnique( const IOSSurfaceCreateInfoMVK & createInfo, Optional<const AllocationCallbacks> allocator = nullptr ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_IOS_MVK*/ + +#ifdef VK_USE_PLATFORM_MACOS_MVK + Result createMacOSSurfaceMVK( const MacOSSurfaceCreateInfoMVK* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType<SurfaceKHR>::type createMacOSSurfaceMVK( const MacOSSurfaceCreateInfoMVK & createInfo, Optional<const AllocationCallbacks> allocator = nullptr ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + UniqueSurfaceKHR createMacOSSurfaceMVKUnique( const MacOSSurfaceCreateInfoMVK & createInfo, Optional<const AllocationCallbacks> allocator = nullptr ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_MACOS_MVK*/ + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkInstance() const { return m_instance; @@ -22340,123 +26939,129 @@ namespace vk vkDebugReportMessageEXT( m_instance, static_cast<VkDebugReportFlagsEXT>( flags ), static_cast<VkDebugReportObjectTypeEXT>( objectType ), object, location, messageCode, layerPrefix.c_str(), message.c_str() ); } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - struct CmdProcessCommandsInfoNVX - { - CmdProcessCommandsInfoNVX( ObjectTableNVX objectTable_ = ObjectTableNVX(), IndirectCommandsLayoutNVX indirectCommandsLayout_ = IndirectCommandsLayoutNVX(), uint32_t indirectCommandsTokenCount_ = 0, const IndirectCommandsTokenNVX* pIndirectCommandsTokens_ = nullptr, uint32_t maxSequencesCount_ = 0, CommandBuffer targetCommandBuffer_ = CommandBuffer(), Buffer sequencesCountBuffer_ = Buffer(), DeviceSize sequencesCountOffset_ = 0, Buffer sequencesIndexBuffer_ = Buffer(), DeviceSize sequencesIndexOffset_ = 0 ) - : sType( StructureType::eCmdProcessCommandsInfoNVX ) - , pNext( nullptr ) - , objectTable( objectTable_ ) - , indirectCommandsLayout( indirectCommandsLayout_ ) - , indirectCommandsTokenCount( indirectCommandsTokenCount_ ) - , pIndirectCommandsTokens( pIndirectCommandsTokens_ ) - , maxSequencesCount( maxSequencesCount_ ) - , targetCommandBuffer( targetCommandBuffer_ ) - , sequencesCountBuffer( sequencesCountBuffer_ ) - , sequencesCountOffset( sequencesCountOffset_ ) - , sequencesIndexBuffer( sequencesIndexBuffer_ ) - , sequencesIndexOffset( sequencesIndexOffset_ ) - { - } - - CmdProcessCommandsInfoNVX( VkCmdProcessCommandsInfoNVX const & rhs ) - { - memcpy( this, &rhs, sizeof(CmdProcessCommandsInfoNVX) ); - } - CmdProcessCommandsInfoNVX& operator=( VkCmdProcessCommandsInfoNVX const & rhs ) - { - memcpy( this, &rhs, sizeof(CmdProcessCommandsInfoNVX) ); - return *this; - } - - CmdProcessCommandsInfoNVX& setPNext( const void* pNext_ ) - { - pNext = pNext_; - return *this; - } - - CmdProcessCommandsInfoNVX& setObjectTable( ObjectTableNVX objectTable_ ) - { - objectTable = objectTable_; - return *this; - } - - CmdProcessCommandsInfoNVX& setIndirectCommandsLayout( IndirectCommandsLayoutNVX indirectCommandsLayout_ ) - { - indirectCommandsLayout = indirectCommandsLayout_; - return *this; - } - - CmdProcessCommandsInfoNVX& setIndirectCommandsTokenCount( uint32_t indirectCommandsTokenCount_ ) + VULKAN_HPP_INLINE Result Instance::enumeratePhysicalDeviceGroupsKHX( uint32_t* pPhysicalDeviceGroupCount, PhysicalDeviceGroupPropertiesKHX* pPhysicalDeviceGroupProperties ) const + { + return static_cast<Result>( vkEnumeratePhysicalDeviceGroupsKHX( m_instance, pPhysicalDeviceGroupCount, reinterpret_cast<VkPhysicalDeviceGroupPropertiesKHX*>( pPhysicalDeviceGroupProperties ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template <typename Allocator> + VULKAN_HPP_INLINE typename ResultValueType<std::vector<PhysicalDeviceGroupPropertiesKHX,Allocator>>::type Instance::enumeratePhysicalDeviceGroupsKHX() const + { + std::vector<PhysicalDeviceGroupPropertiesKHX,Allocator> physicalDeviceGroupProperties; + uint32_t physicalDeviceGroupCount; + Result result; + do { - indirectCommandsTokenCount = indirectCommandsTokenCount_; - return *this; - } + result = static_cast<Result>( vkEnumeratePhysicalDeviceGroupsKHX( m_instance, &physicalDeviceGroupCount, nullptr ) ); + if ( ( result == Result::eSuccess ) && physicalDeviceGroupCount ) + { + physicalDeviceGroupProperties.resize( physicalDeviceGroupCount ); + result = static_cast<Result>( vkEnumeratePhysicalDeviceGroupsKHX( m_instance, &physicalDeviceGroupCount, reinterpret_cast<VkPhysicalDeviceGroupPropertiesKHX*>( physicalDeviceGroupProperties.data() ) ) ); + } + } while ( result == Result::eIncomplete ); + assert( physicalDeviceGroupCount <= physicalDeviceGroupProperties.size() ); + physicalDeviceGroupProperties.resize( physicalDeviceGroupCount ); + return createResultValue( result, physicalDeviceGroupProperties, "vk::Instance::enumeratePhysicalDeviceGroupsKHX" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - CmdProcessCommandsInfoNVX& setPIndirectCommandsTokens( const IndirectCommandsTokenNVX* pIndirectCommandsTokens_ ) - { - pIndirectCommandsTokens = pIndirectCommandsTokens_; - return *this; - } +#ifdef VK_USE_PLATFORM_IOS_MVK + VULKAN_HPP_INLINE Result Instance::createIOSSurfaceMVK( const IOSSurfaceCreateInfoMVK* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const + { + return static_cast<Result>( vkCreateIOSSurfaceMVK( m_instance, reinterpret_cast<const VkIOSSurfaceCreateInfoMVK*>( pCreateInfo ), reinterpret_cast<const VkAllocationCallbacks*>( pAllocator ), reinterpret_cast<VkSurfaceKHR*>( pSurface ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType<SurfaceKHR>::type Instance::createIOSSurfaceMVK( const IOSSurfaceCreateInfoMVK & createInfo, Optional<const AllocationCallbacks> allocator ) const + { + SurfaceKHR surface; + Result result = static_cast<Result>( vkCreateIOSSurfaceMVK( m_instance, reinterpret_cast<const VkIOSSurfaceCreateInfoMVK*>( &createInfo ), reinterpret_cast<const VkAllocationCallbacks*>( static_cast<const AllocationCallbacks*>( allocator)), reinterpret_cast<VkSurfaceKHR*>( &surface ) ) ); + return createResultValue( result, surface, "vk::Instance::createIOSSurfaceMVK" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + VULKAN_HPP_INLINE UniqueSurfaceKHR Instance::createIOSSurfaceMVKUnique( const IOSSurfaceCreateInfoMVK & createInfo, Optional<const AllocationCallbacks> allocator ) const + { + SurfaceKHRDeleter deleter( *this, allocator ); + return UniqueSurfaceKHR( createIOSSurfaceMVK( createInfo, allocator ), deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_IOS_MVK*/ - CmdProcessCommandsInfoNVX& setMaxSequencesCount( uint32_t maxSequencesCount_ ) +#ifdef VK_USE_PLATFORM_MACOS_MVK + VULKAN_HPP_INLINE Result Instance::createMacOSSurfaceMVK( const MacOSSurfaceCreateInfoMVK* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const + { + return static_cast<Result>( vkCreateMacOSSurfaceMVK( m_instance, reinterpret_cast<const VkMacOSSurfaceCreateInfoMVK*>( pCreateInfo ), reinterpret_cast<const VkAllocationCallbacks*>( pAllocator ), reinterpret_cast<VkSurfaceKHR*>( pSurface ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType<SurfaceKHR>::type Instance::createMacOSSurfaceMVK( const MacOSSurfaceCreateInfoMVK & createInfo, Optional<const AllocationCallbacks> allocator ) const + { + SurfaceKHR surface; + Result result = static_cast<Result>( vkCreateMacOSSurfaceMVK( m_instance, reinterpret_cast<const VkMacOSSurfaceCreateInfoMVK*>( &createInfo ), reinterpret_cast<const VkAllocationCallbacks*>( static_cast<const AllocationCallbacks*>( allocator)), reinterpret_cast<VkSurfaceKHR*>( &surface ) ) ); + return createResultValue( result, surface, "vk::Instance::createMacOSSurfaceMVK" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + VULKAN_HPP_INLINE UniqueSurfaceKHR Instance::createMacOSSurfaceMVKUnique( const MacOSSurfaceCreateInfoMVK & createInfo, Optional<const AllocationCallbacks> allocator ) const + { + SurfaceKHRDeleter deleter( *this, allocator ); + return UniqueSurfaceKHR( createMacOSSurfaceMVK( createInfo, allocator ), deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_MACOS_MVK*/ + struct DeviceGroupDeviceCreateInfoKHX + { + DeviceGroupDeviceCreateInfoKHX( uint32_t physicalDeviceCount_ = 0, const PhysicalDevice* pPhysicalDevices_ = nullptr ) + : sType( StructureType::eDeviceGroupDeviceCreateInfoKHX ) + , pNext( nullptr ) + , physicalDeviceCount( physicalDeviceCount_ ) + , pPhysicalDevices( pPhysicalDevices_ ) { - maxSequencesCount = maxSequencesCount_; - return *this; } - CmdProcessCommandsInfoNVX& setTargetCommandBuffer( CommandBuffer targetCommandBuffer_ ) + DeviceGroupDeviceCreateInfoKHX( VkDeviceGroupDeviceCreateInfoKHX const & rhs ) { - targetCommandBuffer = targetCommandBuffer_; - return *this; + memcpy( this, &rhs, sizeof(DeviceGroupDeviceCreateInfoKHX) ); } - CmdProcessCommandsInfoNVX& setSequencesCountBuffer( Buffer sequencesCountBuffer_ ) + DeviceGroupDeviceCreateInfoKHX& operator=( VkDeviceGroupDeviceCreateInfoKHX const & rhs ) { - sequencesCountBuffer = sequencesCountBuffer_; + memcpy( this, &rhs, sizeof(DeviceGroupDeviceCreateInfoKHX) ); return *this; } - CmdProcessCommandsInfoNVX& setSequencesCountOffset( DeviceSize sequencesCountOffset_ ) + DeviceGroupDeviceCreateInfoKHX& setPNext( const void* pNext_ ) { - sequencesCountOffset = sequencesCountOffset_; + pNext = pNext_; return *this; } - CmdProcessCommandsInfoNVX& setSequencesIndexBuffer( Buffer sequencesIndexBuffer_ ) + DeviceGroupDeviceCreateInfoKHX& setPhysicalDeviceCount( uint32_t physicalDeviceCount_ ) { - sequencesIndexBuffer = sequencesIndexBuffer_; + physicalDeviceCount = physicalDeviceCount_; return *this; } - CmdProcessCommandsInfoNVX& setSequencesIndexOffset( DeviceSize sequencesIndexOffset_ ) + DeviceGroupDeviceCreateInfoKHX& setPPhysicalDevices( const PhysicalDevice* pPhysicalDevices_ ) { - sequencesIndexOffset = sequencesIndexOffset_; + pPhysicalDevices = pPhysicalDevices_; return *this; } - operator const VkCmdProcessCommandsInfoNVX&() const + operator const VkDeviceGroupDeviceCreateInfoKHX&() const { - return *reinterpret_cast<const VkCmdProcessCommandsInfoNVX*>(this); + return *reinterpret_cast<const VkDeviceGroupDeviceCreateInfoKHX*>(this); } - bool operator==( CmdProcessCommandsInfoNVX const& rhs ) const + bool operator==( DeviceGroupDeviceCreateInfoKHX const& rhs ) const { return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) - && ( objectTable == rhs.objectTable ) - && ( indirectCommandsLayout == rhs.indirectCommandsLayout ) - && ( indirectCommandsTokenCount == rhs.indirectCommandsTokenCount ) - && ( pIndirectCommandsTokens == rhs.pIndirectCommandsTokens ) - && ( maxSequencesCount == rhs.maxSequencesCount ) - && ( targetCommandBuffer == rhs.targetCommandBuffer ) - && ( sequencesCountBuffer == rhs.sequencesCountBuffer ) - && ( sequencesCountOffset == rhs.sequencesCountOffset ) - && ( sequencesIndexBuffer == rhs.sequencesIndexBuffer ) - && ( sequencesIndexOffset == rhs.sequencesIndexOffset ); + && ( physicalDeviceCount == rhs.physicalDeviceCount ) + && ( pPhysicalDevices == rhs.pPhysicalDevices ); } - bool operator!=( CmdProcessCommandsInfoNVX const& rhs ) const + bool operator!=( DeviceGroupDeviceCreateInfoKHX const& rhs ) const { return !operator==( rhs ); } @@ -22466,18 +27071,10 @@ namespace vk public: const void* pNext; - ObjectTableNVX objectTable; - IndirectCommandsLayoutNVX indirectCommandsLayout; - uint32_t indirectCommandsTokenCount; - const IndirectCommandsTokenNVX* pIndirectCommandsTokens; - uint32_t maxSequencesCount; - CommandBuffer targetCommandBuffer; - Buffer sequencesCountBuffer; - DeviceSize sequencesCountOffset; - Buffer sequencesIndexBuffer; - DeviceSize sequencesIndexOffset; + uint32_t physicalDeviceCount; + const PhysicalDevice* pPhysicalDevices; }; - static_assert( sizeof( CmdProcessCommandsInfoNVX ) == sizeof( VkCmdProcessCommandsInfoNVX ), "struct and wrapper have different size!" ); + static_assert( sizeof( DeviceGroupDeviceCreateInfoKHX ) == sizeof( VkDeviceGroupDeviceCreateInfoKHX ), "struct and wrapper have different size!" ); #ifndef VULKAN_HPP_NO_SMART_HANDLE class InstanceDeleter; @@ -22690,16 +27287,6 @@ namespace vk return "{}"; } - VULKAN_HPP_INLINE std::string to_string(DescriptorSetLayoutCreateFlagBits) - { - return "(void)"; - } - - VULKAN_HPP_INLINE std::string to_string(DescriptorSetLayoutCreateFlags) - { - return "{}"; - } - VULKAN_HPP_INLINE std::string to_string(BufferViewCreateFlagBits) { return "(void)"; @@ -22790,16 +27377,6 @@ namespace vk return "{}"; } - VULKAN_HPP_INLINE std::string to_string(SubpassDescriptionFlagBits) - { - return "(void)"; - } - - VULKAN_HPP_INLINE std::string to_string(SubpassDescriptionFlags) - { - return "{}"; - } - VULKAN_HPP_INLINE std::string to_string(DescriptorPoolResetFlagBits) { return "(void)"; @@ -22810,12 +27387,12 @@ namespace vk return "{}"; } - VULKAN_HPP_INLINE std::string to_string(SwapchainCreateFlagBitsKHR) + VULKAN_HPP_INLINE std::string to_string(DescriptorUpdateTemplateCreateFlagBitsKHR) { return "(void)"; } - VULKAN_HPP_INLINE std::string to_string(SwapchainCreateFlagsKHR) + VULKAN_HPP_INLINE std::string to_string(DescriptorUpdateTemplateCreateFlagsKHR) { return "{}"; } @@ -22938,6 +27515,34 @@ namespace vk } #endif /*VK_USE_PLATFORM_XCB_KHR*/ +#ifdef VK_USE_PLATFORM_IOS_MVK + VULKAN_HPP_INLINE std::string to_string(IOSSurfaceCreateFlagBitsMVK) + { + return "(void)"; + } +#endif /*VK_USE_PLATFORM_IOS_MVK*/ + +#ifdef VK_USE_PLATFORM_IOS_MVK + VULKAN_HPP_INLINE std::string to_string(IOSSurfaceCreateFlagsMVK) + { + return "{}"; + } +#endif /*VK_USE_PLATFORM_IOS_MVK*/ + +#ifdef VK_USE_PLATFORM_MACOS_MVK + VULKAN_HPP_INLINE std::string to_string(MacOSSurfaceCreateFlagBitsMVK) + { + return "(void)"; + } +#endif /*VK_USE_PLATFORM_MACOS_MVK*/ + +#ifdef VK_USE_PLATFORM_MACOS_MVK + VULKAN_HPP_INLINE std::string to_string(MacOSSurfaceCreateFlagsMVK) + { + return "{}"; + } +#endif /*VK_USE_PLATFORM_MACOS_MVK*/ + VULKAN_HPP_INLINE std::string to_string(CommandPoolTrimFlagBitsKHR) { return "(void)"; @@ -22948,6 +27553,26 @@ namespace vk return "{}"; } + VULKAN_HPP_INLINE std::string to_string(PipelineViewportSwizzleStateCreateFlagBitsNV) + { + return "(void)"; + } + + VULKAN_HPP_INLINE std::string to_string(PipelineViewportSwizzleStateCreateFlagsNV) + { + return "{}"; + } + + VULKAN_HPP_INLINE std::string to_string(PipelineDiscardRectangleStateCreateFlagBitsEXT) + { + return "(void)"; + } + + VULKAN_HPP_INLINE std::string to_string(PipelineDiscardRectangleStateCreateFlagsEXT) + { + return "{}"; + } + VULKAN_HPP_INLINE std::string to_string(ImageLayout value) { switch (value) @@ -23642,6 +28267,9 @@ namespace vk case StructureType::eDedicatedAllocationImageCreateInfoNV: return "DedicatedAllocationImageCreateInfoNV"; case StructureType::eDedicatedAllocationBufferCreateInfoNV: return "DedicatedAllocationBufferCreateInfoNV"; case StructureType::eDedicatedAllocationMemoryAllocateInfoNV: return "DedicatedAllocationMemoryAllocateInfoNV"; + case StructureType::eRenderPassMultiviewCreateInfoKHX: return "RenderPassMultiviewCreateInfoKHX"; + case StructureType::ePhysicalDeviceMultiviewFeaturesKHX: return "PhysicalDeviceMultiviewFeaturesKHX"; + case StructureType::ePhysicalDeviceMultiviewPropertiesKHX: return "PhysicalDeviceMultiviewPropertiesKHX"; case StructureType::eExternalMemoryImageCreateInfoNV: return "ExternalMemoryImageCreateInfoNV"; case StructureType::eExportMemoryAllocateInfoNV: return "ExportMemoryAllocateInfoNV"; case StructureType::eImportMemoryWin32HandleInfoNV: return "ImportMemoryWin32HandleInfoNV"; @@ -23656,19 +28284,67 @@ namespace vk case StructureType::ePhysicalDeviceMemoryProperties2KHR: return "PhysicalDeviceMemoryProperties2KHR"; case StructureType::eSparseImageFormatProperties2KHR: return "SparseImageFormatProperties2KHR"; case StructureType::ePhysicalDeviceSparseImageFormatInfo2KHR: return "PhysicalDeviceSparseImageFormatInfo2KHR"; + case StructureType::eMemoryAllocateFlagsInfoKHX: return "MemoryAllocateFlagsInfoKHX"; + case StructureType::eBindBufferMemoryInfoKHX: return "BindBufferMemoryInfoKHX"; + case StructureType::eBindImageMemoryInfoKHX: return "BindImageMemoryInfoKHX"; + case StructureType::eDeviceGroupRenderPassBeginInfoKHX: return "DeviceGroupRenderPassBeginInfoKHX"; + case StructureType::eDeviceGroupCommandBufferBeginInfoKHX: return "DeviceGroupCommandBufferBeginInfoKHX"; + case StructureType::eDeviceGroupSubmitInfoKHX: return "DeviceGroupSubmitInfoKHX"; + case StructureType::eDeviceGroupBindSparseInfoKHX: return "DeviceGroupBindSparseInfoKHX"; + case StructureType::eDeviceGroupPresentCapabilitiesKHX: return "DeviceGroupPresentCapabilitiesKHX"; + case StructureType::eImageSwapchainCreateInfoKHX: return "ImageSwapchainCreateInfoKHX"; + case StructureType::eBindImageMemorySwapchainInfoKHX: return "BindImageMemorySwapchainInfoKHX"; + case StructureType::eAcquireNextImageInfoKHX: return "AcquireNextImageInfoKHX"; + case StructureType::eDeviceGroupPresentInfoKHX: return "DeviceGroupPresentInfoKHX"; + case StructureType::eDeviceGroupSwapchainCreateInfoKHX: return "DeviceGroupSwapchainCreateInfoKHX"; case StructureType::eValidationFlagsEXT: return "ValidationFlagsEXT"; case StructureType::eViSurfaceCreateInfoNN: return "ViSurfaceCreateInfoNN"; + case StructureType::ePhysicalDeviceGroupPropertiesKHX: return "PhysicalDeviceGroupPropertiesKHX"; + case StructureType::eDeviceGroupDeviceCreateInfoKHX: return "DeviceGroupDeviceCreateInfoKHX"; + case StructureType::ePhysicalDeviceExternalImageFormatInfoKHX: return "PhysicalDeviceExternalImageFormatInfoKHX"; + case StructureType::eExternalImageFormatPropertiesKHX: return "ExternalImageFormatPropertiesKHX"; + case StructureType::ePhysicalDeviceExternalBufferInfoKHX: return "PhysicalDeviceExternalBufferInfoKHX"; + case StructureType::eExternalBufferPropertiesKHX: return "ExternalBufferPropertiesKHX"; + case StructureType::ePhysicalDeviceIdPropertiesKHX: return "PhysicalDeviceIdPropertiesKHX"; + case StructureType::ePhysicalDeviceProperties2KHX: return "PhysicalDeviceProperties2KHX"; + case StructureType::eImageFormatProperties2KHX: return "ImageFormatProperties2KHX"; + case StructureType::ePhysicalDeviceImageFormatInfo2KHX: return "PhysicalDeviceImageFormatInfo2KHX"; + case StructureType::eExternalMemoryBufferCreateInfoKHX: return "ExternalMemoryBufferCreateInfoKHX"; + case StructureType::eExternalMemoryImageCreateInfoKHX: return "ExternalMemoryImageCreateInfoKHX"; + case StructureType::eExportMemoryAllocateInfoKHX: return "ExportMemoryAllocateInfoKHX"; + case StructureType::eImportMemoryWin32HandleInfoKHX: return "ImportMemoryWin32HandleInfoKHX"; + case StructureType::eExportMemoryWin32HandleInfoKHX: return "ExportMemoryWin32HandleInfoKHX"; + case StructureType::eMemoryWin32HandlePropertiesKHX: return "MemoryWin32HandlePropertiesKHX"; + case StructureType::eImportMemoryFdInfoKHX: return "ImportMemoryFdInfoKHX"; + case StructureType::eMemoryFdPropertiesKHX: return "MemoryFdPropertiesKHX"; + case StructureType::eWin32KeyedMutexAcquireReleaseInfoKHX: return "Win32KeyedMutexAcquireReleaseInfoKHX"; + case StructureType::ePhysicalDeviceExternalSemaphoreInfoKHX: return "PhysicalDeviceExternalSemaphoreInfoKHX"; + case StructureType::eExternalSemaphorePropertiesKHX: return "ExternalSemaphorePropertiesKHX"; + case StructureType::eExportSemaphoreCreateInfoKHX: return "ExportSemaphoreCreateInfoKHX"; + case StructureType::eImportSemaphoreWin32HandleInfoKHX: return "ImportSemaphoreWin32HandleInfoKHX"; + case StructureType::eExportSemaphoreWin32HandleInfoKHX: return "ExportSemaphoreWin32HandleInfoKHX"; + case StructureType::eD3D12FenceSubmitInfoKHX: return "D3D12FenceSubmitInfoKHX"; + case StructureType::eImportSemaphoreFdInfoKHX: return "ImportSemaphoreFdInfoKHX"; + case StructureType::ePhysicalDevicePushDescriptorPropertiesKHR: return "PhysicalDevicePushDescriptorPropertiesKHR"; + case StructureType::eDescriptorUpdateTemplateCreateInfoKHR: return "DescriptorUpdateTemplateCreateInfoKHR"; case StructureType::eObjectTableCreateInfoNVX: return "ObjectTableCreateInfoNVX"; case StructureType::eIndirectCommandsLayoutCreateInfoNVX: return "IndirectCommandsLayoutCreateInfoNVX"; case StructureType::eCmdProcessCommandsInfoNVX: return "CmdProcessCommandsInfoNVX"; case StructureType::eCmdReserveSpaceForCommandsInfoNVX: return "CmdReserveSpaceForCommandsInfoNVX"; case StructureType::eDeviceGeneratedCommandsLimitsNVX: return "DeviceGeneratedCommandsLimitsNVX"; case StructureType::eDeviceGeneratedCommandsFeaturesNVX: return "DeviceGeneratedCommandsFeaturesNVX"; + case StructureType::ePipelineViewportWScalingStateCreateInfoNV: return "PipelineViewportWScalingStateCreateInfoNV"; case StructureType::eSurfaceCapabilities2EXT: return "SurfaceCapabilities2EXT"; case StructureType::eDisplayPowerInfoEXT: return "DisplayPowerInfoEXT"; case StructureType::eDeviceEventInfoEXT: return "DeviceEventInfoEXT"; case StructureType::eDisplayEventInfoEXT: return "DisplayEventInfoEXT"; case StructureType::eSwapchainCounterCreateInfoEXT: return "SwapchainCounterCreateInfoEXT"; + case StructureType::ePhysicalDeviceMultiviewPerViewAttributesPropertiesNVX: return "PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX"; + case StructureType::ePipelineViewportSwizzleStateCreateInfoNV: return "PipelineViewportSwizzleStateCreateInfoNV"; + case StructureType::ePhysicalDeviceDiscardRectanglePropertiesEXT: return "PhysicalDeviceDiscardRectanglePropertiesEXT"; + case StructureType::ePipelineDiscardRectangleStateCreateInfoEXT: return "PipelineDiscardRectangleStateCreateInfoEXT"; + case StructureType::eIosSurfaceCreateInfoMVK: return "IosSurfaceCreateInfoMVK"; + case StructureType::eMacosSurfaceCreateInfoMVK: return "MacosSurfaceCreateInfoMVK"; default: return "invalid"; } } @@ -23696,6 +28372,18 @@ namespace vk case DynamicState::eStencilCompareMask: return "StencilCompareMask"; case DynamicState::eStencilWriteMask: return "StencilWriteMask"; case DynamicState::eStencilReference: return "StencilReference"; + case DynamicState::eViewportWScalingNV: return "ViewportWScalingNV"; + case DynamicState::eDiscardRectangleEXT: return "DiscardRectangleEXT"; + default: return "invalid"; + } + } + + VULKAN_HPP_INLINE std::string to_string(DescriptorUpdateTemplateTypeKHR value) + { + switch (value) + { + case DescriptorUpdateTemplateTypeKHR::eDescriptorSet: return "DescriptorSet"; + case DescriptorUpdateTemplateTypeKHR::ePushDescriptors: return "PushDescriptors"; default: return "invalid"; } } @@ -23753,6 +28441,7 @@ namespace vk switch (value) { case MemoryHeapFlagBits::eDeviceLocal: return "DeviceLocal"; + case MemoryHeapFlagBits::eMultiInstanceKHX: return "MultiInstanceKHX"; default: return "invalid"; } } @@ -23762,6 +28451,7 @@ namespace vk if (!value) return "{}"; std::string result; if (value & MemoryHeapFlagBits::eDeviceLocal) result += "DeviceLocal | "; + if (value & MemoryHeapFlagBits::eMultiInstanceKHX) result += "MultiInstanceKHX | "; return "{" + result.substr(0, result.size() - 3) + "}"; } @@ -23943,6 +28633,7 @@ namespace vk case ImageCreateFlagBits::eSparseAliased: return "SparseAliased"; case ImageCreateFlagBits::eMutableFormat: return "MutableFormat"; case ImageCreateFlagBits::eCubeCompatible: return "CubeCompatible"; + case ImageCreateFlagBits::eBindSfrKHX: return "BindSfrKHX"; case ImageCreateFlagBits::e2DArrayCompatibleKHR: return "2DArrayCompatibleKHR"; default: return "invalid"; } @@ -23957,6 +28648,7 @@ namespace vk if (value & ImageCreateFlagBits::eSparseAliased) result += "SparseAliased | "; if (value & ImageCreateFlagBits::eMutableFormat) result += "MutableFormat | "; if (value & ImageCreateFlagBits::eCubeCompatible) result += "CubeCompatible | "; + if (value & ImageCreateFlagBits::eBindSfrKHX) result += "BindSfrKHX | "; if (value & ImageCreateFlagBits::e2DArrayCompatibleKHR) result += "2DArrayCompatibleKHR | "; return "{" + result.substr(0, result.size() - 3) + "}"; } @@ -23968,6 +28660,8 @@ namespace vk case PipelineCreateFlagBits::eDisableOptimization: return "DisableOptimization"; case PipelineCreateFlagBits::eAllowDerivatives: return "AllowDerivatives"; case PipelineCreateFlagBits::eDerivative: return "Derivative"; + case PipelineCreateFlagBits::eViewIndexFromDeviceIndexKHX: return "ViewIndexFromDeviceIndexKHX"; + case PipelineCreateFlagBits::eDispatchBaseKHX: return "DispatchBaseKHX"; default: return "invalid"; } } @@ -23979,6 +28673,8 @@ namespace vk if (value & PipelineCreateFlagBits::eDisableOptimization) result += "DisableOptimization | "; if (value & PipelineCreateFlagBits::eAllowDerivatives) result += "AllowDerivatives | "; if (value & PipelineCreateFlagBits::eDerivative) result += "Derivative | "; + if (value & PipelineCreateFlagBits::eViewIndexFromDeviceIndexKHX) result += "ViewIndexFromDeviceIndexKHX | "; + if (value & PipelineCreateFlagBits::eDispatchBaseKHX) result += "DispatchBaseKHX | "; return "{" + result.substr(0, result.size() - 3) + "}"; } @@ -24421,6 +29117,8 @@ namespace vk switch (value) { case DependencyFlagBits::eByRegion: return "ByRegion"; + case DependencyFlagBits::eViewLocalKHX: return "ViewLocalKHX"; + case DependencyFlagBits::eDeviceGroupKHX: return "DeviceGroupKHX"; default: return "invalid"; } } @@ -24430,6 +29128,8 @@ namespace vk if (!value) return "{}"; std::string result; if (value & DependencyFlagBits::eByRegion) result += "ByRegion | "; + if (value & DependencyFlagBits::eViewLocalKHX) result += "ViewLocalKHX | "; + if (value & DependencyFlagBits::eDeviceGroupKHX) result += "DeviceGroupKHX | "; return "{" + result.substr(0, result.size() - 3) + "}"; } @@ -24743,6 +29443,117 @@ namespace vk } } + VULKAN_HPP_INLINE std::string to_string(DescriptorSetLayoutCreateFlagBits value) + { + switch (value) + { + case DescriptorSetLayoutCreateFlagBits::ePushDescriptorKHR: return "PushDescriptorKHR"; + default: return "invalid"; + } + } + + VULKAN_HPP_INLINE std::string to_string(DescriptorSetLayoutCreateFlags value) + { + if (!value) return "{}"; + std::string result; + if (value & DescriptorSetLayoutCreateFlagBits::ePushDescriptorKHR) result += "PushDescriptorKHR | "; + return "{" + result.substr(0, result.size() - 3) + "}"; + } + + VULKAN_HPP_INLINE std::string to_string(ExternalMemoryHandleTypeFlagBitsKHX value) + { + switch (value) + { + case ExternalMemoryHandleTypeFlagBitsKHX::eOpaqueFd: return "OpaqueFd"; + case ExternalMemoryHandleTypeFlagBitsKHX::eOpaqueWin32: return "OpaqueWin32"; + case ExternalMemoryHandleTypeFlagBitsKHX::eOpaqueWin32Kmt: return "OpaqueWin32Kmt"; + case ExternalMemoryHandleTypeFlagBitsKHX::eD3D11Texture: return "D3D11Texture"; + case ExternalMemoryHandleTypeFlagBitsKHX::eD3D11TextureKmt: return "D3D11TextureKmt"; + case ExternalMemoryHandleTypeFlagBitsKHX::eD3D12Heap: return "D3D12Heap"; + case ExternalMemoryHandleTypeFlagBitsKHX::eD3D12Resource: return "D3D12Resource"; + default: return "invalid"; + } + } + + VULKAN_HPP_INLINE std::string to_string(ExternalMemoryHandleTypeFlagsKHX value) + { + if (!value) return "{}"; + std::string result; + if (value & ExternalMemoryHandleTypeFlagBitsKHX::eOpaqueFd) result += "OpaqueFd | "; + if (value & ExternalMemoryHandleTypeFlagBitsKHX::eOpaqueWin32) result += "OpaqueWin32 | "; + if (value & ExternalMemoryHandleTypeFlagBitsKHX::eOpaqueWin32Kmt) result += "OpaqueWin32Kmt | "; + if (value & ExternalMemoryHandleTypeFlagBitsKHX::eD3D11Texture) result += "D3D11Texture | "; + if (value & ExternalMemoryHandleTypeFlagBitsKHX::eD3D11TextureKmt) result += "D3D11TextureKmt | "; + if (value & ExternalMemoryHandleTypeFlagBitsKHX::eD3D12Heap) result += "D3D12Heap | "; + if (value & ExternalMemoryHandleTypeFlagBitsKHX::eD3D12Resource) result += "D3D12Resource | "; + return "{" + result.substr(0, result.size() - 3) + "}"; + } + + VULKAN_HPP_INLINE std::string to_string(ExternalMemoryFeatureFlagBitsKHX value) + { + switch (value) + { + case ExternalMemoryFeatureFlagBitsKHX::eDedicatedOnly: return "DedicatedOnly"; + case ExternalMemoryFeatureFlagBitsKHX::eExportable: return "Exportable"; + case ExternalMemoryFeatureFlagBitsKHX::eImportable: return "Importable"; + default: return "invalid"; + } + } + + VULKAN_HPP_INLINE std::string to_string(ExternalMemoryFeatureFlagsKHX value) + { + if (!value) return "{}"; + std::string result; + if (value & ExternalMemoryFeatureFlagBitsKHX::eDedicatedOnly) result += "DedicatedOnly | "; + if (value & ExternalMemoryFeatureFlagBitsKHX::eExportable) result += "Exportable | "; + if (value & ExternalMemoryFeatureFlagBitsKHX::eImportable) result += "Importable | "; + return "{" + result.substr(0, result.size() - 3) + "}"; + } + + VULKAN_HPP_INLINE std::string to_string(ExternalSemaphoreHandleTypeFlagBitsKHX value) + { + switch (value) + { + case ExternalSemaphoreHandleTypeFlagBitsKHX::eOpaqueFd: return "OpaqueFd"; + case ExternalSemaphoreHandleTypeFlagBitsKHX::eOpaqueWin32: return "OpaqueWin32"; + case ExternalSemaphoreHandleTypeFlagBitsKHX::eOpaqueWin32Kmt: return "OpaqueWin32Kmt"; + case ExternalSemaphoreHandleTypeFlagBitsKHX::eD3D12Fence: return "D3D12Fence"; + case ExternalSemaphoreHandleTypeFlagBitsKHX::eFenceFd: return "FenceFd"; + default: return "invalid"; + } + } + + VULKAN_HPP_INLINE std::string to_string(ExternalSemaphoreHandleTypeFlagsKHX value) + { + if (!value) return "{}"; + std::string result; + if (value & ExternalSemaphoreHandleTypeFlagBitsKHX::eOpaqueFd) result += "OpaqueFd | "; + if (value & ExternalSemaphoreHandleTypeFlagBitsKHX::eOpaqueWin32) result += "OpaqueWin32 | "; + if (value & ExternalSemaphoreHandleTypeFlagBitsKHX::eOpaqueWin32Kmt) result += "OpaqueWin32Kmt | "; + if (value & ExternalSemaphoreHandleTypeFlagBitsKHX::eD3D12Fence) result += "D3D12Fence | "; + if (value & ExternalSemaphoreHandleTypeFlagBitsKHX::eFenceFd) result += "FenceFd | "; + return "{" + result.substr(0, result.size() - 3) + "}"; + } + + VULKAN_HPP_INLINE std::string to_string(ExternalSemaphoreFeatureFlagBitsKHX value) + { + switch (value) + { + case ExternalSemaphoreFeatureFlagBitsKHX::eExportable: return "Exportable"; + case ExternalSemaphoreFeatureFlagBitsKHX::eImportable: return "Importable"; + default: return "invalid"; + } + } + + VULKAN_HPP_INLINE std::string to_string(ExternalSemaphoreFeatureFlagsKHX value) + { + if (!value) return "{}"; + std::string result; + if (value & ExternalSemaphoreFeatureFlagBitsKHX::eExportable) result += "Exportable | "; + if (value & ExternalSemaphoreFeatureFlagBitsKHX::eImportable) result += "Importable | "; + return "{" + result.substr(0, result.size() - 3) + "}"; + } + VULKAN_HPP_INLINE std::string to_string(SurfaceCounterFlagBitsEXT value) { switch (value) @@ -24789,6 +29600,131 @@ namespace vk } } + VULKAN_HPP_INLINE std::string to_string(PeerMemoryFeatureFlagBitsKHX value) + { + switch (value) + { + case PeerMemoryFeatureFlagBitsKHX::eCopySrc: return "CopySrc"; + case PeerMemoryFeatureFlagBitsKHX::eCopyDst: return "CopyDst"; + case PeerMemoryFeatureFlagBitsKHX::eGenericSrc: return "GenericSrc"; + case PeerMemoryFeatureFlagBitsKHX::eGenericDst: return "GenericDst"; + default: return "invalid"; + } + } + + VULKAN_HPP_INLINE std::string to_string(PeerMemoryFeatureFlagsKHX value) + { + if (!value) return "{}"; + std::string result; + if (value & PeerMemoryFeatureFlagBitsKHX::eCopySrc) result += "CopySrc | "; + if (value & PeerMemoryFeatureFlagBitsKHX::eCopyDst) result += "CopyDst | "; + if (value & PeerMemoryFeatureFlagBitsKHX::eGenericSrc) result += "GenericSrc | "; + if (value & PeerMemoryFeatureFlagBitsKHX::eGenericDst) result += "GenericDst | "; + return "{" + result.substr(0, result.size() - 3) + "}"; + } + + VULKAN_HPP_INLINE std::string to_string(MemoryAllocateFlagBitsKHX value) + { + switch (value) + { + case MemoryAllocateFlagBitsKHX::eDeviceMask: return "DeviceMask"; + default: return "invalid"; + } + } + + VULKAN_HPP_INLINE std::string to_string(MemoryAllocateFlagsKHX value) + { + if (!value) return "{}"; + std::string result; + if (value & MemoryAllocateFlagBitsKHX::eDeviceMask) result += "DeviceMask | "; + return "{" + result.substr(0, result.size() - 3) + "}"; + } + + VULKAN_HPP_INLINE std::string to_string(DeviceGroupPresentModeFlagBitsKHX value) + { + switch (value) + { + case DeviceGroupPresentModeFlagBitsKHX::eLocal: return "Local"; + case DeviceGroupPresentModeFlagBitsKHX::eRemote: return "Remote"; + case DeviceGroupPresentModeFlagBitsKHX::eSum: return "Sum"; + case DeviceGroupPresentModeFlagBitsKHX::eLocalMultiDevice: return "LocalMultiDevice"; + default: return "invalid"; + } + } + + VULKAN_HPP_INLINE std::string to_string(DeviceGroupPresentModeFlagsKHX value) + { + if (!value) return "{}"; + std::string result; + if (value & DeviceGroupPresentModeFlagBitsKHX::eLocal) result += "Local | "; + if (value & DeviceGroupPresentModeFlagBitsKHX::eRemote) result += "Remote | "; + if (value & DeviceGroupPresentModeFlagBitsKHX::eSum) result += "Sum | "; + if (value & DeviceGroupPresentModeFlagBitsKHX::eLocalMultiDevice) result += "LocalMultiDevice | "; + return "{" + result.substr(0, result.size() - 3) + "}"; + } + + VULKAN_HPP_INLINE std::string to_string(SwapchainCreateFlagBitsKHR value) + { + switch (value) + { + case SwapchainCreateFlagBitsKHR::eBindSfrKHX: return "BindSfrKHX"; + default: return "invalid"; + } + } + + VULKAN_HPP_INLINE std::string to_string(SwapchainCreateFlagsKHR value) + { + if (!value) return "{}"; + std::string result; + if (value & SwapchainCreateFlagBitsKHR::eBindSfrKHX) result += "BindSfrKHX | "; + return "{" + result.substr(0, result.size() - 3) + "}"; + } + + VULKAN_HPP_INLINE std::string to_string(ViewportCoordinateSwizzleNV value) + { + switch (value) + { + case ViewportCoordinateSwizzleNV::ePositiveX: return "PositiveX"; + case ViewportCoordinateSwizzleNV::eNegativeX: return "NegativeX"; + case ViewportCoordinateSwizzleNV::ePositiveY: return "PositiveY"; + case ViewportCoordinateSwizzleNV::eNegativeY: return "NegativeY"; + case ViewportCoordinateSwizzleNV::ePositiveZ: return "PositiveZ"; + case ViewportCoordinateSwizzleNV::eNegativeZ: return "NegativeZ"; + case ViewportCoordinateSwizzleNV::ePositiveW: return "PositiveW"; + case ViewportCoordinateSwizzleNV::eNegativeW: return "NegativeW"; + default: return "invalid"; + } + } + + VULKAN_HPP_INLINE std::string to_string(DiscardRectangleModeEXT value) + { + switch (value) + { + case DiscardRectangleModeEXT::eInclusive: return "Inclusive"; + case DiscardRectangleModeEXT::eExclusive: return "Exclusive"; + default: return "invalid"; + } + } + + VULKAN_HPP_INLINE std::string to_string(SubpassDescriptionFlagBits value) + { + switch (value) + { + case SubpassDescriptionFlagBits::ePerViewAttributesNVX: return "PerViewAttributesNVX"; + case SubpassDescriptionFlagBits::ePerViewPositionXOnlyNVX: return "PerViewPositionXOnlyNVX"; + default: return "invalid"; + } + } + + VULKAN_HPP_INLINE std::string to_string(SubpassDescriptionFlags value) + { + if (!value) return "{}"; + std::string result; + if (value & SubpassDescriptionFlagBits::ePerViewAttributesNVX) result += "PerViewAttributesNVX | "; + if (value & SubpassDescriptionFlagBits::ePerViewPositionXOnlyNVX) result += "PerViewPositionXOnlyNVX | "; + return "{" + result.substr(0, result.size() - 3) + "}"; + } + } // namespace vk #endif diff --git a/layers/CMakeLists.txt b/layers/CMakeLists.txt index fd0745e2..248e236b 100644 --- a/layers/CMakeLists.txt +++ b/layers/CMakeLists.txt @@ -1,24 +1,24 @@ cmake_minimum_required (VERSION 2.8.11) if(CMAKE_SYSTEM_NAME STREQUAL "Windows") - add_definitions(-DVK_USE_PLATFORM_WIN32_KHR -DWIN32_LEAN_AND_MEAN) + add_definitions(-DVK_USE_PLATFORM_WIN32_KHR -DVK_USE_PLATFORM_WIN32_KHX -DWIN32_LEAN_AND_MEAN) set(DisplayServer Win32) elseif(CMAKE_SYSTEM_NAME STREQUAL "Android") - add_definitions(-DVK_USE_PLATFORM_ANDROID_KHR) + add_definitions(-DVK_USE_PLATFORM_ANDROID_KHR -DVK_USE_PLATFORM_ANDROID_KHX) elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") if (BUILD_WSI_XCB_SUPPORT) - add_definitions(-DVK_USE_PLATFORM_XCB_KHR) + add_definitions(-DVK_USE_PLATFORM_XCB_KHR -DVK_USE_PLATFORM_XCB_KHX) endif() if (BUILD_WSI_XLIB_SUPPORT) - add_definitions(-DVK_USE_PLATFORM_XLIB_KHR -DVK_USE_PLATFORM_XLIB_XRANDR_EXT) + add_definitions(-DVK_USE_PLATFORM_XLIB_KHR -DVK_USE_PLATFORM_XLIB_KHX -DVK_USE_PLATFORM_XLIB_XRANDR_EXT) endif() if (BUILD_WSI_WAYLAND_SUPPORT) - add_definitions(-DVK_USE_PLATFORM_WAYLAND_KHR) + add_definitions(-DVK_USE_PLATFORM_WAYLAND_KHR -DVK_USE_PLATFORM_WAYLAND_KHX) endif() if (BUILD_WSI_MIR_SUPPORT) - add_definitions(-DVK_USE_PLATFORM_MIR_KHR) + add_definitions(-DVK_USE_PLATFORM_MIR_KHR -DVK_USE_PLATFORM_MIR_KHX) include_directories(${MIR_INCLUDE_DIR}) endif() else() @@ -94,6 +94,7 @@ if (WIN32) VERBATIM ) add_library(VkLayer_${target} SHARED ${ARGN} VkLayer_${target}.def) + add_dependencies(VkLayer_${target} generate_helper_files) target_link_Libraries(VkLayer_${target} VkLayer_utils) add_dependencies(VkLayer_${target} generate_helper_files VkLayer_utils) endmacro() @@ -112,6 +113,7 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../loader ${CMAKE_CURRENT_SOURCE_DIR}/../include/vulkan ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_PROJECT_BINARY_DIR} ${CMAKE_BINARY_DIR} ) @@ -133,6 +135,7 @@ endif() run_vk_xml_generate(threading_generator.py thread_check.h) run_vk_xml_generate(parameter_validation_generator.py parameter_validation.h) run_vk_xml_generate(unique_objects_generator.py unique_objects_wrappers.h) +run_vk_xml_generate(dispatch_table_helper_generator.py vk_dispatch_table_helper.h) # Layer Utils Library # For Windows, we use a static lib because the Windows loader has a fairly restrictive loader search @@ -143,6 +146,7 @@ else() add_library(VkLayer_utils SHARED vk_layer_config.cpp vk_layer_extension_utils.cpp vk_layer_utils.cpp) install(TARGETS VkLayer_utils DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() +add_dependencies(VkLayer_utils generate_helper_files) add_vk_layer(core_validation core_validation.cpp vk_layer_table.cpp descriptor_sets.cpp buffer_validation.cpp) add_vk_layer(object_tracker object_tracker.cpp vk_layer_table.cpp) diff --git a/layers/linux/VkLayer_core_validation.json b/layers/linux/VkLayer_core_validation.json index 55e1a721..2bab6a42 100644 --- a/layers/linux/VkLayer_core_validation.json +++ b/layers/linux/VkLayer_core_validation.json @@ -4,7 +4,7 @@ "name": "VK_LAYER_LUNARG_core_validation", "type": "GLOBAL", "library_path": "./libVkLayer_core_validation.so", - "api_version": "1.0.41", + "api_version": "1.0.42", "implementation_version": "1", "description": "LunarG Validation Layer", "instance_extensions": [ diff --git a/layers/linux/VkLayer_object_tracker.json b/layers/linux/VkLayer_object_tracker.json index 970068f5..c7776731 100644 --- a/layers/linux/VkLayer_object_tracker.json +++ b/layers/linux/VkLayer_object_tracker.json @@ -4,7 +4,7 @@ "name": "VK_LAYER_LUNARG_object_tracker", "type": "GLOBAL", "library_path": "./libVkLayer_object_tracker.so", - "api_version": "1.0.41", + "api_version": "1.0.42", "implementation_version": "1", "description": "LunarG Validation Layer", "instance_extensions": [ diff --git a/layers/linux/VkLayer_parameter_validation.json b/layers/linux/VkLayer_parameter_validation.json index c10eb1a6..7d0dfd11 100644 --- a/layers/linux/VkLayer_parameter_validation.json +++ b/layers/linux/VkLayer_parameter_validation.json @@ -4,7 +4,7 @@ "name": "VK_LAYER_LUNARG_parameter_validation", "type": "GLOBAL", "library_path": "./libVkLayer_parameter_validation.so", - "api_version": "1.0.41", + "api_version": "1.0.42", "implementation_version": "1", "description": "LunarG Validation Layer", "instance_extensions": [ diff --git a/layers/linux/VkLayer_swapchain.json b/layers/linux/VkLayer_swapchain.json index a02d73a2..235673fa 100644 --- a/layers/linux/VkLayer_swapchain.json +++ b/layers/linux/VkLayer_swapchain.json @@ -4,7 +4,7 @@ "name": "VK_LAYER_LUNARG_swapchain", "type": "GLOBAL", "library_path": "./libVkLayer_swapchain.so", - "api_version": "1.0.41", + "api_version": "1.0.42", "implementation_version": "1", "description": "LunarG Validation Layer", "instance_extensions": [ diff --git a/layers/linux/VkLayer_threading.json b/layers/linux/VkLayer_threading.json index adf5299a..81c7c9f4 100644 --- a/layers/linux/VkLayer_threading.json +++ b/layers/linux/VkLayer_threading.json @@ -4,7 +4,7 @@ "name": "VK_LAYER_GOOGLE_threading", "type": "GLOBAL", "library_path": "./libVkLayer_threading.so", - "api_version": "1.0.41", + "api_version": "1.0.42", "implementation_version": "1", "description": "Google Validation Layer", "instance_extensions": [ diff --git a/layers/linux/VkLayer_unique_objects.json b/layers/linux/VkLayer_unique_objects.json index 5144a7cc..dc5eef8a 100644 --- a/layers/linux/VkLayer_unique_objects.json +++ b/layers/linux/VkLayer_unique_objects.json @@ -4,7 +4,7 @@ "name": "VK_LAYER_GOOGLE_unique_objects", "type": "GLOBAL", "library_path": "./libVkLayer_unique_objects.so", - "api_version": "1.0.41", + "api_version": "1.0.42", "implementation_version": "1", "description": "Google Validation Layer" } diff --git a/layers/object_tracker.cpp b/layers/object_tracker.cpp index 3c30cb19..bed7080b 100644 --- a/layers/object_tracker.cpp +++ b/layers/object_tracker.cpp @@ -1,8 +1,8 @@ /* - * Copyright (c) 2015-2016 The Khronos Group Inc. - * Copyright (c) 2015-2016 Valve Corporation - * Copyright (c) 2015-2016 LunarG, Inc. - * Copyright (c) 2015-2016 Google, Inc. + * Copyright (c) 2015-2017 The Khronos Group Inc. + * Copyright (c) 2015-2017 Valve Corporation + * Copyright (c) 2015-2017 LunarG, Inc. + * Copyright (c) 2015-2017 Google, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -3308,31 +3308,59 @@ static inline PFN_vkVoidFunction InterceptWsiEnabledCommand(const char *name, Vk static void CheckDeviceRegisterExtensions(const VkDeviceCreateInfo *pCreateInfo, VkDevice device) { layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); - device_data->wsi_enabled = false; - device_data->wsi_display_swapchain_enabled = false; - device_data->wsi_display_extension_enabled = false; - device_data->objtrack_extensions_enabled = false; - device_data->nvx_device_generated_commands_enabled = false; - device_data->ext_display_control_enabled = false; for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) { - if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_SWAPCHAIN_EXTENSION_NAME) == 0) { - device_data->wsi_enabled = true; + if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_DISPLAY_EXTENSION_NAME) == 0) { + device_data->enables.wsi_display_extension = true; } if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME) == 0) { - device_data->wsi_display_swapchain_enabled = true; + device_data->enables.wsi_display_swapchain = true; } - if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_DISPLAY_EXTENSION_NAME) == 0) { - device_data->wsi_display_extension_enabled = true; + if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME) == 0) { + device_data->enables.khr_descriptor_update_template = true; + } + if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_MAINTENANCE1_EXTENSION_NAME) == 0) { + device_data->enables.khr_maintenance1 = true; + } + if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME) == 0) { + device_data->enables.khr_push_descriptor = true; + } + if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_SWAPCHAIN_EXTENSION_NAME) == 0) { + device_data->enables.wsi = true; } if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], "OBJTRACK_EXTENSIONS") == 0) { - device_data->objtrack_extensions_enabled = true; + device_data->enables.objtrack_extensions = true; } - if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME) == 0) { - device_data->nvx_device_generated_commands_enabled = true; + if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHX_DEVICE_GROUP_EXTENSION_NAME) == 0) { + device_data->enables.khx_device_group = true; + } + if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHX_EXTERNAL_MEMORY_FD_EXTENSION_NAME) == 0) { + device_data->enables.khx_external_memory_fd = true; + } +#ifdef VK_USE_PLATFORM_WIN32_KHR + if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHX_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME) == 0) { + device_data->enables.khx_external_memory_win32 = true; + } +#endif // VK_USE_PLATFORM_WIN32_KHR + if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHX_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME) == 0) { + device_data->enables.khx_external_semaphore_fd = true; + } +#ifdef VK_USE_PLATFORM_WIN32_KHR + if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHX_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME) == 0) { + device_data->enables.khx_external_semaphore_win32 = true; + } +#endif // VK_USE_PLATFORM_WIN32_KHR + if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_EXT_DISCARD_RECTANGLES_EXTENSION_NAME) == 0) { + device_data->enables.ext_discard_rectangles = true; } if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_EXT_DISPLAY_CONTROL_EXTENSION_NAME) == 0) { - device_data->ext_display_control_enabled = true; + device_data->enables.ext_display_control = true; + } + if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_NV_CLIP_SPACE_W_SCALING_EXTENSION_NAME) == 0) { + device_data->enables.nv_clip_space_w_scaling = true; + } + if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME) == 0) { + device_data->enables.nvx_device_generated_commands = true; } } } @@ -3343,20 +3371,20 @@ static void CheckInstanceRegisterExtensions(const VkInstanceCreateInfo *pCreateI instanceExtMap[pDisp] = {}; for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) { - if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_SURFACE_EXTENSION_NAME) == 0) { - instanceExtMap[pDisp].wsi_enabled = true; +#ifdef VK_USE_PLATFORM_ANDROID_KHR + if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_ANDROID_SURFACE_EXTENSION_NAME) == 0) { + instanceExtMap[pDisp].android_enabled = true; } +#endif if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_DISPLAY_EXTENSION_NAME) == 0) { instanceExtMap[pDisp].display_enabled = true; } -#ifdef VK_USE_PLATFORM_XLIB_KHR - if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_XLIB_SURFACE_EXTENSION_NAME) == 0) { - instanceExtMap[pDisp].xlib_enabled = true; + if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_SURFACE_EXTENSION_NAME) == 0) { + instanceExtMap[pDisp].wsi_enabled = true; } -#endif -#ifdef VK_USE_PLATFORM_XCB_KHR - if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_XCB_SURFACE_EXTENSION_NAME) == 0) { - instanceExtMap[pDisp].xcb_enabled = true; +#ifdef VK_USE_PLATFORM_MIR_KHR + if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_MIR_SURFACE_EXTENSION_NAME) == 0) { + instanceExtMap[pDisp].mir_enabled = true; } #endif #ifdef VK_USE_PLATFORM_WAYLAND_KHR @@ -3364,19 +3392,19 @@ static void CheckInstanceRegisterExtensions(const VkInstanceCreateInfo *pCreateI instanceExtMap[pDisp].wayland_enabled = true; } #endif -#ifdef VK_USE_PLATFORM_MIR_KHR - if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_MIR_SURFACE_EXTENSION_NAME) == 0) { - instanceExtMap[pDisp].mir_enabled = true; +#ifdef VK_USE_PLATFORM_WIN32_KHR + if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_WIN32_SURFACE_EXTENSION_NAME) == 0) { + instanceExtMap[pDisp].win32_enabled = true; } #endif -#ifdef VK_USE_PLATFORM_ANDROID_KHR - if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_ANDROID_SURFACE_EXTENSION_NAME) == 0) { - instanceExtMap[pDisp].android_enabled = true; +#ifdef VK_USE_PLATFORM_XCB_KHR + if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_XCB_SURFACE_EXTENSION_NAME) == 0) { + instanceExtMap[pDisp].xcb_enabled = true; } #endif -#ifdef VK_USE_PLATFORM_WIN32_KHR - if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_WIN32_SURFACE_EXTENSION_NAME) == 0) { - instanceExtMap[pDisp].win32_enabled = true; +#ifdef VK_USE_PLATFORM_XLIB_KHR + if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_XLIB_SURFACE_EXTENSION_NAME) == 0) { + instanceExtMap[pDisp].xlib_enabled = true; } #endif } @@ -3929,97 +3957,6 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateComputePipelines(VkDevice device, VkPipelin return result; } -// VK_EXT_debug_marker Extension -VKAPI_ATTR VkResult VKAPI_CALL DebugMarkerSetObjectTagEXT(VkDevice device, VkDebugMarkerObjectTagInfoEXT *pTagInfo) { - bool skip_call = VK_FALSE; - std::unique_lock<std::mutex> lock(global_lock); - skip_call |= ValidateObject(device, device, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, false, VALIDATION_ERROR_02007, - VALIDATION_ERROR_UNDEFINED); - lock.unlock(); - if (skip_call) { - return VK_ERROR_VALIDATION_FAILED_EXT; - } - layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); - VkResult result = VK_SUCCESS; - if (dev_data->dispatch_table.DebugMarkerSetObjectTagEXT) { - result = dev_data->dispatch_table.DebugMarkerSetObjectTagEXT(device, pTagInfo); - } - return result; -} - -VKAPI_ATTR VkResult VKAPI_CALL DebugMarkerSetObjectNameEXT(VkDevice device, VkDebugMarkerObjectNameInfoEXT *pNameInfo) { - bool skip_call = VK_FALSE; - std::unique_lock<std::mutex> lock(global_lock); - skip_call |= ValidateObject(device, device, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, false, VALIDATION_ERROR_01999, - VALIDATION_ERROR_UNDEFINED); - lock.unlock(); - if (skip_call) { - return VK_ERROR_VALIDATION_FAILED_EXT; - } - layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); - VkResult result = VK_SUCCESS; - if (dev_data->dispatch_table.DebugMarkerSetObjectNameEXT) { - result = dev_data->dispatch_table.DebugMarkerSetObjectNameEXT(device, pNameInfo); - } - return result; -} - -VKAPI_ATTR void VKAPI_CALL CmdDebugMarkerBeginEXT(VkCommandBuffer commandBuffer, VkDebugMarkerMarkerInfoEXT *pMarkerInfo) { - bool skip_call = VK_FALSE; - std::unique_lock<std::mutex> lock(global_lock); - skip_call |= ValidateObject(commandBuffer, commandBuffer, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, false, - VALIDATION_ERROR_02014, VALIDATION_ERROR_UNDEFINED); - lock.unlock(); - layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); - if (!skip_call && dev_data->dispatch_table.CmdDebugMarkerBeginEXT) { - dev_data->dispatch_table.CmdDebugMarkerBeginEXT(commandBuffer, pMarkerInfo); - } -} - -VKAPI_ATTR void VKAPI_CALL CmdDebugMarkerEndEXT(VkCommandBuffer commandBuffer) { - bool skip_call = VK_FALSE; - std::unique_lock<std::mutex> lock(global_lock); - skip_call |= ValidateObject(commandBuffer, commandBuffer, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, false, - VALIDATION_ERROR_02022, VALIDATION_ERROR_UNDEFINED); - lock.unlock(); - layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); - if (!skip_call && dev_data->dispatch_table.CmdDebugMarkerEndEXT) { - dev_data->dispatch_table.CmdDebugMarkerEndEXT(commandBuffer); - } -} - -VKAPI_ATTR void VKAPI_CALL CmdDebugMarkerInsertEXT(VkCommandBuffer commandBuffer, VkDebugMarkerMarkerInfoEXT *pMarkerInfo) { - bool skip_call = VK_FALSE; - std::unique_lock<std::mutex> lock(global_lock); - skip_call |= ValidateObject(commandBuffer, commandBuffer, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, false, - VALIDATION_ERROR_02025, VALIDATION_ERROR_UNDEFINED); - lock.unlock(); - layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); - if (!skip_call && dev_data->dispatch_table.CmdDebugMarkerInsertEXT) { - dev_data->dispatch_table.CmdDebugMarkerInsertEXT(commandBuffer, pMarkerInfo); - } -} - -// VK_NV_external_memory_capabilities Extension -VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceExternalImageFormatPropertiesNV( - VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, - VkImageCreateFlags flags, VkExternalMemoryHandleTypeFlagsNV externalHandleType, - VkExternalImageFormatPropertiesNV *pExternalImageFormatProperties) { - bool skip_call = false; - { - std::lock_guard<std::mutex> lock(global_lock); - skip_call |= ValidateObject(physicalDevice, physicalDevice, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, false, - VALIDATION_ERROR_01980, VALIDATION_ERROR_UNDEFINED); - } - if (skip_call) { - return VK_ERROR_VALIDATION_FAILED_EXT; - } - VkResult result = get_dispatch_table(ot_instance_table_map, physicalDevice) - ->GetPhysicalDeviceExternalImageFormatPropertiesNV(physicalDevice, format, type, tiling, usage, flags, - externalHandleType, pExternalImageFormatProperties); - return result; -} - // VK_KHR_display Extension VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceDisplayPropertiesKHR(VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, VkDisplayPropertiesKHR *pProperties) { @@ -4154,66 +4091,6 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateDisplayPlaneSurfaceKHR(VkInstance instance, return result; } -#ifdef VK_USE_PLATFORM_WIN32_KHR -// VK_NV_external_memory_win32 Extension -VKAPI_ATTR VkResult VKAPI_CALL GetMemoryWin32HandleNV(VkDevice device, VkDeviceMemory memory, - VkExternalMemoryHandleTypeFlagsNV handleType, HANDLE *pHandle) { - bool skip_call = VK_FALSE; - std::unique_lock<std::mutex> lock(global_lock); - skip_call |= ValidateObject(device, device, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, false, VALIDATION_ERROR_01725, - VALIDATION_ERROR_UNDEFINED); - skip_call |= ValidateObject(device, memory, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, false, VALIDATION_ERROR_01726, - VALIDATION_ERROR_01730); - lock.unlock(); - if (skip_call) { - return VK_ERROR_VALIDATION_FAILED_EXT; - } - VkResult result = get_dispatch_table(ot_device_table_map, device)->GetMemoryWin32HandleNV(device, memory, handleType, pHandle); - return result; -} -#endif // VK_USE_PLATFORM_WIN32_KHR - -// VK_AMD_draw_indirect_count Extension -VKAPI_ATTR void VKAPI_CALL CmdDrawIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, - VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, - uint32_t stride) { - bool skip_call = VK_FALSE; - std::unique_lock<std::mutex> lock(global_lock); - skip_call |= ValidateObject(commandBuffer, commandBuffer, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, false, - VALIDATION_ERROR_01771, VALIDATION_ERROR_UNDEFINED); - skip_call |= ValidateObject(commandBuffer, buffer, VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT, false, VALIDATION_ERROR_01772, - VALIDATION_ERROR_01777); - skip_call |= ValidateObject(commandBuffer, countBuffer, VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT, false, VALIDATION_ERROR_01773, - VALIDATION_ERROR_01777); - skip_call |= ValidateObject(commandBuffer, commandBuffer, VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT, false, VALIDATION_ERROR_01774, - VALIDATION_ERROR_01777); - lock.unlock(); - if (!skip_call) { - get_dispatch_table(ot_device_table_map, commandBuffer) - ->CmdDrawIndirectCountAMD(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride); - } -} - -VKAPI_ATTR void VKAPI_CALL CmdDrawIndexedIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, - VkBuffer countBuffer, VkDeviceSize countBufferOffset, - uint32_t maxDrawCount, uint32_t stride) { - bool skip_call = VK_FALSE; - std::unique_lock<std::mutex> lock(global_lock); - skip_call |= ValidateObject(commandBuffer, commandBuffer, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, false, - VALIDATION_ERROR_01783, VALIDATION_ERROR_UNDEFINED); - skip_call |= ValidateObject(commandBuffer, buffer, VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT, false, VALIDATION_ERROR_01784, - VALIDATION_ERROR_01789); - skip_call |= ValidateObject(commandBuffer, countBuffer, VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT, false, VALIDATION_ERROR_01785, - VALIDATION_ERROR_01789); - skip_call |= ValidateObject(commandBuffer, commandBuffer, VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT, false, VALIDATION_ERROR_01786, - VALIDATION_ERROR_01789); - lock.unlock(); - if (!skip_call) { - get_dispatch_table(ot_device_table_map, commandBuffer) - ->CmdDrawIndexedIndirectCountAMD(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride); - } -} - // VK_KHR_get_physical_device_properties2 Extension VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceFeatures2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2KHR *pFeatures) { bool skip = false; @@ -4327,71 +4204,141 @@ VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceSparseImageFormatProperties2KHR( } } -// VK_NVX_device_generated_commands Extension -VKAPI_ATTR void VKAPI_CALL CmdProcessCommandsNVX(VkCommandBuffer commandBuffer, - const VkCmdProcessCommandsInfoNVX *pProcessCommandsInfo) { +// VK_KHR_descriptor_update_template +VKAPI_ATTR VkResult VKAPI_CALL CreateDescriptorUpdateTemplateKHR(VkDevice device, + const VkDescriptorUpdateTemplateCreateInfoKHR *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkDescriptorUpdateTemplateKHR *pDescriptorUpdateTemplate) { bool skip_call = VK_FALSE; std::unique_lock<std::mutex> lock(global_lock); - skip_call |= ValidateObject(commandBuffer, commandBuffer, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, false, - VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); + skip_call |= ValidateObject(device, device, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, false, VALIDATION_ERROR_UNDEFINED, + VALIDATION_ERROR_UNDEFINED); lock.unlock(); - layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); - if (!skip_call && dev_data->dispatch_table.CmdProcessCommandsNVX) { - dev_data->dispatch_table.CmdProcessCommandsNVX(commandBuffer, pProcessCommandsInfo); + if (skip_call) { + return VK_ERROR_VALIDATION_FAILED_EXT; } + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + VkResult result = VK_SUCCESS; + if (dev_data->dispatch_table.CreateDescriptorUpdateTemplateKHR) { + result = + dev_data->dispatch_table.CreateDescriptorUpdateTemplateKHR(device, pCreateInfo, pAllocator, pDescriptorUpdateTemplate); + // TODO: Add tracking of VkDescriptorUpdateTemplateKHR + } + return result; } -VKAPI_ATTR void VKAPI_CALL CmdReserveSpaceForCommandsNVX(VkCommandBuffer commandBuffer, - const VkCmdReserveSpaceForCommandsInfoNVX *pReserveSpaceInfo) { +VKAPI_ATTR void VKAPI_CALL DestroyDescriptorUpdateTemplateKHR(VkDevice device, + VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, + const VkAllocationCallbacks *pAllocator) { bool skip_call = VK_FALSE; std::unique_lock<std::mutex> lock(global_lock); - skip_call |= ValidateObject(commandBuffer, commandBuffer, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, false, - VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); + skip_call |= ValidateObject(device, device, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, false, VALIDATION_ERROR_UNDEFINED, + VALIDATION_ERROR_UNDEFINED); + // TODO: Add tracking of VkDescriptorUpdateTemplateKHR lock.unlock(); - layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); - if (!skip_call && dev_data->dispatch_table.CmdReserveSpaceForCommandsNVX) { - dev_data->dispatch_table.CmdReserveSpaceForCommandsNVX(commandBuffer, pReserveSpaceInfo); + if (!skip_call) { + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + if (dev_data->dispatch_table.DestroyDescriptorUpdateTemplateKHR) { + dev_data->dispatch_table.DestroyDescriptorUpdateTemplateKHR(device, descriptorUpdateTemplate, pAllocator); + } } } -VKAPI_ATTR VkResult VKAPI_CALL CreateIndirectCommandsLayoutNVX(VkDevice device, - const VkIndirectCommandsLayoutCreateInfoNVX *pCreateInfo, - const VkAllocationCallbacks *pAllocator, - VkIndirectCommandsLayoutNVX *pIndirectCommandsLayout) { +VKAPI_ATTR void VKAPI_CALL UpdateDescriptorSetWithTemplateKHR(VkDevice device, VkDescriptorSet descriptorSet, + VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, + const void *pData) { bool skip_call = VK_FALSE; std::unique_lock<std::mutex> lock(global_lock); skip_call |= ValidateObject(device, device, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, false, VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); + skip_call |= + ValidateObject(device, descriptorSet, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT, false, VALIDATION_ERROR_UNDEFINED, + VALIDATION_ERROR_UNDEFINED); + // TODO: Add tracking of VkDescriptorUpdateTemplateKHR lock.unlock(); - if (skip_call) { - return VK_ERROR_VALIDATION_FAILED_EXT; + if (!skip_call) { + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + if (dev_data->dispatch_table.UpdateDescriptorSetWithTemplateKHR) { + dev_data->dispatch_table.UpdateDescriptorSetWithTemplateKHR(device, descriptorSet, descriptorUpdateTemplate, pData); + } } - layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); - VkResult result = VK_SUCCESS; - if (dev_data->dispatch_table.CreateIndirectCommandsLayoutNVX) { - result = dev_data->dispatch_table.CreateIndirectCommandsLayoutNVX(device, pCreateInfo, pAllocator, pIndirectCommandsLayout); +} + +VKAPI_ATTR void VKAPI_CALL CmdPushDescriptorSetWithTemplateKHR(VkCommandBuffer commandBuffer, + VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, + VkPipelineLayout layout, uint32_t set, const void *pData) { + bool skip_call = false; + std::unique_lock<std::mutex> lock(global_lock); + skip_call |= ValidateObject(commandBuffer, commandBuffer, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, false, + VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); + skip_call |= + ValidateObject(commandBuffer, layout, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT, false, VALIDATION_ERROR_UNDEFINED, + VALIDATION_ERROR_UNDEFINED); + // TODO: Add tracking of VkDescriptorUpdateTemplateKHR + lock.unlock(); + if (!skip_call) { + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); + if (dev_data->dispatch_table.CmdPushDescriptorSetWithTemplateKHR) { + dev_data->dispatch_table.CmdPushDescriptorSetWithTemplateKHR(commandBuffer, descriptorUpdateTemplate, layout, set, + pData); + } } - return result; } -VKAPI_ATTR void VKAPI_CALL DestroyIndirectCommandsLayoutNVX(VkDevice device, VkIndirectCommandsLayoutNVX indirectCommandsLayout, - const VkAllocationCallbacks *pAllocator) { +// VK_KHR_maintenance1 Extension +VKAPI_ATTR void VKAPI_CALL TrimCommandPoolKHR(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlagsKHR flags) { bool skip_call = VK_FALSE; std::unique_lock<std::mutex> lock(global_lock); skip_call |= ValidateObject(device, device, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, false, VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); + skip_call |= + ValidateObject(device, commandPool, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT, false, VALIDATION_ERROR_UNDEFINED, + VALIDATION_ERROR_UNDEFINED); lock.unlock(); if (!skip_call) { layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); - if (dev_data->dispatch_table.DestroyIndirectCommandsLayoutNVX) { - dev_data->dispatch_table.DestroyIndirectCommandsLayoutNVX(device, indirectCommandsLayout, pAllocator); + if (dev_data->dispatch_table.TrimCommandPoolKHR) { + dev_data->dispatch_table.TrimCommandPoolKHR(device, commandPool, flags); } } } -VKAPI_ATTR VkResult VKAPI_CALL CreateObjectTableNVX(VkDevice device, const VkObjectTableCreateInfoNVX *pCreateInfo, - const VkAllocationCallbacks *pAllocator, VkObjectTableNVX *pObjectTable) { - bool skip_call = VK_FALSE; +// VK_KHR_push_descriptor Extension +VKAPI_ATTR void VKAPI_CALL CmdPushDescriptorSetKHR(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, + VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, + const VkWriteDescriptorSet *pDescriptorWrites) { + bool skip_call = false; + std::unique_lock<std::mutex> lock(global_lock); + skip_call |= ValidateObject(commandBuffer, commandBuffer, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, false, + VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); + skip_call |= + ValidateObject(commandBuffer, layout, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT, false, VALIDATION_ERROR_UNDEFINED, + VALIDATION_ERROR_UNDEFINED); + lock.unlock(); + if (!skip_call) { + get_dispatch_table(ot_device_table_map, commandBuffer) + ->CmdPushDescriptorSetKHR(commandBuffer, pipelineBindPoint, layout, set, descriptorWriteCount, pDescriptorWrites); + } +} + +// VK_KHX_device_group Extension +VKAPI_ATTR void VKAPI_CALL GetDeviceGroupPeerMemoryFeaturesKHX(VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, + uint32_t remoteDeviceIndex, + VkPeerMemoryFeatureFlagsKHX *pPeerMemoryFeatures) { + bool skip_call = false; + std::unique_lock<std::mutex> lock(global_lock); + skip_call |= ValidateObject(device, device, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, false, VALIDATION_ERROR_UNDEFINED, + VALIDATION_ERROR_UNDEFINED); + lock.unlock(); + if (!skip_call) { + get_dispatch_table(ot_device_table_map, device) + ->GetDeviceGroupPeerMemoryFeaturesKHX(device, heapIndex, localDeviceIndex, remoteDeviceIndex, pPeerMemoryFeatures); + } +} + +VKAPI_ATTR VkResult VKAPI_CALL BindBufferMemory2KHX(VkDevice device, uint32_t bindInfoCount, + const VkBindBufferMemoryInfoKHX *pBindInfos) { + bool skip_call = false; std::unique_lock<std::mutex> lock(global_lock); skip_call |= ValidateObject(device, device, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, false, VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); @@ -4399,33 +4346,40 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateObjectTableNVX(VkDevice device, const VkObj if (skip_call) { return VK_ERROR_VALIDATION_FAILED_EXT; } - layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); VkResult result = VK_SUCCESS; - if (dev_data->dispatch_table.CreateObjectTableNVX) { - result = dev_data->dispatch_table.CreateObjectTableNVX(device, pCreateInfo, pAllocator, pObjectTable); - } + result = get_dispatch_table(ot_device_table_map, device)->BindBufferMemory2KHX(device, bindInfoCount, pBindInfos); return result; } -VKAPI_ATTR void VKAPI_CALL DestroyObjectTableNVX(VkDevice device, VkObjectTableNVX objectTable, - const VkAllocationCallbacks *pAllocator) { - bool skip_call = VK_FALSE; +VKAPI_ATTR VkResult VKAPI_CALL BindImageMemory2KHX(VkDevice device, uint32_t bindInfoCount, + const VkBindImageMemoryInfoKHX *pBindInfos) { + bool skip_call = false; std::unique_lock<std::mutex> lock(global_lock); skip_call |= ValidateObject(device, device, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, false, VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); lock.unlock(); + if (skip_call) { + return VK_ERROR_VALIDATION_FAILED_EXT; + } + VkResult result = VK_SUCCESS; + result = get_dispatch_table(ot_device_table_map, device)->BindImageMemory2KHX(device, bindInfoCount, pBindInfos); + return result; +} + +VKAPI_ATTR void VKAPI_CALL CmdSetDeviceMaskKHX(VkCommandBuffer commandBuffer, uint32_t deviceMask) { + bool skip_call = false; + std::unique_lock<std::mutex> lock(global_lock); + skip_call |= ValidateObject(commandBuffer, commandBuffer, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, false, + VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); + lock.unlock(); if (!skip_call) { - layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); - if (dev_data->dispatch_table.DestroyObjectTableNVX) { - dev_data->dispatch_table.DestroyObjectTableNVX(device, objectTable, pAllocator); - } + get_dispatch_table(ot_device_table_map, commandBuffer)->CmdSetDeviceMaskKHX(commandBuffer, deviceMask); } } -VKAPI_ATTR VkResult VKAPI_CALL RegisterObjectsNVX(VkDevice device, VkObjectTableNVX objectTable, uint32_t objectCount, - const VkObjectTableEntryNVX *const *ppObjectTableEntries, - const uint32_t *pObjectIndices) { - bool skip_call = VK_FALSE; +VKAPI_ATTR VkResult VKAPI_CALL +GetDeviceGroupPresentCapabilitiesKHX(VkDevice device, VkDeviceGroupPresentCapabilitiesKHX *pDeviceGroupPresentCapabilities) { + bool skip_call = false; std::unique_lock<std::mutex> lock(global_lock); skip_call |= ValidateObject(device, device, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, false, VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); @@ -4433,18 +4387,30 @@ VKAPI_ATTR VkResult VKAPI_CALL RegisterObjectsNVX(VkDevice device, VkObjectTable if (skip_call) { return VK_ERROR_VALIDATION_FAILED_EXT; } - layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); VkResult result = VK_SUCCESS; - if (dev_data->dispatch_table.RegisterObjectsNVX) { - result = - dev_data->dispatch_table.RegisterObjectsNVX(device, objectTable, objectCount, ppObjectTableEntries, pObjectIndices); + result = get_dispatch_table(ot_device_table_map, device) + ->GetDeviceGroupPresentCapabilitiesKHX(device, pDeviceGroupPresentCapabilities); + return result; +} + +VKAPI_ATTR VkResult VKAPI_CALL GetDeviceGroupSurfacePresentModesKHX(VkDevice device, VkSurfaceKHR surface, + VkDeviceGroupPresentModeFlagsKHX *pModes) { + bool skip_call = false; + std::unique_lock<std::mutex> lock(global_lock); + skip_call |= ValidateObject(device, device, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, false, VALIDATION_ERROR_UNDEFINED, + VALIDATION_ERROR_UNDEFINED); + lock.unlock(); + if (skip_call) { + return VK_ERROR_VALIDATION_FAILED_EXT; } + VkResult result = VK_SUCCESS; + result = get_dispatch_table(ot_device_table_map, device)->GetDeviceGroupSurfacePresentModesKHX(device, surface, pModes); return result; } -VKAPI_ATTR VkResult VKAPI_CALL UnregisterObjectsNVX(VkDevice device, VkObjectTableNVX objectTable, uint32_t objectCount, - const VkObjectEntryTypeNVX *pObjectEntryTypes, const uint32_t *pObjectIndices) { - bool skip_call = VK_FALSE; +VKAPI_ATTR VkResult VKAPI_CALL AcquireNextImage2KHX(VkDevice device, const VkAcquireNextImageInfoKHX *pAcquireInfo, + uint32_t *pImageIndex) { + bool skip_call = false; std::unique_lock<std::mutex> lock(global_lock); skip_call |= ValidateObject(device, device, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, false, VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); @@ -4452,31 +4418,102 @@ VKAPI_ATTR VkResult VKAPI_CALL UnregisterObjectsNVX(VkDevice device, VkObjectTab if (skip_call) { return VK_ERROR_VALIDATION_FAILED_EXT; } - layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); VkResult result = VK_SUCCESS; - if (dev_data->dispatch_table.UnregisterObjectsNVX) { - result = dev_data->dispatch_table.UnregisterObjectsNVX(device, objectTable, objectCount, pObjectEntryTypes, pObjectIndices); + result = get_dispatch_table(ot_device_table_map, device)->AcquireNextImage2KHX(device, pAcquireInfo, pImageIndex); + return result; +} + +VKAPI_ATTR void VKAPI_CALL CmdDispatchBaseKHX(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, + uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, + uint32_t groupCountZ) { + bool skip_call = false; + std::unique_lock<std::mutex> lock(global_lock); + skip_call |= ValidateObject(commandBuffer, commandBuffer, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, false, + VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); + lock.unlock(); + if (!skip_call) { + get_dispatch_table(ot_device_table_map, commandBuffer) + ->CmdDispatchBaseKHX(commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, groupCountZ); + } +} + +VKAPI_ATTR void VKAPI_CALL GetPhysicalDevicePresentRectanglesKHX(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, + uint32_t *pRectCount, VkRect2D *pRects) { + bool skip = false; + { + std::unique_lock<std::mutex> lock(global_lock); + skip |= ValidateObject(physicalDevice, physicalDevice, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, false, + VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); + } + if (!skip) { + get_dispatch_table(ot_instance_table_map, physicalDevice) + ->GetPhysicalDevicePresentRectanglesKHX(physicalDevice, surface, pRectCount, pRects); + } +} + +// VK_KHX_device_group_creation Extension +VKAPI_ATTR VkResult VKAPI_CALL EnumeratePhysicalDeviceGroupsKHX( + VkInstance instance, uint32_t *pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupPropertiesKHX *pPhysicalDeviceGroupProperties) { + bool skip_call = false; + std::unique_lock<std::mutex> lock(global_lock); + skip_call |= ValidateObject(instance, instance, VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT, false, VALIDATION_ERROR_UNDEFINED, + VALIDATION_ERROR_UNDEFINED); + lock.unlock(); + if (skip_call) { + return VK_ERROR_VALIDATION_FAILED_EXT; + } + VkResult result = get_dispatch_table(ot_instance_table_map, instance) + ->EnumeratePhysicalDeviceGroupsKHX(instance, pPhysicalDeviceGroupCount, pPhysicalDeviceGroupProperties); + { + lock.lock(); + if (result == VK_SUCCESS) { + if (nullptr != pPhysicalDeviceGroupProperties) { + // NOTE: Each physical device should only appear in one group + for (uint32_t i = 0; i < *pPhysicalDeviceGroupCount; i++) { + for (uint32_t j = 0; j < pPhysicalDeviceGroupProperties[i].physicalDeviceCount; j++) { + CreateObject(instance, pPhysicalDeviceGroupProperties[i].physicalDevices[j], + VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, nullptr); + } + } + } + } + lock.unlock(); } return result; } -VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceGeneratedCommandsPropertiesNVX(VkPhysicalDevice physicalDevice, - VkDeviceGeneratedCommandsFeaturesNVX *pFeatures, - VkDeviceGeneratedCommandsLimitsNVX *pLimits) { +// VK_KHX_external_memory_capabilities Extension +VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceExternalBufferPropertiesKHX( + VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfoKHX *pExternalBufferInfo, + VkExternalBufferPropertiesKHX *pExternalBufferProperties) { bool skip = false; { std::unique_lock<std::mutex> lock(global_lock); skip |= ValidateObject(physicalDevice, physicalDevice, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, false, VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); } - if (skip) { + if (!skip) { get_dispatch_table(ot_instance_table_map, physicalDevice) - ->GetPhysicalDeviceGeneratedCommandsPropertiesNVX(physicalDevice, pFeatures, pLimits); + ->GetPhysicalDeviceExternalBufferPropertiesKHX(physicalDevice, pExternalBufferInfo, pExternalBufferProperties); } } -// VK_EXT_direct_mode_display Extension -VKAPI_ATTR VkResult VKAPI_CALL ReleaseDisplayEXT(VkPhysicalDevice physicalDevice, VkDisplayKHR display) { +VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceProperties2KHX(VkPhysicalDevice physicalDevice, + VkPhysicalDeviceProperties2KHX *pProperties) { + bool skip = false; + { + std::unique_lock<std::mutex> lock(global_lock); + skip |= ValidateObject(physicalDevice, physicalDevice, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, false, + VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); + } + if (!skip) { + get_dispatch_table(ot_instance_table_map, physicalDevice)->GetPhysicalDeviceProperties2KHX(physicalDevice, pProperties); + } +} + +VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceImageFormatProperties2KHX( + VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2KHX *pImageFormatInfo, + VkImageFormatProperties2KHX *pImageFormatProperties) { VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; bool skip = false; { @@ -4487,11 +4524,162 @@ VKAPI_ATTR VkResult VKAPI_CALL ReleaseDisplayEXT(VkPhysicalDevice physicalDevice if (skip) { return VK_ERROR_VALIDATION_FAILED_EXT; } - result = get_dispatch_table(ot_instance_table_map, physicalDevice)->ReleaseDisplayEXT(physicalDevice, display); + result = get_dispatch_table(ot_instance_table_map, physicalDevice) + ->GetPhysicalDeviceImageFormatProperties2KHX(physicalDevice, pImageFormatInfo, pImageFormatProperties); return result; } +// VK_KHX_external_memory_fd Extension +VKAPI_ATTR VkResult VKAPI_CALL GetMemoryFdKHX(VkDevice device, VkDeviceMemory memory, + VkExternalMemoryHandleTypeFlagBitsKHX handleType, int *pFd) { + bool skip_call = false; + std::unique_lock<std::mutex> lock(global_lock); + skip_call |= ValidateObject(device, device, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, false, VALIDATION_ERROR_UNDEFINED, + VALIDATION_ERROR_UNDEFINED); + skip_call |= ValidateObject(device, memory, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, false, VALIDATION_ERROR_UNDEFINED, + VALIDATION_ERROR_UNDEFINED); + lock.unlock(); + if (skip_call) { + return VK_ERROR_VALIDATION_FAILED_EXT; + } + VkResult result = VK_SUCCESS; + result = get_dispatch_table(ot_device_table_map, device)->GetMemoryFdKHX(device, memory, handleType, pFd); + return result; +} + +VKAPI_ATTR VkResult VKAPI_CALL GetMemoryFdPropertiesKHX(VkDevice device, VkExternalMemoryHandleTypeFlagBitsKHX handleType, int fd, + VkMemoryFdPropertiesKHX *pMemoryFdProperties) { + bool skip_call = false; + std::unique_lock<std::mutex> lock(global_lock); + skip_call |= ValidateObject(device, device, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, false, VALIDATION_ERROR_UNDEFINED, + VALIDATION_ERROR_UNDEFINED); + lock.unlock(); + if (skip_call) { + return VK_ERROR_VALIDATION_FAILED_EXT; + } + VkResult result = VK_SUCCESS; + result = get_dispatch_table(ot_device_table_map, device)->GetMemoryFdPropertiesKHX(device, handleType, fd, pMemoryFdProperties); + return result; +} + +// VK_KHX_external_memory_win32 Extension +#ifdef VK_USE_PLATFORM_WIN32_KHR +VKAPI_ATTR VkResult VKAPI_CALL GetMemoryWin32HandleKHX(VkDevice device, VkDeviceMemory memory, + VkExternalMemoryHandleTypeFlagBitsKHX handleType, HANDLE *pHandle) { + bool skip_call = false; + std::unique_lock<std::mutex> lock(global_lock); + skip_call |= ValidateObject(device, device, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, false, VALIDATION_ERROR_UNDEFINED, + VALIDATION_ERROR_UNDEFINED); + skip_call |= ValidateObject(device, memory, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, false, VALIDATION_ERROR_UNDEFINED, + VALIDATION_ERROR_UNDEFINED); + lock.unlock(); + if (skip_call) { + return VK_ERROR_VALIDATION_FAILED_EXT; + } + VkResult result = VK_SUCCESS; + result = get_dispatch_table(ot_device_table_map, device)->GetMemoryWin32HandleKHX(device, memory, handleType, pHandle); + return result; +} + +VKAPI_ATTR VkResult VKAPI_CALL GetMemoryWin32HandlePropertiesKHX(VkDevice device, VkExternalMemoryHandleTypeFlagBitsKHX handleType, + HANDLE handle, + VkMemoryWin32HandlePropertiesKHX *pMemoryWin32HandleProperties) { + bool skip_call = false; + std::unique_lock<std::mutex> lock(global_lock); + skip_call |= ValidateObject(device, device, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, false, VALIDATION_ERROR_UNDEFINED, + VALIDATION_ERROR_UNDEFINED); + lock.unlock(); + if (skip_call) { + return VK_ERROR_VALIDATION_FAILED_EXT; + } + VkResult result = VK_SUCCESS; + result = get_dispatch_table(ot_device_table_map, device) + ->GetMemoryWin32HandlePropertiesKHX(device, handleType, handle, pMemoryWin32HandleProperties); + return result; +} +#endif // VK_USE_PLATFORM_WIN32_KHR + +// VK_KHX_external_semaphore_capabilities Extension +VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceExternalSemaphorePropertiesKHX( + VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfoKHX *pExternalSemaphoreInfo, + VkExternalSemaphorePropertiesKHX *pExternalSemaphoreProperties) { + bool skip = false; + { + std::unique_lock<std::mutex> lock(global_lock); + skip |= ValidateObject(physicalDevice, physicalDevice, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, false, + VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); + } + if (!skip) { + get_dispatch_table(ot_instance_table_map, physicalDevice) + ->GetPhysicalDeviceExternalSemaphorePropertiesKHX(physicalDevice, pExternalSemaphoreInfo, pExternalSemaphoreProperties); + } +} + +// VK_KHX_external_semaphore_fd Extension +VKAPI_ATTR VkResult VKAPI_CALL ImportSemaphoreFdKHX(VkDevice device, const VkImportSemaphoreFdInfoKHX *pImportSemaphoreFdInfo) { + bool skip_call = false; + std::unique_lock<std::mutex> lock(global_lock); + skip_call |= ValidateObject(device, device, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, false, VALIDATION_ERROR_UNDEFINED, + VALIDATION_ERROR_UNDEFINED); + lock.unlock(); + if (skip_call) { + return VK_ERROR_VALIDATION_FAILED_EXT; + } + VkResult result = VK_SUCCESS; + result = get_dispatch_table(ot_device_table_map, device)->ImportSemaphoreFdKHX(device, pImportSemaphoreFdInfo); + return result; +} + +VKAPI_ATTR VkResult VKAPI_CALL GetSemaphoreFdKHX(VkDevice device, VkSemaphore semaphore, + VkExternalSemaphoreHandleTypeFlagBitsKHX handleType, int *pFd) { + bool skip_call = false; + std::unique_lock<std::mutex> lock(global_lock); + skip_call |= ValidateObject(device, device, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, false, VALIDATION_ERROR_UNDEFINED, + VALIDATION_ERROR_UNDEFINED); + lock.unlock(); + if (skip_call) { + return VK_ERROR_VALIDATION_FAILED_EXT; + } + VkResult result = VK_SUCCESS; + result = get_dispatch_table(ot_device_table_map, device)->GetSemaphoreFdKHX(device, semaphore, handleType, pFd); + return result; +} + +// VK_KHX_external_semaphore_win32 Extension +#ifdef VK_USE_PLATFORM_WIN32_KHR +VKAPI_ATTR VkResult VKAPI_CALL +ImportSemaphoreWin32HandleKHX(VkDevice device, const VkImportSemaphoreWin32HandleInfoKHX *pImportSemaphoreWin32HandleInfo) { + bool skip_call = false; + std::unique_lock<std::mutex> lock(global_lock); + skip_call |= ValidateObject(device, device, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, false, VALIDATION_ERROR_UNDEFINED, + VALIDATION_ERROR_UNDEFINED); + lock.unlock(); + if (skip_call) { + return VK_ERROR_VALIDATION_FAILED_EXT; + } + VkResult result = VK_SUCCESS; + result = + get_dispatch_table(ot_device_table_map, device)->ImportSemaphoreWin32HandleKHX(device, pImportSemaphoreWin32HandleInfo); + return result; +} + +VKAPI_ATTR VkResult VKAPI_CALL GetSemaphoreWin32HandleKHX(VkDevice device, VkSemaphore semaphore, + VkExternalSemaphoreHandleTypeFlagBitsKHX handleType, HANDLE *pHandle) { + bool skip_call = false; + std::unique_lock<std::mutex> lock(global_lock); + skip_call |= ValidateObject(device, device, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, false, VALIDATION_ERROR_UNDEFINED, + VALIDATION_ERROR_UNDEFINED); + lock.unlock(); + if (skip_call) { + return VK_ERROR_VALIDATION_FAILED_EXT; + } + VkResult result = VK_SUCCESS; + result = get_dispatch_table(ot_device_table_map, device)->GetSemaphoreWin32HandleKHX(device, semaphore, handleType, pHandle); + return result; +} +#endif // VK_USE_PLATFORM_WIN32_KHR + // VK_EXT_acquire_xlib_display Extension #ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT VKAPI_ATTR VkResult VKAPI_CALL AcquireXlibDisplayEXT(VkPhysicalDevice physicalDevice, Display *dpy, VkDisplayKHR display) { @@ -4501,6 +4689,9 @@ VKAPI_ATTR VkResult VKAPI_CALL AcquireXlibDisplayEXT(VkPhysicalDevice physicalDe std::unique_lock<std::mutex> lock(global_lock); skip |= ValidateObject(physicalDevice, physicalDevice, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, false, VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); + skip |= + ValidateObject(physicalDevice, display, VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT, false, VALIDATION_ERROR_UNDEFINED, + VALIDATION_ERROR_UNDEFINED); } if (skip) { return VK_ERROR_VALIDATION_FAILED_EXT; @@ -4533,25 +4724,113 @@ VKAPI_ATTR VkResult VKAPI_CALL GetRandROutputDisplayEXT(VkPhysicalDevice physica } #endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT -// VK_EXT_display_surface_counter Extension -VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceCapabilities2EXT(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, - VkSurfaceCapabilities2EXT *pSurfaceCapabilities) { +// VK_EXT_debug_marker Extension +VKAPI_ATTR VkResult VKAPI_CALL DebugMarkerSetObjectTagEXT(VkDevice device, VkDebugMarkerObjectTagInfoEXT *pTagInfo) { + bool skip_call = VK_FALSE; + std::unique_lock<std::mutex> lock(global_lock); + skip_call |= ValidateObject(device, device, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, false, VALIDATION_ERROR_02007, + VALIDATION_ERROR_UNDEFINED); + lock.unlock(); + if (skip_call) { + return VK_ERROR_VALIDATION_FAILED_EXT; + } + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + VkResult result = VK_SUCCESS; + if (dev_data->dispatch_table.DebugMarkerSetObjectTagEXT) { + result = dev_data->dispatch_table.DebugMarkerSetObjectTagEXT(device, pTagInfo); + } + return result; +} + +VKAPI_ATTR VkResult VKAPI_CALL DebugMarkerSetObjectNameEXT(VkDevice device, VkDebugMarkerObjectNameInfoEXT *pNameInfo) { + bool skip_call = VK_FALSE; + std::unique_lock<std::mutex> lock(global_lock); + skip_call |= ValidateObject(device, device, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, false, VALIDATION_ERROR_01999, + VALIDATION_ERROR_UNDEFINED); + lock.unlock(); + if (skip_call) { + return VK_ERROR_VALIDATION_FAILED_EXT; + } + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + VkResult result = VK_SUCCESS; + if (dev_data->dispatch_table.DebugMarkerSetObjectNameEXT) { + result = dev_data->dispatch_table.DebugMarkerSetObjectNameEXT(device, pNameInfo); + } + return result; +} + +VKAPI_ATTR void VKAPI_CALL CmdDebugMarkerBeginEXT(VkCommandBuffer commandBuffer, VkDebugMarkerMarkerInfoEXT *pMarkerInfo) { + bool skip_call = VK_FALSE; + std::unique_lock<std::mutex> lock(global_lock); + skip_call |= ValidateObject(commandBuffer, commandBuffer, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, false, + VALIDATION_ERROR_02014, VALIDATION_ERROR_UNDEFINED); + lock.unlock(); + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); + if (!skip_call && dev_data->dispatch_table.CmdDebugMarkerBeginEXT) { + dev_data->dispatch_table.CmdDebugMarkerBeginEXT(commandBuffer, pMarkerInfo); + } +} + +VKAPI_ATTR void VKAPI_CALL CmdDebugMarkerEndEXT(VkCommandBuffer commandBuffer) { + bool skip_call = VK_FALSE; + std::unique_lock<std::mutex> lock(global_lock); + skip_call |= ValidateObject(commandBuffer, commandBuffer, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, false, + VALIDATION_ERROR_02022, VALIDATION_ERROR_UNDEFINED); + lock.unlock(); + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); + if (!skip_call && dev_data->dispatch_table.CmdDebugMarkerEndEXT) { + dev_data->dispatch_table.CmdDebugMarkerEndEXT(commandBuffer); + } +} + +VKAPI_ATTR void VKAPI_CALL CmdDebugMarkerInsertEXT(VkCommandBuffer commandBuffer, VkDebugMarkerMarkerInfoEXT *pMarkerInfo) { + bool skip_call = VK_FALSE; + std::unique_lock<std::mutex> lock(global_lock); + skip_call |= ValidateObject(commandBuffer, commandBuffer, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, false, + VALIDATION_ERROR_02025, VALIDATION_ERROR_UNDEFINED); + lock.unlock(); + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); + if (!skip_call && dev_data->dispatch_table.CmdDebugMarkerInsertEXT) { + dev_data->dispatch_table.CmdDebugMarkerInsertEXT(commandBuffer, pMarkerInfo); + } +} + +// VK_EXT_direct_mode_display Extension +VKAPI_ATTR VkResult VKAPI_CALL ReleaseDisplayEXT(VkPhysicalDevice physicalDevice, VkDisplayKHR display) { VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; bool skip = false; { std::unique_lock<std::mutex> lock(global_lock); skip |= ValidateObject(physicalDevice, physicalDevice, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, false, VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); + skip |= + ValidateObject(physicalDevice, display, VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT, false, VALIDATION_ERROR_UNDEFINED, + VALIDATION_ERROR_UNDEFINED); } if (skip) { return VK_ERROR_VALIDATION_FAILED_EXT; } - result = get_dispatch_table(ot_instance_table_map, physicalDevice) - ->GetPhysicalDeviceSurfaceCapabilities2EXT(physicalDevice, surface, pSurfaceCapabilities); + result = get_dispatch_table(ot_instance_table_map, physicalDevice)->ReleaseDisplayEXT(physicalDevice, display); return result; } +// VK_EXT_discard_rectangles +VKAPI_ATTR void VKAPI_CALL CmdSetDiscardRectangleEXT(VkCommandBuffer commandBuffer, uint32_t firstDiscardRectangle, + uint32_t discardRectangleCount, const VkRect2D *pDiscardRectangles) { + bool skip_call = VK_FALSE; + std::unique_lock<std::mutex> lock(global_lock); + skip_call |= + ValidateObject(commandBuffer, commandBuffer, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, false, + VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); + lock.unlock(); + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); + if (!skip_call && dev_data->dispatch_table.CmdSetDiscardRectangleEXT) { + dev_data->dispatch_table.CmdSetDiscardRectangleEXT(commandBuffer, firstDiscardRectangle, discardRectangleCount, + pDiscardRectangles); + } +} + // VK_EXT_display_control Extension VKAPI_ATTR VkResult VKAPI_CALL DisplayPowerControlEXT(VkDevice device, VkDisplayKHR display, const VkDisplayPowerInfoEXT *pDisplayPowerInfo) { @@ -4622,6 +4901,9 @@ VKAPI_ATTR VkResult VKAPI_CALL GetSwapchainCounterEXT(VkDevice device, VkSwapcha std::unique_lock<std::mutex> lock(global_lock); skip_call |= ValidateObject(device, device, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, false, VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); + skip_call |= + ValidateObject(device, swapchain, VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT, false, VALIDATION_ERROR_UNDEFINED, + VALIDATION_ERROR_UNDEFINED); lock.unlock(); if (skip_call) { return VK_ERROR_VALIDATION_FAILED_EXT; @@ -4634,6 +4916,268 @@ VKAPI_ATTR VkResult VKAPI_CALL GetSwapchainCounterEXT(VkDevice device, VkSwapcha return result; } +// VK_EXT_display_surface_counter Extension +VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceCapabilities2EXT(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, + VkSurfaceCapabilities2EXT *pSurfaceCapabilities) { + VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; + bool skip_call = false; + { + std::unique_lock<std::mutex> lock(global_lock); + skip_call |= ValidateObject(physicalDevice, physicalDevice, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, false, + VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); + } + if (skip_call) { + return VK_ERROR_VALIDATION_FAILED_EXT; + } + result = get_dispatch_table(ot_instance_table_map, physicalDevice) + ->GetPhysicalDeviceSurfaceCapabilities2EXT(physicalDevice, surface, pSurfaceCapabilities); + + return result; +} + +// VK_AMD_draw_indirect_count Extension +VKAPI_ATTR void VKAPI_CALL CmdDrawIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, + VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, + uint32_t stride) { + bool skip_call = VK_FALSE; + std::unique_lock<std::mutex> lock(global_lock); + skip_call |= ValidateObject(commandBuffer, commandBuffer, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, false, + VALIDATION_ERROR_01771, VALIDATION_ERROR_UNDEFINED); + skip_call |= ValidateObject(commandBuffer, buffer, VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT, false, VALIDATION_ERROR_01772, + VALIDATION_ERROR_01777); + skip_call |= ValidateObject(commandBuffer, countBuffer, VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT, false, VALIDATION_ERROR_01773, + VALIDATION_ERROR_01777); + skip_call |= ValidateObject(commandBuffer, commandBuffer, VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT, false, VALIDATION_ERROR_01774, + VALIDATION_ERROR_01777); + lock.unlock(); + if (!skip_call) { + get_dispatch_table(ot_device_table_map, commandBuffer) + ->CmdDrawIndirectCountAMD(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride); + } +} + +VKAPI_ATTR void VKAPI_CALL CmdDrawIndexedIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, + VkBuffer countBuffer, VkDeviceSize countBufferOffset, + uint32_t maxDrawCount, uint32_t stride) { + bool skip_call = VK_FALSE; + std::unique_lock<std::mutex> lock(global_lock); + skip_call |= ValidateObject(commandBuffer, commandBuffer, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, false, + VALIDATION_ERROR_01783, VALIDATION_ERROR_UNDEFINED); + skip_call |= ValidateObject(commandBuffer, buffer, VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT, false, VALIDATION_ERROR_01784, + VALIDATION_ERROR_01789); + skip_call |= ValidateObject(commandBuffer, countBuffer, VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT, false, VALIDATION_ERROR_01785, + VALIDATION_ERROR_01789); + skip_call |= ValidateObject(commandBuffer, commandBuffer, VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT, false, VALIDATION_ERROR_01786, + VALIDATION_ERROR_01789); + lock.unlock(); + if (!skip_call) { + get_dispatch_table(ot_device_table_map, commandBuffer) + ->CmdDrawIndexedIndirectCountAMD(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride); + } +} + +// VK_NV_clip_space_w_scaling Extension +VKAPI_ATTR void VKAPI_CALL CmdSetViewportWScalingNV(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, + const VkViewportWScalingNV *pViewportWScalings) { + bool skip_call = VK_FALSE; + std::unique_lock<std::mutex> lock(global_lock); + skip_call |= ValidateObject(commandBuffer, commandBuffer, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, false, + VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); + lock.unlock(); + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); + if (!skip_call && dev_data->dispatch_table.CmdSetViewportWScalingNV) { + dev_data->dispatch_table.CmdSetViewportWScalingNV(commandBuffer, firstViewport, viewportCount, pViewportWScalings); + } +} + +// VK_NV_external_memory_capabilities Extension +VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceExternalImageFormatPropertiesNV( + VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, + VkImageCreateFlags flags, VkExternalMemoryHandleTypeFlagsNV externalHandleType, + VkExternalImageFormatPropertiesNV *pExternalImageFormatProperties) { + bool skip_call = false; + { + std::lock_guard<std::mutex> lock(global_lock); + skip_call |= ValidateObject(physicalDevice, physicalDevice, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, false, + VALIDATION_ERROR_01980, VALIDATION_ERROR_UNDEFINED); + } + if (skip_call) { + return VK_ERROR_VALIDATION_FAILED_EXT; + } + VkResult result = get_dispatch_table(ot_instance_table_map, physicalDevice) + ->GetPhysicalDeviceExternalImageFormatPropertiesNV(physicalDevice, format, type, tiling, usage, flags, + externalHandleType, pExternalImageFormatProperties); + return result; +} + +#ifdef VK_USE_PLATFORM_WIN32_KHR +// VK_NV_external_memory_win32 Extension +VKAPI_ATTR VkResult VKAPI_CALL GetMemoryWin32HandleNV(VkDevice device, VkDeviceMemory memory, + VkExternalMemoryHandleTypeFlagsNV handleType, HANDLE *pHandle) { + bool skip_call = VK_FALSE; + std::unique_lock<std::mutex> lock(global_lock); + skip_call |= ValidateObject(device, device, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, false, VALIDATION_ERROR_01725, + VALIDATION_ERROR_UNDEFINED); + skip_call |= ValidateObject(device, memory, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, false, VALIDATION_ERROR_01726, + VALIDATION_ERROR_01730); + lock.unlock(); + if (skip_call) { + return VK_ERROR_VALIDATION_FAILED_EXT; + } + VkResult result = get_dispatch_table(ot_device_table_map, device)->GetMemoryWin32HandleNV(device, memory, handleType, pHandle); + return result; +} +#endif // VK_USE_PLATFORM_WIN32_KHR + +// VK_NVX_device_generated_commands Extension +VKAPI_ATTR void VKAPI_CALL CmdProcessCommandsNVX(VkCommandBuffer commandBuffer, + const VkCmdProcessCommandsInfoNVX *pProcessCommandsInfo) { + bool skip_call = VK_FALSE; + std::unique_lock<std::mutex> lock(global_lock); + skip_call |= ValidateObject(commandBuffer, commandBuffer, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, false, + VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); + lock.unlock(); + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); + if (!skip_call && dev_data->dispatch_table.CmdProcessCommandsNVX) { + dev_data->dispatch_table.CmdProcessCommandsNVX(commandBuffer, pProcessCommandsInfo); + } +} + + +VKAPI_ATTR void VKAPI_CALL CmdReserveSpaceForCommandsNVX(VkCommandBuffer commandBuffer, + const VkCmdReserveSpaceForCommandsInfoNVX *pReserveSpaceInfo) { + bool skip_call = VK_FALSE; + std::unique_lock<std::mutex> lock(global_lock); + skip_call |= ValidateObject(commandBuffer, commandBuffer, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, false, + VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); + lock.unlock(); + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); + if (!skip_call && dev_data->dispatch_table.CmdReserveSpaceForCommandsNVX) { + dev_data->dispatch_table.CmdReserveSpaceForCommandsNVX(commandBuffer, pReserveSpaceInfo); + } +} + +VKAPI_ATTR VkResult VKAPI_CALL CreateIndirectCommandsLayoutNVX(VkDevice device, + const VkIndirectCommandsLayoutCreateInfoNVX *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkIndirectCommandsLayoutNVX *pIndirectCommandsLayout) { + bool skip_call = VK_FALSE; + std::unique_lock<std::mutex> lock(global_lock); + skip_call |= ValidateObject(device, device, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, false, VALIDATION_ERROR_UNDEFINED, + VALIDATION_ERROR_UNDEFINED); + lock.unlock(); + if (skip_call) { + return VK_ERROR_VALIDATION_FAILED_EXT; + } + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + VkResult result = VK_SUCCESS; + if (dev_data->dispatch_table.CreateIndirectCommandsLayoutNVX) { + result = dev_data->dispatch_table.CreateIndirectCommandsLayoutNVX(device, pCreateInfo, pAllocator, pIndirectCommandsLayout); + } + return result; +} + +VKAPI_ATTR void VKAPI_CALL DestroyIndirectCommandsLayoutNVX(VkDevice device, VkIndirectCommandsLayoutNVX indirectCommandsLayout, + const VkAllocationCallbacks *pAllocator) { + bool skip_call = VK_FALSE; + std::unique_lock<std::mutex> lock(global_lock); + skip_call |= ValidateObject(device, device, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, false, VALIDATION_ERROR_UNDEFINED, + VALIDATION_ERROR_UNDEFINED); + lock.unlock(); + if (!skip_call) { + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + if (dev_data->dispatch_table.DestroyIndirectCommandsLayoutNVX) { + dev_data->dispatch_table.DestroyIndirectCommandsLayoutNVX(device, indirectCommandsLayout, pAllocator); + } + } +} + +VKAPI_ATTR VkResult VKAPI_CALL CreateObjectTableNVX(VkDevice device, const VkObjectTableCreateInfoNVX *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkObjectTableNVX *pObjectTable) { + bool skip_call = VK_FALSE; + std::unique_lock<std::mutex> lock(global_lock); + skip_call |= ValidateObject(device, device, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, false, VALIDATION_ERROR_UNDEFINED, + VALIDATION_ERROR_UNDEFINED); + lock.unlock(); + if (skip_call) { + return VK_ERROR_VALIDATION_FAILED_EXT; + } + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + VkResult result = VK_SUCCESS; + if (dev_data->dispatch_table.CreateObjectTableNVX) { + result = dev_data->dispatch_table.CreateObjectTableNVX(device, pCreateInfo, pAllocator, pObjectTable); + } + return result; +} + +VKAPI_ATTR void VKAPI_CALL DestroyObjectTableNVX(VkDevice device, VkObjectTableNVX objectTable, + const VkAllocationCallbacks *pAllocator) { + bool skip_call = VK_FALSE; + std::unique_lock<std::mutex> lock(global_lock); + skip_call |= ValidateObject(device, device, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, false, VALIDATION_ERROR_UNDEFINED, + VALIDATION_ERROR_UNDEFINED); + lock.unlock(); + if (!skip_call) { + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + if (dev_data->dispatch_table.DestroyObjectTableNVX) { + dev_data->dispatch_table.DestroyObjectTableNVX(device, objectTable, pAllocator); + } + } +} + +VKAPI_ATTR VkResult VKAPI_CALL RegisterObjectsNVX(VkDevice device, VkObjectTableNVX objectTable, uint32_t objectCount, + const VkObjectTableEntryNVX *const *ppObjectTableEntries, + const uint32_t *pObjectIndices) { + bool skip_call = VK_FALSE; + std::unique_lock<std::mutex> lock(global_lock); + skip_call |= ValidateObject(device, device, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, false, VALIDATION_ERROR_UNDEFINED, + VALIDATION_ERROR_UNDEFINED); + lock.unlock(); + if (skip_call) { + return VK_ERROR_VALIDATION_FAILED_EXT; + } + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + VkResult result = VK_SUCCESS; + if (dev_data->dispatch_table.RegisterObjectsNVX) { + result = + dev_data->dispatch_table.RegisterObjectsNVX(device, objectTable, objectCount, ppObjectTableEntries, pObjectIndices); + } + return result; +} + +VKAPI_ATTR VkResult VKAPI_CALL UnregisterObjectsNVX(VkDevice device, VkObjectTableNVX objectTable, uint32_t objectCount, + const VkObjectEntryTypeNVX *pObjectEntryTypes, const uint32_t *pObjectIndices) { + bool skip_call = VK_FALSE; + std::unique_lock<std::mutex> lock(global_lock); + skip_call |= ValidateObject(device, device, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, false, VALIDATION_ERROR_UNDEFINED, + VALIDATION_ERROR_UNDEFINED); + lock.unlock(); + if (skip_call) { + return VK_ERROR_VALIDATION_FAILED_EXT; + } + layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + VkResult result = VK_SUCCESS; + if (dev_data->dispatch_table.UnregisterObjectsNVX) { + result = dev_data->dispatch_table.UnregisterObjectsNVX(device, objectTable, objectCount, pObjectEntryTypes, pObjectIndices); + } + return result; +} + +VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceGeneratedCommandsPropertiesNVX(VkPhysicalDevice physicalDevice, + VkDeviceGeneratedCommandsFeaturesNVX *pFeatures, + VkDeviceGeneratedCommandsLimitsNVX *pLimits) { + bool skip = false; + { + std::unique_lock<std::mutex> lock(global_lock); + skip |= ValidateObject(physicalDevice, physicalDevice, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, false, + VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); + } + if (skip) { + get_dispatch_table(ot_instance_table_map, physicalDevice) + ->GetPhysicalDeviceGeneratedCommandsPropertiesNVX(physicalDevice, pFeatures, pLimits); + } +} + static inline PFN_vkVoidFunction InterceptCoreDeviceCommand(const char *name) { if (!name || name[0] != 'v' || name[1] != 'k') return NULL; @@ -4800,35 +5344,6 @@ static inline PFN_vkVoidFunction InterceptCoreInstanceCommand(const char *name) return NULL; } -static inline PFN_vkVoidFunction InterceptDeviceExtensionCommand(const char *name, VkDevice device) { - if (device) { - layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); - - if (!name || name[0] != 'v' || name[1] != 'k') return NULL; - - name += 2; - - if (device_data->nvx_device_generated_commands_enabled) { - if (!strcmp(name, "CmdProcessCommandsNVX")) return (PFN_vkVoidFunction)CmdProcessCommandsNVX; - if (!strcmp(name, "CmdReserveSpaceForCommandsNVX")) return (PFN_vkVoidFunction)CmdReserveSpaceForCommandsNVX; - if (!strcmp(name, "CreateIndirectCommandsLayoutNVX")) return (PFN_vkVoidFunction)CreateIndirectCommandsLayoutNVX; - if (!strcmp(name, "DestroyIndirectCommandsLayoutNVX")) return (PFN_vkVoidFunction)DestroyIndirectCommandsLayoutNVX; - if (!strcmp(name, "CreateObjectTableNVX")) return (PFN_vkVoidFunction)CreateObjectTableNVX; - if (!strcmp(name, "DestroyObjectTableNVX")) return (PFN_vkVoidFunction)DestroyObjectTableNVX; - if (!strcmp(name, "RegisterObjectsNVX")) return (PFN_vkVoidFunction)RegisterObjectsNVX; - if (!strcmp(name, "UnregisterObjectsNVX")) return (PFN_vkVoidFunction)UnregisterObjectsNVX; - } - if (device_data->ext_display_control_enabled) { - if (!strcmp(name, "DisplayPowerControlEXT")) return (PFN_vkVoidFunction)DisplayPowerControlEXT; - if (!strcmp(name, "RegisterDeviceEventEXT")) return (PFN_vkVoidFunction)RegisterDeviceEventEXT; - if (!strcmp(name, "RegisterDisplayEventEXT")) return (PFN_vkVoidFunction)RegisterDisplayEventEXT; - if (!strcmp(name, "GetSwapchainCounterEXT")) return (PFN_vkVoidFunction)GetSwapchainCounterEXT; - } - } - - return NULL; -} - static inline PFN_vkVoidFunction InterceptInstanceExtensionCommand(const char *name) { if (!name || name[0] != 'v' || name[1] != 'k') return NULL; @@ -4842,22 +5357,113 @@ static inline PFN_vkVoidFunction InterceptInstanceExtensionCommand(const char *n return (PFN_vkVoidFunction)GetPhysicalDeviceImageFormatProperties2KHR; if (!strcmp(name, "GetPhysicalDeviceQueueFamilyProperties2KHR")) return (PFN_vkVoidFunction)GetPhysicalDeviceQueueFamilyProperties2KHR; - if (!strcmp(name, "GetPhysicalDeviceMemoryProperties2KHR")) return (PFN_vkVoidFunction)GetPhysicalDeviceMemoryProperties2KHR; - if (!strcmp(name, "GetPhysicalDeviceSparseImageFormatProperties2KHR")) - return (PFN_vkVoidFunction)GetPhysicalDeviceSparseImageFormatProperties2KHR; - // VK_NVX_device_generated_commands Extension - if (!strcmp(name, "GetPhysicalDeviceGeneratedCommandsPropertiesNVX")) - return (PFN_vkVoidFunction)GetPhysicalDeviceGeneratedCommandsPropertiesNVX; - // VK_EXT_direct_mode_display Extension - if (!strcmp(name, "ReleaseDisplayEXT")) return (PFN_vkVoidFunction)ReleaseDisplayEXT; + // VK_KHX_device_group Extension + if (!strcmp(name, "GetPhysicalDevicePresentRectanglesKHX")) return (PFN_vkVoidFunction)GetPhysicalDevicePresentRectanglesKHX; + // VK_KHX_device_group_creation Extension + if (!strcmp(name, "EnumeratePhysicalDeviceGroupsKHX")) return (PFN_vkVoidFunction)EnumeratePhysicalDeviceGroupsKHX; + // VK_KHX_external_memory_capabilities Extension + if (!strcmp(name, "GetPhysicalDeviceExternalBufferPropertiesKHX")) + return (PFN_vkVoidFunction)GetPhysicalDeviceExternalBufferPropertiesKHX; + if (!strcmp(name, "GetPhysicalDeviceProperties2KHX")) return (PFN_vkVoidFunction)GetPhysicalDeviceProperties2KHX; + if (!strcmp(name, "GetPhysicalDeviceImageFormatProperties2KHX")) + return (PFN_vkVoidFunction)GetPhysicalDeviceImageFormatProperties2KHX; + // VK_KHX_external_semaphore_capabilities Extension + if (!strcmp(name, "GetPhysicalDeviceExternalSemaphorePropertiesKHX")) + return (PFN_vkVoidFunction)GetPhysicalDeviceExternalSemaphorePropertiesKHX; #ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT // VK_EXT_acquire_xlib_display Extension if (!strcmp(name, "AcquireXlibDisplayEXT")) return (PFN_vkVoidFunction)AcquireXlibDisplayEXT; if (!strcmp(name, "GetRandROutputDisplayEXT")) return (PFN_vkVoidFunction)GetRandROutputDisplayEXT; #endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT + // VK_EXT_direct_mode_display Extension + if (!strcmp(name, "ReleaseDisplayEXT")) return (PFN_vkVoidFunction)ReleaseDisplayEXT; // VK_EXT_display_surface_counter Extension if (!strcmp(name, "GetPhysicalDeviceSurfaceCapabilities2EXT")) return (PFN_vkVoidFunction)GetPhysicalDeviceSurfaceCapabilities2EXT; + // VK_NV_clip_space_w_scaling Extension + if (!strcmp(name, "CmdSetViewportWScalingNV")) return (PFN_vkVoidFunction)CmdSetViewportWScalingNV; + // VK_NVX_device_generated_commands Extension + if (!strcmp(name, "GetPhysicalDeviceGeneratedCommandsPropertiesNVX")) + return (PFN_vkVoidFunction)GetPhysicalDeviceGeneratedCommandsPropertiesNVX; + + return NULL; +} + +static inline PFN_vkVoidFunction InterceptDeviceExtensionCommand(const char *name, VkDevice device) { + if (device) { + layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + + if (!name || name[0] != 'v' || name[1] != 'k') return NULL; + + name += 2; + + if (device_data->enables.khr_descriptor_update_template) { + if (!strcmp(name, "CreateDescriptorUpdateTemplateKHR")) return (PFN_vkVoidFunction)CreateDescriptorUpdateTemplateKHR; + if (!strcmp(name, "DestroyDescriptorUpdateTemplateKHR")) return (PFN_vkVoidFunction)DestroyDescriptorUpdateTemplateKHR; + if (!strcmp(name, "UpdateDescriptorSetWithTemplateKHR")) return (PFN_vkVoidFunction)UpdateDescriptorSetWithTemplateKHR; + if (!strcmp(name, "CmdPushDescriptorSetWithTemplateKHR")) + return (PFN_vkVoidFunction)CmdPushDescriptorSetWithTemplateKHR; + } + if (device_data->enables.khr_maintenance1) { + if (!strcmp(name, "TrimCommandPoolKHR")) return (PFN_vkVoidFunction)TrimCommandPoolKHR; + } + if (device_data->enables.khr_push_descriptor) { + if (!strcmp(name, "CmdPushDescriptorSetKHR")) return (PFN_vkVoidFunction)CmdPushDescriptorSetKHR; + } + if (device_data->enables.khx_device_group) { + // VK_KHX_device_group Extension + if (!strcmp(name, "GetDeviceGroupPeerMemoryFeaturesKHX")) + return (PFN_vkVoidFunction)GetDeviceGroupPeerMemoryFeaturesKHX; + if (!strcmp(name, "BindBufferMemory2KHX")) return (PFN_vkVoidFunction)BindBufferMemory2KHX; + if (!strcmp(name, "BindImageMemory2KHX")) return (PFN_vkVoidFunction)BindImageMemory2KHX; + if (!strcmp(name, "CmdSetDeviceMaskKHX")) return (PFN_vkVoidFunction)CmdSetDeviceMaskKHX; + if (!strcmp(name, "GetDeviceGroupPresentCapabilitiesKHX")) + return (PFN_vkVoidFunction)GetDeviceGroupPresentCapabilitiesKHX; + if (!strcmp(name, "GetDeviceGroupSurfacePresentModesKHX")) + return (PFN_vkVoidFunction)GetDeviceGroupSurfacePresentModesKHX; + if (!strcmp(name, "AcquireNextImage2KHX")) return (PFN_vkVoidFunction)AcquireNextImage2KHX; + if (!strcmp(name, "CmdDispatchBaseKHX")) return (PFN_vkVoidFunction)CmdDispatchBaseKHX; + } +#ifdef VK_USE_PLATFORM_WIN32_KHR + if (device_data->enables.khx_external_memory_win32) { + if (!strcmp(name, "GetMemoryWin32HandleKHX")) return (PFN_vkVoidFunction)GetMemoryWin32HandleKHX; + if (!strcmp(name, "GetMemoryWin32HandlePropertiesKHX")) return (PFN_vkVoidFunction)GetMemoryWin32HandlePropertiesKHX; + } +#endif // VK_USE_PLATFORM_WIN32_KHR + if (device_data->enables.khx_external_memory_fd) { + if (!strcmp(name, "GetMemoryFdKHX")) return (PFN_vkVoidFunction)GetMemoryFdKHX; + if (!strcmp(name, "GetMemoryFdPropertiesKHX")) return (PFN_vkVoidFunction)GetMemoryFdPropertiesKHX; + } +#ifdef VK_USE_PLATFORM_WIN32_KHR + if (device_data->enables.khx_external_semaphore_win32) { + if (!strcmp(name, "ImportSemaphoreWin32HandleKHX")) return (PFN_vkVoidFunction)ImportSemaphoreWin32HandleKHX; + if (!strcmp(name, "GetSemaphoreWin32HandleKHX")) return (PFN_vkVoidFunction)GetSemaphoreWin32HandleKHX; + } +#endif // VK_USE_PLATFORM_WIN32_KHR + if (device_data->enables.khx_external_semaphore_fd) { + if (!strcmp(name, "ImportSemaphoreFdKHX")) return (PFN_vkVoidFunction)ImportSemaphoreFdKHX; + if (!strcmp(name, "GetSemaphoreFdKHX")) return (PFN_vkVoidFunction)GetSemaphoreFdKHX; + } + if (device_data->enables.ext_discard_rectangles) { + if (!strcmp(name, "CmdSetDiscardRectangleEXT")) return (PFN_vkVoidFunction)CmdSetDiscardRectangleEXT; + } + if (device_data->enables.ext_display_control) { + if (!strcmp(name, "DisplayPowerControlEXT")) return (PFN_vkVoidFunction)DisplayPowerControlEXT; + if (!strcmp(name, "RegisterDeviceEventEXT")) return (PFN_vkVoidFunction)RegisterDeviceEventEXT; + if (!strcmp(name, "RegisterDisplayEventEXT")) return (PFN_vkVoidFunction)RegisterDisplayEventEXT; + if (!strcmp(name, "GetSwapchainCounterEXT")) return (PFN_vkVoidFunction)GetSwapchainCounterEXT; + } + if (device_data->enables.nvx_device_generated_commands) { + if (!strcmp(name, "CmdProcessCommandsNVX")) return (PFN_vkVoidFunction)CmdProcessCommandsNVX; + if (!strcmp(name, "CmdReserveSpaceForCommandsNVX")) return (PFN_vkVoidFunction)CmdReserveSpaceForCommandsNVX; + if (!strcmp(name, "CreateIndirectCommandsLayoutNVX")) return (PFN_vkVoidFunction)CreateIndirectCommandsLayoutNVX; + if (!strcmp(name, "DestroyIndirectCommandsLayoutNVX")) return (PFN_vkVoidFunction)DestroyIndirectCommandsLayoutNVX; + if (!strcmp(name, "CreateObjectTableNVX")) return (PFN_vkVoidFunction)CreateObjectTableNVX; + if (!strcmp(name, "DestroyObjectTableNVX")) return (PFN_vkVoidFunction)DestroyObjectTableNVX; + if (!strcmp(name, "RegisterObjectsNVX")) return (PFN_vkVoidFunction)RegisterObjectsNVX; + if (!strcmp(name, "UnregisterObjectsNVX")) return (PFN_vkVoidFunction)UnregisterObjectsNVX; + } + } return NULL; } @@ -4866,7 +5472,7 @@ static inline PFN_vkVoidFunction InterceptWsiEnabledCommand(const char *name, Vk if (device) { layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); - if (device_data->wsi_enabled) { + if (device_data->enables.wsi) { if (!strcmp("vkCreateSwapchainKHR", name)) return reinterpret_cast<PFN_vkVoidFunction>(CreateSwapchainKHR); if (!strcmp("vkDestroySwapchainKHR", name)) return reinterpret_cast<PFN_vkVoidFunction>(DestroySwapchainKHR); if (!strcmp("vkGetSwapchainImagesKHR", name)) return reinterpret_cast<PFN_vkVoidFunction>(GetSwapchainImagesKHR); @@ -4874,13 +5480,13 @@ static inline PFN_vkVoidFunction InterceptWsiEnabledCommand(const char *name, Vk if (!strcmp("vkQueuePresentKHR", name)) return reinterpret_cast<PFN_vkVoidFunction>(QueuePresentKHR); } - if (device_data->wsi_display_swapchain_enabled) { + if (device_data->enables.wsi_display_swapchain) { if (!strcmp("vkCreateSharedSwapchainsKHR", name)) { return reinterpret_cast<PFN_vkVoidFunction>(CreateSharedSwapchainsKHR); } } - if (device_data->wsi_display_extension_enabled) { + if (device_data->enables.wsi_display_extension) { if (!strcmp("vkGetPhysicalDeviceDisplayPropertiesKHR", name)) return reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceDisplayPropertiesKHR); if (!strcmp("vkGetPhysicalDeviceDisplayPlanePropertiesKHR", name)) diff --git a/layers/object_tracker.h b/layers/object_tracker.h index abbe3c2d..ae1e9c4a 100644 --- a/layers/object_tracker.h +++ b/layers/object_tracker.h @@ -1,7 +1,7 @@ -/* Copyright (c) 2015-2016 The Khronos Group Inc. - * Copyright (c) 2015-2016 Valve Corporation - * Copyright (c) 2015-2016 LunarG, Inc. - * Copyright (C) 2015-2016 Google Inc. +/* Copyright (c) 2015-2017 The Khronos Group Inc. + * Copyright (c) 2015-2017 Valve Corporation + * Copyright (c) 2015-2017 LunarG, Inc. + * Copyright (C) 2015-2017 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -94,12 +94,32 @@ struct layer_data { debug_report_data *report_data; std::vector<VkDebugReportCallbackEXT> logging_callback; - bool wsi_enabled; - bool wsi_display_swapchain_enabled; - bool wsi_display_extension_enabled; - bool objtrack_extensions_enabled; - bool nvx_device_generated_commands_enabled; - bool ext_display_control_enabled; + + union device_extension_enables { + struct { + bool wsi : 1; + bool wsi_display_swapchain : 1; + bool wsi_display_extension : 1; + bool objtrack_extensions : 1; + bool khr_descriptor_update_template : 1; + bool khr_maintenance1 : 1; + bool khr_push_descriptor : 1; + bool khx_device_group : 1; +#ifdef VK_USE_PLATFORM_WIN32_KHR + bool khx_external_memory_win32 : 1; +#endif // VK_USE_PLATFORM_WIN32_KHR + bool khx_external_memory_fd : 1; +#ifdef VK_USE_PLATFORM_WIN32_KHR + bool khx_external_semaphore_win32 : 1; +#endif // VK_USE_PLATFORM_WIN32_KHR + bool khx_external_semaphore_fd : 1; + bool ext_display_control : 1; + bool ext_discard_rectangles : 1; + bool nv_clip_space_w_scaling : 1; + bool nvx_device_generated_commands : 1; + }; + uint64_t padding[4]; + } enables; // The following are for keeping track of the temporary callbacks that can // be used in vkCreateInstance and vkDestroyInstance: @@ -124,16 +144,13 @@ struct layer_data { num_objects{}, num_total_objects(0), report_data(nullptr), - wsi_enabled(false), - wsi_display_swapchain_enabled(false), - wsi_display_extension_enabled(false), - objtrack_extensions_enabled(false), num_tmp_callbacks(0), tmp_dbg_create_infos(nullptr), tmp_callbacks(nullptr), object_map{}, dispatch_table{} { object_map.resize(VK_DEBUG_REPORT_OBJECT_TYPE_RANGE_SIZE_EXT + 1); + memset(enables.padding, 0, sizeof(uint64_t) * 4); } }; diff --git a/layers/parameter_validation.cpp b/layers/parameter_validation.cpp index 023f1964..402aebf8 100644 --- a/layers/parameter_validation.cpp +++ b/layers/parameter_validation.cpp @@ -82,13 +82,22 @@ struct layer_data { bool khr_swapchain_enabled : 1; bool khr_display_swapchain_enabled : 1; bool khr_maintenance1 : 1; + bool khr_push_descriptor : 1; + bool khr_descriptor_update_template : 1; + bool khx_device_group : 1; + bool khx_external_memory_fd : 1; + bool khx_external_memory_win32 : 1; + bool khx_external_semaphore_fd : 1; + bool khx_external_semaphore_win32 : 1; bool ext_debug_marker : 1; + bool ext_discard_rectangles : 1; + bool ext_display_control : 1; + bool amd_draw_indirect_count : 1; bool amd_negative_viewport_height : 1; + bool nv_clip_space_w_scaling : 1; bool nv_external_memory : 1; bool nv_external_memory_win32 : 1; bool nvx_device_generated_commands : 1; - bool ext_display_control : 1; - bool amd_draw_indirect_count : 1; }; uint64_t padding[4]; } enables; @@ -1599,6 +1608,12 @@ static void CheckInstanceRegisterExtensions(const VkInstanceCreateInfo *pCreateI instance_data->extensions.display_enabled = true; } else if (strcmp(name, VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME) == 0) { instance_data->extensions.khr_get_phys_dev_properties2_enabled = true; + } else if (strcmp(name, VK_KHX_DEVICE_GROUP_CREATION_EXTENSION_NAME) == 0) { + instance_data->extensions.khx_device_group_creation_enabled = true; + } else if (strcmp(name, VK_KHX_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME) == 0) { + instance_data->extensions.khx_external_memory_capabilities_enabled = true; + } else if (strcmp(name, VK_KHX_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME) == 0) { + instance_data->extensions.khx_external_semaphore_capabilities_enabled = true; } else if (strcmp(name, VK_NV_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME) == 0) { instance_data->extensions.nv_external_memory_capabilities_enabled = true; #ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT @@ -1624,22 +1639,42 @@ static void CheckDeviceRegisterExtensions(const VkDeviceCreateInfo *pCreateInfo, device_data->enables.khr_display_swapchain_enabled = true; } else if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_MAINTENANCE1_EXTENSION_NAME) == 0) { device_data->enables.khr_maintenance1 = true; + } else if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME) == 0) { + device_data->enables.khr_push_descriptor = true; + } else if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME) == 0) { + device_data->enables.khr_descriptor_update_template = true; + } else if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHX_DEVICE_GROUP_EXTENSION_NAME) == 0) { + device_data->enables.khx_device_group = true; + } else if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHX_EXTERNAL_MEMORY_FD_EXTENSION_NAME) == 0) { + device_data->enables.khx_external_memory_fd = true; + } else if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHX_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME) == 0) { + device_data->enables.khx_external_semaphore_fd = true; #ifdef VK_USE_PLATFORM_WIN32_KHR - } else if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME) == 0) { - device_data->enables.nv_external_memory_win32 = true; + } else if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHX_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME) == 0) { + device_data->enables.khx_external_memory_win32 = true; + } else if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHX_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME) == 0) { + device_data->enables.khx_external_semaphore_win32 = true; #endif } else if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_EXT_DEBUG_MARKER_EXTENSION_NAME) == 0) { device_data->enables.ext_debug_marker = true; + } else if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_EXT_DISCARD_RECTANGLES_EXTENSION_NAME) == 0) { + device_data->enables.ext_discard_rectangles = true; + } else if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_EXT_DISPLAY_CONTROL_EXTENSION_NAME) == 0) { + device_data->enables.ext_display_control = true; + } else if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME) == 0) { + device_data->enables.amd_draw_indirect_count = true; } else if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_EXTENSION_NAME) == 0) { device_data->enables.amd_negative_viewport_height = true; + } else if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_NV_CLIP_SPACE_W_SCALING_EXTENSION_NAME) == 0) { + device_data->enables.nv_clip_space_w_scaling = true; } else if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_NV_EXTERNAL_MEMORY_EXTENSION_NAME) == 0) { device_data->enables.nv_external_memory = true; +#ifdef VK_USE_PLATFORM_WIN32_KHR + } else if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME) == 0) { + device_data->enables.nv_external_memory_win32 = true; +#endif } else if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME) == 0) { device_data->enables.nvx_device_generated_commands = true; - } else if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_EXT_DISPLAY_CONTROL_EXTENSION_NAME) == 0) { - device_data->enables.ext_display_control = true; - } else if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME) == 0) { - device_data->enables.amd_draw_indirect_count = true; } } } @@ -1702,6 +1737,25 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateDevice(VkPhysicalDevice physicalDevice, con cur_pnext = (std_header *)cur_pnext->pNext; } } + if (pCreateInfo->pNext != NULL && pCreateInfo->pEnabledFeatures) { + // Check for get_physical_device_properties2 struct + struct std_header { + VkStructureType sType; + const void *pNext; + }; + std_header *cur_pnext = (std_header *)pCreateInfo->pNext; + while (cur_pnext) { + if (VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR == cur_pnext->sType) { + // Cannot include VkPhysicalDeviceFeatures2KHR and have non-null pEnabledFeatures + skip |= log_msg(my_instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, INVALID_USAGE, LayerName, + "VkDeviceCreateInfo->pNext includes a VkPhysicalDeviceFeatures2KHR struct when " + "pCreateInfo->pEnabledFeatures is non-NULL."); + break; + } + cur_pnext = (std_header *)cur_pnext->pNext; + } + } } if (!skip) { @@ -2581,21 +2635,20 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateImage(VkDevice device, const VkImageCreateI if ((pCreateInfo->flags & VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT) != 0) { // Linear tiling is unsupported if (VK_IMAGE_TILING_LINEAR == pCreateInfo->tiling) { - skip |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, INVALID_USAGE, - LayerName, "vkCreateImage: if pCreateInfo->flags contains VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT " - "then image tiling of VK_IMAGE_TILING_LINEAR is not supported"); + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, + INVALID_USAGE, LayerName, + "vkCreateImage: if pCreateInfo->flags contains VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT " + "then image tiling of VK_IMAGE_TILING_LINEAR is not supported"); } // Sparse 1D image isn't valid if (VK_IMAGE_TYPE_1D == pCreateInfo->imageType) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, - VALIDATION_ERROR_02352, LayerName, - "vkCreateImage: cannot specify VK_IMAGE_CREATE_SPARSE_BINDING_BIT for 1D image. %s", - validation_error_map[VALIDATION_ERROR_02352]); + VALIDATION_ERROR_02352, LayerName, + "vkCreateImage: cannot specify VK_IMAGE_CREATE_SPARSE_BINDING_BIT for 1D image. %s", + validation_error_map[VALIDATION_ERROR_02352]); } - // Sparse 2D image when device doesn't support it if ((VK_FALSE == device_data->physical_device_features.sparseResidencyImage2D) && (VK_IMAGE_TYPE_2D == pCreateInfo->imageType)) { @@ -5039,7 +5092,6 @@ VKAPI_ATTR VkResult VKAPI_CALL QueuePresentKHR(VkQueue queue, const VkPresentInf VK_KHR_SWAPCHAIN_EXTENSION_NAME); skip |= parameter_validation_vkQueuePresentKHR(my_data->report_data, pPresentInfo); - if (!skip) { result = my_data->dispatch_table.QueuePresentKHR(queue, pPresentInfo); @@ -5759,7 +5811,7 @@ VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceSparseImageFormatProperties2KHR( VKAPI_ATTR void VKAPI_CALL TrimCommandPoolKHR(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlagsKHR flags) { bool skip_call = false; - layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); assert(my_data != NULL); skip_call |= require_device_extension(my_data, my_data->enables.khr_maintenance1, "vkTrimCommandPoolKHR", @@ -5772,6 +5824,542 @@ VKAPI_ATTR void VKAPI_CALL TrimCommandPoolKHR(VkDevice device, VkCommandPool com } } +// Definitions for the VK_KHR_push_descriptor extension + +VKAPI_ATTR void VKAPI_CALL CmdPushDescriptorSetKHR(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, + VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, + const VkWriteDescriptorSet *pDescriptorWrites) { + bool skip_call = false; + auto my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); + assert(my_data != NULL); + + skip_call |= require_device_extension(my_data, my_data->enables.khr_push_descriptor, "vkCmdPushDescriptorSetKHR", + VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME); + + skip_call |= parameter_validation_vkCmdPushDescriptorSetKHR(my_data->report_data, pipelineBindPoint, layout, set, + descriptorWriteCount, pDescriptorWrites); + + if (!skip_call) { + my_data->dispatch_table.CmdPushDescriptorSetKHR(commandBuffer, pipelineBindPoint, layout, set, descriptorWriteCount, + pDescriptorWrites); + } +} + +// Definitions for the VK_KHR_descriptor_update_template extension + +VKAPI_ATTR VkResult VKAPI_CALL CreateDescriptorUpdateTemplateKHR(VkDevice device, + const VkDescriptorUpdateTemplateCreateInfoKHR *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkDescriptorUpdateTemplateKHR *pDescriptorUpdateTemplate) { + VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; + bool skip_call = false; + auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + assert(my_data != NULL); + + skip_call |= require_device_extension(my_data, my_data->enables.khr_descriptor_update_template, + "vkCreateDescriptorUpdateTemplateKHR", VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME); + + skip_call |= parameter_validation_vkCreateDescriptorUpdateTemplateKHR(my_data->report_data, pCreateInfo, pAllocator, + pDescriptorUpdateTemplate); + + if (!skip_call) { + result = + my_data->dispatch_table.CreateDescriptorUpdateTemplateKHR(device, pCreateInfo, pAllocator, pDescriptorUpdateTemplate); + validate_result(my_data->report_data, "vkCreateDescriptorUpdateTemplateKHR", result); + } + + return result; +} + +VKAPI_ATTR void VKAPI_CALL DestroyDescriptorUpdateTemplateKHR(VkDevice device, + VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, + const VkAllocationCallbacks *pAllocator) { + bool skip_call = false; + auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + assert(my_data != NULL); + + skip_call |= require_device_extension(my_data, my_data->enables.khr_descriptor_update_template, + "vkDestroyDescriptorUpdateTemplateKHR", VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME); + +#if 0 // Validation not automatically generated + skip_call |= parameter_validation_vkDestroyDescriptorUpdateTemplateKHR(my_data->report_data, descriptorUpdateTemplate, + pAllocator); +#endif + + if (!skip_call) { + my_data->dispatch_table.DestroyDescriptorUpdateTemplateKHR(device, descriptorUpdateTemplate, pAllocator); + } +} + +VKAPI_ATTR void VKAPI_CALL UpdateDescriptorSetWithTemplateKHR(VkDevice device, VkDescriptorSet descriptorSet, + VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, + const void *pData) { + bool skip_call = false; + auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + assert(my_data != NULL); + + skip_call |= require_device_extension(my_data, my_data->enables.khr_descriptor_update_template, + "vkUpdateDescriptorSetWithTemplateKHR", VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME); + + skip_call |= parameter_validation_vkUpdateDescriptorSetWithTemplateKHR(my_data->report_data, descriptorSet, + descriptorUpdateTemplate, pData); + + if (!skip_call) { + my_data->dispatch_table.UpdateDescriptorSetWithTemplateKHR(device, descriptorSet, descriptorUpdateTemplate, pData); + } +} + +VKAPI_ATTR void VKAPI_CALL CmdPushDescriptorSetWithTemplateKHR(VkCommandBuffer commandBuffer, + VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, + VkPipelineLayout layout, uint32_t set, const void *pData) { + bool skip_call = false; + auto my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); + assert(my_data != NULL); + + skip_call |= + require_device_extension(my_data, my_data->enables.khr_descriptor_update_template, "vkCmdPushDescriptorSetWithTemplateKHR", + VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME); + + skip_call |= parameter_validation_vkCmdPushDescriptorSetWithTemplateKHR(my_data->report_data, descriptorUpdateTemplate, layout, + set, pData); + + if (!skip_call) { + my_data->dispatch_table.CmdPushDescriptorSetWithTemplateKHR(commandBuffer, descriptorUpdateTemplate, layout, set, pData); + } +} + +// Definitions for the VK_KHX_device_group_creation extension + +VKAPI_ATTR VkResult VKAPI_CALL EnumeratePhysicalDeviceGroupsKHX( + VkInstance instance, uint32_t *pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupPropertiesKHX *pPhysicalDeviceGroupProperties) { + VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; + bool skip_call = false; + auto my_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); + assert(my_data != NULL); + + skip_call |= require_instance_extension(instance, &instance_extension_enables::khx_device_group_creation_enabled, + "vkEnumeratePhysicalDeviceGroupsKHX", VK_KHX_DEVICE_GROUP_CREATION_EXTENSION_NAME); + + skip_call |= parameter_validation_vkEnumeratePhysicalDeviceGroupsKHX(my_data->report_data, pPhysicalDeviceGroupCount, + pPhysicalDeviceGroupProperties); + + if (!skip_call) { + result = my_data->dispatch_table.EnumeratePhysicalDeviceGroupsKHX(instance, pPhysicalDeviceGroupCount, + pPhysicalDeviceGroupProperties); + validate_result(my_data->report_data, "vkEnumeratePhysicalDeviceGroupsKHX", result); + } + return result; +} + +// Definitions for the VK_KHX_device_group extension + +VKAPI_ATTR void VKAPI_CALL GetDeviceGroupPeerMemoryFeaturesKHX(VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, + uint32_t remoteDeviceIndex, + VkPeerMemoryFeatureFlagsKHX *pPeerMemoryFeatures) { + bool skip_call = false; + auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + assert(my_data != NULL); + + skip_call |= require_device_extension(my_data, my_data->enables.khx_device_group, "vkGetDeviceGroupPeerMemoryFeaturesKHX", + VK_KHX_DEVICE_GROUP_EXTENSION_NAME); + + skip_call |= parameter_validation_vkGetDeviceGroupPeerMemoryFeaturesKHX(my_data->report_data, heapIndex, localDeviceIndex, + remoteDeviceIndex, pPeerMemoryFeatures); + + if (!skip_call) { + my_data->dispatch_table.GetDeviceGroupPeerMemoryFeaturesKHX(device, heapIndex, localDeviceIndex, remoteDeviceIndex, + pPeerMemoryFeatures); + } +} + +VKAPI_ATTR VkResult VKAPI_CALL BindBufferMemory2KHX(VkDevice device, uint32_t bindInfoCount, + const VkBindBufferMemoryInfoKHX *pBindInfos) { + VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; + bool skip_call = false; + auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + assert(my_data != NULL); + + skip_call |= require_device_extension(my_data, my_data->enables.khx_device_group, "vkBindBufferMemory2KHX", + VK_KHX_DEVICE_GROUP_EXTENSION_NAME); + + skip_call |= parameter_validation_vkBindBufferMemory2KHX(my_data->report_data, bindInfoCount, pBindInfos); + + if (!skip_call) { + result = my_data->dispatch_table.BindBufferMemory2KHX(device, bindInfoCount, pBindInfos); + validate_result(my_data->report_data, "vkBindBufferMemory2KHX", result); + } + + return result; +} + +VKAPI_ATTR VkResult VKAPI_CALL BindImageMemory2KHX(VkDevice device, uint32_t bindInfoCount, + const VkBindImageMemoryInfoKHX *pBindInfos) { + VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; + bool skip_call = false; + auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + assert(my_data != NULL); + + skip_call |= require_device_extension(my_data, my_data->enables.khx_device_group, "vkBindImageMemory2KHX", + VK_KHX_DEVICE_GROUP_EXTENSION_NAME); + + skip_call |= parameter_validation_vkBindImageMemory2KHX(my_data->report_data, bindInfoCount, pBindInfos); + + if (!skip_call) { + result = my_data->dispatch_table.BindImageMemory2KHX(device, bindInfoCount, pBindInfos); + validate_result(my_data->report_data, "vkBindImageMemory2KHX", result); + } + + return result; +} + +VKAPI_ATTR void VKAPI_CALL CmdSetDeviceMaskKHX(VkCommandBuffer commandBuffer, uint32_t deviceMask) { + bool skip_call = false; + auto my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); + assert(my_data != NULL); + + skip_call |= require_device_extension(my_data, my_data->enables.khx_device_group, "vkCmdSetDeviceMaskKHX", + VK_KHX_DEVICE_GROUP_EXTENSION_NAME); + +#if 0 // Validation not automatically generated + skip_call |= parameter_validation_vkCmdSetDeviceMaskKHX(my_data->report_data, deviceMask); +#endif + + if (!skip_call) { + my_data->dispatch_table.CmdSetDeviceMaskKHX(commandBuffer, deviceMask); + } +} + +VKAPI_ATTR VkResult VKAPI_CALL +GetDeviceGroupPresentCapabilitiesKHX(VkDevice device, VkDeviceGroupPresentCapabilitiesKHX *pDeviceGroupPresentCapabilities) { + VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; + bool skip_call = false; + auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + assert(my_data != NULL); + + skip_call |= require_device_extension(my_data, my_data->enables.khx_device_group, "vkGetDeviceGroupPresentCapabilitiesKHX", + VK_KHX_DEVICE_GROUP_EXTENSION_NAME); + + skip_call |= parameter_validation_vkGetDeviceGroupPresentCapabilitiesKHX(my_data->report_data, pDeviceGroupPresentCapabilities); + + if (!skip_call) { + result = my_data->dispatch_table.GetDeviceGroupPresentCapabilitiesKHX(device, pDeviceGroupPresentCapabilities); + validate_result(my_data->report_data, "vkGetDeviceGroupPresentCapabilitiesKHX", result); + } + + return result; +} + +VKAPI_ATTR VkResult VKAPI_CALL GetDeviceGroupSurfacePresentModesKHX(VkDevice device, VkSurfaceKHR surface, + VkDeviceGroupPresentModeFlagsKHX *pModes) { + VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; + bool skip_call = false; + auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + assert(my_data != NULL); + + skip_call |= require_device_extension(my_data, my_data->enables.khx_device_group, "vkGetDeviceGroupSurfacePresentModesKHX", + VK_KHX_DEVICE_GROUP_EXTENSION_NAME); + + skip_call |= parameter_validation_vkGetDeviceGroupSurfacePresentModesKHX(my_data->report_data, surface, pModes); + + if (!skip_call) { + result = my_data->dispatch_table.GetDeviceGroupSurfacePresentModesKHX(device, surface, pModes); + validate_result(my_data->report_data, "vkGetDeviceGroupSurfacePresentModesKHX", result); + } + return result; +} + +VKAPI_ATTR VkResult VKAPI_CALL AcquireNextImage2KHX(VkDevice device, const VkAcquireNextImageInfoKHX *pAcquireInfo, + uint32_t *pImageIndex) { + VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; + bool skip_call = false; + auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + assert(my_data != NULL); + + skip_call |= require_device_extension(my_data, my_data->enables.khx_device_group, "vkAcquireNextImage2KHX", + VK_KHX_DEVICE_GROUP_EXTENSION_NAME); + + skip_call |= parameter_validation_vkAcquireNextImage2KHX(my_data->report_data, pAcquireInfo, pImageIndex); + + if (!skip_call) { + result = my_data->dispatch_table.AcquireNextImage2KHX(device, pAcquireInfo, pImageIndex); + validate_result(my_data->report_data, "vkAcquireNextImage2KHX", result); + } + return result; +} + +VKAPI_ATTR void VKAPI_CALL CmdDispatchBaseKHX(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, + uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, + uint32_t groupCountZ) { + bool skip_call = false; + auto my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); + assert(my_data != NULL); + + skip_call |= require_device_extension(my_data, my_data->enables.khx_device_group, "vkCmdDispatchBaseKHX", + VK_KHX_DEVICE_GROUP_EXTENSION_NAME); + +#if 0 // Validation not automatically generated + skip_call |= parameter_validation_vkCmdDispatchBaseKHX(my_data->report_data, baseGroupX, baseGroupY, baseGroupZ, + groupCountX, groupCountY, groupCountZ); +#endif + + if (!skip_call) { + my_data->dispatch_table.CmdDispatchBaseKHX(commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, + groupCountZ); + } +} + +VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDevicePresentRectanglesKHX(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, + uint32_t *pRectCount, VkRect2D *pRects) { + VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; + bool skip = false; + auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); + assert(my_data != NULL); + + skip |= parameter_validation_vkGetPhysicalDevicePresentRectanglesKHX(my_data->report_data, surface, pRectCount, pRects); + + if (!skip) { + result = my_data->dispatch_table.GetPhysicalDevicePresentRectanglesKHX(physicalDevice, surface, pRectCount, pRects); + + validate_result(my_data->report_data, "vkGetPhysicalDevicePresentRectanglesKHX", result); + } + + return result; +} + +// Definitions for the VK_KHX_external_memory_capabilities extension + +VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceExternalBufferPropertiesKHX( + VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfoKHX *pExternalBufferInfo, + VkExternalBufferPropertiesKHX *pExternalBufferProperties) { + auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); + assert(my_data != NULL); + bool skip = false; + skip |= require_instance_extension(physicalDevice, &instance_extension_enables::khx_external_memory_capabilities_enabled, + "vkGetPhysicalDeviceExternalBufferPropertiesKHX", + VK_KHX_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME); + skip |= parameter_validation_vkGetPhysicalDeviceExternalBufferPropertiesKHX(my_data->report_data, pExternalBufferInfo, + pExternalBufferProperties); + if (!skip) { + my_data->dispatch_table.GetPhysicalDeviceExternalBufferPropertiesKHX(physicalDevice, pExternalBufferInfo, + pExternalBufferProperties); + } +} + +VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceProperties2KHX(VkPhysicalDevice physicalDevice, + VkPhysicalDeviceProperties2KHX *pProperties) { + auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); + assert(my_data != NULL); + bool skip = false; + skip |= require_instance_extension(physicalDevice, &instance_extension_enables::khx_external_memory_capabilities_enabled, + "vkGetPhysicalDeviceProperties2KHX", VK_KHX_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME); + skip |= parameter_validation_vkGetPhysicalDeviceProperties2KHX(my_data->report_data, pProperties); + if (!skip) { + my_data->dispatch_table.GetPhysicalDeviceProperties2KHX(physicalDevice, pProperties); + } +} + +VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceImageFormatProperties2KHX( + VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2KHX *pImageFormatInfo, + VkImageFormatProperties2KHX *pImageFormatProperties) { + VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; + auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); + assert(my_data != NULL); + bool skip = false; + skip |= require_instance_extension(physicalDevice, &instance_extension_enables::khx_external_memory_capabilities_enabled, + "vkGetPhysicalDeviceImageFormatProperties2KHX", + VK_KHX_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME); + skip |= parameter_validation_vkGetPhysicalDeviceImageFormatProperties2KHX(my_data->report_data, pImageFormatInfo, + pImageFormatProperties); + if (!skip) { + result = my_data->dispatch_table.GetPhysicalDeviceImageFormatProperties2KHX(physicalDevice, pImageFormatInfo, + pImageFormatProperties); + validate_result(my_data->report_data, "vkGetPhysicalDeviceImageFormatProperties2KHX", result); + } + return result; +} + +// Definitions for the VK_KHX_external_memory_fd extension + +VKAPI_ATTR VkResult VKAPI_CALL GetMemoryFdKHX(VkDevice device, VkDeviceMemory memory, + VkExternalMemoryHandleTypeFlagBitsKHX handleType, int *pFd) { + VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; + bool skip_call = false; + auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + assert(my_data != NULL); + + skip_call |= require_device_extension(my_data, my_data->enables.khx_external_memory_fd, "vkGetMemoryFdKHX", + VK_KHX_EXTERNAL_MEMORY_FD_EXTENSION_NAME); + + skip_call |= parameter_validation_vkGetMemoryFdKHX(my_data->report_data, memory, handleType, pFd); + + if (!skip_call) { + result = my_data->dispatch_table.GetMemoryFdKHX(device, memory, handleType, pFd); + validate_result(my_data->report_data, "vkGetMemoryFdKHX", result); + } + + return result; +} + +VKAPI_ATTR VkResult VKAPI_CALL GetMemoryFdPropertiesKHX(VkDevice device, VkExternalMemoryHandleTypeFlagBitsKHX handleType, int fd, + VkMemoryFdPropertiesKHX *pMemoryFdProperties) { + VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; + bool skip_call = false; + auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + assert(my_data != NULL); + + skip_call |= require_device_extension(my_data, my_data->enables.khx_external_memory_fd, "vkGetMemoryFdPropertiesKHX", + VK_KHX_EXTERNAL_MEMORY_FD_EXTENSION_NAME); + + skip_call |= parameter_validation_vkGetMemoryFdPropertiesKHX(my_data->report_data, handleType, fd, pMemoryFdProperties); + + if (!skip_call) { + result = my_data->dispatch_table.GetMemoryFdPropertiesKHX(device, handleType, fd, pMemoryFdProperties); + validate_result(my_data->report_data, "vkGetMemoryFdPropertiesKHX", result); + } + + return result; +} + +// Definitions for the VK_KHX_external_memory_win32 extension + +#ifdef VK_USE_PLATFORM_WIN32_KHX +VKAPI_ATTR VkResult VKAPI_CALL GetMemoryWin32HandleKHX(VkDevice device, VkDeviceMemory memory, + VkExternalMemoryHandleTypeFlagBitsKHX handleType, HANDLE *pHandle) { + VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; + bool skip_call = false; + auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + assert(my_data != NULL); + skip_call |= require_device_extension(my_data, my_data->enables.khx_external_memory_win32, "vkGetMemoryWin32HandleKHX", + VK_KHX_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME); + + skip_call |= parameter_validation_vkGetMemoryWin32HandleKHX(my_data->report_data, memory, handleType, pHandle); + + if (!skip_call) { + result = my_data->dispatch_table.GetMemoryWin32HandleKHX(device, memory, handleType, pHandle); + validate_result(my_data->report_data, "vkGetMemoryWin32HandleKHX", result); + } + return result; +} + +VKAPI_ATTR VkResult VKAPI_CALL GetMemoryWin32HandlePropertiesKHX(VkDevice device, VkExternalMemoryHandleTypeFlagBitsKHX handleType, + HANDLE handle, + VkMemoryWin32HandlePropertiesKHX *pMemoryWin32HandleProperties) { + VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; + bool skip_call = false; + auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + assert(my_data != NULL); + skip_call |= require_device_extension(my_data, my_data->enables.khx_external_memory_win32, + "vkGetMemoryWin32HandlePropertiesKHX", VK_KHX_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME); + + skip_call |= parameter_validation_vkGetMemoryWin32HandlePropertiesKHX(my_data->report_data, handleType, handle, + pMemoryWin32HandleProperties); + + if (!skip_call) { + result = + my_data->dispatch_table.GetMemoryWin32HandlePropertiesKHX(device, handleType, handle, pMemoryWin32HandleProperties); + validate_result(my_data->report_data, "vkGetMemoryWin32HandlePropertiesKHX", result); + } + return result; +} +#endif // VK_USE_PLATFORM_WIN32_KHX + +// Definitions for the VK_KHX_external_semaphore_capabilities extension + +VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceExternalSemaphorePropertiesKHX( + VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfoKHX *pExternalSemaphoreInfo, + VkExternalSemaphorePropertiesKHX *pExternalSemaphoreProperties) { + auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); + assert(my_data != NULL); + bool skip = false; + skip |= require_instance_extension(physicalDevice, &instance_extension_enables::khx_external_memory_capabilities_enabled, + "vkGetPhysicalDeviceExternalSemaphorePropertiesKHX", + VK_KHX_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME); + skip |= parameter_validation_vkGetPhysicalDeviceExternalSemaphorePropertiesKHX(my_data->report_data, pExternalSemaphoreInfo, + pExternalSemaphoreProperties); + if (!skip) { + my_data->dispatch_table.GetPhysicalDeviceExternalSemaphorePropertiesKHX(physicalDevice, pExternalSemaphoreInfo, + pExternalSemaphoreProperties); + } +} + +// Definitions for the VK_KHX_external_semaphore_fd extension + +VKAPI_ATTR VkResult VKAPI_CALL ImportSemaphoreFdKHX(VkDevice device, const VkImportSemaphoreFdInfoKHX *pImportSemaphoreFdInfo) { + VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; + bool skip_call = false; + auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + assert(my_data != NULL); + + skip_call |= require_device_extension(my_data, my_data->enables.khx_external_semaphore_fd, "vkImportSemaphoreFdKHX", + VK_KHX_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME); + + skip_call |= parameter_validation_vkImportSemaphoreFdKHX(my_data->report_data, pImportSemaphoreFdInfo); + + if (!skip_call) { + result = my_data->dispatch_table.ImportSemaphoreFdKHX(device, pImportSemaphoreFdInfo); + validate_result(my_data->report_data, "vkImportSemaphoreFdKHX", result); + } + + return result; +} + +VKAPI_ATTR VkResult VKAPI_CALL GetSemaphoreFdKHX(VkDevice device, VkSemaphore semaphore, + VkExternalSemaphoreHandleTypeFlagBitsKHX handleType, int *pFd) { + VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; + bool skip_call = false; + auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + assert(my_data != NULL); + + skip_call |= require_device_extension(my_data, my_data->enables.khx_external_semaphore_fd, "vkGetSemaphoreFdKHX", + VK_KHX_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME); + + skip_call |= parameter_validation_vkGetSemaphoreFdKHX(my_data->report_data, semaphore, handleType, pFd); + + if (!skip_call) { + result = my_data->dispatch_table.GetSemaphoreFdKHX(device, semaphore, handleType, pFd); + validate_result(my_data->report_data, "vkGetSemaphoreFdKHX", result); + } + + return result; +} + +// Definitions for the VK_KHX_external_semaphore_win32 extension + +#ifdef VK_USE_PLATFORM_WIN32_KHX +VKAPI_ATTR VkResult VKAPI_CALL +ImportSemaphoreWin32HandleKHX(VkDevice device, const VkImportSemaphoreWin32HandleInfoKHX *pImportSemaphoreWin32HandleInfo) { + VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; + bool skip_call = false; + auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + assert(my_data != NULL); + skip_call |= require_device_extension(my_data, my_data->enables.khx_external_semaphore_win32, "vkImportSemaphoreWin32HandleKHX", + VK_KHX_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME); + + skip_call |= parameter_validation_vkImportSemaphoreWin32HandleKHX(my_data->report_data, pImportSemaphoreWin32HandleInfo); + if (!skip_call) { + result = my_data->dispatch_table.ImportSemaphoreWin32HandleKHX(device, pImportSemaphoreWin32HandleInfo); + validate_result(my_data->report_data, "vkImportSemaphoreWin32HandleKHX", result); + } + return result; +} + +VKAPI_ATTR VkResult VKAPI_CALL GetSemaphoreWin32HandleKHX(VkDevice device, VkSemaphore semaphore, + VkExternalSemaphoreHandleTypeFlagBitsKHX handleType, HANDLE *pHandle) { + VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; + bool skip_call = false; + auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + assert(my_data != NULL); + skip_call |= require_device_extension(my_data, my_data->enables.khx_external_semaphore_win32, "vkGetSemaphoreWin32HandleKHX", + VK_KHX_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME); + skip_call |= parameter_validation_vkGetSemaphoreWin32HandleKHX(my_data->report_data, semaphore, handleType, pHandle); + if (!skip_call) { + result = my_data->dispatch_table.GetSemaphoreWin32HandleKHX(device, semaphore, handleType, pHandle); + validate_result(my_data->report_data, "vkGetSemaphoreWin32HandleKHX", result); + } + return result; +} +#endif // VK_USE_PLATFORM_WIN32_KHX + // Definitions for the VK_EXT_acquire_xlib_display extension #ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT @@ -5812,7 +6400,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetRandROutputDisplayEXT(VkPhysicalDevice physica VKAPI_ATTR VkResult VKAPI_CALL DebugMarkerSetObjectTagEXT(VkDevice device, VkDebugMarkerObjectTagInfoEXT *pTagInfo) { VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; bool skip = false; - layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); assert(my_data != NULL); skip |= require_device_extension(my_data, my_data->enables.ext_debug_marker, "vkDebugMarkerSetObjectTagEXT", @@ -5835,7 +6423,7 @@ VKAPI_ATTR VkResult VKAPI_CALL DebugMarkerSetObjectTagEXT(VkDevice device, VkDeb VKAPI_ATTR VkResult VKAPI_CALL DebugMarkerSetObjectNameEXT(VkDevice device, VkDebugMarkerObjectNameInfoEXT *pNameInfo) { VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; bool skip = false; - layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); assert(my_data != NULL); skip |= require_device_extension(my_data, my_data->enables.ext_debug_marker, "vkDebugMarkerSetObjectNameEXT", @@ -5857,7 +6445,7 @@ VKAPI_ATTR VkResult VKAPI_CALL DebugMarkerSetObjectNameEXT(VkDevice device, VkDe VKAPI_ATTR void VKAPI_CALL CmdDebugMarkerBeginEXT(VkCommandBuffer commandBuffer, VkDebugMarkerMarkerInfoEXT *pMarkerInfo) { bool skip = false; - layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); + auto my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); assert(my_data != NULL); skip |= require_device_extension(my_data, my_data->enables.ext_debug_marker, "vkCmdDebugMarkerBeginEXT", @@ -5872,7 +6460,7 @@ VKAPI_ATTR void VKAPI_CALL CmdDebugMarkerBeginEXT(VkCommandBuffer commandBuffer, VKAPI_ATTR void VKAPI_CALL CmdDebugMarkerInsertEXT(VkCommandBuffer commandBuffer, VkDebugMarkerMarkerInfoEXT *pMarkerInfo) { bool skip = false; - layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); + auto my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); assert(my_data != NULL); skip |= require_device_extension(my_data, my_data->enables.ext_debug_marker, "vkCmdDebugMarkerInsertEXT", @@ -5904,6 +6492,159 @@ VKAPI_ATTR VkResult VKAPI_CALL ReleaseDisplayEXT(VkPhysicalDevice physicalDevice return result; } +// Definitions for the VK_EXT_discard_rectangles extension + +VKAPI_ATTR void VKAPI_CALL CmdSetDiscardRectangleEXT(VkCommandBuffer commandBuffer, uint32_t firstDiscardRectangle, + uint32_t discardRectangleCount, const VkRect2D *pDiscardRectangles) { + bool skip = false; + auto my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); + assert(my_data != NULL); + + skip |= require_device_extension(my_data, my_data->enables.ext_discard_rectangles, "vkCmdSetDiscardRectangleEXT", + VK_EXT_DISCARD_RECTANGLES_EXTENSION_NAME); + + skip |= parameter_validation_vkCmdSetDiscardRectangleEXT(my_data->report_data, firstDiscardRectangle, + discardRectangleCount, pDiscardRectangles); + + if (!skip && my_data->dispatch_table.CmdSetDiscardRectangleEXT) { + my_data->dispatch_table.CmdSetDiscardRectangleEXT(commandBuffer, firstDiscardRectangle, discardRectangleCount, + pDiscardRectangles); + } +} + +// Definitions for the VK_EXT_display_control extension + +VKAPI_ATTR VkResult VKAPI_CALL DisplayPowerControlEXT(VkDevice device, VkDisplayKHR display, + const VkDisplayPowerInfoEXT *pDisplayPowerInfo) { + VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; + bool skip = false; + auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + assert(my_data != NULL); + + skip |= require_device_extension(my_data, my_data->enables.ext_display_control, "vkDisplayPowerControlEXT", + VK_EXT_DISPLAY_CONTROL_EXTENSION_NAME); + + skip |= parameter_validation_vkDisplayPowerControlEXT(my_data->report_data, display, pDisplayPowerInfo); + + if (!skip) { + if (my_data->dispatch_table.DisplayPowerControlEXT) { + result = my_data->dispatch_table.DisplayPowerControlEXT(device, display, pDisplayPowerInfo); + validate_result(my_data->report_data, "vkDisplayPowerControlEXT", result); + } else { + result = VK_SUCCESS; + } + } + + return result; +} + +VKAPI_ATTR VkResult VKAPI_CALL RegisterDeviceEventEXT(VkDevice device, const VkDeviceEventInfoEXT *pDeviceEventInfo, + const VkAllocationCallbacks *pAllocator, VkFence *pFence) { + VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; + bool skip = false; + auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + assert(my_data != NULL); + + skip |= require_device_extension(my_data, my_data->enables.ext_display_control, "vkRegisterDeviceEventEXT", + VK_EXT_DISPLAY_CONTROL_EXTENSION_NAME); + + skip |= parameter_validation_vkRegisterDeviceEventEXT(my_data->report_data, pDeviceEventInfo, pAllocator, pFence); + + if (!skip) { + if (my_data->dispatch_table.RegisterDeviceEventEXT) { + result = my_data->dispatch_table.RegisterDeviceEventEXT(device, pDeviceEventInfo, pAllocator, pFence); + validate_result(my_data->report_data, "vkRegisterDeviceEventEXT", result); + } else { + result = VK_SUCCESS; + } + } + + return result; +} + +VKAPI_ATTR VkResult VKAPI_CALL RegisterDisplayEventEXT(VkDevice device, VkDisplayKHR display, + const VkDisplayEventInfoEXT *pDisplayEventInfo, + const VkAllocationCallbacks *pAllocator, VkFence *pFence) { + VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; + bool skip = false; + auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + assert(my_data != NULL); + + skip |= require_device_extension(my_data, my_data->enables.ext_display_control, "vkRegisterDisplayEventEXT", + VK_EXT_DISPLAY_CONTROL_EXTENSION_NAME); + + skip |= parameter_validation_vkRegisterDisplayEventEXT(my_data->report_data, display, pDisplayEventInfo, pAllocator, pFence); + + if (!skip) { + if (my_data->dispatch_table.RegisterDisplayEventEXT) { + result = my_data->dispatch_table.RegisterDisplayEventEXT(device, display, pDisplayEventInfo, pAllocator, pFence); + validate_result(my_data->report_data, "vkRegisterDisplayEventEXT", result); + } else { + result = VK_SUCCESS; + } + } + + return result; +} + +VKAPI_ATTR VkResult VKAPI_CALL GetSwapchainCounterEXT(VkDevice device, VkSwapchainKHR swapchain, + VkSurfaceCounterFlagBitsEXT counter, uint64_t *pCounterValue) { + VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; + bool skip = false; + auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + assert(my_data != NULL); + + skip |= require_device_extension(my_data, my_data->enables.ext_display_control, "vkGetSwapchainCounterEXT", + VK_EXT_DISPLAY_CONTROL_EXTENSION_NAME); + + skip |= parameter_validation_vkGetSwapchainCounterEXT(my_data->report_data, swapchain, counter, pCounterValue); + + if (!skip) { + if (my_data->dispatch_table.GetSwapchainCounterEXT) { + result = my_data->dispatch_table.GetSwapchainCounterEXT(device, swapchain, counter, pCounterValue); + validate_result(my_data->report_data, "vkGetSwapchainCounterEXT", result); + } else { + result = VK_SUCCESS; + } + } + + return result; +} + +// Definitions for the VK_AMD_draw_indirect_count extension + +VKAPI_ATTR void VKAPI_CALL CmdDrawIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, + VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, + uint32_t stride) { + bool skip = false; + auto my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); + assert(my_data != NULL); + skip |= require_device_extension(my_data, my_data->enables.amd_draw_indirect_count, "vkCmdDrawIndirectCountAMD", + VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME); + skip |= parameter_validation_vkCmdDrawIndirectCountAMD(my_data->report_data, buffer, offset, countBuffer, countBufferOffset, + maxDrawCount, stride); + if (!skip) { + my_data->dispatch_table.CmdDrawIndirectCountAMD(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, + stride); + } +} + +VKAPI_ATTR void VKAPI_CALL CmdDrawIndexedIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, + VkBuffer countBuffer, VkDeviceSize countBufferOffset, + uint32_t maxDrawCount, uint32_t stride) { + bool skip = false; + auto my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); + assert(my_data != NULL); + skip |= require_device_extension(my_data, my_data->enables.amd_draw_indirect_count, "vkCmdDrawIndexedIndirectCountAMD", + VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME); + skip |= parameter_validation_vkCmdDrawIndexedIndirectCountAMD(my_data->report_data, buffer, offset, countBuffer, + countBufferOffset, maxDrawCount, stride); + if (!skip) { + my_data->dispatch_table.CmdDrawIndexedIndirectCountAMD(commandBuffer, buffer, offset, countBuffer, countBufferOffset, + maxDrawCount, stride); + } +} + // Definitions for the VK_EXT_display_surface_counter extension VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceCapabilities2EXT(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, @@ -5922,6 +6663,23 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceCapabilities2EXT(VkPhysic return result; } +// Definitions for the VK_NV_clip_space_w_scaling Extension + +VKAPI_ATTR void VKAPI_CALL CmdSetViewportWScalingNV(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, + const VkViewportWScalingNV *pViewportWScalings) { + bool skip = false; + auto my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); + assert(my_data != NULL); + skip |= require_device_extension(my_data, my_data->enables.amd_draw_indirect_count, "vkCmdSetViewportWScalingNV", + VK_NV_CLIP_SPACE_W_SCALING_EXTENSION_NAME); +#if 0 // Validation not automatically generated + skip |= parameter_validation_vkCmdSetViewportWScalingNV(my_data->report_data, firstViewport, viewportCount, pViewportWScalings); +#endif + if (!skip) { + my_data->dispatch_table.CmdSetViewportWScalingNV(commandBuffer, firstViewport, viewportCount, pViewportWScalings); + } +} + // Definitions for the VK_NV_external_memory_capabilities Extension VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceExternalImageFormatPropertiesNV( @@ -5957,7 +6715,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetMemoryWin32HandleNV(VkDevice device, VkDeviceM VkExternalMemoryHandleTypeFlagsNV handleType, HANDLE *pHandle) { VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; bool skip = false; - layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); assert(my_data != NULL); skip |= require_device_extension(my_data, my_data->enables.nv_external_memory_win32, "vkGetMemoryWin32HandleNV", @@ -5978,7 +6736,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetMemoryWin32HandleNV(VkDevice device, VkDeviceM VKAPI_ATTR void VKAPI_CALL CmdProcessCommandsNVX(VkCommandBuffer commandBuffer, const VkCmdProcessCommandsInfoNVX *pProcessCommandsInfo) { bool skip = false; - layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); + auto my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); assert(my_data != NULL); skip |= require_device_extension(my_data, my_data->enables.nvx_device_generated_commands, "vkCmdProcessCommandsNVX", VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME); @@ -5991,7 +6749,7 @@ VKAPI_ATTR void VKAPI_CALL CmdProcessCommandsNVX(VkCommandBuffer commandBuffer, VKAPI_ATTR void VKAPI_CALL CmdReserveSpaceForCommandsNVX(VkCommandBuffer commandBuffer, const VkCmdReserveSpaceForCommandsInfoNVX *pReserveSpaceInfo) { bool skip = false; - layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); + auto my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); assert(my_data != NULL); skip |= require_device_extension(my_data, my_data->enables.nvx_device_generated_commands, "vkCmdReserveSpaceForCommandsNVX", VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME); @@ -6007,7 +6765,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateIndirectCommandsLayoutNVX(VkDevice device, VkIndirectCommandsLayoutNVX *pIndirectCommandsLayout) { VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; bool skip = false; - layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); assert(my_data != NULL); skip |= require_device_extension(my_data, my_data->enables.nvx_device_generated_commands, "vkCreateIndirectCommandsLayoutNVX", VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME); @@ -6023,7 +6781,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateIndirectCommandsLayoutNVX(VkDevice device, VKAPI_ATTR void VKAPI_CALL DestroyIndirectCommandsLayoutNVX(VkDevice device, VkIndirectCommandsLayoutNVX indirectCommandsLayout, const VkAllocationCallbacks *pAllocator) { bool skip = false; - layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); assert(my_data != NULL); skip |= require_device_extension(my_data, my_data->enables.nvx_device_generated_commands, "vkDestroyIndirectCommandsLayoutNVX", VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME); @@ -6039,7 +6797,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateObjectTableNVX(VkDevice device, const VkObj const VkAllocationCallbacks *pAllocator, VkObjectTableNVX *pObjectTable) { VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; bool skip = false; - layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); assert(my_data != NULL); skip |= require_device_extension(my_data, my_data->enables.nvx_device_generated_commands, "vkCreateObjectTableNVX", VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME); @@ -6054,7 +6812,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateObjectTableNVX(VkDevice device, const VkObj VKAPI_ATTR void VKAPI_CALL DestroyObjectTableNVX(VkDevice device, VkObjectTableNVX objectTable, const VkAllocationCallbacks *pAllocator) { bool skip = false; - layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); assert(my_data != NULL); skip |= require_device_extension(my_data, my_data->enables.nvx_device_generated_commands, "vkDestroyObjectTableNVX", VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME); @@ -6071,7 +6829,7 @@ VKAPI_ATTR VkResult VKAPI_CALL RegisterObjectsNVX(VkDevice device, VkObjectTable const uint32_t *pObjectIndices) { VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; bool skip = false; - layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); assert(my_data != NULL); skip |= require_device_extension(my_data, my_data->enables.nvx_device_generated_commands, "vkRegisterObjectsNVX", VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME); @@ -6088,7 +6846,7 @@ VKAPI_ATTR VkResult VKAPI_CALL UnregisterObjectsNVX(VkDevice device, VkObjectTab const VkObjectEntryTypeNVX *pObjectEntryTypes, const uint32_t *pObjectIndices) { VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; bool skip = false; - layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); assert(my_data != NULL); skip |= require_device_extension(my_data, my_data->enables.nvx_device_generated_commands, "vkUnregisterObjectsNVX", VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME); @@ -6101,97 +6859,6 @@ VKAPI_ATTR VkResult VKAPI_CALL UnregisterObjectsNVX(VkDevice device, VkObjectTab return result; } -VKAPI_ATTR VkResult VKAPI_CALL DisplayPowerControlEXT(VkDevice device, VkDisplayKHR display, - const VkDisplayPowerInfoEXT *pDisplayPowerInfo) { - VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; - bool skip = false; - layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); - skip |= require_device_extension(dev_data, dev_data->enables.ext_display_control, "vkDisplayPowerControlEXT", - VK_EXT_DISPLAY_CONTROL_EXTENSION_NAME); - skip |= parameter_validation_vkDisplayPowerControlEXT(dev_data->report_data, display, pDisplayPowerInfo); - if (!skip) { - result = dev_data->dispatch_table.DisplayPowerControlEXT(device, display, pDisplayPowerInfo); - validate_result(dev_data->report_data, "vkDisplayPowerControlEXT", result); - } - return result; -} - -VKAPI_ATTR VkResult VKAPI_CALL GetSwapchainCounterEXT(VkDevice device, VkSwapchainKHR swapchain, - VkSurfaceCounterFlagBitsEXT counter, uint64_t *pCounterValue) { - VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; - bool skip = false; - layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); - skip |= require_device_extension(dev_data, dev_data->enables.ext_display_control, "vkGetSwapchainCounterEXT", - VK_EXT_DISPLAY_CONTROL_EXTENSION_NAME); - skip |= parameter_validation_vkGetSwapchainCounterEXT(dev_data->report_data, swapchain, counter, pCounterValue); - if (!skip) { - result = dev_data->dispatch_table.GetSwapchainCounterEXT(device, swapchain, counter, pCounterValue); - validate_result(dev_data->report_data, "vkGetSwapchainCounterEXT", result); - } - return result; -} - -VKAPI_ATTR VkResult VKAPI_CALL RegisterDeviceEventEXT(VkDevice device, const VkDeviceEventInfoEXT *pDeviceEventInfo, - const VkAllocationCallbacks *pAllocator, VkFence *pFence) { - VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; - bool skip = false; - layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); - skip |= require_device_extension(dev_data, dev_data->enables.ext_display_control, "vkDisplayPowerControlEXT", - VK_EXT_DISPLAY_CONTROL_EXTENSION_NAME); - skip |= parameter_validation_vkRegisterDeviceEventEXT(dev_data->report_data, pDeviceEventInfo, pAllocator, pFence); - if (!skip) { - result = dev_data->dispatch_table.RegisterDeviceEventEXT(device, pDeviceEventInfo, pAllocator, pFence); - validate_result(dev_data->report_data, "vkRegisterDeviceEventEXT", result); - } - return result; -} - -VKAPI_ATTR VkResult VKAPI_CALL RegisterDisplayEventEXT(VkDevice device, VkDisplayKHR display, - const VkDisplayEventInfoEXT *pDisplayEventInfo, - const VkAllocationCallbacks *pAllocator, VkFence *pFence) { - VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; - bool skip = false; - layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); - skip |= require_device_extension(dev_data, dev_data->enables.ext_display_control, "vkDisplayPowerControlEXT", - VK_EXT_DISPLAY_CONTROL_EXTENSION_NAME); - skip |= parameter_validation_vkRegisterDisplayEventEXT(dev_data->report_data, display, pDisplayEventInfo, pAllocator, pFence); - if (!skip) { - result = dev_data->dispatch_table.RegisterDisplayEventEXT(device, display, pDisplayEventInfo, pAllocator, pFence); - validate_result(dev_data->report_data, "vkRegisterDisplayEventEXT", result); - } - return result; -} - -VKAPI_ATTR void VKAPI_CALL CmdDrawIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, - VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, - uint32_t stride) { - bool skip = false; - layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); - skip |= require_device_extension(dev_data, dev_data->enables.amd_draw_indirect_count, "vkCmdDrawIndirectCountAMD", - VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME); - skip |= parameter_validation_vkCmdDrawIndirectCountAMD(dev_data->report_data, buffer, offset, countBuffer, countBufferOffset, - maxDrawCount, stride); - if (!skip) { - dev_data->dispatch_table.CmdDrawIndirectCountAMD(commandBuffer, buffer, offset, countBuffer, countBufferOffset, - maxDrawCount, stride); - } -} - -VKAPI_ATTR void VKAPI_CALL CmdDrawIndexedIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, - VkBuffer countBuffer, VkDeviceSize countBufferOffset, - uint32_t maxDrawCount, uint32_t stride) { - bool skip = false; - layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); - skip |= require_device_extension(dev_data, dev_data->enables.amd_draw_indirect_count, "CmdDrawIndexedIndirectCountAMD", - VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME); - skip |= parameter_validation_vkCmdDrawIndexedIndirectCountAMD(dev_data->report_data, buffer, offset, countBuffer, - countBufferOffset, maxDrawCount, stride); - if (!skip) { - dev_data->dispatch_table.CmdDrawIndexedIndirectCountAMD(commandBuffer, buffer, offset, countBuffer, countBufferOffset, - maxDrawCount, stride); - } -} - VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceGeneratedCommandsPropertiesNVX(VkPhysicalDevice physicalDevice, VkDeviceGeneratedCommandsFeaturesNVX *pFeatures, VkDeviceGeneratedCommandsLimitsNVX *pLimits) { @@ -6204,44 +6871,436 @@ VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceGeneratedCommandsPropertiesNVX(VkPhy } } -static inline PFN_vkVoidFunction layer_intercept_proc(const char *name) { - for (unsigned int i = 0; i < sizeof(procmap) / sizeof(procmap[0]); i++) { - if (!strcmp(name, procmap[i].name)) return procmap[i].pFunc; - } - return NULL; -} +static PFN_vkVoidFunction intercept_core_instance_command(const char *name); + +static PFN_vkVoidFunction intercept_core_device_command(const char *name); + +static PFN_vkVoidFunction InterceptWsiEnabledCommand(const char *name, VkDevice device); + +static PFN_vkVoidFunction InterceptWsiEnabledCommand(const char *name, VkInstance instance); + +static PFN_vkVoidFunction intercept_extension_instance_command(const char *name, VkInstance instance); + +static PFN_vkVoidFunction intercept_extension_device_command(const char *name, VkDevice device); VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL GetDeviceProcAddr(VkDevice device, const char *funcName) { assert(device); - PFN_vkVoidFunction addr = layer_intercept_proc(funcName); - if (addr) return addr; + auto data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + + if (validate_string(data->report_data, "vkGetDeviceProcAddr", "funcName", funcName)) { + return NULL; + } + + PFN_vkVoidFunction proc = intercept_core_device_command(funcName); + if (proc) return proc; + + proc = InterceptWsiEnabledCommand(funcName, device); + if (proc) return proc; - layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); + proc = intercept_extension_device_command(funcName, device); + if (proc) return proc; - if (!dev_data->dispatch_table.GetDeviceProcAddr) return nullptr; - return dev_data->dispatch_table.GetDeviceProcAddr(device, funcName); + if (!data->dispatch_table.GetDeviceProcAddr) return nullptr; + return data->dispatch_table.GetDeviceProcAddr(device, funcName); } VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL GetInstanceProcAddr(VkInstance instance, const char *funcName) { + PFN_vkVoidFunction proc = intercept_core_instance_command(funcName); + if (!proc) proc = intercept_core_device_command(funcName); + + if (!proc) proc = InterceptWsiEnabledCommand(funcName, VkDevice(VK_NULL_HANDLE)); - PFN_vkVoidFunction addr = layer_intercept_proc(funcName); - if (addr) return addr; + if (proc) return proc; assert(instance); - auto instance_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); + auto data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); + + proc = debug_report_get_instance_proc_addr(data->report_data, funcName); + if (!proc) proc = InterceptWsiEnabledCommand(funcName, instance); - if (!instance_data->dispatch_table.GetInstanceProcAddr) return nullptr; - return instance_data->dispatch_table.GetInstanceProcAddr(instance, funcName); + if (!proc) proc = intercept_extension_instance_command(funcName, instance); + + if (proc) return proc; + + if (!data->dispatch_table.GetInstanceProcAddr) return nullptr; + return data->dispatch_table.GetInstanceProcAddr(instance, funcName); } VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL GetPhysicalDeviceProcAddr(VkInstance instance, const char *funcName) { assert(instance); - auto pdev_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); + auto data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); + + if (!data->dispatch_table.GetPhysicalDeviceProcAddr) return nullptr; + return data->dispatch_table.GetPhysicalDeviceProcAddr(instance, funcName); +} + +static PFN_vkVoidFunction intercept_core_instance_command(const char *name) { + static const struct { + const char *name; + PFN_vkVoidFunction proc; + } core_instance_commands[] = { + {"vkGetInstanceProcAddr", reinterpret_cast<PFN_vkVoidFunction>(GetInstanceProcAddr)}, + {"vkCreateInstance", reinterpret_cast<PFN_vkVoidFunction>(CreateInstance)}, + {"vkDestroyInstance", reinterpret_cast<PFN_vkVoidFunction>(DestroyInstance)}, + {"vkCreateDevice", reinterpret_cast<PFN_vkVoidFunction>(CreateDevice)}, + {"vkEnumeratePhysicalDevices", reinterpret_cast<PFN_vkVoidFunction>(EnumeratePhysicalDevices)}, + {"vk_layerGetPhysicalDeviceProcAddr", reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceProcAddr)}, + {"vkGetPhysicalDeviceProperties", reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceProperties)}, + {"vkGetPhysicalDeviceFeatures", reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceFeatures)}, + {"vkGetPhysicalDeviceFormatProperties", reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceFormatProperties)}, + {"vkGetPhysicalDeviceImageFormatProperties", reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceImageFormatProperties)}, + {"vkGetPhysicalDeviceSparseImageFormatProperties", + reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceSparseImageFormatProperties)}, + {"vkGetPhysicalDeviceQueueFamilyProperties", reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceQueueFamilyProperties)}, + {"vkGetPhysicalDeviceMemoryProperties", reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceMemoryProperties)}, + {"vkEnumerateInstanceLayerProperties", reinterpret_cast<PFN_vkVoidFunction>(EnumerateInstanceLayerProperties)}, + {"vkEnumerateDeviceLayerProperties", reinterpret_cast<PFN_vkVoidFunction>(EnumerateDeviceLayerProperties)}, + {"vkEnumerateInstanceExtensionProperties", reinterpret_cast<PFN_vkVoidFunction>(EnumerateInstanceExtensionProperties)}, + {"vkEnumerateDeviceExtensionProperties", reinterpret_cast<PFN_vkVoidFunction>(EnumerateDeviceExtensionProperties)}, + }; + + for (size_t i = 0; i < ARRAY_SIZE(core_instance_commands); i++) { + if (!strcmp(core_instance_commands[i].name, name)) return core_instance_commands[i].proc; + } + + return nullptr; +} + +static PFN_vkVoidFunction intercept_core_device_command(const char *name) { + static const struct { + const char *name; + PFN_vkVoidFunction proc; + } core_device_commands[] = { + {"vkGetDeviceProcAddr", reinterpret_cast<PFN_vkVoidFunction>(GetDeviceProcAddr)}, + {"vkDestroyDevice", reinterpret_cast<PFN_vkVoidFunction>(DestroyDevice)}, + {"vkGetDeviceQueue", reinterpret_cast<PFN_vkVoidFunction>(GetDeviceQueue)}, + {"vkQueueSubmit", reinterpret_cast<PFN_vkVoidFunction>(QueueSubmit)}, + {"vkQueueWaitIdle", reinterpret_cast<PFN_vkVoidFunction>(QueueWaitIdle)}, + {"vkDeviceWaitIdle", reinterpret_cast<PFN_vkVoidFunction>(DeviceWaitIdle)}, + {"vkAllocateMemory", reinterpret_cast<PFN_vkVoidFunction>(AllocateMemory)}, + {"vkFreeMemory", reinterpret_cast<PFN_vkVoidFunction>(FreeMemory)}, + {"vkMapMemory", reinterpret_cast<PFN_vkVoidFunction>(MapMemory)}, + {"vkUnmapMemory", reinterpret_cast<PFN_vkVoidFunction>(UnmapMemory)}, + {"vkFlushMappedMemoryRanges", reinterpret_cast<PFN_vkVoidFunction>(FlushMappedMemoryRanges)}, + {"vkInvalidateMappedMemoryRanges", reinterpret_cast<PFN_vkVoidFunction>(InvalidateMappedMemoryRanges)}, + {"vkGetDeviceMemoryCommitment", reinterpret_cast<PFN_vkVoidFunction>(GetDeviceMemoryCommitment)}, + {"vkBindBufferMemory", reinterpret_cast<PFN_vkVoidFunction>(BindBufferMemory)}, + {"vkBindImageMemory", reinterpret_cast<PFN_vkVoidFunction>(BindImageMemory)}, + {"vkCreateFence", reinterpret_cast<PFN_vkVoidFunction>(CreateFence)}, + {"vkDestroyFence", reinterpret_cast<PFN_vkVoidFunction>(DestroyFence)}, + {"vkResetFences", reinterpret_cast<PFN_vkVoidFunction>(ResetFences)}, + {"vkGetFenceStatus", reinterpret_cast<PFN_vkVoidFunction>(GetFenceStatus)}, + {"vkWaitForFences", reinterpret_cast<PFN_vkVoidFunction>(WaitForFences)}, + {"vkCreateSemaphore", reinterpret_cast<PFN_vkVoidFunction>(CreateSemaphore)}, + {"vkDestroySemaphore", reinterpret_cast<PFN_vkVoidFunction>(DestroySemaphore)}, + {"vkCreateEvent", reinterpret_cast<PFN_vkVoidFunction>(CreateEvent)}, + {"vkDestroyEvent", reinterpret_cast<PFN_vkVoidFunction>(DestroyEvent)}, + {"vkGetEventStatus", reinterpret_cast<PFN_vkVoidFunction>(GetEventStatus)}, + {"vkSetEvent", reinterpret_cast<PFN_vkVoidFunction>(SetEvent)}, + {"vkResetEvent", reinterpret_cast<PFN_vkVoidFunction>(ResetEvent)}, + {"vkCreateQueryPool", reinterpret_cast<PFN_vkVoidFunction>(CreateQueryPool)}, + {"vkDestroyQueryPool", reinterpret_cast<PFN_vkVoidFunction>(DestroyQueryPool)}, + {"vkGetQueryPoolResults", reinterpret_cast<PFN_vkVoidFunction>(GetQueryPoolResults)}, + {"vkCreateBuffer", reinterpret_cast<PFN_vkVoidFunction>(CreateBuffer)}, + {"vkDestroyBuffer", reinterpret_cast<PFN_vkVoidFunction>(DestroyBuffer)}, + {"vkCreateBufferView", reinterpret_cast<PFN_vkVoidFunction>(CreateBufferView)}, + {"vkDestroyBufferView", reinterpret_cast<PFN_vkVoidFunction>(DestroyBufferView)}, + {"vkCreateImage", reinterpret_cast<PFN_vkVoidFunction>(CreateImage)}, + {"vkDestroyImage", reinterpret_cast<PFN_vkVoidFunction>(DestroyImage)}, + {"vkGetImageSubresourceLayout", reinterpret_cast<PFN_vkVoidFunction>(GetImageSubresourceLayout)}, + {"vkCreateImageView", reinterpret_cast<PFN_vkVoidFunction>(CreateImageView)}, + {"vkDestroyImageView", reinterpret_cast<PFN_vkVoidFunction>(DestroyImageView)}, + {"vkCreateShaderModule", reinterpret_cast<PFN_vkVoidFunction>(CreateShaderModule)}, + {"vkDestroyShaderModule", reinterpret_cast<PFN_vkVoidFunction>(DestroyShaderModule)}, + {"vkCreatePipelineCache", reinterpret_cast<PFN_vkVoidFunction>(CreatePipelineCache)}, + {"vkDestroyPipelineCache", reinterpret_cast<PFN_vkVoidFunction>(DestroyPipelineCache)}, + {"vkGetPipelineCacheData", reinterpret_cast<PFN_vkVoidFunction>(GetPipelineCacheData)}, + {"vkMergePipelineCaches", reinterpret_cast<PFN_vkVoidFunction>(MergePipelineCaches)}, + {"vkCreateGraphicsPipelines", reinterpret_cast<PFN_vkVoidFunction>(CreateGraphicsPipelines)}, + {"vkCreateComputePipelines", reinterpret_cast<PFN_vkVoidFunction>(CreateComputePipelines)}, + {"vkDestroyPipeline", reinterpret_cast<PFN_vkVoidFunction>(DestroyPipeline)}, + {"vkCreatePipelineLayout", reinterpret_cast<PFN_vkVoidFunction>(CreatePipelineLayout)}, + {"vkDestroyPipelineLayout", reinterpret_cast<PFN_vkVoidFunction>(DestroyPipelineLayout)}, + {"vkCreateSampler", reinterpret_cast<PFN_vkVoidFunction>(CreateSampler)}, + {"vkDestroySampler", reinterpret_cast<PFN_vkVoidFunction>(DestroySampler)}, + {"vkCreateDescriptorSetLayout", reinterpret_cast<PFN_vkVoidFunction>(CreateDescriptorSetLayout)}, + {"vkDestroyDescriptorSetLayout", reinterpret_cast<PFN_vkVoidFunction>(DestroyDescriptorSetLayout)}, + {"vkCreateDescriptorPool", reinterpret_cast<PFN_vkVoidFunction>(CreateDescriptorPool)}, + {"vkDestroyDescriptorPool", reinterpret_cast<PFN_vkVoidFunction>(DestroyDescriptorPool)}, + {"vkResetDescriptorPool", reinterpret_cast<PFN_vkVoidFunction>(ResetDescriptorPool)}, + {"vkAllocateDescriptorSets", reinterpret_cast<PFN_vkVoidFunction>(AllocateDescriptorSets)}, + {"vkFreeDescriptorSets", reinterpret_cast<PFN_vkVoidFunction>(FreeDescriptorSets)}, + {"vkUpdateDescriptorSets", reinterpret_cast<PFN_vkVoidFunction>(UpdateDescriptorSets)}, + {"vkCmdSetViewport", reinterpret_cast<PFN_vkVoidFunction>(CmdSetViewport)}, + {"vkCmdSetScissor", reinterpret_cast<PFN_vkVoidFunction>(CmdSetScissor)}, + {"vkCmdSetLineWidth", reinterpret_cast<PFN_vkVoidFunction>(CmdSetLineWidth)}, + {"vkCmdSetDepthBias", reinterpret_cast<PFN_vkVoidFunction>(CmdSetDepthBias)}, + {"vkCmdSetBlendConstants", reinterpret_cast<PFN_vkVoidFunction>(CmdSetBlendConstants)}, + {"vkCmdSetDepthBounds", reinterpret_cast<PFN_vkVoidFunction>(CmdSetDepthBounds)}, + {"vkCmdSetStencilCompareMask", reinterpret_cast<PFN_vkVoidFunction>(CmdSetStencilCompareMask)}, + {"vkCmdSetStencilWriteMask", reinterpret_cast<PFN_vkVoidFunction>(CmdSetStencilWriteMask)}, + {"vkCmdSetStencilReference", reinterpret_cast<PFN_vkVoidFunction>(CmdSetStencilReference)}, + {"vkAllocateCommandBuffers", reinterpret_cast<PFN_vkVoidFunction>(AllocateCommandBuffers)}, + {"vkFreeCommandBuffers", reinterpret_cast<PFN_vkVoidFunction>(FreeCommandBuffers)}, + {"vkBeginCommandBuffer", reinterpret_cast<PFN_vkVoidFunction>(BeginCommandBuffer)}, + {"vkEndCommandBuffer", reinterpret_cast<PFN_vkVoidFunction>(EndCommandBuffer)}, + {"vkResetCommandBuffer", reinterpret_cast<PFN_vkVoidFunction>(ResetCommandBuffer)}, + {"vkCmdBindPipeline", reinterpret_cast<PFN_vkVoidFunction>(CmdBindPipeline)}, + {"vkCmdBindDescriptorSets", reinterpret_cast<PFN_vkVoidFunction>(CmdBindDescriptorSets)}, + {"vkCmdBindVertexBuffers", reinterpret_cast<PFN_vkVoidFunction>(CmdBindVertexBuffers)}, + {"vkCmdBindIndexBuffer", reinterpret_cast<PFN_vkVoidFunction>(CmdBindIndexBuffer)}, + {"vkCmdDraw", reinterpret_cast<PFN_vkVoidFunction>(CmdDraw)}, + {"vkCmdDrawIndexed", reinterpret_cast<PFN_vkVoidFunction>(CmdDrawIndexed)}, + {"vkCmdDrawIndirect", reinterpret_cast<PFN_vkVoidFunction>(CmdDrawIndirect)}, + {"vkCmdDrawIndexedIndirect", reinterpret_cast<PFN_vkVoidFunction>(CmdDrawIndexedIndirect)}, + {"vkCmdDispatch", reinterpret_cast<PFN_vkVoidFunction>(CmdDispatch)}, + {"vkCmdDispatchIndirect", reinterpret_cast<PFN_vkVoidFunction>(CmdDispatchIndirect)}, + {"vkCmdCopyBuffer", reinterpret_cast<PFN_vkVoidFunction>(CmdCopyBuffer)}, + {"vkCmdCopyImage", reinterpret_cast<PFN_vkVoidFunction>(CmdCopyImage)}, + {"vkCmdBlitImage", reinterpret_cast<PFN_vkVoidFunction>(CmdBlitImage)}, + {"vkCmdCopyBufferToImage", reinterpret_cast<PFN_vkVoidFunction>(CmdCopyBufferToImage)}, + {"vkCmdCopyImageToBuffer", reinterpret_cast<PFN_vkVoidFunction>(CmdCopyImageToBuffer)}, + {"vkCmdUpdateBuffer", reinterpret_cast<PFN_vkVoidFunction>(CmdUpdateBuffer)}, + {"vkCmdFillBuffer", reinterpret_cast<PFN_vkVoidFunction>(CmdFillBuffer)}, + {"vkCmdClearColorImage", reinterpret_cast<PFN_vkVoidFunction>(CmdClearColorImage)}, + {"vkCmdClearDepthStencilImage", reinterpret_cast<PFN_vkVoidFunction>(CmdClearDepthStencilImage)}, + {"vkCmdClearAttachments", reinterpret_cast<PFN_vkVoidFunction>(CmdClearAttachments)}, + {"vkCmdResolveImage", reinterpret_cast<PFN_vkVoidFunction>(CmdResolveImage)}, + {"vkCmdSetEvent", reinterpret_cast<PFN_vkVoidFunction>(CmdSetEvent)}, + {"vkCmdResetEvent", reinterpret_cast<PFN_vkVoidFunction>(CmdResetEvent)}, + {"vkCmdWaitEvents", reinterpret_cast<PFN_vkVoidFunction>(CmdWaitEvents)}, + {"vkCmdPipelineBarrier", reinterpret_cast<PFN_vkVoidFunction>(CmdPipelineBarrier)}, + {"vkCmdBeginQuery", reinterpret_cast<PFN_vkVoidFunction>(CmdBeginQuery)}, + {"vkCmdEndQuery", reinterpret_cast<PFN_vkVoidFunction>(CmdEndQuery)}, + {"vkCmdResetQueryPool", reinterpret_cast<PFN_vkVoidFunction>(CmdResetQueryPool)}, + {"vkCmdWriteTimestamp", reinterpret_cast<PFN_vkVoidFunction>(CmdWriteTimestamp)}, + {"vkCmdCopyQueryPoolResults", reinterpret_cast<PFN_vkVoidFunction>(CmdCopyQueryPoolResults)}, + {"vkCmdPushConstants", reinterpret_cast<PFN_vkVoidFunction>(CmdPushConstants)}, + {"vkCreateFramebuffer", reinterpret_cast<PFN_vkVoidFunction>(CreateFramebuffer)}, + {"vkDestroyFramebuffer", reinterpret_cast<PFN_vkVoidFunction>(DestroyFramebuffer)}, + {"vkCreateRenderPass", reinterpret_cast<PFN_vkVoidFunction>(CreateRenderPass)}, + {"vkDestroyRenderPass", reinterpret_cast<PFN_vkVoidFunction>(DestroyRenderPass)}, + {"vkGetRenderAreaGranularity", reinterpret_cast<PFN_vkVoidFunction>(GetRenderAreaGranularity)}, + {"vkCreateCommandPool", reinterpret_cast<PFN_vkVoidFunction>(CreateCommandPool)}, + {"vkDestroyCommandPool", reinterpret_cast<PFN_vkVoidFunction>(DestroyCommandPool)}, + {"vkResetCommandPool", reinterpret_cast<PFN_vkVoidFunction>(ResetCommandPool)}, + {"vkCmdBeginRenderPass", reinterpret_cast<PFN_vkVoidFunction>(CmdBeginRenderPass)}, + {"vkCmdNextSubpass", reinterpret_cast<PFN_vkVoidFunction>(CmdNextSubpass)}, + {"vkCmdExecuteCommands", reinterpret_cast<PFN_vkVoidFunction>(CmdExecuteCommands)}, + {"vkCmdEndRenderPass", reinterpret_cast<PFN_vkVoidFunction>(CmdEndRenderPass)}, + }; + + for (size_t i = 0; i < ARRAY_SIZE(core_device_commands); i++) { + if (!strcmp(core_device_commands[i].name, name)) return core_device_commands[i].proc; + } + + return nullptr; +} + +static PFN_vkVoidFunction InterceptWsiEnabledCommand(const char *name, VkDevice device) { + static const struct { + const char *name; + PFN_vkVoidFunction proc; + } wsi_device_commands[] = { + {"vkCreateSwapchainKHR", reinterpret_cast<PFN_vkVoidFunction>(CreateSwapchainKHR)}, + {"vkGetSwapchainImagesKHR", reinterpret_cast<PFN_vkVoidFunction>(GetSwapchainImagesKHR)}, + {"vkAcquireNextImageKHR", reinterpret_cast<PFN_vkVoidFunction>(AcquireNextImageKHR)}, + {"vkQueuePresentKHR", reinterpret_cast<PFN_vkVoidFunction>(QueuePresentKHR)}, + {"vkDestroySwapchainKHR", reinterpret_cast<PFN_vkVoidFunction>(DestroySwapchainKHR)}, + {"vkCreateSharedSwapchainsKHR", reinterpret_cast<PFN_vkVoidFunction>(CreateSharedSwapchainsKHR)}, + }; + + if (device) { + for (size_t i = 0; i < ARRAY_SIZE(wsi_device_commands); i++) { + if (!strcmp(wsi_device_commands[i].name, name)) return wsi_device_commands[i].proc; + } + + if (!strcmp("vkCreateSharedSwapchainsKHR", name)) { + return reinterpret_cast<PFN_vkVoidFunction>(CreateSharedSwapchainsKHR); + } + } + + return nullptr; +} + +static PFN_vkVoidFunction InterceptWsiEnabledCommand(const char *name, VkInstance instance) { + static const struct { + const char *name; + PFN_vkVoidFunction proc; + } wsi_instance_commands[] = { + {"vkGetPhysicalDeviceSurfaceSupportKHR", reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceSurfaceSupportKHR)}, + {"vkGetPhysicalDeviceSurfaceCapabilitiesKHR", + reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceSurfaceCapabilitiesKHR)}, + {"vkGetPhysicalDeviceSurfaceFormatsKHR", reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceSurfaceFormatsKHR)}, + {"vkGetPhysicalDeviceSurfacePresentModesKHR", + reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceSurfacePresentModesKHR)}, + {"vkDestroySurfaceKHR", reinterpret_cast<PFN_vkVoidFunction>(DestroySurfaceKHR)}, + {"vkGetPhysicalDeviceDisplayPropertiesKHR", reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceDisplayPropertiesKHR)}, + {"vkGetPhysicalDeviceDisplayPlanePropertiesKHR", + reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceDisplayPlanePropertiesKHR)}, + {"vkGetDisplayPlaneSupportedDisplaysKHR", reinterpret_cast<PFN_vkVoidFunction>(GetDisplayPlaneSupportedDisplaysKHR)}, + {"vkGetDisplayModePropertiesKHR", reinterpret_cast<PFN_vkVoidFunction>(GetDisplayModePropertiesKHR)}, + {"vkCreateDisplayModeKHR", reinterpret_cast<PFN_vkVoidFunction>(CreateDisplayModeKHR)}, + {"vkGetDisplayPlaneCapabilitiesKHR", reinterpret_cast<PFN_vkVoidFunction>(GetDisplayPlaneCapabilitiesKHR)}, + {"vkCreateDisplayPlaneSurfaceKHR", reinterpret_cast<PFN_vkVoidFunction>(CreateDisplayPlaneSurfaceKHR)}, +#ifdef VK_USE_PLATFORM_WIN32_KHR + {"vkCreateWin32SurfaceKHR", reinterpret_cast<PFN_vkVoidFunction>(CreateWin32SurfaceKHR)}, + {"vkGetPhysicalDeviceWin32PresentationSupportKHR", + reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceWin32PresentationSupportKHR)}, +#endif +#ifdef VK_USE_PLATFORM_XCB_KHR + {"vkCreateXcbSurfaceKHR", reinterpret_cast<PFN_vkVoidFunction>(CreateXcbSurfaceKHR)}, + {"vkGetPhysicalDeviceXcbPresentationSupportKHR", + reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceXcbPresentationSupportKHR)}, +#endif +#ifdef VK_USE_PLATFORM_XLIB_KHR + {"vkCreateXlibSurfaceKHR", reinterpret_cast<PFN_vkVoidFunction>(CreateXlibSurfaceKHR)}, + {"vkGetPhysicalDeviceXlibPresentationSupportKHR", + reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceXlibPresentationSupportKHR)}, +#endif +#ifdef VK_USE_PLATFORM_MIR_KHR + {"vkCreateMirSurfaceKHR", reinterpret_cast<PFN_vkVoidFunction>(CreateMirSurfaceKHR)}, + {"vkGetPhysicalDeviceMirPresentationSupportKHR", + reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceMirPresentationSupportKHR)}, +#endif +#ifdef VK_USE_PLATFORM_WAYLAND_KHR + {"vkCreateWaylandSurfaceKHR", reinterpret_cast<PFN_vkVoidFunction>(CreateWaylandSurfaceKHR)}, + {"vkGetPhysicalDeviceWaylandPresentationSupportKHR", + reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceWaylandPresentationSupportKHR)}, +#endif +#ifdef VK_USE_PLATFORM_ANDROID_KHR + {"vkCreateAndroidSurfaceKHR", reinterpret_cast<PFN_vkVoidFunction>(CreateAndroidSurfaceKHR)}, +#endif + }; + + for (size_t i = 0; i < ARRAY_SIZE(wsi_instance_commands); i++) { + if (!strcmp(wsi_instance_commands[i].name, name)) return wsi_instance_commands[i].proc; + } + + return nullptr; +} + +static PFN_vkVoidFunction intercept_extension_instance_command(const char *name, VkInstance instance) { + static const struct { + const char *name; + PFN_vkVoidFunction proc; + } extension_instance_commands[] = { + {"vkGetPhysicalDeviceFeatures2KHR", reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceFeatures2KHR)}, + {"vkGetPhysicalDeviceProperties2KHR", reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceProperties2KHR)}, + {"vkGetPhysicalDeviceFormatProperties2KHR", reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceFormatProperties2KHR)}, + {"vkGetPhysicalDeviceImageFormatProperties2KHR", + reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceImageFormatProperties2KHR)}, + {"vkGetPhysicalDeviceQueueFamilyProperties2KHR", + reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceQueueFamilyProperties2KHR)}, + {"vkGetPhysicalDeviceMemoryProperties2KHR", reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceMemoryProperties2KHR)}, + {"vkGetPhysicalDeviceSparseImageFormatProperties2KHR", + reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceSparseImageFormatProperties2KHR)}, + // KHX_device_group (physical device procs) + {"vkGetPhysicalDevicePresentRectanglesKHX", reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDevicePresentRectanglesKHX)}, + // KHX_device_group_creation + {"vkEnumeratePhysicalDeviceGroupsKHX", reinterpret_cast<PFN_vkVoidFunction>(EnumeratePhysicalDeviceGroupsKHX)}, + // KHX_external_memory_capabilities + {"vkGetPhysicalDeviceExternalBufferPropertiesKHX", + reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceExternalBufferPropertiesKHX)}, + {"vkGetPhysicalDeviceProperties2KHX", reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceProperties2KHX)}, + {"vkGetPhysicalDeviceImageFormatProperties2KHX", + reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceImageFormatProperties2KHX)}, + // KHX_external_semaphore_capabilities + {"vkGetPhysicalDeviceExternalSemaphorePropertiesKHX", + reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceExternalSemaphorePropertiesKHX)}, + // NV_external_memory_capabilities + {"vkGetPhysicalDeviceExternalImageFormatPropertiesNV", + reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceExternalImageFormatPropertiesNV)}, + // NVX_device_generated_commands + {"vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX", + reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceGeneratedCommandsPropertiesNVX)}, + }; + + for (size_t i = 0; i < ARRAY_SIZE(extension_instance_commands); i++) { + if (!strcmp(extension_instance_commands[i].name, name)) return extension_instance_commands[i].proc; + } + + return nullptr; +} + +static PFN_vkVoidFunction intercept_extension_device_command(const char *name, VkDevice device) { + struct ExtProc { + const char *name; + PFN_vkVoidFunction proc; + } extension_device_commands[] = { + // KHR_maintenance1 + {"vkTrimCommandPoolKHR", reinterpret_cast<PFN_vkVoidFunction>(TrimCommandPoolKHR)}, + // KHR_push_descriptor + {"vkCmdPushDescriptorSetKHR", reinterpret_cast<PFN_vkVoidFunction>(CmdPushDescriptorSetKHR)}, + // KHR_descriptor_update_template + {"vkCreateDescriptorUpdateTemplateKHR", reinterpret_cast<PFN_vkVoidFunction>(CreateDescriptorUpdateTemplateKHR)}, + {"vkDestroyDescriptorUpdateTemplateKHR", reinterpret_cast<PFN_vkVoidFunction>(DestroyDescriptorUpdateTemplateKHR)}, + {"vkUpdateDescriptorSetWithTemplateKHR", reinterpret_cast<PFN_vkVoidFunction>(UpdateDescriptorSetWithTemplateKHR)}, + {"vkCmdPushDescriptorSetWithTemplateKHR", reinterpret_cast<PFN_vkVoidFunction>(CmdPushDescriptorSetWithTemplateKHR)}, + // KHX_device_group + {"vkGetDeviceGroupPeerMemoryFeaturesKHX", reinterpret_cast<PFN_vkVoidFunction>(GetDeviceGroupPeerMemoryFeaturesKHX)}, + {"vkBindBufferMemory2KHX", reinterpret_cast<PFN_vkVoidFunction>(BindBufferMemory2KHX)}, + {"vkBindImageMemory2KHX", reinterpret_cast<PFN_vkVoidFunction>(BindImageMemory2KHX)}, + // Nothing to validate: {"vkCmdSetDeviceMaskKHX", reinterpret_cast<PFN_vkVoidFunction>(vkCmdSetDeviceMaskKHX) }, + {"vkGetDeviceGroupPresentCapabilitiesKHX", reinterpret_cast<PFN_vkVoidFunction>(GetDeviceGroupPresentCapabilitiesKHX)}, + {"vkGetDeviceGroupSurfacePresentModesKHX", reinterpret_cast<PFN_vkVoidFunction>(GetDeviceGroupSurfacePresentModesKHX)}, + {"vkAcquireNextImage2KHX", reinterpret_cast<PFN_vkVoidFunction>(AcquireNextImage2KHX)}, + {"vkCmdDispatchBaseKHX", reinterpret_cast<PFN_vkVoidFunction>(CmdDispatchBaseKHX)}, + // KHX_external_memory_fd + {"vkGetMemoryFdKHX", reinterpret_cast<PFN_vkVoidFunction>(GetMemoryFdKHX)}, + {"vkGetMemoryFdPropertiesKHX", reinterpret_cast<PFN_vkVoidFunction>(GetMemoryFdPropertiesKHX)}, + // KHX_external_semaphore_fd + {"vkImportSemaphoreFdKHX", reinterpret_cast<PFN_vkVoidFunction>(ImportSemaphoreFdKHX)}, + {"vkGetSemaphoreFdKHX", reinterpret_cast<PFN_vkVoidFunction>(GetSemaphoreFdKHX)}, +#ifdef VK_USE_PLATFORM_WIN32_KHR + // KHX_external_memory_win32 + {"vkGetMemoryWin32HandleKHX", reinterpret_cast<PFN_vkVoidFunction>(GetMemoryWin32HandleKHX)}, + {"vkGetMemoryWin32HandlePropertiesKHX", reinterpret_cast<PFN_vkVoidFunction>(GetMemoryWin32HandlePropertiesKHX)}, + // KHX_external_semaphore_win32 + {"vkImportSemaphoreWin32HandleKHX", reinterpret_cast<PFN_vkVoidFunction>(ImportSemaphoreWin32HandleKHX)}, + {"vkGetSemaphoreWin32HandleKHX", reinterpret_cast<PFN_vkVoidFunction>(GetSemaphoreWin32HandleKHX)}, +#endif // VK_USE_PLATFORM_WIN32_KHR + // EXT_debug_marker + {"vkDebugMarkerSetObjectTagEXT", reinterpret_cast<PFN_vkVoidFunction>(DebugMarkerSetObjectTagEXT)}, + {"vkDebugMarkerSetObjectNameEXT", reinterpret_cast<PFN_vkVoidFunction>(DebugMarkerSetObjectNameEXT)}, + {"vkCmdDebugMarkerBeginEXT", reinterpret_cast<PFN_vkVoidFunction>(CmdDebugMarkerBeginEXT)}, + {"vkCmdDebugMarkerInsertEXT", reinterpret_cast<PFN_vkVoidFunction>(CmdDebugMarkerInsertEXT)}, + // VK_EXT_discard_rectangles + {"vkCmdSetDiscardRectangleEXT", reinterpret_cast<PFN_vkVoidFunction>(CmdSetDiscardRectangleEXT)}, + // EXT_display_control + {"vkDisplayPowerControlEXT", reinterpret_cast<PFN_vkVoidFunction>(DisplayPowerControlEXT)}, + {"vkRegisterDeviceEventEXT", reinterpret_cast<PFN_vkVoidFunction>(RegisterDeviceEventEXT)}, + {"vkRegisterDisplayEventEXT", reinterpret_cast<PFN_vkVoidFunction>(RegisterDisplayEventEXT)}, + {"vkGetSwapchainCounterEXT", reinterpret_cast<PFN_vkVoidFunction>(GetSwapchainCounterEXT)}, + // AMD_draw_indirect_count extension + {"vkCmdDrawIndirectCountAMD", reinterpret_cast<PFN_vkVoidFunction>(CmdDrawIndirectCountAMD)}, + {"vkCmdDrawIndexedIndirectCountAMD", reinterpret_cast<PFN_vkVoidFunction>(CmdDrawIndexedIndirectCountAMD)}, + // VK_NV_clip_space_w_scaling extension + {"vkCmdSetViewportWScalingNV", reinterpret_cast<PFN_vkVoidFunction>(CmdSetViewportWScalingNV)}, +#ifdef VK_USE_PLATFORM_WIN32_KHR + // NV_external_memory_win32 + {"vkGetMemoryWin32HandleNV", reinterpret_cast<PFN_vkVoidFunction>(GetMemoryWin32HandleNV)}, +#endif // VK_USE_PLATFORM_WIN32_KHR + // NVX_device_generated_commands + {"vkCmdProcessCommandsNVX", reinterpret_cast<PFN_vkVoidFunction>(CmdProcessCommandsNVX)}, + {"vkCmdReserveSpaceForCommandsNVX", reinterpret_cast<PFN_vkVoidFunction>(CmdReserveSpaceForCommandsNVX)}, + {"vkCreateIndirectCommandsLayoutNVX", reinterpret_cast<PFN_vkVoidFunction>(CreateIndirectCommandsLayoutNVX)}, + {"vkDestroyIndirectCommandsLayoutNVX", reinterpret_cast<PFN_vkVoidFunction>(DestroyIndirectCommandsLayoutNVX)}, + {"vkCreateObjectTableNVX", reinterpret_cast<PFN_vkVoidFunction>(CreateObjectTableNVX)}, + {"vkDestroyObjectTableNVX", reinterpret_cast<PFN_vkVoidFunction>(DestroyObjectTableNVX)}, + {"vkRegisterObjectsNVX", reinterpret_cast<PFN_vkVoidFunction>(RegisterObjectsNVX)}, + {"vkUnregisterObjectsNVX", reinterpret_cast<PFN_vkVoidFunction>(UnregisterObjectsNVX)}, + }; + + if (device) { + for (size_t i = 0; i < ARRAY_SIZE(extension_device_commands); i++) { + if (!strcmp(extension_device_commands[i].name, name)) return extension_device_commands[i].proc; + } + } - if (!pdev_data->dispatch_table.GetPhysicalDeviceProcAddr) return nullptr; - return pdev_data->dispatch_table.GetPhysicalDeviceProcAddr(instance, funcName); + return nullptr; } } // namespace parameter_validation diff --git a/layers/parameter_validation_utils.h b/layers/parameter_validation_utils.h index e3197b64..842268f0 100644 --- a/layers/parameter_validation_utils.h +++ b/layers/parameter_validation_utils.h @@ -82,6 +82,10 @@ struct instance_extension_enables { bool win32_enabled; bool display_enabled; bool khr_get_phys_dev_properties2_enabled; + bool khx_device_group_creation_enabled; + bool khx_external_fence_capabilities_enabled; + bool khx_external_memory_capabilities_enabled; + bool khx_external_semaphore_capabilities_enabled; bool ext_acquire_xlib_display_enabled; bool ext_direct_mode_display_enabled; bool ext_display_surface_counter_enabled; diff --git a/layers/threading.h b/layers/threading.h index acec7cd5..426f6c10 100644 --- a/layers/threading.h +++ b/layers/threading.h @@ -252,6 +252,7 @@ struct layer_data { counter<VkDisplayModeKHR> c_VkDisplayModeKHR; counter<VkSurfaceKHR> c_VkSurfaceKHR; counter<VkSwapchainKHR> c_VkSwapchainKHR; + counter<VkDescriptorUpdateTemplateKHR> c_VkDescriptorUpdateTemplateKHR; #else // DISTINCT_NONDISPATCHABLE_HANDLES counter<uint64_t> c_uint64_t; #endif // DISTINCT_NONDISPATCHABLE_HANDLES @@ -292,7 +293,9 @@ struct layer_data { c_VkDisplayKHR("VkDisplayKHR", VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT), c_VkDisplayModeKHR("VkDisplayModeKHR", VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT), c_VkSurfaceKHR("VkSurfaceKHR", VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT), - c_VkSwapchainKHR("VkSwapchainKHR", VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT) + c_VkSwapchainKHR("VkSwapchainKHR", VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT), + // TODO: Add proper structure for VkDescriptorUpdateTemplateKHR + c_VkDescriptorUpdateTemplateKHR("VkDescriptorUpdateTemplateKHR", VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT) #else // DISTINCT_NONDISPATCHABLE_HANDLES c_uint64_t("NON_DISPATCHABLE_HANDLE", VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT) #endif // DISTINCT_NONDISPATCHABLE_HANDLES @@ -340,6 +343,7 @@ WRAPPER(VkDisplayKHR) WRAPPER(VkDisplayModeKHR) WRAPPER(VkSurfaceKHR) WRAPPER(VkSwapchainKHR) +WRAPPER(VkDescriptorUpdateTemplateKHR) #else // DISTINCT_NONDISPATCHABLE_HANDLES WRAPPER(uint64_t) #endif // DISTINCT_NONDISPATCHABLE_HANDLES diff --git a/layers/unique_objects.cpp b/layers/unique_objects.cpp index 560daffc..ea02869f 100644 --- a/layers/unique_objects.cpp +++ b/layers/unique_objects.cpp @@ -273,6 +273,9 @@ static inline PFN_vkVoidFunction layer_intercept_proc(const char *name) { if (0 == strcmp(name, "vk_layerGetPhysicalDeviceProcAddr")) { return (PFN_vkVoidFunction)GetPhysicalDeviceProcAddr; } + if (0 == strcmp(name, "vk_layerGetPhysicalDeviceProcAddr")) { + return (PFN_vkVoidFunction)GetPhysicalDeviceProcAddr; + } return NULL; } diff --git a/layers/windows/VkLayer_core_validation.json b/layers/windows/VkLayer_core_validation.json index 9d68dddb..9af363e2 100644 --- a/layers/windows/VkLayer_core_validation.json +++ b/layers/windows/VkLayer_core_validation.json @@ -4,7 +4,7 @@ "name": "VK_LAYER_LUNARG_core_validation", "type": "GLOBAL", "library_path": ".\\VkLayer_core_validation.dll", - "api_version": "1.0.41", + "api_version": "1.0.42", "implementation_version": "1", "description": "LunarG Validation Layer", "instance_extensions": [ diff --git a/layers/windows/VkLayer_object_tracker.json b/layers/windows/VkLayer_object_tracker.json index 750e051a..c63f1b7e 100644 --- a/layers/windows/VkLayer_object_tracker.json +++ b/layers/windows/VkLayer_object_tracker.json @@ -4,7 +4,7 @@ "name": "VK_LAYER_LUNARG_object_tracker", "type": "GLOBAL", "library_path": ".\\VkLayer_object_tracker.dll", - "api_version": "1.0.41", + "api_version": "1.0.42", "implementation_version": "1", "description": "LunarG Validation Layer", "instance_extensions": [ diff --git a/layers/windows/VkLayer_parameter_validation.json b/layers/windows/VkLayer_parameter_validation.json index a348013d..9df8ccde 100644 --- a/layers/windows/VkLayer_parameter_validation.json +++ b/layers/windows/VkLayer_parameter_validation.json @@ -4,7 +4,7 @@ "name": "VK_LAYER_LUNARG_parameter_validation", "type": "GLOBAL", "library_path": ".\\VkLayer_parameter_validation.dll", - "api_version": "1.0.41", + "api_version": "1.0.42", "implementation_version": "1", "description": "LunarG Validation Layer", "instance_extensions": [ diff --git a/layers/windows/VkLayer_swapchain.json b/layers/windows/VkLayer_swapchain.json index ee28425e..c76e201d 100644 --- a/layers/windows/VkLayer_swapchain.json +++ b/layers/windows/VkLayer_swapchain.json @@ -4,7 +4,7 @@ "name": "VK_LAYER_LUNARG_swapchain", "type": "GLOBAL", "library_path": ".\\VkLayer_swapchain.dll", - "api_version": "1.0.41", + "api_version": "1.0.42", "implementation_version": "1", "description": "LunarG Validation Layer", "instance_extensions": [ diff --git a/layers/windows/VkLayer_threading.json b/layers/windows/VkLayer_threading.json index 24eac6da..756c7ddf 100644 --- a/layers/windows/VkLayer_threading.json +++ b/layers/windows/VkLayer_threading.json @@ -4,7 +4,7 @@ "name": "VK_LAYER_GOOGLE_threading", "type": "GLOBAL", "library_path": ".\\VkLayer_threading.dll", - "api_version": "1.0.41", + "api_version": "1.0.42", "implementation_version": "1", "description": "Google Validation Layer", "instance_extensions": [ diff --git a/layers/windows/VkLayer_unique_objects.json b/layers/windows/VkLayer_unique_objects.json index 41b372b0..b6eaa5ae 100644 --- a/layers/windows/VkLayer_unique_objects.json +++ b/layers/windows/VkLayer_unique_objects.json @@ -4,7 +4,7 @@ "name": "VK_LAYER_GOOGLE_unique_objects", "type": "GLOBAL", "library_path": ".\\VkLayer_unique_objects.dll", - "api_version": "1.0.41", + "api_version": "1.0.42", "implementation_version": "1", "description": "Google Validation Layer" } diff --git a/loader/CMakeLists.txt b/loader/CMakeLists.txt index 05bbfbf5..d4abafff 100644 --- a/loader/CMakeLists.txt +++ b/loader/CMakeLists.txt @@ -1,7 +1,10 @@ include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_PROJECT_BINARY_DIR} + ${CMAKE_BINARY_DIR} ) + if(CMAKE_SYSTEM_NAME STREQUAL "Windows") add_definitions(-DVK_USE_PLATFORM_WIN32_KHR -DWIN32_LEAN_AND_MEAN) set(DisplayServer Win32) @@ -47,11 +50,8 @@ set(NORMAL_LOADER_SRCS trampoline.c wsi.c wsi.h - extensions.c - extensions.h debug_report.c debug_report.h - table_ops.h gpa_helper.h cJSON.c cJSON.h @@ -59,14 +59,14 @@ set(NORMAL_LOADER_SRCS murmurhash.h ) -set (OPT_LOADER_SRCS +set(OPT_LOADER_SRCS dev_ext_trampoline.c phys_dev_ext.c ) -set (LOADER_SRCS ${NORMAL_LOADER_SRCS} ${OPT_LOADER_SRCS}) add_definitions(-DAPI_NAME="${API_NAME}") + if (WIN32) # Use static MSVCRT libraries foreach(configuration in CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO @@ -85,8 +85,12 @@ if (WIN32) separate_arguments(LOCAL_C_FLAGS_REL WINDOWS_COMMAND ${CMAKE_C_FLAGS_RELEASE}) add_library(loader-norm OBJECT ${NORMAL_LOADER_SRCS} dirent_on_windows.c) + add_dependencies(loader-norm generate_helper_files) + target_compile_options(loader-norm PUBLIC "$<$<CONFIG:DEBUG>:${LOCAL_C_FLAGS_DBG}>") add_library(loader-opt OBJECT ${OPT_LOADER_SRCS}) + add_dependencies(loader-opt generate_helper_files) + target_compile_options(loader-opt PUBLIC "$<$<CONFIG:DEBUG>:${LOCAL_C_FLAGS_REL}>") add_library(${API_LOWERCASE}-${MAJOR} SHARED $<TARGET_OBJECTS:loader-opt> $<TARGET_OBJECTS:loader-norm> ${CMAKE_CURRENT_BINARY_DIR}/${API_LOWERCASE}-${MAJOR}.def ${CMAKE_CURRENT_SOURCE_DIR}/loader.rc) add_library(VKstatic.${MAJOR} STATIC $<TARGET_OBJECTS:loader-opt> $<TARGET_OBJECTS:loader-norm>) @@ -94,6 +98,8 @@ if (WIN32) set_target_properties(${API_LOWERCASE}-${MAJOR} PROPERTIES LINK_FLAGS_DEBUG /ignore:4098) set_target_properties(VKstatic.${MAJOR} PROPERTIES OUTPUT_NAME VKstatic.${MAJOR}) target_link_libraries(${API_LOWERCASE}-${MAJOR} shlwapi) + add_dependencies(${API_LOWERCASE}-${MAJOR} generate_helper_files) + target_link_libraries(VKstatic.${MAJOR} shlwapi) if (CMAKE_GENERATOR MATCHES "^Visual Studio.*") file(TO_NATIVE_PATH ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>/${API_LOWERCASE}-${MAJOR}.dll COPY_SRC_PATH) @@ -112,8 +118,10 @@ if (WIN32) else() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wpointer-arith") - add_library(${API_LOWERCASE} SHARED ${LOADER_SRCS}) - set_target_properties(${API_LOWERCASE} PROPERTIES SOVERSION "1" VERSION "1.0.41") + add_library(${API_LOWERCASE} SHARED ${NORMAL_LOADER_SRCS} ${OPT_LOADER_SRCS}) + add_dependencies(${API_LOWERCASE} generate_helper_files) + set_target_properties(${API_LOWERCASE} PROPERTIES SOVERSION "1" VERSION "1.0.42") target_link_libraries(${API_LOWERCASE} -ldl -lpthread -lm) + install(TARGETS ${API_LOWERCASE} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() diff --git a/loader/debug_report.c b/loader/debug_report.c index bd46282a..04e55ccf 100644 --- a/loader/debug_report.c +++ b/loader/debug_report.c @@ -272,15 +272,12 @@ static VKAPI_ATTR void VKAPI_CALL debug_report_DebugReportMessageEXT(VkInstance inst->disp->layer_inst_disp.DebugReportMessageEXT(instance, flags, objType, object, location, msgCode, pLayerPrefix, pMsg); } -/* - * This is the instance chain terminator function - * for CreateDebugReportCallback - */ - -VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDebugReportCallback(VkInstance instance, - const VkDebugReportCallbackCreateInfoEXT *pCreateInfo, - const VkAllocationCallbacks *pAllocator, - VkDebugReportCallbackEXT *pCallback) { +// This is the instance chain terminator function +// for CreateDebugReportCallback +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDebugReportCallbackEXT(VkInstance instance, + const VkDebugReportCallbackCreateInfoEXT *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkDebugReportCallbackEXT *pCallback) { VkDebugReportCallbackEXT *icd_info = NULL; const struct loader_icd_term *icd_term; struct loader_instance *inst = (struct loader_instance *)instance; @@ -309,11 +306,11 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDebugReportCallback(VkInstance i storage_idx = 0; for (icd_term = inst->icd_terms; icd_term; icd_term = icd_term->next) { - if (!icd_term->CreateDebugReportCallbackEXT) { + if (!icd_term->dispatch.CreateDebugReportCallbackEXT) { continue; } - res = icd_term->CreateDebugReportCallbackEXT(icd_term->instance, pCreateInfo, pAllocator, &icd_info[storage_idx]); + res = icd_term->dispatch.CreateDebugReportCallbackEXT(icd_term->instance, pCreateInfo, pAllocator, &icd_info[storage_idx]); if (res != VK_SUCCESS) { goto out; @@ -356,12 +353,12 @@ out: if (VK_SUCCESS != res) { storage_idx = 0; for (icd_term = inst->icd_terms; icd_term; icd_term = icd_term->next) { - if (NULL == icd_term->DestroyDebugReportCallbackEXT) { + if (NULL == icd_term->dispatch.DestroyDebugReportCallbackEXT) { continue; } if (icd_info && icd_info[storage_idx]) { - icd_term->DestroyDebugReportCallbackEXT(icd_term->instance, icd_info[storage_idx], pAllocator); + icd_term->dispatch.DestroyDebugReportCallbackEXT(icd_term->instance, icd_info[storage_idx], pAllocator); } storage_idx++; } @@ -390,12 +387,9 @@ out: return res; } -/* - * This is the instance chain terminator function - * for DestroyDebugReportCallback - */ -VKAPI_ATTR void VKAPI_CALL terminator_DestroyDebugReportCallback(VkInstance instance, VkDebugReportCallbackEXT callback, - const VkAllocationCallbacks *pAllocator) { +// This is the instance chain terminator function for DestroyDebugReportCallback +VKAPI_ATTR void VKAPI_CALL terminator_DestroyDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackEXT callback, + const VkAllocationCallbacks *pAllocator) { uint32_t storage_idx; VkDebugReportCallbackEXT *icd_info; const struct loader_icd_term *icd_term; @@ -404,12 +398,12 @@ VKAPI_ATTR void VKAPI_CALL terminator_DestroyDebugReportCallback(VkInstance inst icd_info = *(VkDebugReportCallbackEXT **)&callback; storage_idx = 0; for (icd_term = inst->icd_terms; icd_term; icd_term = icd_term->next) { - if (NULL == icd_term->DestroyDebugReportCallbackEXT) { + if (NULL == icd_term->dispatch.DestroyDebugReportCallbackEXT) { continue; } if (icd_info[storage_idx]) { - icd_term->DestroyDebugReportCallbackEXT(icd_term->instance, icd_info[storage_idx], pAllocator); + icd_term->dispatch.DestroyDebugReportCallbackEXT(icd_term->instance, icd_info[storage_idx], pAllocator); } storage_idx++; } @@ -425,29 +419,24 @@ VKAPI_ATTR void VKAPI_CALL terminator_DestroyDebugReportCallback(VkInstance inst } } -/* - * This is the instance chain terminator function - * for DebugReportMessage - */ -VKAPI_ATTR void VKAPI_CALL terminator_DebugReportMessage(VkInstance instance, VkDebugReportFlagsEXT flags, - VkDebugReportObjectTypeEXT objType, uint64_t object, size_t location, - int32_t msgCode, const char *pLayerPrefix, const char *pMsg) { +// This is the instance chain terminator function for DebugReportMessage +VKAPI_ATTR void VKAPI_CALL terminator_DebugReportMessageEXT(VkInstance instance, VkDebugReportFlagsEXT flags, + VkDebugReportObjectTypeEXT objType, uint64_t object, size_t location, + int32_t msgCode, const char *pLayerPrefix, const char *pMsg) { const struct loader_icd_term *icd_term; struct loader_instance *inst = (struct loader_instance *)instance; loader_platform_thread_lock_mutex(&loader_lock); for (icd_term = inst->icd_terms; icd_term; icd_term = icd_term->next) { - if (icd_term->DebugReportMessageEXT != NULL) { - icd_term->DebugReportMessageEXT(icd_term->instance, flags, objType, object, location, msgCode, pLayerPrefix, pMsg); + if (icd_term->dispatch.DebugReportMessageEXT != NULL) { + icd_term->dispatch.DebugReportMessageEXT(icd_term->instance, flags, objType, object, location, msgCode, pLayerPrefix, + pMsg); } } - /* - * Now that all ICDs have seen the message, call the necessary callbacks. - * Ignoring "bail" return value as there is nothing to bail from at this - * point. - */ + // Now that all ICDs have seen the message, call the necessary callbacks. Ignoring "bail" return value + // as there is nothing to bail from at this point. util_DebugReportMessage(inst, flags, objType, object, location, msgCode, pLayerPrefix, pMsg); diff --git a/loader/debug_report.h b/loader/debug_report.h index 425811f2..89074d7f 100644 --- a/loader/debug_report.h +++ b/loader/debug_report.h @@ -23,82 +23,81 @@ #include "vk_loader_platform.h" #include "loader.h" -/* - * CreateMsgCallback is global and needs to be - * applied to all layers and ICDs. - * What happens if a layer is enabled on both the instance chain - * as well as the device chain and a call to CreateMsgCallback is made? - * Do we need to make sure that each layer / driver only gets called once? - * Should a layer implementing support for CreateMsgCallback only be allowed (?) - * to live on one chain? Or maybe make it the application's responsibility. - * If the app enables DRAW_STATE on at both CreateInstance time and CreateDevice - * time, CreateMsgCallback will call the DRAW_STATE layer twice. Once via - * the instance chain and once via the device chain. - * The loader should only return the DEBUG_REPORT extension as supported - * for the GetGlobalExtensionSupport call. That should help eliminate one - * duplication. - * Since the instance chain requires us iterating over the available ICDs - * and each ICD will have it's own unique MsgCallback object we need to - * track those objects to give back the right one. - * This also implies that the loader has to intercept vkDestroyObject and - * if the extension is enabled and the object type is a MsgCallback then - * we must translate the object into the proper ICD specific ones. - * DestroyObject works on a device chain. Should not be what's destroying - * the MsgCallback object. That needs to be an instance thing. So, since - * we used an instance to create it, we need a custom Destroy that also - * takes an instance. That way we can iterate over the ICDs properly. - * Example use: - * CreateInstance: DEBUG_REPORT - * Loader will create instance chain with enabled extensions. - * TODO: Should validation layers be enabled here? If not, they will not be in - * the instance chain. - * fn = GetProcAddr(INSTANCE, "vkCreateMsgCallback") -> point to loader's - * vkCreateMsgCallback - * App creates a callback object: fn(..., &MsgCallbackObject1) - * Have only established the instance chain so far. Loader will call the - * instance chain. - * Each layer in the instance chain will call down to the next layer, - * terminating with - * the CreateMsgCallback loader terminator function that creates the actual - * MsgCallbackObject1 object. - * The loader CreateMsgCallback terminator will iterate over the ICDs. - * Calling each ICD that supports vkCreateMsgCallback and collect answers in - * icd_msg_callback_map here. - * As result is sent back up the chain each layer has opportunity to record the - * callback operation and - * appropriate MsgCallback object. - * ... - * Any reports matching the flags set in MsgCallbackObject1 will generate the - * defined callback behavior - * in the layer / ICD that initiated that report. - * ... - * CreateDevice: MemTracker:... - * App does not include DEBUG_REPORT as that is a global extension. - * TODO: GetExtensionSupport must not report DEBUG_REPORT when using instance. - * App MUST include any desired validation layers or they will not participate - * in the device call chain. - * App creates a callback object: fn(..., &MsgCallbackObject2) - * Loader's vkCreateMsgCallback is called. - * Loader sends call down instance chain - this is a global extension - any - * validation layer that was - * enabled at CreateInstance will be able to register the callback. Loader will - * iterate over the ICDs and - * will record the ICD's version of the MsgCallback2 object here. - * ... - * Any report will go to the layer's report function and it will check the flags - * for MsgCallbackObject1 - * and MsgCallbackObject2 and take the appropriate action as indicated by the - * app. - * ... - * App calls vkDestroyMsgCallback( MsgCallbackObject1 ) - * Loader's DestroyMsgCallback is where call starts. DestroyMsgCallback will be - * sent down instance chain - * ending in the loader's DestroyMsgCallback terminator which will iterate over - * the ICD's destroying each - * ICD version of that MsgCallback object and then destroy the loader's version - * of the object. - * Any reports generated after this will only have MsgCallbackObject2 available. - */ + +// CreateMsgCallback is global and needs to be +// applied to all layers and ICDs. +// What happens if a layer is enabled on both the instance chain +// as well as the device chain and a call to CreateMsgCallback is made? +// Do we need to make sure that each layer / driver only gets called once? +// Should a layer implementing support for CreateMsgCallback only be allowed (?) +// to live on one chain? Or maybe make it the application's responsibility. +// If the app enables DRAW_STATE on at both CreateInstance time and CreateDevice +// time, CreateMsgCallback will call the DRAW_STATE layer twice. Once via +// the instance chain and once via the device chain. +// The loader should only return the DEBUG_REPORT extension as supported +// for the GetGlobalExtensionSupport call. That should help eliminate one +// duplication. +// Since the instance chain requires us iterating over the available ICDs +// and each ICD will have it's own unique MsgCallback object we need to +// track those objects to give back the right one. +// This also implies that the loader has to intercept vkDestroyObject and +// if the extension is enabled and the object type is a MsgCallback then +// we must translate the object into the proper ICD specific ones. +// DestroyObject works on a device chain. Should not be what's destroying +// the MsgCallback object. That needs to be an instance thing. So, since +// we used an instance to create it, we need a custom Destroy that also +// takes an instance. That way we can iterate over the ICDs properly. +// Example use: +// CreateInstance: DEBUG_REPORT +// Loader will create instance chain with enabled extensions. +// TODO: Should validation layers be enabled here? If not, they will not be in +// the instance chain. +// fn = GetProcAddr(INSTANCE, "vkCreateMsgCallback") -> point to loader's +// vkCreateMsgCallback +// App creates a callback object: fn(..., &MsgCallbackObject1) +// Have only established the instance chain so far. Loader will call the +// instance chain. +// Each layer in the instance chain will call down to the next layer, +// terminating with +// the CreateMsgCallback loader terminator function that creates the actual +// MsgCallbackObject1 object. +// The loader CreateMsgCallback terminator will iterate over the ICDs. +// Calling each ICD that supports vkCreateMsgCallback and collect answers in +// icd_msg_callback_map here. +// As result is sent back up the chain each layer has opportunity to record the +// callback operation and +// appropriate MsgCallback object. +// ... +// Any reports matching the flags set in MsgCallbackObject1 will generate the +// defined callback behavior +// in the layer / ICD that initiated that report. +// ... +// CreateDevice: MemTracker:... +// App does not include DEBUG_REPORT as that is a global extension. +// TODO: GetExtensionSupport must not report DEBUG_REPORT when using instance. +// App MUST include any desired validation layers or they will not participate +// in the device call chain. +// App creates a callback object: fn(..., &MsgCallbackObject2) +// Loader's vkCreateMsgCallback is called. +// Loader sends call down instance chain - this is a global extension - any +// validation layer that was +// enabled at CreateInstance will be able to register the callback. Loader will +// iterate over the ICDs and +// will record the ICD's version of the MsgCallback2 object here. +// ... +// Any report will go to the layer's report function and it will check the flags +// for MsgCallbackObject1 +// and MsgCallbackObject2 and take the appropriate action as indicated by the +// app. +// ... +// App calls vkDestroyMsgCallback( MsgCallbackObject1 ) +// Loader's DestroyMsgCallback is where call starts. DestroyMsgCallback will be +// sent down instance chain +// ending in the loader's DestroyMsgCallback terminator which will iterate over +// the ICD's destroying each +// ICD version of that MsgCallback object and then destroy the loader's version +// of the object. +// Any reports generated after this will only have MsgCallbackObject2 available. void debug_report_add_instance_extensions(const struct loader_instance *inst, struct loader_extension_list *ext_list); @@ -106,17 +105,17 @@ void debug_report_create_instance(struct loader_instance *ptr_instance, const Vk bool debug_report_instance_gpa(struct loader_instance *ptr_instance, const char *name, void **addr); -VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDebugReportCallback(VkInstance instance, - const VkDebugReportCallbackCreateInfoEXT *pCreateInfo, - const VkAllocationCallbacks *pAllocator, - VkDebugReportCallbackEXT *pCallback); +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDebugReportCallbackEXT(VkInstance instance, + const VkDebugReportCallbackCreateInfoEXT *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkDebugReportCallbackEXT *pCallback); -VKAPI_ATTR void VKAPI_CALL terminator_DestroyDebugReportCallback(VkInstance instance, VkDebugReportCallbackEXT callback, - const VkAllocationCallbacks *pAllocator); +VKAPI_ATTR void VKAPI_CALL terminator_DestroyDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackEXT callback, + const VkAllocationCallbacks *pAllocator); -VKAPI_ATTR void VKAPI_CALL terminator_DebugReportMessage(VkInstance instance, VkDebugReportFlagsEXT flags, - VkDebugReportObjectTypeEXT objType, uint64_t object, size_t location, - int32_t msgCode, const char *pLayerPrefix, const char *pMsg); +VKAPI_ATTR void VKAPI_CALL terminator_DebugReportMessageEXT(VkInstance instance, VkDebugReportFlagsEXT flags, + VkDebugReportObjectTypeEXT objType, uint64_t object, size_t location, + int32_t msgCode, const char *pLayerPrefix, const char *pMsg); VkResult util_CreateDebugReportCallback(struct loader_instance *inst, VkDebugReportCallbackCreateInfoEXT *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDebugReportCallbackEXT callback); diff --git a/loader/extensions.c b/loader/extensions.c deleted file mode 100644 index fb05809f..00000000 --- a/loader/extensions.c +++ /dev/null @@ -1,694 +0,0 @@ -/* - * Copyright (c) 2015-2016 The Khronos Group Inc. - * Copyright (c) 2015-2016 Valve Corporation - * Copyright (c) 2015-2016 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Author: Mark Lobodzinski <mark@lunarg.com> - */ - -#define _GNU_SOURCE -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include "vk_loader_platform.h" -#include "loader.h" -#include "extensions.h" -#include "table_ops.h" -#include <vulkan/vk_icd.h> -#include "wsi.h" - -// Definitions for the VK_KHR_get_physical_device_properties2 extension - -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFeatures2KHR(VkPhysicalDevice physicalDevice, - VkPhysicalDeviceFeatures2KHR *pFeatures) { - const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); - disp = loader_get_instance_layer_dispatch(physicalDevice); - disp->GetPhysicalDeviceFeatures2KHR(unwrapped_phys_dev, pFeatures); -} - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceFeatures2KHR(VkPhysicalDevice physicalDevice, - VkPhysicalDeviceFeatures2KHR *pFeatures) { - struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; - struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - if (NULL == icd_term->GetPhysicalDeviceFeatures2KHR) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "ICD associated with VkPhysicalDevice does not support " - "vkGetPhysicalDeviceFeatures2KHR"); - } - icd_term->GetPhysicalDeviceFeatures2KHR(phys_dev_term->phys_dev, pFeatures); -} - -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceProperties2KHR(VkPhysicalDevice physicalDevice, - VkPhysicalDeviceProperties2KHR *pProperties) { - const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); - disp = loader_get_instance_layer_dispatch(physicalDevice); - disp->GetPhysicalDeviceProperties2KHR(unwrapped_phys_dev, pProperties); -} - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceProperties2KHR(VkPhysicalDevice physicalDevice, - VkPhysicalDeviceProperties2KHR *pProperties) { - struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; - struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - if (NULL == icd_term->GetPhysicalDeviceProperties2KHR) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "ICD associated with VkPhysicalDevice does not support " - "vkGetPhysicalDeviceProperties2KHR"); - } - icd_term->GetPhysicalDeviceProperties2KHR(phys_dev_term->phys_dev, pProperties); -} - -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFormatProperties2KHR(VkPhysicalDevice physicalDevice, VkFormat format, - VkFormatProperties2KHR *pFormatProperties) { - const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); - disp = loader_get_instance_layer_dispatch(physicalDevice); - disp->GetPhysicalDeviceFormatProperties2KHR(unwrapped_phys_dev, format, pFormatProperties); -} - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceFormatProperties2KHR(VkPhysicalDevice physicalDevice, VkFormat format, - VkFormatProperties2KHR *pFormatProperties) { - struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; - struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - if (NULL == icd_term->GetPhysicalDeviceFormatProperties2KHR) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "ICD associated with VkPhysicalDevice does not support " - "vkGetPhysicalDeviceFormatProperties2KHR"); - } - icd_term->GetPhysicalDeviceFormatProperties2KHR(phys_dev_term->phys_dev, format, pFormatProperties); -} - -VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceImageFormatProperties2KHR( - VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2KHR *pImageFormatInfo, - VkImageFormatProperties2KHR *pImageFormatProperties) { - const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); - disp = loader_get_instance_layer_dispatch(physicalDevice); - return disp->GetPhysicalDeviceImageFormatProperties2KHR(unwrapped_phys_dev, pImageFormatInfo, pImageFormatProperties); -} - -VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceImageFormatProperties2KHR( - VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2KHR *pImageFormatInfo, - VkImageFormatProperties2KHR *pImageFormatProperties) { - struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; - struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - if (NULL == icd_term->GetPhysicalDeviceImageFormatProperties2KHR) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "ICD associated with VkPhysicalDevice does not support " - "vkGetPhysicalDeviceImageFormatProperties2KHR"); - } - return icd_term->GetPhysicalDeviceImageFormatProperties2KHR(phys_dev_term->phys_dev, pImageFormatInfo, pImageFormatProperties); -} - -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceQueueFamilyProperties2KHR(VkPhysicalDevice physicalDevice, - uint32_t *pQueueFamilyPropertyCount, - VkQueueFamilyProperties2KHR *pQueueFamilyProperties) { - const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); - disp = loader_get_instance_layer_dispatch(physicalDevice); - disp->GetPhysicalDeviceQueueFamilyProperties2KHR(unwrapped_phys_dev, pQueueFamilyPropertyCount, pQueueFamilyProperties); -} - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceQueueFamilyProperties2KHR( - VkPhysicalDevice physicalDevice, uint32_t *pQueueFamilyPropertyCount, VkQueueFamilyProperties2KHR *pQueueFamilyProperties) { - struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; - struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - if (NULL == icd_term->GetPhysicalDeviceQueueFamilyProperties2KHR) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "ICD associated with VkPhysicalDevice does not support " - "vkGetPhysicalDeviceQueueFamilyProperties2KHR"); - } - icd_term->GetPhysicalDeviceQueueFamilyProperties2KHR(phys_dev_term->phys_dev, pQueueFamilyPropertyCount, - pQueueFamilyProperties); -} - -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceMemoryProperties2KHR(VkPhysicalDevice physicalDevice, - VkPhysicalDeviceMemoryProperties2KHR *pMemoryProperties) { - const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); - disp = loader_get_instance_layer_dispatch(physicalDevice); - disp->GetPhysicalDeviceMemoryProperties2KHR(unwrapped_phys_dev, pMemoryProperties); -} -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceMemoryProperties2KHR( - VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2KHR *pMemoryProperties) { - struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; - struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - if (NULL == icd_term->GetPhysicalDeviceMemoryProperties2KHR) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "ICD associated with VkPhysicalDevice does not support " - "vkGetPhysicalDeviceMemoryProperties2KHR"); - } - icd_term->GetPhysicalDeviceMemoryProperties2KHR(phys_dev_term->phys_dev, pMemoryProperties); -} - -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceSparseImageFormatProperties2KHR( - VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2KHR *pFormatInfo, uint32_t *pPropertyCount, - VkSparseImageFormatProperties2KHR *pProperties) { - const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); - disp = loader_get_instance_layer_dispatch(physicalDevice); - disp->GetPhysicalDeviceSparseImageFormatProperties2KHR(unwrapped_phys_dev, pFormatInfo, pPropertyCount, pProperties); -} - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceSparseImageFormatProperties2KHR( - VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2KHR *pFormatInfo, uint32_t *pPropertyCount, - VkSparseImageFormatProperties2KHR *pProperties) { - struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; - struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - if (NULL == icd_term->GetPhysicalDeviceSparseImageFormatProperties2KHR) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "ICD associated with VkPhysicalDevice does not support " - "vkGetPhysicalDeviceSparseImageFormatProperties2KHR"); - } - icd_term->GetPhysicalDeviceSparseImageFormatProperties2KHR(phys_dev_term->phys_dev, pFormatInfo, pPropertyCount, pProperties); -} - -// Definitions for the VK_KHR_maintenance1 extension - -VKAPI_ATTR void VKAPI_CALL vkTrimCommandPoolKHR(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlagsKHR flags) { - const VkLayerDispatchTable *disp = loader_get_dispatch(device); - disp->TrimCommandPoolKHR(device, commandPool, flags); -} - -// Definitions for the VK_EXT_acquire_xlib_display extension - -#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT -VKAPI_ATTR VkResult VKAPI_CALL vkAcquireXlibDisplayEXT(VkPhysicalDevice physicalDevice, Display *dpy, VkDisplayKHR display) { - const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); - disp = loader_get_instance_layer_dispatch(physicalDevice); - return disp->AcquireXlibDisplayEXT(unwrapped_phys_dev, dpy, display); -} - -VKAPI_ATTR VkResult VKAPI_CALL terminator_AcquireXlibDisplayEXT(VkPhysicalDevice physicalDevice, Display *dpy, - VkDisplayKHR display) { - struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; - struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - if (NULL == icd_term->AcquireXlibDisplayEXT) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "ICD associated with VkPhysicalDevice does not support " - "vkAcquireXlibDisplayEXT"); - } - return icd_term->AcquireXlibDisplayEXT(phys_dev_term->phys_dev, dpy, display); -} - -VKAPI_ATTR VkResult VKAPI_CALL vkGetRandROutputDisplayEXT(VkPhysicalDevice physicalDevice, Display *dpy, RROutput rrOutput, - VkDisplayKHR *pDisplay) { - const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); - disp = loader_get_instance_layer_dispatch(physicalDevice); - return disp->GetRandROutputDisplayEXT(unwrapped_phys_dev, dpy, rrOutput, pDisplay); -} - -VKAPI_ATTR VkResult VKAPI_CALL terminator_GetRandROutputDisplayEXT(VkPhysicalDevice physicalDevice, Display *dpy, RROutput rrOutput, - VkDisplayKHR *pDisplay) { - struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; - struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - if (NULL == icd_term->GetRandROutputDisplayEXT) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "ICD associated with VkPhysicalDevice does not support " - "vkGetRandROutputDisplayEXT"); - } - return icd_term->GetRandROutputDisplayEXT(phys_dev_term->phys_dev, dpy, rrOutput, pDisplay); -} -#endif /* VK_USE_PLATFORM_XLIB_XRANDR_EXT */ - -// Definitions for the VK_EXT_debug_marker extension commands which -// need to have a terminator function - -VKAPI_ATTR VkResult VKAPI_CALL vkDebugMarkerSetObjectTagEXT(VkDevice device, VkDebugMarkerObjectTagInfoEXT *pTagInfo) { - const VkLayerDispatchTable *disp = loader_get_dispatch(device); - // If this is a physical device, we have to replace it with the proper one - // for the next call. - if (pTagInfo->objectType == VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT) { - struct loader_physical_device_tramp *phys_dev_tramp = (struct loader_physical_device_tramp *)(uintptr_t)pTagInfo->object; - pTagInfo->object = (uint64_t)(uintptr_t)phys_dev_tramp->phys_dev; - } - return disp->DebugMarkerSetObjectTagEXT(device, pTagInfo); -} - -VKAPI_ATTR VkResult VKAPI_CALL terminator_DebugMarkerSetObjectTagEXT(VkDevice device, VkDebugMarkerObjectTagInfoEXT *pTagInfo) { - uint32_t icd_index = 0; - struct loader_device *dev; - struct loader_icd_term *icd_term = loader_get_icd_and_device(device, &dev, &icd_index); - if (NULL != icd_term && NULL != icd_term->DebugMarkerSetObjectTagEXT) { - // If this is a physical device, we have to replace it with the proper - // one for the next call. - if (pTagInfo->objectType == VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT) { - struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)(uintptr_t)pTagInfo->object; - pTagInfo->object = (uint64_t)(uintptr_t)phys_dev_term->phys_dev; - - // If this is a KHR_surface, and the ICD has created its own, we - // have to replace it with the proper one for the next call. - } else if (pTagInfo->objectType == VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT) { - if (NULL != icd_term && NULL != icd_term->CreateSwapchainKHR) { - VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)pTagInfo->object; - if (NULL != icd_surface->real_icd_surfaces) { - pTagInfo->object = (uint64_t)icd_surface->real_icd_surfaces[icd_index]; - } - } - } - return icd_term->DebugMarkerSetObjectTagEXT(device, pTagInfo); - } else { - return VK_SUCCESS; - } -} - -VKAPI_ATTR VkResult VKAPI_CALL vkDebugMarkerSetObjectNameEXT(VkDevice device, VkDebugMarkerObjectNameInfoEXT *pNameInfo) { - const VkLayerDispatchTable *disp = loader_get_dispatch(device); - // If this is a physical device, we have to replace it with the proper one - // for the next call. - if (pNameInfo->objectType == VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT) { - struct loader_physical_device_tramp *phys_dev_tramp = (struct loader_physical_device_tramp *)(uintptr_t)pNameInfo->object; - pNameInfo->object = (uint64_t)(uintptr_t)phys_dev_tramp->phys_dev; - } - return disp->DebugMarkerSetObjectNameEXT(device, pNameInfo); -} - -VKAPI_ATTR VkResult VKAPI_CALL terminator_DebugMarkerSetObjectNameEXT(VkDevice device, VkDebugMarkerObjectNameInfoEXT *pNameInfo) { - uint32_t icd_index = 0; - struct loader_device *dev; - struct loader_icd_term *icd_term = loader_get_icd_and_device(device, &dev, &icd_index); - if (NULL != icd_term && NULL != icd_term->DebugMarkerSetObjectNameEXT) { - // If this is a physical device, we have to replace it with the proper - // one for the next call. - if (pNameInfo->objectType == VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT) { - struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)(uintptr_t)pNameInfo->object; - pNameInfo->object = (uint64_t)(uintptr_t)phys_dev_term->phys_dev; - - // If this is a KHR_surface, and the ICD has created its own, we - // have to replace it with the proper one for the next call. - } else if (pNameInfo->objectType == VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT) { - if (NULL != icd_term && NULL != icd_term->CreateSwapchainKHR) { - VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)pNameInfo->object; - if (NULL != icd_surface->real_icd_surfaces) { - pNameInfo->object = (uint64_t)(uintptr_t)icd_surface->real_icd_surfaces[icd_index]; - } - } - } - return icd_term->DebugMarkerSetObjectNameEXT(device, pNameInfo); - } else { - return VK_SUCCESS; - } -} - -// Definitions for the VK_EXT_direct_mode_display extension - -VKAPI_ATTR VkResult VKAPI_CALL vkReleaseDisplayEXT(VkPhysicalDevice physicalDevice, VkDisplayKHR display) { - const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); - disp = loader_get_instance_layer_dispatch(physicalDevice); - return disp->ReleaseDisplayEXT(unwrapped_phys_dev, display); -} - -VKAPI_ATTR VkResult VKAPI_CALL terminator_ReleaseDisplayEXT(VkPhysicalDevice physicalDevice, VkDisplayKHR display) { - struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; - struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - if (NULL == icd_term->ReleaseDisplayEXT) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "ICD associated with VkPhysicalDevice does not support " - "vkReleaseDisplayEXT"); - } - return icd_term->ReleaseDisplayEXT(phys_dev_term->phys_dev, display); -} - -// Definitions for the VK_EXT_display_surface_counter extension - -VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceCapabilities2EXT(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, - VkSurfaceCapabilities2EXT *pSurfaceCapabilities) { - const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); - disp = loader_get_instance_layer_dispatch(physicalDevice); - return disp->GetPhysicalDeviceSurfaceCapabilities2EXT(unwrapped_phys_dev, surface, pSurfaceCapabilities); -} - -VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfaceCapabilities2EXT( - VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilities2EXT *pSurfaceCapabilities) { - struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; - struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - if (NULL != icd_term) { - if (NULL == icd_term->GetPhysicalDeviceSurfaceCapabilities2EXT) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "ICD associated with VkPhysicalDevice does not support " - "vkGetPhysicalDeviceSurfaceCapabilities2EXT"); - } - VkIcdSurface *icd_surface = (VkIcdSurface *)(surface); - uint8_t icd_index = phys_dev_term->icd_index; - if (NULL != icd_surface->real_icd_surfaces) { - if (NULL != (void *)icd_surface->real_icd_surfaces[icd_index]) { - return icd_term->GetPhysicalDeviceSurfaceCapabilities2EXT( - phys_dev_term->phys_dev, icd_surface->real_icd_surfaces[icd_index], pSurfaceCapabilities); - } - } - } - return icd_term->GetPhysicalDeviceSurfaceCapabilities2EXT(phys_dev_term->phys_dev, surface, pSurfaceCapabilities); -} - -// Definitions for the VK_AMD_draw_indirect_count extension - -VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, - VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, - uint32_t stride) { - const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); - disp->CmdDrawIndirectCountAMD(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride); -} - -VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndexedIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, - VkBuffer countBuffer, VkDeviceSize countBufferOffset, - uint32_t maxDrawCount, uint32_t stride) { - const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); - disp->CmdDrawIndexedIndirectCountAMD(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride); -} - -// Definitions for the VK_NV_external_memory_capabilities extension - -VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceExternalImageFormatPropertiesNV( - VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, - VkImageCreateFlags flags, VkExternalMemoryHandleTypeFlagsNV externalHandleType, - VkExternalImageFormatPropertiesNV *pExternalImageFormatProperties) { - const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); - disp = loader_get_instance_layer_dispatch(physicalDevice); - - return disp->GetPhysicalDeviceExternalImageFormatPropertiesNV(unwrapped_phys_dev, format, type, tiling, usage, flags, - externalHandleType, pExternalImageFormatProperties); -} - -VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceExternalImageFormatPropertiesNV( - VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, - VkImageCreateFlags flags, VkExternalMemoryHandleTypeFlagsNV externalHandleType, - VkExternalImageFormatPropertiesNV *pExternalImageFormatProperties) { - struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; - struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - - if (!icd_term->GetPhysicalDeviceExternalImageFormatPropertiesNV) { - if (externalHandleType) { - return VK_ERROR_FORMAT_NOT_SUPPORTED; - } - - if (!icd_term->GetPhysicalDeviceImageFormatProperties) { - return VK_ERROR_INITIALIZATION_FAILED; - } - - pExternalImageFormatProperties->externalMemoryFeatures = 0; - pExternalImageFormatProperties->exportFromImportedHandleTypes = 0; - pExternalImageFormatProperties->compatibleHandleTypes = 0; - - return icd_term->GetPhysicalDeviceImageFormatProperties(phys_dev_term->phys_dev, format, type, tiling, usage, flags, - &pExternalImageFormatProperties->imageFormatProperties); - } - - return icd_term->GetPhysicalDeviceExternalImageFormatPropertiesNV(phys_dev_term->phys_dev, format, type, tiling, usage, flags, - externalHandleType, pExternalImageFormatProperties); -} - -#ifdef VK_USE_PLATFORM_WIN32_KHR - -// Definitions for the VK_NV_external_memory_win32 extension - -VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandleNV(VkDevice device, VkDeviceMemory memory, - VkExternalMemoryHandleTypeFlagsNV handleType, HANDLE *pHandle) { - const VkLayerDispatchTable *disp = loader_get_dispatch(device); - return disp->GetMemoryWin32HandleNV(device, memory, handleType, pHandle); -} - -#endif // VK_USE_PLATFORM_WIN32_KHR - -// Definitions for the VK_NVX_device_generated_commands - -VKAPI_ATTR void VKAPI_CALL vkCmdProcessCommandsNVX(VkCommandBuffer commandBuffer, - const VkCmdProcessCommandsInfoNVX *pProcessCommandsInfo) { - const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); - disp->CmdProcessCommandsNVX(commandBuffer, pProcessCommandsInfo); -} - -VKAPI_ATTR void VKAPI_CALL vkCmdReserveSpaceForCommandsNVX(VkCommandBuffer commandBuffer, - const VkCmdReserveSpaceForCommandsInfoNVX *pReserveSpaceInfo) { - const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); - disp->CmdReserveSpaceForCommandsNVX(commandBuffer, pReserveSpaceInfo); -} - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateIndirectCommandsLayoutNVX(VkDevice device, - const VkIndirectCommandsLayoutCreateInfoNVX *pCreateInfo, - const VkAllocationCallbacks *pAllocator, - VkIndirectCommandsLayoutNVX *pIndirectCommandsLayout) { - const VkLayerDispatchTable *disp = loader_get_dispatch(device); - return disp->CreateIndirectCommandsLayoutNVX(device, pCreateInfo, pAllocator, pIndirectCommandsLayout); -} - -VKAPI_ATTR void VKAPI_CALL vkDestroyIndirectCommandsLayoutNVX(VkDevice device, VkIndirectCommandsLayoutNVX indirectCommandsLayout, - const VkAllocationCallbacks *pAllocator) { - const VkLayerDispatchTable *disp = loader_get_dispatch(device); - disp->DestroyIndirectCommandsLayoutNVX(device, indirectCommandsLayout, pAllocator); -} - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateObjectTableNVX(VkDevice device, const VkObjectTableCreateInfoNVX *pCreateInfo, - const VkAllocationCallbacks *pAllocator, VkObjectTableNVX *pObjectTable) { - const VkLayerDispatchTable *disp = loader_get_dispatch(device); - return disp->CreateObjectTableNVX(device, pCreateInfo, pAllocator, pObjectTable); -} - -VKAPI_ATTR void VKAPI_CALL vkDestroyObjectTableNVX(VkDevice device, VkObjectTableNVX objectTable, - const VkAllocationCallbacks *pAllocator) { - const VkLayerDispatchTable *disp = loader_get_dispatch(device); - disp->DestroyObjectTableNVX(device, objectTable, pAllocator); -} - -VKAPI_ATTR VkResult VKAPI_CALL vkRegisterObjectsNVX(VkDevice device, VkObjectTableNVX objectTable, uint32_t objectCount, - const VkObjectTableEntryNVX *const *ppObjectTableEntries, - const uint32_t *pObjectIndices) { - const VkLayerDispatchTable *disp = loader_get_dispatch(device); - return disp->RegisterObjectsNVX(device, objectTable, objectCount, ppObjectTableEntries, pObjectIndices); -} - -VKAPI_ATTR VkResult VKAPI_CALL vkUnregisterObjectsNVX(VkDevice device, VkObjectTableNVX objectTable, uint32_t objectCount, - const VkObjectEntryTypeNVX *pObjectEntryTypes, - const uint32_t *pObjectIndices) { - const VkLayerDispatchTable *disp = loader_get_dispatch(device); - return disp->UnregisterObjectsNVX(device, objectTable, objectCount, pObjectEntryTypes, pObjectIndices); -} - -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX(VkPhysicalDevice physicalDevice, - VkDeviceGeneratedCommandsFeaturesNVX *pFeatures, - VkDeviceGeneratedCommandsLimitsNVX *pLimits) { - const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); - disp = loader_get_instance_layer_dispatch(physicalDevice); - disp->GetPhysicalDeviceGeneratedCommandsPropertiesNVX(unwrapped_phys_dev, pFeatures, pLimits); -} - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceGeneratedCommandsPropertiesNVX( - VkPhysicalDevice physicalDevice, VkDeviceGeneratedCommandsFeaturesNVX *pFeatures, VkDeviceGeneratedCommandsLimitsNVX *pLimits) { - struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; - struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - if (NULL == icd_term->GetPhysicalDeviceGeneratedCommandsPropertiesNVX) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "ICD associated with VkPhysicalDevice does not support " - "vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX"); - } else { - icd_term->GetPhysicalDeviceGeneratedCommandsPropertiesNVX(phys_dev_term->phys_dev, pFeatures, pLimits); - } -} - -// GPA helpers for extensions - -bool extension_instance_gpa(struct loader_instance *ptr_instance, const char *name, void **addr) { - *addr = NULL; - - // Functions for the VK_KHR_get_physical_device_properties2 extension - - if (!strcmp("vkGetPhysicalDeviceFeatures2KHR", name)) { - *addr = (ptr_instance->enabled_known_extensions.khr_get_physical_device_properties2 == 1) - ? (void *)vkGetPhysicalDeviceFeatures2KHR - : NULL; - return true; - } - if (!strcmp("vkGetPhysicalDeviceProperties2KHR", name)) { - *addr = (ptr_instance->enabled_known_extensions.khr_get_physical_device_properties2 == 1) - ? (void *)vkGetPhysicalDeviceProperties2KHR - : NULL; - return true; - } - if (!strcmp("vkGetPhysicalDeviceFormatProperties2KHR", name)) { - *addr = (ptr_instance->enabled_known_extensions.khr_get_physical_device_properties2 == 1) - ? (void *)vkGetPhysicalDeviceFormatProperties2KHR - : NULL; - return true; - } - if (!strcmp("vkGetPhysicalDeviceImageFormatProperties2KHR", name)) { - *addr = (ptr_instance->enabled_known_extensions.khr_get_physical_device_properties2 == 1) - ? (void *)vkGetPhysicalDeviceImageFormatProperties2KHR - : NULL; - return true; - } - if (!strcmp("vkGetPhysicalDeviceQueueFamilyProperties2KHR", name)) { - *addr = (ptr_instance->enabled_known_extensions.khr_get_physical_device_properties2 == 1) - ? (void *)vkGetPhysicalDeviceQueueFamilyProperties2KHR - : NULL; - return true; - } - if (!strcmp("vkGetPhysicalDeviceMemoryProperties2KHR", name)) { - *addr = (ptr_instance->enabled_known_extensions.khr_get_physical_device_properties2 == 1) - ? (void *)vkGetPhysicalDeviceMemoryProperties2KHR - : NULL; - return true; - } - if (!strcmp("vkGetPhysicalDeviceSparseImageFormatProperties2KHR", name)) { - *addr = (ptr_instance->enabled_known_extensions.khr_get_physical_device_properties2 == 1) - ? (void *)vkGetPhysicalDeviceSparseImageFormatProperties2KHR - : NULL; - return true; - } - - // Functions for the VK_KHR_maintenance1 extension - - if (!strcmp("vkTrimCommandPoolKHR", name)) { - *addr = (void *)vkTrimCommandPoolKHR; - return true; - } - -// Functions for the VK_EXT_acquire_xlib_display extension - -#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT - if (!strcmp("vkAcquireXlibDisplayEXT", name)) { - *addr = (ptr_instance->enabled_known_extensions.ext_acquire_xlib_display == 1) ? (void *)vkAcquireXlibDisplayEXT : NULL; - return true; - } - - if (!strcmp("vkGetRandROutputDisplayEXT", name)) { - *addr = (ptr_instance->enabled_known_extensions.ext_acquire_xlib_display == 1) ? (void *)vkGetRandROutputDisplayEXT : NULL; - return true; - } - -#endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT - - // Definitions for the VK_EXT_debug_marker extension commands which - // need to have a terminator function. Since these are device - // commands, we always need to return a valid value for them. - - if (!strcmp("vkDebugMarkerSetObjectTagEXT", name)) { - *addr = (void *)vkDebugMarkerSetObjectTagEXT; - return true; - } - if (!strcmp("vkDebugMarkerSetObjectNameEXT", name)) { - *addr = (void *)vkDebugMarkerSetObjectNameEXT; - return true; - } - - // Functions for the VK_EXT_direct_mode_display extension - - if (!strcmp("vkReleaseDisplayEXT", name)) { - *addr = (ptr_instance->enabled_known_extensions.ext_direct_mode_display == 1) ? (void *)vkReleaseDisplayEXT : NULL; - return true; - } - - // Functions for the VK_EXT_display_surface_counter extension - - if (!strcmp("vkGetPhysicalDeviceSurfaceCapabilities2EXT", name)) { - *addr = (ptr_instance->enabled_known_extensions.ext_display_surface_counter == 1) - ? (void *)vkGetPhysicalDeviceSurfaceCapabilities2EXT - : NULL; - return true; - } - - // Functions for the VK_AMD_draw_indirect_count extension - - if (!strcmp("vkCmdDrawIndirectCountAMD", name)) { - *addr = (void *)vkCmdDrawIndirectCountAMD; - return true; - } - if (!strcmp("vkCmdDrawIndexedIndirectCountAMD", name)) { - *addr = (void *)vkCmdDrawIndexedIndirectCountAMD; - return true; - } - // Functions for the VK_NV_external_memory_capabilities extension - - if (!strcmp("vkGetPhysicalDeviceExternalImageFormatPropertiesNV", name)) { - *addr = (ptr_instance->enabled_known_extensions.nv_external_memory_capabilities == 1) - ? (void *)vkGetPhysicalDeviceExternalImageFormatPropertiesNV - : NULL; - return true; - } - -#ifdef VK_USE_PLATFORM_WIN32_KHR - - // Functions for the VK_NV_external_memory_win32 extension - if (!strcmp("vkGetMemoryWin32HandleNV", name)) { - *addr = (void *)vkGetMemoryWin32HandleNV; - return true; - } - -#endif // VK_USE_PLATFORM_WIN32_KHR - - // Functions for the VK_NVX_device_generated_commands extension - - if (!strcmp("vkCmdProcessCommandsNVX", name)) { - *addr = (void *)vkCmdProcessCommandsNVX; - return true; - } - if (!strcmp("vkCmdReserveSpaceForCommandsNVX", name)) { - *addr = (void *)vkCmdReserveSpaceForCommandsNVX; - return true; - } - if (!strcmp("vkCreateIndirectCommandsLayoutNVX", name)) { - *addr = (void *)vkCreateIndirectCommandsLayoutNVX; - return true; - } - if (!strcmp("vkDestroyIndirectCommandsLayoutNVX", name)) { - *addr = (void *)vkDestroyIndirectCommandsLayoutNVX; - return true; - } - if (!strcmp("vkCreateObjectTableNVX", name)) { - *addr = (void *)vkCreateObjectTableNVX; - return true; - } - if (!strcmp("vkDestroyObjectTableNVX", name)) { - *addr = (void *)vkDestroyObjectTableNVX; - return true; - } - if (!strcmp("vkRegisterObjectsNVX", name)) { - *addr = (void *)vkRegisterObjectsNVX; - return true; - } - if (!strcmp("vkUnregisterObjectsNVX", name)) { - *addr = (void *)vkUnregisterObjectsNVX; - return true; - } - if (!strcmp("vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX", name)) { - *addr = (void *)vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX; - return true; - } - - return false; -} - -void extensions_create_instance(struct loader_instance *ptr_instance, const VkInstanceCreateInfo *pCreateInfo) { - for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) { - if (0 == strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME)) { - ptr_instance->enabled_known_extensions.khr_get_physical_device_properties2 = 1; -#ifdef VK_USE_PLATFORM_XLIB_KHR - } else if (0 == strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_EXT_ACQUIRE_XLIB_DISPLAY_EXTENSION_NAME)) { - ptr_instance->enabled_known_extensions.ext_acquire_xlib_display = 1; -#endif - } else if (0 == strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_EXT_DIRECT_MODE_DISPLAY_EXTENSION_NAME)) { - ptr_instance->enabled_known_extensions.ext_direct_mode_display = 1; - } else if (0 == strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_EXT_DISPLAY_SURFACE_COUNTER_EXTENSION_NAME)) { - ptr_instance->enabled_known_extensions.ext_display_surface_counter = 1; - } else if (0 == strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_NV_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME)) { - ptr_instance->enabled_known_extensions.nv_external_memory_capabilities = 1; - } - } -} diff --git a/loader/extensions.h b/loader/extensions.h deleted file mode 100644 index 5736f3ba..00000000 --- a/loader/extensions.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) 2015-2016 The Khronos Group Inc. - * Copyright (c) 2015-2016 Valve Corporation - * Copyright (c) 2015-2016 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Author: Mark Lobodzinski <mark@lunarg.com> - * - */ - -#include "vk_loader_platform.h" -#include "loader.h" - -bool extension_instance_gpa(struct loader_instance *ptr_instance, const char *name, void **addr); - -void extensions_create_instance(struct loader_instance *ptr_instance, const VkInstanceCreateInfo *pCreateInfo); - -// Instance extension terminators for the VK_KHR_get_physical_device_properties2 -// extension - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceFeatures2KHR(VkPhysicalDevice physicalDevice, - VkPhysicalDeviceFeatures2KHR *pFeatures); - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceProperties2KHR(VkPhysicalDevice physicalDevice, - VkPhysicalDeviceProperties2KHR *pProperties); - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceFormatProperties2KHR(VkPhysicalDevice physicalDevice, VkFormat format, - VkFormatProperties2KHR *pFormatProperties); - -VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceImageFormatProperties2KHR( - VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2KHR *pImageFormatInfo, - VkImageFormatProperties2KHR *pImageFormatProperties); - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceQueueFamilyProperties2KHR( - VkPhysicalDevice physicalDevice, uint32_t *pQueueFamilyPropertyCount, VkQueueFamilyProperties2KHR *pQueueFamilyProperties); - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceMemoryProperties2KHR( - VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2KHR *pMemoryProperties); - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceSparseImageFormatProperties2KHR( - VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2KHR *pFormatInfo, uint32_t *pPropertyCount, - VkSparseImageFormatProperties2KHR *pProperties); - -// Instance extension terminators for the VK_EXT_acquire_xlib_display -// extension - -#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT -VKAPI_ATTR VkResult VKAPI_CALL terminator_AcquireXlibDisplayEXT(VkPhysicalDevice physicalDevice, Display *dpy, - VkDisplayKHR display); - -VKAPI_ATTR VkResult VKAPI_CALL terminator_GetRandROutputDisplayEXT(VkPhysicalDevice physicalDevice, Display *dpy, RROutput rrOutput, - VkDisplayKHR *pDisplay); -#endif /* VK_USE_PLATFORM_XLIB_XRANDR_EXT */ - -// Instance extension terminators for the VK_EXT_direct_mode_display -// extension - -VKAPI_ATTR VkResult VKAPI_CALL terminator_ReleaseDisplayEXT(VkPhysicalDevice physicalDevice, VkDisplayKHR display); - -// Instance extension terminators for the VK_EXT_display_surface_counter -// extension - -VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfaceCapabilities2EXT(VkPhysicalDevice physicalDevice, - VkSurfaceKHR surface, - VkSurfaceCapabilities2EXT *pSurfaceCapabilities); - -// Device extension terminators for the VK_NV_external_memory_capabilities -// extension - -VKAPI_ATTR VkResult VKAPI_CALL terminator_DebugMarkerSetObjectTagEXT(VkDevice device, VkDebugMarkerObjectTagInfoEXT *pTagInfo); - -VKAPI_ATTR VkResult VKAPI_CALL terminator_DebugMarkerSetObjectNameEXT(VkDevice device, VkDebugMarkerObjectNameInfoEXT *pNameInfo); - -// Instance extension terminators for the VK_NV_external_memory_capabilities -// extension - -VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceExternalImageFormatPropertiesNV( - VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, - VkImageCreateFlags flags, VkExternalMemoryHandleTypeFlagsNV externalHandleType, - VkExternalImageFormatPropertiesNV *pExternalImageFormatProperties); - -// Instance extension terminators for the VK_NVX_device_generated_commands -// extension -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceGeneratedCommandsPropertiesNVX( - VkPhysicalDevice physicalDevice, VkDeviceGeneratedCommandsFeaturesNVX *pFeatures, VkDeviceGeneratedCommandsLimitsNVX *pLimits); diff --git a/loader/gpa_helper.h b/loader/gpa_helper.h index 93d60df9..0763938b 100644 --- a/loader/gpa_helper.h +++ b/loader/gpa_helper.h @@ -22,7 +22,6 @@ #include <string.h> #include "debug_report.h" #include "wsi.h" -#include "extensions.h" static inline void *trampolineGetProcAddr(struct loader_instance *inst, const char *funcName) { // Don't include or check global functions diff --git a/loader/loader.c b/loader/loader.c index 244b8dc8..4d6d168a 100644 --- a/loader/loader.c +++ b/loader/loader.c @@ -41,10 +41,8 @@ #include "vk_loader_platform.h" #include "loader.h" #include "gpa_helper.h" -#include "table_ops.h" #include "debug_report.h" #include "wsi.h" -#include "extensions.h" #include "vulkan/vk_icd.h" #include "cJSON.h" #include "murmurhash.h" @@ -55,6 +53,9 @@ #endif #endif +// Generated file containing all the extension data +#include "vk_loader_extensions.c" + struct loader_struct loader = {0}; // TLS for instance for alloc/free callbacks THREAD_LOCAL_DECL struct loader_instance *tls_instance; @@ -86,127 +87,6 @@ loader_platform_thread_mutex loader_json_lock; const char *std_validation_str = "VK_LAYER_LUNARG_standard_validation"; -// This table contains the loader's instance dispatch table, which contains -// default functions if no instance layers are activated. This contains -// pointers to "terminator functions". -const VkLayerInstanceDispatchTable instance_disp = { - .GetInstanceProcAddr = vkGetInstanceProcAddr, - .DestroyInstance = terminator_DestroyInstance, - .EnumeratePhysicalDevices = terminator_EnumeratePhysicalDevices, - .GetPhysicalDeviceFeatures = terminator_GetPhysicalDeviceFeatures, - .GetPhysicalDeviceFormatProperties = terminator_GetPhysicalDeviceFormatProperties, - .GetPhysicalDeviceImageFormatProperties = terminator_GetPhysicalDeviceImageFormatProperties, - .GetPhysicalDeviceProperties = terminator_GetPhysicalDeviceProperties, - .GetPhysicalDeviceQueueFamilyProperties = terminator_GetPhysicalDeviceQueueFamilyProperties, - .GetPhysicalDeviceMemoryProperties = terminator_GetPhysicalDeviceMemoryProperties, - .EnumerateDeviceExtensionProperties = terminator_EnumerateDeviceExtensionProperties, - .EnumerateDeviceLayerProperties = terminator_EnumerateDeviceLayerProperties, - .GetPhysicalDeviceSparseImageFormatProperties = terminator_GetPhysicalDeviceSparseImageFormatProperties, - .DestroySurfaceKHR = terminator_DestroySurfaceKHR, - .GetPhysicalDeviceSurfaceSupportKHR = terminator_GetPhysicalDeviceSurfaceSupportKHR, - .GetPhysicalDeviceSurfaceCapabilitiesKHR = terminator_GetPhysicalDeviceSurfaceCapabilitiesKHR, - .GetPhysicalDeviceSurfaceFormatsKHR = terminator_GetPhysicalDeviceSurfaceFormatsKHR, - .GetPhysicalDeviceSurfacePresentModesKHR = terminator_GetPhysicalDeviceSurfacePresentModesKHR, -#ifdef VK_USE_PLATFORM_MIR_KHR - .CreateMirSurfaceKHR = terminator_CreateMirSurfaceKHR, - .GetPhysicalDeviceMirPresentationSupportKHR = terminator_GetPhysicalDeviceMirPresentationSupportKHR, -#endif -#ifdef VK_USE_PLATFORM_WAYLAND_KHR - .CreateWaylandSurfaceKHR = terminator_CreateWaylandSurfaceKHR, - .GetPhysicalDeviceWaylandPresentationSupportKHR = terminator_GetPhysicalDeviceWaylandPresentationSupportKHR, -#endif -#ifdef VK_USE_PLATFORM_WIN32_KHR - .CreateWin32SurfaceKHR = terminator_CreateWin32SurfaceKHR, - .GetPhysicalDeviceWin32PresentationSupportKHR = terminator_GetPhysicalDeviceWin32PresentationSupportKHR, -#endif -#ifdef VK_USE_PLATFORM_XCB_KHR - .CreateXcbSurfaceKHR = terminator_CreateXcbSurfaceKHR, - .GetPhysicalDeviceXcbPresentationSupportKHR = terminator_GetPhysicalDeviceXcbPresentationSupportKHR, -#endif -#ifdef VK_USE_PLATFORM_XLIB_KHR - .CreateXlibSurfaceKHR = terminator_CreateXlibSurfaceKHR, - .GetPhysicalDeviceXlibPresentationSupportKHR = terminator_GetPhysicalDeviceXlibPresentationSupportKHR, -#endif -#ifdef VK_USE_PLATFORM_ANDROID_KHR - .CreateAndroidSurfaceKHR = terminator_CreateAndroidSurfaceKHR, -#endif - .GetPhysicalDeviceDisplayPropertiesKHR = terminator_GetPhysicalDeviceDisplayPropertiesKHR, - .GetPhysicalDeviceDisplayPlanePropertiesKHR = terminator_GetPhysicalDeviceDisplayPlanePropertiesKHR, - .GetDisplayPlaneSupportedDisplaysKHR = terminator_GetDisplayPlaneSupportedDisplaysKHR, - .GetDisplayModePropertiesKHR = terminator_GetDisplayModePropertiesKHR, - .CreateDisplayModeKHR = terminator_CreateDisplayModeKHR, - .GetDisplayPlaneCapabilitiesKHR = terminator_GetDisplayPlaneCapabilitiesKHR, - .CreateDisplayPlaneSurfaceKHR = terminator_CreateDisplayPlaneSurfaceKHR, - - // KHR_get_physical_device_properties2 - .GetPhysicalDeviceFeatures2KHR = terminator_GetPhysicalDeviceFeatures2KHR, - .GetPhysicalDeviceProperties2KHR = terminator_GetPhysicalDeviceProperties2KHR, - .GetPhysicalDeviceFormatProperties2KHR = terminator_GetPhysicalDeviceFormatProperties2KHR, - .GetPhysicalDeviceImageFormatProperties2KHR = terminator_GetPhysicalDeviceImageFormatProperties2KHR, - .GetPhysicalDeviceQueueFamilyProperties2KHR = terminator_GetPhysicalDeviceQueueFamilyProperties2KHR, - .GetPhysicalDeviceMemoryProperties2KHR = terminator_GetPhysicalDeviceMemoryProperties2KHR, - .GetPhysicalDeviceSparseImageFormatProperties2KHR = terminator_GetPhysicalDeviceSparseImageFormatProperties2KHR, - -#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT - // EXT_acquire_xlib_display - .AcquireXlibDisplayEXT = terminator_AcquireXlibDisplayEXT, - .GetRandROutputDisplayEXT = terminator_GetRandROutputDisplayEXT, -#endif - - // EXT_debug_report - .CreateDebugReportCallbackEXT = terminator_CreateDebugReportCallback, - .DestroyDebugReportCallbackEXT = terminator_DestroyDebugReportCallback, - .DebugReportMessageEXT = terminator_DebugReportMessage, - - // EXT_direct_mode_display - .ReleaseDisplayEXT = terminator_ReleaseDisplayEXT, - - // EXT_display_surface_counter - .GetPhysicalDeviceSurfaceCapabilities2EXT = terminator_GetPhysicalDeviceSurfaceCapabilities2EXT, - - // NV_external_memory_capabilities - .GetPhysicalDeviceExternalImageFormatPropertiesNV = terminator_GetPhysicalDeviceExternalImageFormatPropertiesNV, - - // NVX_device_generated_commands - .GetPhysicalDeviceGeneratedCommandsPropertiesNVX = terminator_GetPhysicalDeviceGeneratedCommandsPropertiesNVX, -}; - -// A null-terminated list of all of the instance extensions supported by the -// loader -static const char *const LOADER_INSTANCE_EXTENSIONS[] = {VK_KHR_SURFACE_EXTENSION_NAME, - VK_KHR_DISPLAY_EXTENSION_NAME, -#ifdef VK_USE_PLATFORM_XLIB_KHR - VK_KHR_XLIB_SURFACE_EXTENSION_NAME, -#endif -#ifdef VK_USE_PLATFORM_XCB_KHR - VK_KHR_XCB_SURFACE_EXTENSION_NAME, -#endif -#ifdef VK_USE_PLATFORM_WAYLAND_KHR - VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME, -#endif -#ifdef VK_USE_PLATFORM_MIR_KHR - VK_KHR_MIR_SURFACE_EXTENSION_NAME, -#endif -#ifdef VK_USE_PLATFORM_ANDROID_KHR - VK_KHR_ANDROID_SURFACE_EXTENSION_NAME, -#endif -#ifdef VK_USE_PLATFORM_WIN32_KHR - VK_KHR_WIN32_SURFACE_EXTENSION_NAME, -#endif - VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, -#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT - VK_EXT_ACQUIRE_XLIB_DISPLAY_EXTENSION_NAME, -#endif - VK_EXT_DEBUG_REPORT_EXTENSION_NAME, - VK_EXT_DIRECT_MODE_DISPLAY_EXTENSION_NAME, - VK_EXT_DISPLAY_SURFACE_COUNTER_EXTENSION_NAME, - VK_EXT_VALIDATION_FLAGS_EXTENSION_NAME, -#ifdef VK_USE_PLATFORM_VI_NN - VK_NN_VI_SURFACE_EXTENSION_NAME, -#endif - VK_NV_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME, - NULL}; - LOADER_PLATFORM_THREAD_ONCE_DECLARATION(once_init); void *loader_instance_heap_alloc(const struct loader_instance *instance, size_t size, VkSystemAllocationScope alloc_scope) { @@ -215,9 +95,8 @@ void *loader_instance_heap_alloc(const struct loader_instance *instance, size_t { #else if (instance && instance->alloc_callbacks.pfnAllocation) { - /* These are internal structures, so it's best to align everything to - * the largest unit size which is the size of a uint64_t. - */ + // These are internal structures, so it's best to align everything to + // the largest unit size which is the size of a uint64_t. pMemory = instance->alloc_callbacks.pfnAllocation(instance->alloc_callbacks.pUserData, size, sizeof(uint64_t), alloc_scope); } else { #endif @@ -250,9 +129,8 @@ void *loader_instance_heap_realloc(const struct loader_instance *instance, void #if (DEBUG_DISABLE_APP_ALLOCATORS == 1) #else } else if (instance && instance->alloc_callbacks.pfnReallocation) { - /* These are internal structures, so it's best to align everything to - * the largest unit size which is the size of a uint64_t. - */ + // These are internal structures, so it's best to align everything to + // the largest unit size which is the size of a uint64_t. pNewMem = instance->alloc_callbacks.pfnReallocation(instance->alloc_callbacks.pUserData, pMemory, size, sizeof(uint64_t), alloc_scope); #endif @@ -274,9 +152,8 @@ void *loader_device_heap_alloc(const struct loader_device *device, size_t size, { #else if (device && device->alloc_callbacks.pfnAllocation) { - /* These are internal structures, so it's best to align everything to - * the largest unit size which is the size of a uint64_t. - */ + // These are internal structures, so it's best to align everything to + // the largest unit size which is the size of a uint64_t. pMemory = device->alloc_callbacks.pfnAllocation(device->alloc_callbacks.pUserData, size, sizeof(uint64_t), alloc_scope); } else { #endif @@ -309,9 +186,8 @@ void *loader_device_heap_realloc(const struct loader_device *device, void *pMemo #if (DEBUG_DISABLE_APP_ALLOCATORS == 1) #else } else if (device && device->alloc_callbacks.pfnReallocation) { - /* These are internal structures, so it's best to align everything to - * the largest unit size which is the size of a uint64_t. - */ + // These are internal structures, so it's best to align everything to + // the largest unit size which is the size of a uint64_t. pNewMem = device->alloc_callbacks.pfnReallocation(device->alloc_callbacks.pUserData, pMemory, size, sizeof(uint64_t), alloc_scope); #endif @@ -583,20 +459,17 @@ out: #endif // WIN32 -/** - * Combine path elements, separating each element with the platform-specific - * directory separator, and save the combined string to a destination buffer, - * not exceeding the given length. Path elements are given as variadic args, - * with a NULL element terminating the list. - * - * \returns the total length of the combined string, not including an ASCII - * NUL termination character. This length may exceed the available storage: - * in this case, the written string will be truncated to avoid a buffer - * overrun, and the return value will greater than or equal to the storage - * size. A NULL argument may be provided as the destination buffer in order - * to determine the required string length without actually writing a string. - */ - +// Combine path elements, separating each element with the platform-specific +// directory separator, and save the combined string to a destination buffer, +// not exceeding the given length. Path elements are given as variadic args, +// with a NULL element terminating the list. +// +// \returns the total length of the combined string, not including an ASCII +// NUL termination character. This length may exceed the available storage: +// in this case, the written string will be truncated to avoid a buffer +// overrun, and the return value will greater than or equal to the storage +// size. A NULL argument may be provided as the destination buffer in order +// to determine the required string length without actually writing a string. static size_t loader_platform_combine_path(char *dest, size_t len, ...) { size_t required_len = 0; va_list ap; @@ -630,10 +503,7 @@ static size_t loader_platform_combine_path(char *dest, size_t len, ...) { return required_len; } -/** - * Given string of three part form "maj.min.pat" convert to a vulkan version - * number. - */ +// Given string of three part form "maj.min.pat" convert to a vulkan version number. static uint32_t loader_make_version(char *vers_str) { uint32_t vers = 0, major = 0, minor = 0, patch = 0; char *vers_tok; @@ -662,10 +532,7 @@ bool compare_vk_extension_properties(const VkExtensionProperties *op1, const VkE return strcmp(op1->extensionName, op2->extensionName) == 0 ? true : false; } -/** - * Search the given ext_array for an extension - * matching the given vk_ext_prop - */ +// Search the given ext_array for an extension matching the given vk_ext_prop bool has_vk_extension_property_array(const VkExtensionProperties *vk_ext_prop, const uint32_t count, const VkExtensionProperties *ext_array) { for (uint32_t i = 0; i < count; i++) { @@ -674,10 +541,7 @@ bool has_vk_extension_property_array(const VkExtensionProperties *vk_ext_prop, c return false; } -/** - * Search the given ext_list for an extension - * matching the given vk_ext_prop - */ +// Search the given ext_list for an extension matching the given vk_ext_prop bool has_vk_extension_property(const VkExtensionProperties *vk_ext_prop, const struct loader_extension_list *ext_list) { for (uint32_t i = 0; i < ext_list->count; i++) { if (compare_vk_extension_properties(&ext_list->list[i], vk_ext_prop)) return true; @@ -685,9 +549,7 @@ bool has_vk_extension_property(const VkExtensionProperties *vk_ext_prop, const s return false; } -/** - * Search the given ext_list for a device extension matching the given ext_prop - */ +// Search the given ext_list for a device extension matching the given ext_prop bool has_vk_dev_ext_property(const VkExtensionProperties *ext_prop, const struct loader_device_extension_list *ext_list) { for (uint32_t i = 0; i < ext_list->count; i++) { if (compare_vk_extension_properties(&ext_list->list[i].props, ext_prop)) return true; @@ -695,9 +557,7 @@ bool has_vk_dev_ext_property(const VkExtensionProperties *ext_prop, const struct return false; } -/* - * Search the given layer list for a layer matching the given layer name - */ +// Search the given layer list for a layer matching the given layer name static struct loader_layer_properties *loader_get_layer_property(const char *name, const struct loader_layer_list *layer_list) { for (uint32_t i = 0; i < layer_list->count; i++) { const VkLayerProperties *item = &layer_list->list[i].info; @@ -706,9 +566,7 @@ static struct loader_layer_properties *loader_get_layer_property(const char *nam return NULL; } -/** - * Get the next unused layer property in the list. Init the property to zero. - */ +// Get the next unused layer property in the list. Init the property to zero. static struct loader_layer_properties *loader_get_next_layer_property(const struct loader_instance *inst, struct loader_layer_list *layer_list) { if (layer_list->capacity == 0) { @@ -724,7 +582,7 @@ static struct loader_layer_properties *loader_get_next_layer_property(const stru layer_list->capacity = sizeof(struct loader_layer_properties) * 64; } - // ensure enough room to add an entry + // Ensure enough room to add an entry if ((layer_list->count + 1) * sizeof(struct loader_layer_properties) > layer_list->capacity) { layer_list->list = loader_instance_heap_realloc(inst, layer_list->list, layer_list->capacity, layer_list->capacity * 2, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); @@ -741,9 +599,7 @@ static struct loader_layer_properties *loader_get_next_layer_property(const stru return &(layer_list->list[layer_list->count - 1]); } -/** - * Remove all layer properties entrys from the list - */ +// Remove all layer properties entrys from the list void loader_delete_layer_properties(const struct loader_instance *inst, struct loader_layer_list *layer_list) { uint32_t i, j; struct loader_device_extension_list *dev_ext_list; @@ -776,7 +632,7 @@ static VkResult loader_add_instance_extensions(const struct loader_instance *ins VkResult res = VK_SUCCESS; if (!fp_get_props) { - /* No EnumerateInstanceExtensionProperties defined */ + // No EnumerateInstanceExtensionProperties defined goto out; } @@ -790,7 +646,7 @@ static VkResult loader_add_instance_extensions(const struct loader_instance *ins } if (count == 0) { - /* No ExtensionProperties to report */ + // No ExtensionProperties to report goto out; } @@ -834,10 +690,8 @@ out: return res; } -/* - * Initialize ext_list with the physical device extensions. - * The extension properties are passed as inputs in count and ext_props. - */ +// Initialize ext_list with the physical device extensions. +// The extension properties are passed as inputs in count and ext_props. static VkResult loader_init_device_extensions(const struct loader_instance *inst, struct loader_physical_device_term *phys_dev_term, uint32_t count, VkExtensionProperties *ext_props, struct loader_extension_list *ext_list) { @@ -929,12 +783,8 @@ void loader_destroy_generic_list(const struct loader_instance *inst, struct load list->capacity = 0; } -/* - * Append non-duplicate extension properties defined in props - * to the given ext_list. - * Return - * Vk_SUCCESS on success - */ +// Append non-duplicate extension properties defined in props to the given ext_list. +// Return - Vk_SUCCESS on success VkResult loader_add_to_ext_list(const struct loader_instance *inst, struct loader_extension_list *ext_list, uint32_t prop_list_count, const VkExtensionProperties *props) { uint32_t i; @@ -978,12 +828,9 @@ VkResult loader_add_to_ext_list(const struct loader_instance *inst, struct loade return VK_SUCCESS; } -/* - * Append one extension property defined in props with entrypoints - * defined in entrys to the given ext_list. Do not append if a duplicate - * Return - * Vk_SUCCESS on success - */ +// Append one extension property defined in props with entrypoints defined in entrys to the given +// ext_list. Do not append if a duplicate. +// Return - Vk_SUCCESS on success VkResult loader_add_to_dev_ext_list(const struct loader_instance *inst, struct loader_device_extension_list *ext_list, const VkExtensionProperties *props, uint32_t entry_count, char **entrys) { uint32_t idx; @@ -1052,11 +899,8 @@ VkResult loader_add_to_dev_ext_list(const struct loader_instance *inst, struct l return VK_SUCCESS; } -/** - * Search the given search_list for any layers in the props list. - * Add these to the output layer_list. Don't add duplicates to the output - * layer_list. - */ +// Search the given search_list for any layers in the props list. Add these to the +// output layer_list. Don't add duplicates to the output layer_list. static VkResult loader_add_layer_names_to_list(const struct loader_instance *inst, struct loader_layer_list *output_list, uint32_t name_count, const char *const *names, const struct loader_layer_list *search_list) { @@ -1081,9 +925,7 @@ static VkResult loader_add_layer_names_to_list(const struct loader_instance *ins return err; } -/* - * Manage lists of VkLayerProperties - */ +// Manage lists of VkLayerProperties static bool loader_init_layer_list(const struct loader_instance *inst, struct loader_layer_list *list) { list->capacity = 32 * sizeof(struct loader_layer_properties); list->list = loader_instance_heap_alloc(inst, list->capacity, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); @@ -1106,10 +948,7 @@ void loader_destroy_layer_list(const struct loader_instance *inst, struct loader layer_list->capacity = 0; } -/* - * Search the given layer list for a list - * matching the given VkLayerProperties - */ +// Search the given layer list for a list matching the given VkLayerProperties bool has_vk_layer_property(const VkLayerProperties *vk_layer_prop, const struct loader_layer_list *list) { for (uint32_t i = 0; i < list->count; i++) { if (strcmp(vk_layer_prop->layerName, list->list[i].info.layerName) == 0) return true; @@ -1117,10 +956,7 @@ bool has_vk_layer_property(const VkLayerProperties *vk_layer_prop, const struct return false; } -/* - * Search the given layer list for a layer - * matching the given name - */ +// Search the given layer list for a layer matching the given name bool has_layer_name(const char *name, const struct loader_layer_list *list) { for (uint32_t i = 0; i < list->count; i++) { if (strcmp(name, list->list[i].info.layerName) == 0) return true; @@ -1128,10 +964,7 @@ bool has_layer_name(const char *name, const struct loader_layer_list *list) { return false; } -/* - * Append non-duplicate layer properties defined in prop_list - * to the given layer_info list - */ +// Append non-duplicate layer properties defined in prop_list to the given layer_info list VkResult loader_add_to_layer_list(const struct loader_instance *inst, struct loader_layer_list *list, uint32_t prop_list_count, const struct loader_layer_properties *props) { uint32_t i; @@ -1173,20 +1006,16 @@ VkResult loader_add_to_layer_list(const struct loader_instance *inst, struct loa return VK_SUCCESS; } -/** - * Search the search_list for any layer with a name - * that matches the given name and a type that matches the given type - * Add all matching layers to the found_list - * Do not add if found loader_layer_properties is already - * on the found_list. - */ +// Search the search_list for any layer with a name that matches the given name and a type +// that matches the given type. Add all matching layers to the found_list. +// Do not add if found loader_layer_properties is already on the found_list. void loader_find_layer_name_add_list(const struct loader_instance *inst, const char *name, const enum layer_type type, const struct loader_layer_list *search_list, struct loader_layer_list *found_list) { bool found = false; for (uint32_t i = 0; i < search_list->count; i++) { struct loader_layer_properties *layer_prop = &search_list->list[i]; if (0 == strcmp(layer_prop->info.layerName, name) && (layer_prop->type & type)) { - /* Found a layer with the same name, add to found_list */ + // Found a layer with the same name, add to found_list if (VK_SUCCESS == loader_add_to_layer_list(inst, found_list, 1, layer_prop)) { found = true; } @@ -1214,26 +1043,25 @@ static VkExtensionProperties *get_dev_extension_property(const char *name, const return NULL; } -/* - * For Instance extensions implemented within the loader (i.e. DEBUG_REPORT - * the extension must provide two entry points for the loader to use: - * - "trampoline" entry point - this is the address returned by GetProcAddr - * and will always do what's necessary to support a global call. - * - "terminator" function - this function will be put at the end of the - * instance chain and will contain the necessary logic to call / process - * the extension for the appropriate ICDs that are available. - * There is no generic mechanism for including these functions, the references - * must be placed into the appropriate loader entry points. - * GetInstanceProcAddr: call extension GetInstanceProcAddr to check for - * GetProcAddr requests - * loader_coalesce_extensions(void) - add extension records to the list of - * global - * extension available to the app. - * instance_disp - add function pointer for terminator function to this array. - * The extension itself should be in a separate file that will be - * linked directly with the loader. - */ - +// For Instance extensions implemented within the loader (i.e. DEBUG_REPORT +// the extension must provide two entry points for the loader to use: +// - "trampoline" entry point - this is the address returned by GetProcAddr +// and will always do what's necessary to support a +// global call. +// - "terminator" function - this function will be put at the end of the +// instance chain and will contain the necessary logic +// to call / process the extension for the appropriate +// ICDs that are available. +// There is no generic mechanism for including these functions, the references +// must be placed into the appropriate loader entry points. +// GetInstanceProcAddr: call extension GetInstanceProcAddr to check for GetProcAddr +// requests +// loader_coalesce_extensions(void) - add extension records to the list of global +// extension available to the app. +// instance_disp - add function pointer for terminator function +// to this array. +// The extension itself should be in a separate file that will be linked directly +// with the loader. VkResult loader_get_icd_loader_instance_extensions(const struct loader_instance *inst, struct loader_icd_tramp_list *icd_tramp_list, struct loader_extension_list *inst_exts) { struct loader_extension_list icd_exts; @@ -1418,7 +1246,7 @@ static struct loader_icd_term *loader_icd_add(struct loader_instance *ptr_inst, icd_term->scanned_icd = scanned_icd; icd_term->this_instance = ptr_inst; - /* prepend to the list */ + // Prepend to the list icd_term->next = ptr_inst->icd_terms; ptr_inst->icd_terms = icd_term; ptr_inst->total_icd_count++; @@ -1426,14 +1254,12 @@ static struct loader_icd_term *loader_icd_add(struct loader_instance *ptr_inst, return icd_term; } -/** - * Determine the ICD interface version to use. - * @param icd - * @param pVersion Output parameter indicating which version to use or 0 if - * the negotiation API is not supported by the ICD - * @return bool indicating true if the selected interface version is supported - * by the loader, false indicates the version is not supported - */ +// Determine the ICD interface version to use. +// @param icd +// @param pVersion Output parameter indicating which version to use or 0 if +// the negotiation API is not supported by the ICD +// @return bool indicating true if the selected interface version is supported +// by the loader, false indicates the version is not supported bool loader_get_icd_interface_version(PFN_vkNegotiateLoaderICDInterfaceVersion fp_negotiate_icd_version, uint32_t *pVersion) { if (fp_negotiate_icd_version == NULL) { // ICD does not support the negotiation API, it supports version 0 or 1 @@ -1500,8 +1326,8 @@ static VkResult loader_scanned_icd_add(const struct loader_instance *inst, struc uint32_t interface_vers; VkResult res = VK_SUCCESS; - /* TODO implement smarter opening/closing of libraries. For now this - * function leaves libraries open and the scanned_icd_clear closes them */ + // TODO implement smarter opening/closing of libraries. For now this + // function leaves libraries open and the scanned_icd_clear closes them handle = loader_platform_open_library(filename); if (NULL == handle) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, loader_platform_open_library_error(filename)); @@ -1624,105 +1450,6 @@ out: return res; } -static bool loader_icd_init_entrys(struct loader_icd_term *icd_term, VkInstance inst, const PFN_vkGetInstanceProcAddr fp_gipa) { -/* initialize entrypoint function pointers */ - -#define LOOKUP_GIPA(func, required) \ - do { \ - icd_term->func = (PFN_vk##func)fp_gipa(inst, "vk" #func); \ - if (!icd_term->func && required) { \ - loader_log((struct loader_instance *)inst, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, \ - loader_platform_get_proc_address_error("vk" #func)); \ - return false; \ - } \ - } while (0) - - LOOKUP_GIPA(GetDeviceProcAddr, true); - LOOKUP_GIPA(DestroyInstance, true); - LOOKUP_GIPA(EnumeratePhysicalDevices, true); - LOOKUP_GIPA(GetPhysicalDeviceFeatures, true); - LOOKUP_GIPA(GetPhysicalDeviceFormatProperties, true); - LOOKUP_GIPA(GetPhysicalDeviceImageFormatProperties, true); - LOOKUP_GIPA(CreateDevice, true); - LOOKUP_GIPA(GetPhysicalDeviceProperties, true); - LOOKUP_GIPA(GetPhysicalDeviceMemoryProperties, true); - LOOKUP_GIPA(GetPhysicalDeviceQueueFamilyProperties, true); - LOOKUP_GIPA(EnumerateDeviceExtensionProperties, true); - LOOKUP_GIPA(GetPhysicalDeviceSparseImageFormatProperties, true); - LOOKUP_GIPA(GetPhysicalDeviceSurfaceSupportKHR, false); - LOOKUP_GIPA(GetPhysicalDeviceSurfaceCapabilitiesKHR, false); - LOOKUP_GIPA(GetPhysicalDeviceSurfaceFormatsKHR, false); - LOOKUP_GIPA(GetPhysicalDeviceSurfacePresentModesKHR, false); - LOOKUP_GIPA(GetPhysicalDeviceDisplayPropertiesKHR, false); - LOOKUP_GIPA(GetDisplayModePropertiesKHR, false); - LOOKUP_GIPA(CreateDisplayPlaneSurfaceKHR, false); - LOOKUP_GIPA(GetPhysicalDeviceDisplayPlanePropertiesKHR, false); - LOOKUP_GIPA(GetDisplayPlaneSupportedDisplaysKHR, false); - LOOKUP_GIPA(CreateDisplayModeKHR, false); - LOOKUP_GIPA(GetDisplayPlaneCapabilitiesKHR, false); - LOOKUP_GIPA(DestroySurfaceKHR, false); - LOOKUP_GIPA(CreateSwapchainKHR, false); -#ifdef VK_USE_PLATFORM_WIN32_KHR - LOOKUP_GIPA(CreateWin32SurfaceKHR, false); - LOOKUP_GIPA(GetPhysicalDeviceWin32PresentationSupportKHR, false); -#endif -#ifdef VK_USE_PLATFORM_XCB_KHR - LOOKUP_GIPA(CreateXcbSurfaceKHR, false); - LOOKUP_GIPA(GetPhysicalDeviceXcbPresentationSupportKHR, false); -#endif -#ifdef VK_USE_PLATFORM_XLIB_KHR - LOOKUP_GIPA(CreateXlibSurfaceKHR, false); - LOOKUP_GIPA(GetPhysicalDeviceXlibPresentationSupportKHR, false); -#endif -#ifdef VK_USE_PLATFORM_MIR_KHR - LOOKUP_GIPA(CreateMirSurfaceKHR, false); - LOOKUP_GIPA(GetPhysicalDeviceMirPresentationSupportKHR, false); -#endif -#ifdef VK_USE_PLATFORM_WAYLAND_KHR - LOOKUP_GIPA(CreateWaylandSurfaceKHR, false); - LOOKUP_GIPA(GetPhysicalDeviceWaylandPresentationSupportKHR, false); -#endif - LOOKUP_GIPA(CreateSharedSwapchainsKHR, false); - - // KHR_get_physical_device_properties2 - LOOKUP_GIPA(GetPhysicalDeviceFeatures2KHR, false); - LOOKUP_GIPA(GetPhysicalDeviceProperties2KHR, false); - LOOKUP_GIPA(GetPhysicalDeviceFormatProperties2KHR, false); - LOOKUP_GIPA(GetPhysicalDeviceImageFormatProperties2KHR, false); - LOOKUP_GIPA(GetPhysicalDeviceQueueFamilyProperties2KHR, false); - LOOKUP_GIPA(GetPhysicalDeviceMemoryProperties2KHR, false); - LOOKUP_GIPA(GetPhysicalDeviceSparseImageFormatProperties2KHR, false); - // EXT_debug_marker (items needing a trampoline/terminator) - LOOKUP_GIPA(DebugMarkerSetObjectTagEXT, false); - LOOKUP_GIPA(DebugMarkerSetObjectNameEXT, false); - -#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT - // EXT_acquire_xlib_display - LOOKUP_GIPA(AcquireXlibDisplayEXT, false); - LOOKUP_GIPA(GetRandROutputDisplayEXT, false); -#endif - - // EXT_debug_report - LOOKUP_GIPA(CreateDebugReportCallbackEXT, false); - LOOKUP_GIPA(DestroyDebugReportCallbackEXT, false); - LOOKUP_GIPA(DebugReportMessageEXT, false); - - // EXT_direct_mode_display - LOOKUP_GIPA(ReleaseDisplayEXT, false); - - // EXT_display_surface_counter - LOOKUP_GIPA(GetPhysicalDeviceSurfaceCapabilities2EXT, false); - - // NV_external_memory_capabilities - LOOKUP_GIPA(GetPhysicalDeviceExternalImageFormatPropertiesNV, false); - // NVX_device_generated_commands - LOOKUP_GIPA(GetPhysicalDeviceGeneratedCommandsPropertiesNVX, false); - -#undef LOOKUP_GIPA - - return true; -} - static void loader_debug_init(void) { char *env, *orig; @@ -1730,7 +1457,7 @@ static void loader_debug_init(void) { g_loader_debug = 0; - /* parse comma-separated debug options */ + // Parse comma-separated debug options orig = env = loader_getenv("VK_LOADER_DEBUG", NULL); while (env) { char *p = strchr(env, ','); @@ -1791,14 +1518,12 @@ struct loader_manifest_files { char **filename_list; }; -/** - * Get next file or dirname given a string list or registry key path - * - * \returns - * A pointer to first char in the next path. - * The next path (or NULL) in the list is returned in next_path. - * Note: input string is modified in some cases. PASS IN A COPY! - */ +// Get next file or dirname given a string list or registry key path +// +// \returns +// A pointer to first char in the next path. +// The next path (or NULL) in the list is returned in next_path. +// Note: input string is modified in some cases. PASS IN A COPY! static char *loader_get_next_path(char *path) { uint32_t len; char *next; @@ -1816,14 +1541,11 @@ static char *loader_get_next_path(char *path) { return next; } -/** - * Given a path which is absolute or relative, expand the path if relative or - * leave the path unmodified if absolute. The base path to prepend to relative - * paths is given in rel_base. - * - * \returns - * A string in out_fullpath of the full absolute path - */ +// Given a path which is absolute or relative, expand the path if relative or +// leave the path unmodified if absolute. The base path to prepend to relative +// paths is given in rel_base. +// +// @return - A string in out_fullpath of the full absolute path static void loader_expand_path(const char *path, const char *rel_base, size_t out_size, char *out_fullpath) { if (loader_platform_is_path_absolute(path)) { // do not prepend a base to an absolute path @@ -1833,14 +1555,10 @@ static void loader_expand_path(const char *path, const char *rel_base, size_t ou loader_platform_combine_path(out_fullpath, out_size, rel_base, path, NULL); } -/** - * Given a filename (file) and a list of paths (dir), try to find an existing - * file in the paths. If filename already is a path then no - * searching in the given paths. - * - * \returns - * A string in out_fullpath of either the full path or file. - */ +// Given a filename (file) and a list of paths (dir), try to find an existing +// file in the paths. If filename already is a path then no searching in the given paths. +// +// @return - A string in out_fullpath of either the full path or file. static void loader_get_fullpath(const char *file, const char *dirs, size_t out_size, char *out_fullpath) { if (!loader_platform_is_path(file) && *dirs) { char *dirs_copy, *dir, *next_dir; @@ -1860,13 +1578,10 @@ static void loader_get_fullpath(const char *file, const char *dirs, size_t out_s (void)snprintf(out_fullpath, out_size, "%s", file); } -/** - * Read a JSON file into a buffer. - * - * \returns - * A pointer to a cJSON object representing the JSON parse tree. - * This returned buffer should be freed by caller. - */ +// Read a JSON file into a buffer. +// +// @return - A pointer to a cJSON object representing the JSON parse tree. +// This returned buffer should be freed by caller. static VkResult loader_get_json(const struct loader_instance *inst, const char *filename, cJSON **json) { FILE *file = NULL; char *json_buf; @@ -1906,7 +1621,7 @@ static VkResult loader_get_json(const struct loader_instance *inst, const char * } json_buf[len] = '\0'; - // parse text from file + // Parse text from file *json = cJSON_Parse(json_buf); if (*json == NULL) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, @@ -1926,9 +1641,7 @@ out: return res; } -/** - * Do a deep copy of the loader_layer_properties structure. - */ +// Do a deep copy of the loader_layer_properties structure. VkResult loader_copy_layer_properties(const struct loader_instance *inst, struct loader_layer_properties *dst, struct loader_layer_properties *src) { uint32_t cnt, i; @@ -2009,18 +1722,16 @@ bool loader_find_layer_name_array(const char *name, uint32_t layer_count, const return false; } -/** - * Searches through an array of layer names (ppp_layer_names) looking for a - * layer key_name. - * If not found then simply returns updating nothing. - * Otherwise, it uses expand_count, expand_names adding them to layer names. - * Any duplicate (pre-existing) expand_names in layer names are removed. - * Order is otherwise preserved, with the layer key_name being replaced by the - * expand_names. - * @param inst - * @param layer_count - * @param ppp_layer_names - */ +// Searches through an array of layer names (ppp_layer_names) looking for a +// layer key_name. +// If not found then simply returns updating nothing. +// Otherwise, it uses expand_count, expand_names adding them to layer names. +// Any duplicate (pre-existing) expand_names in layer names are removed. +// Order is otherwise preserved, with the layer key_name being replaced by the +// expand_names. +// @param inst +// @param layer_count +// @param ppp_layer_names VkResult loader_expand_layer_names(struct loader_instance *inst, const char *key_name, uint32_t expand_count, const char expand_names[][VK_MAX_EXTENSION_NAME_SIZE], uint32_t *layer_count, char const *const **ppp_layer_names) { @@ -2071,7 +1782,7 @@ VkResult loader_expand_layer_names(struct loader_instance *inst, const char *key void loader_delete_shadow_inst_layer_names(const struct loader_instance *inst, const VkInstanceCreateInfo *orig, VkInstanceCreateInfo *ours) { - /* Free the layer names array iff we had to reallocate it */ + // Free the layer names array iff we had to reallocate it if (orig->ppEnabledLayerNames != ours->ppEnabledLayerNames) { loader_instance_heap_free(inst, (void *)ours->ppEnabledLayerNames); } @@ -2087,16 +1798,14 @@ void loader_init_std_validation_props(struct loader_layer_properties *props) { props->info.specVersion = VK_MAKE_VERSION(1, 0, VK_HEADER_VERSION); } -/** - * Searches through the existing instance layer lists looking for - * the set of required layer names. If found then it adds a meta property to the - * layer list. - * Assumes the required layers are the same for both instance and device lists. - * @param inst - * @param layer_count number of layers in layer_names - * @param layer_names array of required layer names - * @param layer_instance_list - */ +// Searches through the existing instance layer lists looking for +// the set of required layer names. If found then it adds a meta property to the +// layer list. +// Assumes the required layers are the same for both instance and device lists. +// @param inst +// @param layer_count number of layers in layer_names +// @param layer_names array of required layer names +// @param layer_instance_list static void loader_add_layer_property_meta(const struct loader_instance *inst, uint32_t layer_count, const char layer_names[][VK_MAX_EXTENSION_NAME_SIZE], struct loader_layer_list *layer_instance_list) { @@ -2145,17 +1854,14 @@ static void loader_read_json_layer(const struct loader_instance *inst, struct lo cJSON *ext_item; VkExtensionProperties ext_prop; -/* - * The following are required in the "layer" object: - * (required) "name" - * (required) "type" - * (required) “library_path” - * (required) “api_version” - * (required) “implementation_version” - * (required) “description” - * (required for implicit layers) “disable_environment” - */ - +// The following are required in the "layer" object: +// (required) "name" +// (required) "type" +// (required) “library_path” +// (required) “api_version” +// (required) “implementation_version” +// (required) “description” +// (required for implicit layers) “disable_environment” #define GET_JSON_OBJECT(node, var) \ { \ var = cJSON_GetObjectItem(node, #var); \ @@ -2265,13 +1971,11 @@ static void loader_read_json_layer(const struct loader_instance *inst, struct lo props->disable_env_var.value[sizeof(props->disable_env_var.value) - 1] = '\0'; } -/** -* Now get all optional items and objects and put in list: -* functions -* instance_extensions -* device_extensions -* enable_environment (implicit layers only) -*/ +// Now get all optional items and objects and put in list: +// functions +// instance_extensions +// device_extensions +// enable_environment (implicit layers only) #define GET_JSON_OBJECT(node, var) \ { var = cJSON_GetObjectItem(node, #var); } #define GET_JSON_ITEM(node, var) \ @@ -2453,17 +2157,15 @@ static inline bool layer_json_supports_layers_tag(const layer_json_version *laye return false; } -/** - * Given a cJSON struct (json) of the top level JSON object from layer manifest - * file, add entry to the layer_list. Fill out the layer_properties in this list - * entry from the input cJSON object. - * - * \returns - * void - * layer_list has a new entry and initialized accordingly. - * If the json input object does not have all the required fields no entry - * is added to the list. - */ +// Given a cJSON struct (json) of the top level JSON object from layer manifest +// file, add entry to the layer_list. Fill out the layer_properties in this list +// entry from the input cJSON object. +// +// \returns +// void +// layer_list has a new entry and initialized accordingly. +// If the json input object does not have all the required fields no entry +// is added to the list. static void loader_add_layer_properties(const struct loader_instance *inst, struct loader_layer_list *layer_instance_list, cJSON *json, bool is_implicit, char *filename) { // The following Fields in layer manifest file that are required: @@ -2569,33 +2271,31 @@ static void loader_add_layer_properties(const struct loader_instance *inst, stru return; } -/** - * Find the Vulkan library manifest files. - * - * This function scans the "location" or "env_override" directories/files - * for a list of JSON manifest files. If env_override is non-NULL - * and has a valid value. Then the location is ignored. Otherwise - * location is used to look for manifest files. The location - * is interpreted as Registry path on Windows and a directory path(s) - * on Linux. "home_location" is an additional directory in the users home - * directory to look at. It is expanded into the dir path - * $XDG_DATA_HOME/home_location or $HOME/.local/share/home_location depending - * on environment variables. This "home_location" is only used on Linux. - * - * \returns - * VKResult - * A string list of manifest files to be opened in out_files param. - * List has a pointer to string for each manifest filename. - * When done using the list in out_files, pointers should be freed. - * Location or override string lists can be either files or directories as - *follows: - * | location | override - * -------------------------------- - * Win ICD | files | files - * Win Layer | files | dirs - * Linux ICD | dirs | files - * Linux Layer| dirs | dirs - */ +// Find the Vulkan library manifest files. +// +// This function scans the "location" or "env_override" directories/files +// for a list of JSON manifest files. If env_override is non-NULL +// and has a valid value. Then the location is ignored. Otherwise +// location is used to look for manifest files. The location +// is interpreted as Registry path on Windows and a directory path(s) +// on Linux. "home_location" is an additional directory in the users home +// directory to look at. It is expanded into the dir path +// $XDG_DATA_HOME/home_location or $HOME/.local/share/home_location depending +// on environment variables. This "home_location" is only used on Linux. +// +// \returns +// VKResult +// A string list of manifest files to be opened in out_files param. +// List has a pointer to string for each manifest filename. +// When done using the list in out_files, pointers should be freed. +// Location or override string lists can be either files or directories as +//follows: +// | location | override +// -------------------------------- +// Win ICD | files | files +// Win Layer | files | dirs +// Linux ICD | dirs | files +// Linux Layer| dirs | dirs static VkResult loader_get_manifest_files(const struct loader_instance *inst, const char *env_override, const char *source_override, bool is_layer, bool warn_if_not_present, const char *location, const char *relative_location, struct loader_manifest_files *out_files) { @@ -2619,7 +2319,7 @@ static VkResult loader_get_manifest_files(const struct loader_instance *inst, co } else if (env_override != NULL) { #if !defined(_WIN32) if (geteuid() != getuid() || getegid() != getgid()) { - /* Don't allow setuid apps to use the env var: */ + // Don't allow setuid apps to use the env var: env_override = NULL; } #endif @@ -2834,7 +2534,7 @@ static VkResult loader_get_manifest_files(const struct loader_instance *inst, co #endif } while (name) { - /* Look for files ending with ".json" suffix */ + // Look for files ending with ".json" suffix uint32_t nlen = (uint32_t)strlen(name); const char *suf = name + nlen - 5; if ((nlen > 5) && !strncmp(suf, ".json", 5)) { @@ -2986,18 +2686,17 @@ out: void loader_init_icd_lib_list() {} void loader_destroy_icd_lib_list() {} -/** - * Try to find the Vulkan ICD driver(s). - * - * This function scans the default system loader path(s) or path - * specified by the \c VK_ICD_FILENAMES environment variable in - * order to find loadable VK ICDs manifest files. From these - * manifest files it finds the ICD libraries. - * - * \returns - * Vulkan result - * (on result == VK_SUCCESS) a list of icds that were discovered - */ + +// Try to find the Vulkan ICD driver(s). +// +// This function scans the default system loader path(s) or path +// specified by the \c VK_ICD_FILENAMES environment variable in +// order to find loadable VK ICDs manifest files. From these +// manifest files it finds the ICD libraries. +// +// \returns +// Vulkan result +// (on result == VK_SUCCESS) a list of icds that were discovered VkResult loader_icd_scan(const struct loader_instance *inst, struct loader_icd_tramp_list *icd_tramp_list) { char *file_str; uint16_t file_major_vers = 0; @@ -3307,7 +3006,7 @@ void loader_implicit_layer_scan(const struct loader_instance *inst, struct loade return; } - /* cleanup any previously scanned libraries */ + // Cleanup any previously scanned libraries loader_delete_layer_properties(inst, instance_layers); loader_platform_thread_lock_mutex(&loader_json_lock); @@ -3428,6 +3127,12 @@ VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL loader_gpa_device_internal(VkDevice dev struct loader_device *dev; struct loader_icd_term *icd_term = loader_get_icd_and_device(device, &dev, NULL); + // Return this function if a layer above here is asking for the vkGetDeviceProcAddr. + // This is so we can properly intercept any device commands needing a terminator. + if (!strcmp(pName, "vkGetDeviceProcAddr")) { + return (PFN_vkVoidFunction)loader_gpa_device_internal; + } + // NOTE: Device Funcs needing Trampoline/Terminator. // Overrides for device functions needing a trampoline and // a terminator because certain device entry-points still need to go @@ -3436,30 +3141,21 @@ VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL loader_gpa_device_internal(VkDevice dev // object before passing the appropriate info along to the ICD. // This is why we also have to override the direct ICD call to // vkGetDeviceProcAddr to intercept those calls. - if (!strcmp(pName, "vkGetDeviceProcAddr")) { - return (PFN_vkVoidFunction)loader_gpa_device_internal; - } else if (!strcmp(pName, "vkCreateSwapchainKHR")) { - return (PFN_vkVoidFunction)terminator_vkCreateSwapchainKHR; - } else if (!strcmp(pName, "vkCreateSharedSwapchainsKHR")) { - return (PFN_vkVoidFunction)terminator_vkCreateSharedSwapchainsKHR; - } else if (!strcmp(pName, "vkDebugMarkerSetObjectTagEXT")) { - return (PFN_vkVoidFunction)terminator_DebugMarkerSetObjectTagEXT; - } else if (!strcmp(pName, "vkDebugMarkerSetObjectNameEXT")) { - return (PFN_vkVoidFunction)terminator_DebugMarkerSetObjectNameEXT; + PFN_vkVoidFunction addr = get_extension_device_proc_terminator(pName); + if (NULL != addr) { + return addr; } - return icd_term->GetDeviceProcAddr(device, pName); + return icd_term->dispatch.GetDeviceProcAddr(device, pName); } -/** - * Initialize device_ext dispatch table entry as follows: - * If dev == NULL find all logical devices created within this instance and - * init the entry (given by idx) in the ext dispatch table. - * If dev != NULL only initialize the entry in the given dev's dispatch table. - * The initialization value is gotten by calling down the device chain with - * GDPA. - * If GDPA returns NULL then don't initialize the dispatch table entry. - */ +// Initialize device_ext dispatch table entry as follows: +// If dev == NULL find all logical devices created within this instance and +// init the entry (given by idx) in the ext dispatch table. +// If dev != NULL only initialize the entry in the given dev's dispatch table. +// The initialization value is gotten by calling down the device chain with +// GDPA. +// If GDPA returns NULL then don't initialize the dispatch table entry. static void loader_init_dispatch_dev_ext_entry(struct loader_instance *inst, struct loader_device *dev, uint32_t idx, const char *funcName) @@ -3480,11 +3176,8 @@ static void loader_init_dispatch_dev_ext_entry(struct loader_instance *inst, str } } -/** - * Find all dev extension in the hash table and initialize the dispatch table - * for dev for each of those extension entrypoints found in hash table. - - */ +// Find all dev extension in the hash table and initialize the dispatch table +// for dev for each of those extension entrypoints found in hash table. void loader_init_dispatch_dev_ext(struct loader_instance *inst, struct loader_device *dev) { for (uint32_t i = 0; i < MAX_NUM_UNKNOWN_EXTS; i++) { if (inst->dev_ext_disp_hash[i].func_name != NULL) @@ -3624,24 +3317,22 @@ static bool loader_name_in_dev_ext_table(struct loader_instance *inst, uint32_t return false; } -/** - * This function returns generic trampoline code address for unknown entry - * points. - * Presumably, these unknown entry points (as given by funcName) are device - * extension entrypoints. A hash table is used to keep a list of unknown entry - * points and their mapping to the device extension dispatch table - * (struct loader_dev_ext_dispatch_table). - * \returns - * For a given entry point string (funcName), if an existing mapping is found - * the - * trampoline address for that mapping is returned. Otherwise, this unknown - * entry point - * has not been seen yet. Next check if a layer or ICD supports it. If so then - * a - * new entry in the hash table is initialized and that trampoline address for - * the new entry is returned. Null is returned if the hash table is full or - * if no discovered layer or ICD returns a non-NULL GetProcAddr for it. - */ +// This function returns generic trampoline code address for unknown entry +// points. +// Presumably, these unknown entry points (as given by funcName) are device +// extension entrypoints. A hash table is used to keep a list of unknown entry +// points and their mapping to the device extension dispatch table +// (struct loader_dev_ext_dispatch_table). +// \returns +// For a given entry point string (funcName), if an existing mapping is found +// the +// trampoline address for that mapping is returned. Otherwise, this unknown +// entry point +// has not been seen yet. Next check if a layer or ICD supports it. If so then +// a +// new entry in the hash table is initialized and that trampoline address for +// the new entry is returned. Null is returned if the hash table is full or +// if no discovered layer or ICD returns a non-NULL GetProcAddr for it. void *loader_dev_ext_gpa(struct loader_instance *inst, const char *funcName) { uint32_t idx; uint32_t seed = 0; @@ -3893,10 +3584,9 @@ out: } struct loader_instance *loader_get_instance(const VkInstance instance) { - /* look up the loader_instance in our list by comparing dispatch tables, as - * there is no guarantee the instance is still a loader_instance* after any - * layers which wrap the instance object. - */ + // look up the loader_instance in our list by comparing dispatch tables, as + // there is no guarantee the instance is still a loader_instance* after any + // layers which wrap the instance object. const VkLayerInstanceDispatchTable *disp; struct loader_instance *ptr_instance = NULL; disp = loader_get_instance_layer_dispatch(instance); @@ -3930,7 +3620,7 @@ static void loader_close_layer_lib(const struct loader_instance *inst, struct lo void loader_deactivate_layers(const struct loader_instance *instance, struct loader_device *device, struct loader_layer_list *list) { - /* delete instance list of enabled layers and close any layer libraries */ + // Delete instance list of enabled layers and close any layer libraries for (uint32_t i = 0; i < list->count; i++) { struct loader_layer_properties *layer_prop = &list->list[i]; @@ -3939,10 +3629,8 @@ void loader_deactivate_layers(const struct loader_instance *instance, struct loa loader_destroy_layer_list(instance, device, list); } -/** - * Go through the search_list and find any layers which match type. If layer - * type match is found in then add it to ext_list. - */ +// Go through the search_list and find any layers which match type. If layer +// type match is found in then add it to ext_list. static void loader_add_layer_implicit(const struct loader_instance *inst, const enum layer_type type, struct loader_layer_list *list, const struct loader_layer_list *search_list) { bool enable; @@ -3951,7 +3639,7 @@ static void loader_add_layer_implicit(const struct loader_instance *inst, const for (i = 0; i < search_list->count; i++) { const struct loader_layer_properties *prop = &search_list->list[i]; if (prop->type & type) { - /* Found an implicit layer, see if it should be enabled */ + // Found an implicit layer, see if it should be enabled enable = false; // if no enable_environment variable is specified, this implicit @@ -3982,11 +3670,9 @@ static void loader_add_layer_implicit(const struct loader_instance *inst, const } } -/** - * Get the layer name(s) from the env_name environment variable. If layer - * is found in search_list then add it to layer_list. But only add it to - * layer_list if type matches. - */ +// Get the layer name(s) from the env_name environment variable. If layer +// is found in search_list then add it to layer_list. But only add it to +// layer_list if type matches. static void loader_add_layer_env(struct loader_instance *inst, const enum layer_type type, const char *env_name, struct loader_layer_list *layer_list, const struct loader_layer_list *search_list) { char *layerEnv; @@ -4007,10 +3693,8 @@ static void loader_add_layer_env(struct loader_instance *inst, const enum layer_ while (name && *name) { next = loader_get_next_path(name); if (!strcmp(std_validation_str, name)) { - /* add meta list of layers - don't attempt to remove duplicate layers already added by app or - env var - */ + // Add meta list of layers + // Don't attempt to remove duplicate layers already added by app or env var loader_log(inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, "Expanding meta layer %s found in environment variable", std_validation_str); if (type == VK_LAYER_TYPE_INSTANCE_EXPLICIT) inst->activated_layers_are_std_val = true; @@ -4039,13 +3723,13 @@ VkResult loader_enable_instance_layers(struct loader_instance *inst, const VkIns return VK_ERROR_OUT_OF_HOST_MEMORY; } - /* Add any implicit layers first */ + // Add any implicit layers first loader_add_layer_implicit(inst, VK_LAYER_TYPE_INSTANCE_IMPLICIT, &inst->activated_layer_list, instance_layers); - /* Add any layers specified via environment variable next */ + // Add any layers specified via environment variable next loader_add_layer_env(inst, VK_LAYER_TYPE_INSTANCE_EXPLICIT, "VK_INSTANCE_LAYERS", &inst->activated_layer_list, instance_layers); - /* Add layers specified by the application */ + // Add layers specified by the application err = loader_add_layer_names_to_list(inst, &inst->activated_layer_list, pCreateInfo->enabledLayerCount, pCreateInfo->ppEnabledLayerNames, instance_layers); @@ -4082,24 +3766,22 @@ bool loader_get_layer_interface_version(PFN_vkNegotiateLoaderLayerInterfaceVersi return true; } -/* - * Given the list of layers to activate in the loader_instance - * structure. This function will add a VkLayerInstanceCreateInfo - * structure to the VkInstanceCreateInfo.pNext pointer. - * Each activated layer will have it's own VkLayerInstanceLink - * structure that tells the layer what Get*ProcAddr to call to - * get function pointers to the next layer down. - * Once the chain info has been created this function will - * execute the CreateInstance call chain. Each layer will - * then have an opportunity in it's CreateInstance function - * to setup it's dispatch table when the lower layer returns - * successfully. - * Each layer can wrap or not-wrap the returned VkInstance object - * as it sees fit. - * The instance chain is terminated by a loader function - * that will call CreateInstance on all available ICD's and - * cache those VkInstance objects for future use. - */ +// Given the list of layers to activate in the loader_instance +// structure. This function will add a VkLayerInstanceCreateInfo +// structure to the VkInstanceCreateInfo.pNext pointer. +// Each activated layer will have it's own VkLayerInstanceLink +// structure that tells the layer what Get*ProcAddr to call to +// get function pointers to the next layer down. +// Once the chain info has been created this function will +// execute the CreateInstance call chain. Each layer will +// then have an opportunity in it's CreateInstance function +// to setup it's dispatch table when the lower layer returns +// successfully. +// Each layer can wrap or not-wrap the returned VkInstance object +// as it sees fit. +// The instance chain is terminated by a loader function +// that will call CreateInstance on all available ICD's and +// cache those VkInstance objects for future use. VkResult loader_create_instance_chain(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, struct loader_instance *inst, VkInstance *created_instance) { uint32_t activated_layers = 0; @@ -4269,6 +3951,49 @@ VkResult loader_create_device_chain(const struct loader_physical_device_tramp *p memcpy(&loader_create_info, pCreateInfo, sizeof(VkDeviceCreateInfo)); + // Before we continue, we need to find out if the KHX_device_group extension is in the enabled list. If it is, we then + // need to look for the corresponding VkDeviceGroupDeviceCreateInfoKHX struct in the device list. This is because we + // need to replace all the incoming physical device values (which are really loader trampoline physical device values) + // with the layer/ICD version. + if (inst->enabled_known_extensions.khx_device_group_creation == 1) { + struct VkStructureHeader *pNext = (struct VkStructureHeader *)loader_create_info.pNext; + struct VkStructureHeader *pPrev = (struct VkStructureHeader *)&loader_create_info; + while (NULL != pNext) { + if (VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO_KHX == pNext->sType) { + VkDeviceGroupDeviceCreateInfoKHX *cur_struct = (VkDeviceGroupDeviceCreateInfoKHX *)pNext; + if (0 < cur_struct->physicalDeviceCount && NULL != cur_struct->pPhysicalDevices) { + VkDeviceGroupDeviceCreateInfoKHX *temp_struct = loader_stack_alloc(sizeof(VkDeviceGroupDeviceCreateInfoKHX)); + VkPhysicalDevice *phys_dev_array = NULL; + if (NULL == temp_struct) { + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + memcpy(temp_struct, cur_struct, sizeof(VkDeviceGroupDeviceCreateInfoKHX)); + phys_dev_array = loader_stack_alloc(sizeof(VkPhysicalDevice) * cur_struct->physicalDeviceCount); + if (NULL == phys_dev_array) { + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + + // Before calling down, replace the incoming physical device values (which are really loader trampoline + // physical devices) with the next layer (or possibly even the terminator) physical device values. + struct loader_physical_device_tramp *cur_tramp; + for (uint32_t phys_dev = 0; phys_dev < cur_struct->physicalDeviceCount; phys_dev++) { + cur_tramp = (struct loader_physical_device_tramp *)cur_struct->pPhysicalDevices[phys_dev]; + phys_dev_array[phys_dev] = cur_tramp->phys_dev; + } + temp_struct->pPhysicalDevices = phys_dev_array; + + // Replace the old struct in the pNext chain with this one. + pPrev->pNext = (const void *)temp_struct; + pNext = (struct VkStructureHeader *)(temp_struct); + } + break; + } + + pPrev = pNext; + pNext = (struct VkStructureHeader *)(pPrev->pNext); + } + } + layer_device_link_info = loader_stack_alloc(sizeof(VkLayerDeviceLink) * dev->activated_layer_list.count); if (!layer_device_link_info) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, @@ -4295,10 +4020,8 @@ VkResult loader_create_device_chain(const struct loader_physical_device_tramp *p continue; } - // If we can negotiate an interface version, then we can also - // get everything we need from the one function call, so try - // that first, and see if we can get all the function pointers - // necessary from that one call. + // If we can negotiate an interface version, then we can also get everything we need from the one function + // call, so try that first, and see if we can get all the function pointers necessary from that one call. if (NULL == layer_prop->functions.negotiate_layer_interface) { PFN_vkNegotiateLoaderLayerInterfaceVersion negotiate_interface = NULL; if (strlen(layer_prop->functions.str_negotiate_interface) == 0) { @@ -4315,13 +4038,11 @@ VkResult loader_create_device_chain(const struct loader_physical_device_tramp *p VkNegotiateLayerInterface interface_struct; if (loader_get_layer_interface_version(negotiate_interface, &interface_struct)) { - // Go ahead and set the properites version to the - // correct value. + // Go ahead and set the properites version to the correct value. layer_prop->interface_version = interface_struct.loaderLayerInterfaceVersion; - // If the interface is 2 or newer, we have access to the - // new GetPhysicalDeviceProcAddr function, so grab it, - // and the other necessary functions, from the structure. + // If the interface is 2 or newer, we have access to the new GetPhysicalDeviceProcAddr + // function, so grab it, and the other necessary functions, from the structure. if (interface_struct.loaderLayerInterfaceVersion > 1) { fpGIPA = interface_struct.pfnGetInstanceProcAddr; fpGDPA = interface_struct.pfnGetDeviceProcAddr; @@ -4478,20 +4199,17 @@ VkResult loader_validate_instance_extensions(const struct loader_instance *inst, extension_prop = NULL; - /* Not in global list, search layer extension lists */ + // Not in global list, search layer extension lists for (uint32_t j = 0; j < pCreateInfo->enabledLayerCount; j++) { layer_prop = loader_get_layer_property(pCreateInfo->ppEnabledLayerNames[j], instance_layers); if (!layer_prop) { - /* Should NOT get here, loader_validate_layers - * should have already filtered this case out. - */ + // Should NOT get here, loader_validate_layers should have already filtered this case out. continue; } extension_prop = get_extension_property(pCreateInfo->ppEnabledExtensionNames[i], &layer_prop->instance_extension_list); if (extension_prop) { - /* Found the extension in one of the layers enabled by the app. - */ + // Found the extension in one of the layers enabled by the app. break; } } @@ -4601,8 +4319,7 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateInstance(const VkInstanceCreateI struct loader_extension_list icd_exts; loader_log(ptr_instance, VK_DEBUG_REPORT_DEBUG_BIT_EXT, 0, "Build ICD instance extension list"); - // traverse scanned icd list adding non-duplicate extensions to the - // list + // traverse scanned icd list adding non-duplicate extensions to the list res = loader_init_generic_list(ptr_instance, (struct loader_generic_list *)&icd_exts, sizeof(VkExtensionProperties)); if (VK_ERROR_OUT_OF_HOST_MEMORY == res) { // If out of memory, bail immediately. @@ -4624,8 +4341,7 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateInstance(const VkInstanceCreateI // If out of memory, bail immediately. goto out; } else { - // Something bad happened with this ICD, so free it and try - // the next. + // Something bad happened with this ICD, so free it and try the next. ptr_instance->icd_terms = icd_term->next; icd_term->next = NULL; loader_icd_destroy(ptr_instance, icd_term, pAllocator); @@ -4660,8 +4376,8 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateInstance(const VkInstanceCreateI continue; } - if (!loader_icd_init_entrys(icd_term, icd_term->instance, - ptr_instance->icd_tramp_list.scanned_list[i].GetInstanceProcAddr)) { + if (!loader_icd_init_entries(icd_term, icd_term->instance, + ptr_instance->icd_tramp_list.scanned_list[i].GetInstanceProcAddr)) { loader_log(ptr_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, "terminator_CreateInstance: Failed to CreateInstance and find " "entrypoints with ICD. Skipping ICD."); @@ -4672,9 +4388,8 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateInstance(const VkInstanceCreateI one_icd_successful = true; } - // If no ICDs were added to instance list and res is unchanged - // from it's initial value, the loader was unable to find - // a suitable ICD. + // If no ICDs were added to instance list and res is unchanged from it's initial value, the loader was unable to + // find a suitable ICD. if (VK_SUCCESS == res && (ptr_instance->icd_terms == NULL || !one_icd_successful)) { res = VK_ERROR_INCOMPATIBLE_DRIVER; } @@ -4686,7 +4401,7 @@ out: icd_term = ptr_instance->icd_terms; ptr_instance->icd_terms = icd_term->next; if (NULL != icd_term->instance) { - icd_term->DestroyInstance(icd_term->instance, pAllocator); + icd_term->dispatch.DestroyInstance(icd_term->instance, pAllocator); } loader_icd_destroy(ptr_instance, icd_term, pAllocator); } @@ -4721,7 +4436,7 @@ VKAPI_ATTR void VKAPI_CALL terminator_DestroyInstance(VkInstance instance, const while (NULL != icd_terms) { if (icd_terms->instance) { - icd_terms->DestroyInstance(icd_terms->instance, pAllocator); + icd_terms->dispatch.DestroyInstance(icd_terms->instance, pAllocator); } next_icd_term = icd_terms->next; icd_terms->instance = VK_NULL_HANDLE; @@ -4751,7 +4466,7 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDevice(VkPhysicalDevice physical struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; struct loader_device *dev = (struct loader_device *)*pDevice; - PFN_vkCreateDevice fpCreateDevice = icd_term->CreateDevice; + PFN_vkCreateDevice fpCreateDevice = icd_term->dispatch.CreateDevice; struct loader_extension_list icd_exts; dev->phys_dev_term = phys_dev_term; @@ -4796,7 +4511,7 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDevice(VkPhysicalDevice physical goto out; } - res = loader_add_device_extensions(icd_term->this_instance, icd_term->EnumerateDeviceExtensionProperties, + res = loader_add_device_extensions(icd_term->this_instance, icd_term->dispatch.EnumerateDeviceExtensionProperties, phys_dev_term->phys_dev, icd_term->scanned_icd->lib_name, &icd_exts); if (res != VK_SUCCESS) { goto out; @@ -4816,6 +4531,48 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDevice(VkPhysicalDevice physical } } + // Before we continue, If KHX_device_group is the list of enabled and viable extensions, then we then need to look for the + // corresponding VkDeviceGroupDeviceCreateInfoKHX struct in the device list and replace all the physical device values (which + // are really loader physical device terminator values) with the ICD versions. + if (icd_term->this_instance->enabled_known_extensions.khx_device_group_creation == 1) { + struct VkStructureHeader *pNext = (struct VkStructureHeader *)localCreateInfo.pNext; + struct VkStructureHeader *pPrev = (struct VkStructureHeader *)&localCreateInfo; + while (NULL != pNext) { + if (VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO_KHX == pNext->sType) { + VkDeviceGroupDeviceCreateInfoKHX *cur_struct = (VkDeviceGroupDeviceCreateInfoKHX *)pNext; + if (0 < cur_struct->physicalDeviceCount && NULL != cur_struct->pPhysicalDevices) { + VkDeviceGroupDeviceCreateInfoKHX *temp_struct = loader_stack_alloc(sizeof(VkDeviceGroupDeviceCreateInfoKHX)); + VkPhysicalDevice *phys_dev_array = NULL; + if (NULL == temp_struct) { + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + memcpy(temp_struct, cur_struct, sizeof(VkDeviceGroupDeviceCreateInfoKHX)); + phys_dev_array = loader_stack_alloc(sizeof(VkPhysicalDevice) * cur_struct->physicalDeviceCount); + if (NULL == phys_dev_array) { + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + + // Before calling down, replace the incoming physical device values (which are really loader terminator + // physical devices) with the ICDs physical device values. + struct loader_physical_device_term *cur_term; + for (uint32_t phys_dev = 0; phys_dev < cur_struct->physicalDeviceCount; phys_dev++) { + cur_term = (struct loader_physical_device_term *)cur_struct->pPhysicalDevices[phys_dev]; + phys_dev_array[phys_dev] = cur_term->phys_dev; + } + temp_struct->pPhysicalDevices = phys_dev_array; + + // Replace the old struct in the pNext chain with this one. + pPrev->pNext = (const void *)temp_struct; + pNext = (struct VkStructureHeader *)(temp_struct); + } + break; + } + + pPrev = pNext; + pNext = (struct VkStructureHeader *)(pPrev->pNext); + } + } + res = fpCreateDevice(phys_dev_term->phys_dev, &localCreateInfo, pAllocator, &dev->icd_device); if (res != VK_SUCCESS) { loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, @@ -4828,7 +4585,7 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDevice(VkPhysicalDevice physical *pDevice = dev->icd_device; loader_add_logical_device(icd_term->this_instance, icd_term, dev); - /* Init dispatch pointer in new device object */ + // Init dispatch pointer in new device object loader_init_dispatch(*pDevice, &dev->loader_dispatch); out: @@ -4983,7 +4740,7 @@ VkResult setupLoaderTermPhysDevs(struct loader_instance *inst) { // For each ICD, query the number of physical devices, and then get an // internal value for those physical devices. for (uint32_t icd_idx = 0; NULL != icd_term; icd_term = icd_term->next, icd_idx++) { - res = icd_term->EnumeratePhysicalDevices(icd_term->instance, &icd_phys_dev_array[icd_idx].count, NULL); + res = icd_term->dispatch.EnumeratePhysicalDevices(icd_term->instance, &icd_phys_dev_array[icd_idx].count, NULL); if (VK_SUCCESS != res) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "setupLoaderTermPhysDevs: Call to " @@ -5004,8 +4761,8 @@ VkResult setupLoaderTermPhysDevs(struct loader_instance *inst) { goto out; } - res = icd_term->EnumeratePhysicalDevices(icd_term->instance, &(icd_phys_dev_array[icd_idx].count), - icd_phys_dev_array[icd_idx].phys_devs); + res = icd_term->dispatch.EnumeratePhysicalDevices(icd_term->instance, &(icd_phys_dev_array[icd_idx].count), + icd_phys_dev_array[icd_idx].phys_devs); if (VK_SUCCESS != res) { goto out; } @@ -5149,8 +4906,8 @@ VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceProperties(VkPhysicalDevi VkPhysicalDeviceProperties *pProperties) { struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - if (NULL != icd_term->GetPhysicalDeviceProperties) { - icd_term->GetPhysicalDeviceProperties(phys_dev_term->phys_dev, pProperties); + if (NULL != icd_term->dispatch.GetPhysicalDeviceProperties) { + icd_term->dispatch.GetPhysicalDeviceProperties(phys_dev_term->phys_dev, pProperties); } } @@ -5159,8 +4916,8 @@ VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceQueueFamilyProperties(VkP VkQueueFamilyProperties *pProperties) { struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - if (NULL != icd_term->GetPhysicalDeviceQueueFamilyProperties) { - icd_term->GetPhysicalDeviceQueueFamilyProperties(phys_dev_term->phys_dev, pQueueFamilyPropertyCount, pProperties); + if (NULL != icd_term->dispatch.GetPhysicalDeviceQueueFamilyProperties) { + icd_term->dispatch.GetPhysicalDeviceQueueFamilyProperties(phys_dev_term->phys_dev, pQueueFamilyPropertyCount, pProperties); } } @@ -5168,8 +4925,8 @@ VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceMemoryProperties(VkPhysic VkPhysicalDeviceMemoryProperties *pProperties) { struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - if (NULL != icd_term->GetPhysicalDeviceMemoryProperties) { - icd_term->GetPhysicalDeviceMemoryProperties(phys_dev_term->phys_dev, pProperties); + if (NULL != icd_term->dispatch.GetPhysicalDeviceMemoryProperties) { + icd_term->dispatch.GetPhysicalDeviceMemoryProperties(phys_dev_term->phys_dev, pProperties); } } @@ -5177,8 +4934,8 @@ VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceFeatures(VkPhysicalDevice VkPhysicalDeviceFeatures *pFeatures) { struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - if (NULL != icd_term->GetPhysicalDeviceFeatures) { - icd_term->GetPhysicalDeviceFeatures(phys_dev_term->phys_dev, pFeatures); + if (NULL != icd_term->dispatch.GetPhysicalDeviceFeatures) { + icd_term->dispatch.GetPhysicalDeviceFeatures(phys_dev_term->phys_dev, pFeatures); } } @@ -5186,8 +4943,8 @@ VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceFormatProperties(VkPhysic VkFormatProperties *pFormatInfo) { struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - if (NULL != icd_term->GetPhysicalDeviceFormatProperties) { - icd_term->GetPhysicalDeviceFormatProperties(phys_dev_term->phys_dev, format, pFormatInfo); + if (NULL != icd_term->dispatch.GetPhysicalDeviceFormatProperties) { + icd_term->dispatch.GetPhysicalDeviceFormatProperties(phys_dev_term->phys_dev, format, pFormatInfo); } } @@ -5197,14 +4954,14 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceImageFormatProperties VkImageFormatProperties *pImageFormatProperties) { struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - if (NULL == icd_term->GetPhysicalDeviceImageFormatProperties) { + if (NULL == icd_term->dispatch.GetPhysicalDeviceImageFormatProperties) { loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "Encountered the vkEnumerateDeviceLayerProperties " "terminator. This means a layer improperly continued."); return VK_ERROR_INITIALIZATION_FAILED; } - return icd_term->GetPhysicalDeviceImageFormatProperties(phys_dev_term->phys_dev, format, type, tiling, usage, flags, - pImageFormatProperties); + return icd_term->dispatch.GetPhysicalDeviceImageFormatProperties(phys_dev_term->phys_dev, format, type, tiling, usage, flags, + pImageFormatProperties); } VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, @@ -5214,9 +4971,9 @@ VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceSparseImageFormatProperti VkSparseImageFormatProperties *pProperties) { struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - if (NULL != icd_term->GetPhysicalDeviceSparseImageFormatProperties) { - icd_term->GetPhysicalDeviceSparseImageFormatProperties(phys_dev_term->phys_dev, format, type, samples, usage, tiling, - pNumProperties, pProperties); + if (NULL != icd_term->dispatch.GetPhysicalDeviceSparseImageFormatProperties) { + icd_term->dispatch.GetPhysicalDeviceSparseImageFormatProperties(phys_dev_term->phys_dev, format, type, samples, usage, + tiling, pNumProperties, pProperties); } } @@ -5231,18 +4988,17 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumerateDeviceExtensionProperties(VkP assert(pLayerName == NULL || strlen(pLayerName) == 0); - /* Any layer or trampoline wrapping should be removed at this point in time - * can just cast to the expected type for VkPhysicalDevice. */ + // Any layer or trampoline wrapping should be removed at this point in time can just cast to the expected + // type for VkPhysicalDevice. phys_dev_term = (struct loader_physical_device_term *)physicalDevice; - /* this case is during the call down the instance chain with pLayerName - * == NULL*/ + // This case is during the call down the instance chain with pLayerName == NULL struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; uint32_t icd_ext_count = *pPropertyCount; VkResult res; - /* get device extensions */ - res = icd_term->EnumerateDeviceExtensionProperties(phys_dev_term->phys_dev, NULL, &icd_ext_count, pProperties); + // Get the available device extensions + res = icd_term->dispatch.EnumerateDeviceExtensionProperties(phys_dev_term->phys_dev, NULL, &icd_ext_count, pProperties); if (res != VK_SUCCESS) { goto out; } @@ -5254,22 +5010,17 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumerateDeviceExtensionProperties(VkP loader_add_layer_implicit(icd_term->this_instance, VK_LAYER_TYPE_INSTANCE_IMPLICIT, &implicit_layer_list, &icd_term->this_instance->instance_layer_list); - /* we need to determine which implicit layers are active, - * and then add their extensions. This can't be cached as - * it depends on results of environment variables (which can change). - */ + // We need to determine which implicit layers are active, and then add their extensions. This can't be cached as + // it depends on results of environment variables (which can change). if (pProperties != NULL) { - /* initialize dev_extension list within the physicalDevice object */ + // Initialize dev_extension list within the physicalDevice object res = loader_init_device_extensions(icd_term->this_instance, phys_dev_term, icd_ext_count, pProperties, &icd_exts); if (res != VK_SUCCESS) { goto out; } - /* we need to determine which implicit layers are active, - * and then add their extensions. This can't be cached as - * it depends on results of environment variables (which can - * change). - */ + // We need to determine which implicit layers are active, and then add their extensions. This can't be cached as + // it depends on results of environment variables (which can change). res = loader_add_to_ext_list(icd_term->this_instance, &all_exts, icd_exts.count, icd_exts.list); if (res != VK_SUCCESS) { goto out; @@ -5293,17 +5044,16 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumerateDeviceExtensionProperties(VkP for (uint32_t i = 0; i < all_exts.count && i < capacity; i++) { props[i] = all_exts.list[i]; } - /* wasn't enough space for the extensions, we did partial copy now - * return VK_INCOMPLETE */ + + // Wasn't enough space for the extensions, we did partial copy now return VK_INCOMPLETE if (capacity < all_exts.count) { res = VK_INCOMPLETE; } else { *pPropertyCount = all_exts.count; } } else { - /* just return the count; need to add in the count of implicit layer - * extensions - * don't worry about duplicates being added in the count */ + // Just return the count; need to add in the count of implicit layer extensions + // don't worry about duplicates being added in the count *pPropertyCount = icd_ext_count; for (uint32_t i = 0; i < implicit_layer_list.count; i++) { diff --git a/loader/loader.h b/loader/loader.h index 9a4fd8fc..417588ea 100644 --- a/loader/loader.h +++ b/loader/loader.h @@ -32,9 +32,9 @@ #include "vk_loader_platform.h" #include "vk_loader_layer.h" #include <vulkan/vk_layer.h> - #include <vulkan/vk_icd.h> #include <assert.h> +#include "vk_loader_extensions.h" #if defined(__GNUC__) && __GNUC__ >= 4 #define LOADER_EXPORT __attribute__((visibility("default"))) @@ -189,121 +189,29 @@ struct loader_device { struct loader_device *next; }; -/* per ICD structure */ +// Per ICD information + +// Per ICD structure struct loader_icd_term { // pointers to find other structs const struct loader_scanned_icd *scanned_icd; const struct loader_instance *this_instance; struct loader_device *logical_device_list; VkInstance instance; // instance object from the icd - PFN_vkGetDeviceProcAddr GetDeviceProcAddr; - PFN_vkDestroyInstance DestroyInstance; - PFN_vkEnumeratePhysicalDevices EnumeratePhysicalDevices; - PFN_vkGetPhysicalDeviceFeatures GetPhysicalDeviceFeatures; - PFN_vkGetPhysicalDeviceFormatProperties GetPhysicalDeviceFormatProperties; - PFN_vkGetPhysicalDeviceImageFormatProperties GetPhysicalDeviceImageFormatProperties; - PFN_vkCreateDevice CreateDevice; - PFN_vkGetPhysicalDeviceProperties GetPhysicalDeviceProperties; - PFN_vkGetPhysicalDeviceQueueFamilyProperties GetPhysicalDeviceQueueFamilyProperties; - PFN_vkGetPhysicalDeviceMemoryProperties GetPhysicalDeviceMemoryProperties; - PFN_vkEnumerateDeviceExtensionProperties EnumerateDeviceExtensionProperties; - PFN_vkGetPhysicalDeviceSparseImageFormatProperties GetPhysicalDeviceSparseImageFormatProperties; - // WSI extensions - PFN_vkGetPhysicalDeviceSurfaceSupportKHR GetPhysicalDeviceSurfaceSupportKHR; - PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR GetPhysicalDeviceSurfaceCapabilitiesKHR; - PFN_vkGetPhysicalDeviceSurfaceFormatsKHR GetPhysicalDeviceSurfaceFormatsKHR; - PFN_vkGetPhysicalDeviceSurfacePresentModesKHR GetPhysicalDeviceSurfacePresentModesKHR; -#ifdef VK_USE_PLATFORM_WIN32_KHR - PFN_vkCreateWin32SurfaceKHR CreateWin32SurfaceKHR; - PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR GetPhysicalDeviceWin32PresentationSupportKHR; -#endif -#ifdef VK_USE_PLATFORM_MIR_KHR - PFN_vkCreateMirSurfaceKHR CreateMirSurfaceKHR; - PFN_vkGetPhysicalDeviceMirPresentationSupportKHR GetPhysicalDeviceMirPresentationSupportKHR; -#endif -#ifdef VK_USE_PLATFORM_WAYLAND_KHR - PFN_vkCreateWaylandSurfaceKHR CreateWaylandSurfaceKHR; - PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR GetPhysicalDeviceWaylandPresentationSupportKHR; -#endif -#ifdef VK_USE_PLATFORM_XCB_KHR - PFN_vkCreateXcbSurfaceKHR CreateXcbSurfaceKHR; - PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR GetPhysicalDeviceXcbPresentationSupportKHR; -#endif -#ifdef VK_USE_PLATFORM_XLIB_KHR - PFN_vkCreateXlibSurfaceKHR CreateXlibSurfaceKHR; - PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR GetPhysicalDeviceXlibPresentationSupportKHR; -#endif - PFN_vkGetPhysicalDeviceDisplayPropertiesKHR GetPhysicalDeviceDisplayPropertiesKHR; - PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR GetPhysicalDeviceDisplayPlanePropertiesKHR; - PFN_vkGetDisplayPlaneSupportedDisplaysKHR GetDisplayPlaneSupportedDisplaysKHR; - PFN_vkGetDisplayModePropertiesKHR GetDisplayModePropertiesKHR; - PFN_vkCreateDisplayModeKHR CreateDisplayModeKHR; - PFN_vkGetDisplayPlaneCapabilitiesKHR GetDisplayPlaneCapabilitiesKHR; - PFN_vkCreateDisplayPlaneSurfaceKHR CreateDisplayPlaneSurfaceKHR; - PFN_vkDestroySurfaceKHR DestroySurfaceKHR; - PFN_vkCreateSwapchainKHR CreateSwapchainKHR; - PFN_vkCreateSharedSwapchainsKHR CreateSharedSwapchainsKHR; - - // KHR_get_physical_device_properties2 - PFN_vkGetPhysicalDeviceFeatures2KHR GetPhysicalDeviceFeatures2KHR; - PFN_vkGetPhysicalDeviceProperties2KHR GetPhysicalDeviceProperties2KHR; - PFN_vkGetPhysicalDeviceFormatProperties2KHR GetPhysicalDeviceFormatProperties2KHR; - PFN_vkGetPhysicalDeviceImageFormatProperties2KHR GetPhysicalDeviceImageFormatProperties2KHR; - PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR GetPhysicalDeviceQueueFamilyProperties2KHR; - PFN_vkGetPhysicalDeviceMemoryProperties2KHR GetPhysicalDeviceMemoryProperties2KHR; - PFN_vkGetPhysicalDeviceSparseImageFormatProperties2KHR GetPhysicalDeviceSparseImageFormatProperties2KHR; - -#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT - // EXT_acquire_xlib_display - PFN_vkAcquireXlibDisplayEXT AcquireXlibDisplayEXT; - PFN_vkGetRandROutputDisplayEXT GetRandROutputDisplayEXT; -#endif - - // EXT_debug_report - PFN_vkCreateDebugReportCallbackEXT CreateDebugReportCallbackEXT; - PFN_vkDestroyDebugReportCallbackEXT DestroyDebugReportCallbackEXT; - PFN_vkDebugReportMessageEXT DebugReportMessageEXT; - - // EXT_debug_marker (items needing a trampoline/terminator) - PFN_vkDebugMarkerSetObjectTagEXT DebugMarkerSetObjectTagEXT; - PFN_vkDebugMarkerSetObjectNameEXT DebugMarkerSetObjectNameEXT; - - // EXT_direct_mode_display - PFN_vkReleaseDisplayEXT ReleaseDisplayEXT; - - // EXT_display_surface_counter - PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT GetPhysicalDeviceSurfaceCapabilities2EXT; - - // NV_external_memory_capabilities - PFN_vkGetPhysicalDeviceExternalImageFormatPropertiesNV GetPhysicalDeviceExternalImageFormatPropertiesNV; - - // NVX_device_generated_commands - PFN_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX GetPhysicalDeviceGeneratedCommandsPropertiesNVX; + struct loader_icd_term_dispatch dispatch; struct loader_icd_term *next; PFN_PhysDevExt phys_dev_ext[MAX_NUM_UNKNOWN_EXTS]; }; -// per ICD library structure +// Per ICD library structure struct loader_icd_tramp_list { size_t capacity; uint32_t count; struct loader_scanned_icd *scanned_list; }; -union loader_instance_extension_enables { - struct { - uint8_t khr_get_physical_device_properties2 : 1; - uint8_t ext_acquire_xlib_display : 1; - uint8_t ext_debug_report : 1; - uint8_t ext_direct_mode_display : 1; - uint8_t ext_display_surface_counter : 1; - uint8_t nv_external_memory_capabilities : 1; - }; - uint64_t padding[4]; -}; - struct loader_instance_dispatch_table { VkLayerInstanceDispatchTable layer_inst_disp; // must be first entry in structure @@ -311,7 +219,7 @@ struct loader_instance_dispatch_table { PFN_PhysDevExt phys_dev_ext[MAX_NUM_UNKNOWN_EXTS]; }; -// per instance structure +// Per instance structure struct loader_instance { struct loader_instance_dispatch_table *disp; // must be first entry in structure @@ -369,27 +277,27 @@ struct loader_instance { bool wsi_display_enabled; }; -/* VkPhysicalDevice requires special treatment by loader. Firstly, terminator - * code must be able to get the struct loader_icd_term to call into the proper - * driver (multiple ICD/gpu case). This can be accomplished by wrapping the - * created VkPhysicalDevice in loader terminate_EnumeratePhysicalDevices(). - * Secondly, the loader must be able to handle wrapped by layer VkPhysicalDevice - * in trampoline code. This implies, that the loader trampoline code must also - * wrap the VkPhysicalDevice object in trampoline code. Thus, loader has to - * wrap the VkPhysicalDevice created object twice. In trampoline code it can't - * rely on the terminator object wrapping since a layer may also wrap. Since - * trampoline code wraps the VkPhysicalDevice this means all loader trampoline - * code that passes a VkPhysicalDevice should unwrap it. */ - -/* per enumerated PhysicalDevice structure, used to wrap in trampoline code and - also same structure used to wrap in terminator code */ +// VkPhysicalDevice requires special treatment by loader. Firstly, terminator +// code must be able to get the struct loader_icd_term to call into the proper +// driver (multiple ICD/gpu case). This can be accomplished by wrapping the +// created VkPhysicalDevice in loader terminate_EnumeratePhysicalDevices(). +// Secondly, the loader must be able to handle wrapped by layer VkPhysicalDevice +// in trampoline code. This implies, that the loader trampoline code must also +// wrap the VkPhysicalDevice object in trampoline code. Thus, loader has to +// wrap the VkPhysicalDevice created object twice. In trampoline code it can't +// rely on the terminator object wrapping since a layer may also wrap. Since +// trampoline code wraps the VkPhysicalDevice this means all loader trampoline +// code that passes a VkPhysicalDevice should unwrap it. + +// Per enumerated PhysicalDevice structure, used to wrap in trampoline code and +// also same structure used to wrap in terminator code struct loader_physical_device_tramp { struct loader_instance_dispatch_table *disp; // must be first entry in structure struct loader_instance *this_instance; VkPhysicalDevice phys_dev; // object from layers/loader terminator }; -/* per enumerated PhysicalDevice structure, used to wrap in terminator code */ +// Per enumerated PhysicalDevice structure, used to wrap in terminator code struct loader_physical_device_term { struct loader_instance_dispatch_table *disp; // must be first entry in structure struct loader_icd_term *this_icd_term; @@ -445,13 +353,12 @@ static inline void loader_init_dispatch(void *obj, const void *data) { loader_set_dispatch(obj, data); } -/* global variables used across files */ +// Global variables used across files extern struct loader_struct loader; extern THREAD_LOCAL_DECL struct loader_instance *tls_instance; extern LOADER_PLATFORM_THREAD_ONCE_DEFINITION(once_init); extern loader_platform_thread_mutex loader_lock; extern loader_platform_thread_mutex loader_json_lock; -extern const VkLayerInstanceDispatchTable instance_disp; extern const char *std_validation_str; struct loader_msg_callback_map_entry { @@ -459,7 +366,7 @@ struct loader_msg_callback_map_entry { VkDebugReportCallbackEXT loader_obj; }; -/* helper function definitions */ +// Helper function definitions void *loader_instance_heap_alloc(const struct loader_instance *instance, size_t size, VkSystemAllocationScope allocationScope); void loader_instance_heap_free(const struct loader_instance *instance, void *pMemory); void *loader_instance_heap_realloc(const struct loader_instance *instance, void *pMemory, size_t orig_size, size_t size, @@ -563,51 +470,6 @@ VkResult loader_validate_device_extensions(struct loader_physical_device_tramp * VkResult setupLoaderTrampPhysDevs(VkInstance instance); VkResult setupLoaderTermPhysDevs(struct loader_instance *inst); -/* instance layer chain termination entrypoint definitions */ -VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateInstance(const VkInstanceCreateInfo *pCreateInfo, - const VkAllocationCallbacks *pAllocator, VkInstance *pInstance); - -VKAPI_ATTR void VKAPI_CALL terminator_DestroyInstance(VkInstance instance, const VkAllocationCallbacks *pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumeratePhysicalDevices(VkInstance instance, uint32_t *pPhysicalDeviceCount, - VkPhysicalDevice *pPhysicalDevices); - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice, - VkPhysicalDeviceFeatures *pFeatures); - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, - VkFormatProperties *pFormatInfo); - -VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, - VkImageType type, VkImageTiling tiling, - VkImageUsageFlags usage, VkImageCreateFlags flags, - VkImageFormatProperties *pImageFormatProperties); - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, - VkImageType type, VkSampleCountFlagBits samples, - VkImageUsageFlags usage, VkImageTiling tiling, - uint32_t *pNumProperties, - VkSparseImageFormatProperties *pProperties); - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice, - VkPhysicalDeviceProperties *pProperties); - -VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, - const char *pLayerName, uint32_t *pCount, - VkExtensionProperties *pProperties); - -VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t *pCount, - VkLayerProperties *pProperties); - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceQueueFamilyProperties(VkPhysicalDevice physicalDevice, uint32_t *pCount, - VkQueueFamilyProperties *pProperties); - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceMemoryProperties(VkPhysicalDevice physicalDevice, - VkPhysicalDeviceMemoryProperties *pProperties); - -VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDevice(VkPhysicalDevice gpu, const VkDeviceCreateInfo *pCreateInfo, - const VkAllocationCallbacks *pAllocator, VkDevice *pDevice); - VkStringErrorFlags vk_string_validate(const int max_length, const char *char_array); -#endif /* LOADER_H */ +#endif // LOADER_H diff --git a/loader/trampoline.c b/loader/trampoline.c index 23a1b702..2550cbf5 100644 --- a/loader/trampoline.c +++ b/loader/trampoline.c @@ -30,70 +30,62 @@ #include "loader.h" #include "debug_report.h" #include "wsi.h" -#include "extensions.h" +#include "vk_loader_extensions.h" #include "gpa_helper.h" -#include "table_ops.h" - -/* Trampoline entrypoints are in this file for core Vulkan commands */ -/** - * Get an instance level or global level entry point address. - * @param instance - * @param pName - * @return - * If instance == NULL returns a global level functions only - * If instance is valid returns a trampoline entry point for all dispatchable - * Vulkan - * functions both core and extensions. - */ + +// Trampoline entrypoints are in this file for core Vulkan commands + +// Get an instance level or global level entry point address. +// @param instance +// @param pName +// @return +// If instance == NULL returns a global level functions only +// If instance is valid returns a trampoline entry point for all dispatchable Vulkan +// functions both core and extensions. LOADER_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetInstanceProcAddr(VkInstance instance, const char *pName) { void *addr; addr = globalGetProcAddr(pName); if (instance == VK_NULL_HANDLE) { - // get entrypoint addresses that are global (no dispatchable object) + // Get entrypoint addresses that are global (no dispatchable object) return addr; } else { - // if a global entrypoint return NULL + // If a global entrypoint return NULL if (addr) return NULL; } struct loader_instance *ptr_instance = loader_get_instance(instance); if (ptr_instance == NULL) return NULL; - // Return trampoline code for non-global entrypoints including any - // extensions. + // Return trampoline code for non-global entrypoints including any extensions. // Device extensions are returned if a layer or ICD supports the extension. // Instance extensions are returned if the extension is enabled and the // loader or someone else supports the extension return trampolineGetProcAddr(ptr_instance, pName); } -/** - * Get a device level or global level entry point address. - * @param device - * @param pName - * @return - * If device is valid, returns a device relative entry point for device level - * entry points both core and extensions. - * Device relative means call down the device chain. - */ +// Get a device level or global level entry point address. +// @param device +// @param pName +// @return +// If device is valid, returns a device relative entry point for device level +// entry points both core and extensions. +// Device relative means call down the device chain. LOADER_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetDeviceProcAddr(VkDevice device, const char *pName) { void *addr; - /* for entrypoints that loader must handle (ie non-dispatchable or create - object) - make sure the loader entrypoint is returned */ + // For entrypoints that loader must handle (ie non-dispatchable or create object) + // make sure the loader entrypoint is returned addr = loader_non_passthrough_gdpa(pName); if (addr) { return addr; } - /* Although CreateDevice is on device chain it's dispatchable object isn't - * a VkDevice or child of VkDevice so return NULL. - */ + // Although CreateDevice is on device chain it's dispatchable object isn't + // a VkDevice or child of VkDevice so return NULL. if (!strcmp(pName, "CreateDevice")) return NULL; - /* return the dispatch table entrypoint for the fastest case */ + // Return the dispatch table entrypoint for the fastest case const VkLayerDispatchTable *disp_table = *(VkLayerDispatchTable **)device; if (disp_table == NULL) return NULL; @@ -119,7 +111,7 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceExtensionPropert memset(&instance_layers, 0, sizeof(instance_layers)); loader_platform_thread_once(&once_init, loader_initialize); - /* get layer libraries if needed */ + // Get layer libraries if needed if (pLayerName && strlen(pLayerName) != 0) { if (vk_string_validate(MaxLoaderStringLength, pLayerName) != VK_STRING_ERROR_NONE) { assert(VK_FALSE && @@ -154,13 +146,13 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceExtensionPropert } } } else { - /* Scan/discover all ICD libraries */ + // Scan/discover all ICD libraries memset(&icd_tramp_list, 0, sizeof(struct loader_icd_tramp_list)); res = loader_icd_scan(NULL, &icd_tramp_list); if (VK_SUCCESS != res) { goto out; } - /* get extensions from all ICD's, merge so no duplicates */ + // Get extensions from all ICD's, merge so no duplicates res = loader_get_icd_loader_instance_extensions(NULL, &icd_tramp_list, &local_ext_list); if (VK_SUCCESS != res) { goto out; @@ -214,7 +206,7 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceLayerProperties( uint32_t copy_size; - /* get layer libraries */ + // Get layer libraries memset(&instance_layer_list, 0, sizeof(instance_layer_list)); loader_layer_scan(NULL, &instance_layer_list); @@ -276,10 +268,8 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance(const VkInstanceCr ptr_instance->alloc_callbacks = *pAllocator; } - /* - * Look for one or more debug report create info structures - * and setup a callback(s) for each one found. - */ + // Look for one or more debug report create info structures + // and setup a callback(s) for each one found. ptr_instance->num_tmp_callbacks = 0; ptr_instance->tmp_dbg_create_infos = NULL; ptr_instance->tmp_callbacks = NULL; @@ -300,13 +290,13 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance(const VkInstanceCr } } - /* Due to implicit layers need to get layer list even if - * enabledLayerCount == 0 and VK_INSTANCE_LAYERS is unset. For now always - * get layer list via loader_layer_scan(). */ + // Due to implicit layers need to get layer list even if + // enabledLayerCount == 0 and VK_INSTANCE_LAYERS is unset. For now always + // get layer list via loader_layer_scan(). memset(&ptr_instance->instance_layer_list, 0, sizeof(ptr_instance->instance_layer_list)); loader_layer_scan(ptr_instance, &ptr_instance->instance_layer_list); - /* validate the app requested layers to be enabled */ + // Validate the app requested layers to be enabled if (pCreateInfo->enabledLayerCount > 0) { res = loader_validate_layers(ptr_instance, pCreateInfo->enabledLayerCount, pCreateInfo->ppEnabledLayerNames, &ptr_instance->instance_layer_list); @@ -315,7 +305,7 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance(const VkInstanceCr } } - /* convert any meta layers to the actual layers makes a copy of layer name*/ + // Convert any meta layers to the actual layers makes a copy of layer name VkResult layerErr = loader_expand_layer_names(ptr_instance, std_validation_str, sizeof(std_validation_names) / sizeof(std_validation_names[0]), std_validation_names, &ici.enabledLayerCount, &ici.ppEnabledLayerNames); @@ -324,14 +314,14 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance(const VkInstanceCr goto out; } - /* Scan/discover all ICD libraries */ + // Scan/discover all ICD libraries memset(&ptr_instance->icd_tramp_list, 0, sizeof(ptr_instance->icd_tramp_list)); res = loader_icd_scan(ptr_instance, &ptr_instance->icd_tramp_list); if (res != VK_SUCCESS) { goto out; } - /* get extensions from all ICD's, merge so no duplicates, then validate */ + // Get extensions from all ICD's, merge so no duplicates, then validate res = loader_get_icd_loader_instance_extensions(ptr_instance, &ptr_instance->icd_tramp_list, &ptr_instance->ext_list); if (res != VK_SUCCESS) { goto out; @@ -354,7 +344,7 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance(const VkInstanceCr ptr_instance->next = loader.instances; loader.instances = ptr_instance; - /* activate any layers on instance chain */ + // Activate any layers on instance chain res = loader_enable_instance_layers(ptr_instance, &ici, &ptr_instance->instance_layer_list); if (res != VK_SUCCESS) { goto out; @@ -372,12 +362,10 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance(const VkInstanceCr *pInstance = created_instance; - /* - * Finally have the layers in place and everyone has seen - * the CreateInstance command go by. This allows the layer's - * GetInstanceProcAddr functions to return valid extension functions - * if enabled. - */ + // Finally have the layers in place and everyone has seen + // the CreateInstance command go by. This allows the layer's + // GetInstanceProcAddr functions to return valid extension functions + // if enabled. loader_activate_instance_layer_extensions(ptr_instance, *pInstance); } @@ -406,7 +394,7 @@ out: loader_instance_heap_free(ptr_instance, ptr_instance); } else { - /* Remove temporary debug_report callback */ + // Remove temporary debug_report callback util_DestroyDebugReportCallbacks(ptr_instance, pAllocator, ptr_instance->num_tmp_callbacks, ptr_instance->tmp_callbacks); loader_delete_shadow_inst_layer_names(ptr_instance, pCreateInfo, &ici); @@ -484,8 +472,7 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumeratePhysicalDevices(VkInstan } if (NULL == pPhysicalDevices || 0 == inst->total_gpu_count) { - // Call down. At the lower levels, this will setup the terminator - // structures in the loader. + // Call down. At the lower levels, this will setup the terminator structures in the loader. res = disp->EnumeratePhysicalDevices(instance, pPhysicalDeviceCount, pPhysicalDevices); if (VK_SUCCESS != res) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, @@ -506,15 +493,15 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumeratePhysicalDevices(VkInstan } // Wrap the PhysDev object for loader usage, return wrapped objects - if (inst->total_gpu_count > *pPhysicalDeviceCount) { + if (inst->phys_dev_count_tramp > *pPhysicalDeviceCount) { loader_log(inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, "vkEnumeratePhysicalDevices: Trimming device count down" " by application request from %d to %d physical devices", - inst->total_gpu_count, *pPhysicalDeviceCount); + inst->phys_dev_count_tramp, *pPhysicalDeviceCount); count = *pPhysicalDeviceCount; res = VK_INCOMPLETE; } else { - count = inst->total_gpu_count; + count = inst->phys_dev_count_tramp; *pPhysicalDeviceCount = count; } @@ -593,7 +580,7 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice(VkPhysicalDevice phy phys_dev = (struct loader_physical_device_tramp *)physicalDevice; inst = (struct loader_instance *)phys_dev->this_instance; - /* Get the physical device (ICD) extensions */ + // Get the physical device (ICD) extensions struct loader_extension_list icd_exts; icd_exts.list = NULL; res = loader_init_generic_list(inst, (struct loader_generic_list *)&icd_exts, sizeof(VkExtensionProperties)); @@ -609,7 +596,7 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice(VkPhysicalDevice phy goto out; } - /* make sure requested extensions to be enabled are supported */ + // Make sure requested extensions to be enabled are supported res = loader_validate_device_extensions(phys_dev, &inst->activated_layer_list, &icd_exts, pCreateInfo); if (res != VK_SUCCESS) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "vkCreateDevice: Failed to validate extensions in list"); @@ -622,7 +609,7 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice(VkPhysicalDevice phy goto out; } - /* copy the instance layer list into the device */ + // Copy the instance layer list into the device dev->activated_layer_list.capacity = inst->activated_layer_list.capacity; dev->activated_layer_list.count = inst->activated_layer_list.count; dev->activated_layer_list.list = @@ -701,10 +688,10 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateDeviceExtensionPropertie loader_platform_thread_lock_mutex(&loader_lock); - /* If pLayerName == NULL, then querying ICD extensions, pass this call - down the instance chain which will terminate in the ICD. This allows - layers to filter the extensions coming back up the chain. - If pLayerName != NULL then get layer extensions from manifest file. */ + // If pLayerName == NULL, then querying ICD extensions, pass this call + // down the instance chain which will terminate in the ICD. This allows + // layers to filter the extensions coming back up the chain. + // If pLayerName != NULL then get layer extensions from manifest file. if (pLayerName == NULL || strlen(pLayerName) == 0) { const VkLayerInstanceDispatchTable *disp; @@ -784,8 +771,8 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateDeviceLayerProperties(Vk memset(&layers_list, 0, sizeof(layers_list)); loader_platform_thread_lock_mutex(&loader_lock); - /* Don't dispatch this call down the instance chain, want all device layers - enumerated and instance chain may not contain all device layers */ + // Don't dispatch this call down the instance chain, want all device layers + // enumerated and instance chain may not contain all device layers // TODO re-evaluate the above statement we maybe able to start calling // down the chain @@ -799,8 +786,8 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateDeviceLayerProperties(Vk loader_platform_thread_unlock_mutex(&loader_lock); return VK_SUCCESS; } - /* make sure to enumerate standard_validation if that is what was used - at the instance layer enablement */ + // Make sure to enumerate standard_validation if that is what was used + // at the instance layer enablement if (inst->activated_layers_are_std_val) { enabled_layers = &layers_list; enabled_layers->count = count; diff --git a/loader/wsi.c b/loader/wsi.c index 257e1141..131ca518 100644 --- a/loader/wsi.c +++ b/loader/wsi.c @@ -155,8 +155,8 @@ VKAPI_ATTR void VKAPI_CALL terminator_DestroySurfaceKHR(VkInstance instance, VkS uint32_t i = 0; for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) { if (icd_term->scanned_icd->interface_version >= ICD_VER_SUPPORTS_ICD_SURFACE_KHR) { - if (NULL != icd_term->DestroySurfaceKHR && (VkSurfaceKHR)NULL != icd_surface->real_icd_surfaces[i]) { - icd_term->DestroySurfaceKHR(icd_term->instance, icd_surface->real_icd_surfaces[i], pAllocator); + if (NULL != icd_term->dispatch.DestroySurfaceKHR && (VkSurfaceKHR)NULL != icd_surface->real_icd_surfaces[i]) { + icd_term->dispatch.DestroySurfaceKHR(icd_term->instance, icd_surface->real_icd_surfaces[i], pAllocator); icd_surface->real_icd_surfaces[i] = (VkSurfaceKHR)NULL; } } else { @@ -195,24 +195,30 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfaceSupportKHR(VkP struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance; if (!ptr_instance->wsi_surface_enabled) { loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_VK_KHR_surface extension not enabled. " - "vkGetPhysicalDeviceSurfaceSupportKHR not executed!\n"); + "VK_KHR_surface extension not enabled. vkGetPhysicalDeviceSurfaceSupportKHR not executed!\n"); return VK_SUCCESS; } - // Next, if so, proceed with the implementation of this function: - assert(pSupported && "GetPhysicalDeviceSurfaceSupportKHR: Error, null pSupported"); + if (NULL == pSupported) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "NULL pointer passed into vkGetPhysicalDeviceSurfaceSupportKHR for pSupported!\n"); + assert(false && "GetPhysicalDeviceSurfaceSupportKHR: Error, null pSupported"); + } *pSupported = false; - assert(icd_term->GetPhysicalDeviceSurfaceSupportKHR && "loader: null GetPhysicalDeviceSurfaceSupportKHR ICD pointer"); + if (NULL == icd_term->dispatch.GetPhysicalDeviceSurfaceSupportKHR) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD for selected physical device is not exporting vkGetPhysicalDeviceSurfaceSupportKHR!\n"); + assert(false && "loader: null GetPhysicalDeviceSurfaceSupportKHR ICD pointer"); + } VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)surface; if (NULL != icd_surface->real_icd_surfaces && (VkSurfaceKHR)NULL != icd_surface->real_icd_surfaces[phys_dev_term->icd_index]) { - return icd_term->GetPhysicalDeviceSurfaceSupportKHR(phys_dev_term->phys_dev, queueFamilyIndex, - icd_surface->real_icd_surfaces[phys_dev_term->icd_index], pSupported); + return icd_term->dispatch.GetPhysicalDeviceSurfaceSupportKHR( + phys_dev_term->phys_dev, queueFamilyIndex, icd_surface->real_icd_surfaces[phys_dev_term->icd_index], pSupported); } - return icd_term->GetPhysicalDeviceSurfaceSupportKHR(phys_dev_term->phys_dev, queueFamilyIndex, surface, pSupported); + return icd_term->dispatch.GetPhysicalDeviceSurfaceSupportKHR(phys_dev_term->phys_dev, queueFamilyIndex, surface, pSupported); } // This is the trampoline entrypoint for GetPhysicalDeviceSurfaceCapabilitiesKHR @@ -236,25 +242,29 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfaceCapabilitiesKH struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance; if (!ptr_instance->wsi_surface_enabled) { loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_surface extension not enabled. " - "vkGetPhysicalDeviceSurfaceCapabilitiesKHR not executed!\n"); + "VK_KHR_surface extension not enabled. vkGetPhysicalDeviceSurfaceCapabilitiesKHR not executed!\n"); return VK_SUCCESS; } - // Next, if so, proceed with the implementation of this function: - assert(pSurfaceCapabilities && - "GetPhysicalDeviceSurfaceCapabilitiesKHR: " - "Error, null pSurfaceCapabilities"); + if (NULL == pSurfaceCapabilities) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "NULL pointer passed into vkGetPhysicalDeviceSurfaceCapabilitiesKHR for pSurfaceCapabilities!\n"); + assert(false && "GetPhysicalDeviceSurfaceCapabilitiesKHR: Error, null pSurfaceCapabilities"); + } - assert(icd_term->GetPhysicalDeviceSurfaceCapabilitiesKHR && "loader: null GetPhysicalDeviceSurfaceCapabilitiesKHR ICD pointer"); + if (NULL == icd_term->dispatch.GetPhysicalDeviceSurfaceCapabilitiesKHR) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD for selected physical device is not exporting vkGetPhysicalDeviceSurfaceCapabilitiesKHR!\n"); + assert(false && "loader: null GetPhysicalDeviceSurfaceCapabilitiesKHR ICD pointer"); + } VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)surface; if (NULL != icd_surface->real_icd_surfaces && (VkSurfaceKHR)NULL != icd_surface->real_icd_surfaces[phys_dev_term->icd_index]) { - return icd_term->GetPhysicalDeviceSurfaceCapabilitiesKHR( + return icd_term->dispatch.GetPhysicalDeviceSurfaceCapabilitiesKHR( phys_dev_term->phys_dev, icd_surface->real_icd_surfaces[phys_dev_term->icd_index], pSurfaceCapabilities); } - return icd_term->GetPhysicalDeviceSurfaceCapabilitiesKHR(phys_dev_term->phys_dev, surface, pSurfaceCapabilities); + return icd_term->dispatch.GetPhysicalDeviceSurfaceCapabilitiesKHR(phys_dev_term->phys_dev, surface, pSurfaceCapabilities); } // This is the trampoline entrypoint for GetPhysicalDeviceSurfaceFormatsKHR @@ -280,24 +290,31 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfaceFormatsKHR(VkP struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance; if (!ptr_instance->wsi_surface_enabled) { loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_surface extension not enabled. " - "vkGetPhysicalDeviceSurfaceFormatsKHR not executed!\n"); + "VK_KHR_surface extension not enabled. vkGetPhysicalDeviceSurfaceFormatsKHR not executed!\n"); return VK_SUCCESS; } - // Next, if so, proceed with the implementation of this function: - assert(pSurfaceFormatCount && "GetPhysicalDeviceSurfaceFormatsKHR: Error, null pSurfaceFormatCount"); + if (NULL == pSurfaceFormatCount) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "NULL pointer passed into vkGetPhysicalDeviceSurfaceFormatsKHR for pSurfaceFormatCount!\n"); + assert(false && "GetPhysicalDeviceSurfaceFormatsKHR(: Error, null pSurfaceFormatCount"); + } - assert(icd_term->GetPhysicalDeviceSurfaceFormatsKHR && "loader: null GetPhysicalDeviceSurfaceFormatsKHR ICD pointer"); + if (NULL == icd_term->dispatch.GetPhysicalDeviceSurfaceFormatsKHR) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD for selected physical device is not exporting vkGetPhysicalDeviceSurfaceCapabilitiesKHR!\n"); + assert(false && "loader: null GetPhysicalDeviceSurfaceFormatsKHR ICD pointer"); + } VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)surface; if (NULL != icd_surface->real_icd_surfaces && (VkSurfaceKHR)NULL != icd_surface->real_icd_surfaces[phys_dev_term->icd_index]) { - return icd_term->GetPhysicalDeviceSurfaceFormatsKHR(phys_dev_term->phys_dev, - icd_surface->real_icd_surfaces[phys_dev_term->icd_index], - pSurfaceFormatCount, pSurfaceFormats); + return icd_term->dispatch.GetPhysicalDeviceSurfaceFormatsKHR(phys_dev_term->phys_dev, + icd_surface->real_icd_surfaces[phys_dev_term->icd_index], + pSurfaceFormatCount, pSurfaceFormats); } - return icd_term->GetPhysicalDeviceSurfaceFormatsKHR(phys_dev_term->phys_dev, surface, pSurfaceFormatCount, pSurfaceFormats); + return icd_term->dispatch.GetPhysicalDeviceSurfaceFormatsKHR(phys_dev_term->phys_dev, surface, pSurfaceFormatCount, + pSurfaceFormats); } // This is the trampoline entrypoint for GetPhysicalDeviceSurfacePresentModesKHR @@ -323,25 +340,30 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfacePresentModesKH struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance; if (!ptr_instance->wsi_surface_enabled) { loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_surface extension not enabled. " - "vkGetPhysicalDeviceSurfacePresentModesKHR not executed!\n"); + "VK_KHR_surface extension not enabled. vkGetPhysicalDeviceSurfacePresentModesKHR not executed!\n"); return VK_SUCCESS; } - // Next, if so, proceed with the implementation of this function: - assert(pPresentModeCount && - "GetPhysicalDeviceSurfacePresentModesKHR: " - "Error, null pPresentModeCount"); + if (NULL == pPresentModeCount) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "NULL pointer passed into vkGetPhysicalDeviceSurfacePresentModesKHR for pPresentModeCount!\n"); + assert(false && "GetPhysicalDeviceSurfacePresentModesKHR(: Error, null pPresentModeCount"); + } - assert(icd_term->GetPhysicalDeviceSurfacePresentModesKHR && "loader: null GetPhysicalDeviceSurfacePresentModesKHR ICD pointer"); + if (NULL == icd_term->dispatch.GetPhysicalDeviceSurfacePresentModesKHR) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD for selected physical device is not exporting vkGetPhysicalDeviceSurfacePresentModesKHR!\n"); + assert(false && "loader: null GetPhysicalDeviceSurfacePresentModesKHR ICD pointer"); + } VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)surface; if (NULL != icd_surface->real_icd_surfaces && (VkSurfaceKHR)NULL != icd_surface->real_icd_surfaces[phys_dev_term->icd_index]) { - return icd_term->GetPhysicalDeviceSurfacePresentModesKHR( + return icd_term->dispatch.GetPhysicalDeviceSurfacePresentModesKHR( phys_dev_term->phys_dev, icd_surface->real_icd_surfaces[phys_dev_term->icd_index], pPresentModeCount, pPresentModes); } - return icd_term->GetPhysicalDeviceSurfacePresentModesKHR(phys_dev_term->phys_dev, surface, pPresentModeCount, pPresentModes); + return icd_term->dispatch.GetPhysicalDeviceSurfacePresentModesKHR(phys_dev_term->phys_dev, surface, pPresentModeCount, + pPresentModes); } // Functions for the VK_KHR_swapchain extension: @@ -355,13 +377,13 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateSwapchainKHR(VkDevice devic return disp->CreateSwapchainKHR(device, pCreateInfo, pAllocator, pSwapchain); } -VKAPI_ATTR VkResult VKAPI_CALL terminator_vkCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR *pCreateInfo, - const VkAllocationCallbacks *pAllocator, - VkSwapchainKHR *pSwapchain) { +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkSwapchainKHR *pSwapchain) { uint32_t icd_index = 0; struct loader_device *dev; struct loader_icd_term *icd_term = loader_get_icd_and_device(device, &dev, &icd_index); - if (NULL != icd_term && NULL != icd_term->CreateSwapchainKHR) { + if (NULL != icd_term && NULL != icd_term->dispatch.CreateSwapchainKHR) { VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)pCreateInfo->surface; if (NULL != icd_surface->real_icd_surfaces) { if ((VkSurfaceKHR)NULL != icd_surface->real_icd_surfaces[icd_index]) { @@ -374,10 +396,10 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_vkCreateSwapchainKHR(VkDevice device, } memcpy(pCreateCopy, pCreateInfo, sizeof(VkSwapchainCreateInfoKHR)); pCreateCopy->surface = icd_surface->real_icd_surfaces[icd_index]; - return icd_term->CreateSwapchainKHR(device, pCreateCopy, pAllocator, pSwapchain); + return icd_term->dispatch.CreateSwapchainKHR(device, pCreateCopy, pAllocator, pSwapchain); } } - return icd_term->CreateSwapchainKHR(device, pCreateInfo, pAllocator, pSwapchain); + return icd_term->dispatch.CreateSwapchainKHR(device, pCreateInfo, pAllocator, pSwapchain); } return VK_SUCCESS; } @@ -390,10 +412,7 @@ LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroySwapchainKHR(VkDevice device, disp->DestroySwapchainKHR(device, swapchain, pAllocator); } -/* - * This is the trampoline entrypoint - * for GetSwapchainImagesKHR - */ +// This is the trampoline entrypoint for GetSwapchainImagesKHR LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain, uint32_t *pSwapchainImageCount, VkImage *pSwapchainImages) { const VkLayerDispatchTable *disp; @@ -401,10 +420,7 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetSwapchainImagesKHR(VkDevice de return disp->GetSwapchainImagesKHR(device, swapchain, pSwapchainImageCount, pSwapchainImages); } -/* - * This is the trampoline entrypoint - * for AcquireNextImageKHR - */ +// This is the trampoline entrypoint for AcquireNextImageKHR LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkAcquireNextImageKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t *pImageIndex) { const VkLayerDispatchTable *disp; @@ -472,8 +488,7 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateWin32SurfaceKHR(VkInstance insta struct loader_instance *ptr_instance = loader_get_instance(instance); if (!ptr_instance->wsi_win32_surface_enabled) { loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_win32_surface extension not enabled. " - "vkCreateWin32SurfaceKHR not executed!\n"); + "VK_KHR_win32_surface extension not enabled. vkCreateWin32SurfaceKHR not executed!\n"); vkRes = VK_ERROR_EXTENSION_NOT_PRESENT; goto out; } @@ -492,9 +507,9 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateWin32SurfaceKHR(VkInstance insta // Loop through each ICD and determine if they need to create a surface for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) { if (icd_term->scanned_icd->interface_version >= ICD_VER_SUPPORTS_ICD_SURFACE_KHR) { - if (NULL != icd_term->CreateWin32SurfaceKHR) { - vkRes = icd_term->CreateWin32SurfaceKHR(icd_term->instance, pCreateInfo, pAllocator, - &pIcdSurface->real_icd_surfaces[i]); + if (NULL != icd_term->dispatch.CreateWin32SurfaceKHR) { + vkRes = icd_term->dispatch.CreateWin32SurfaceKHR(icd_term->instance, pCreateInfo, pAllocator, + &pIcdSurface->real_icd_surfaces[i]); if (VK_SUCCESS != vkRes) { goto out; } @@ -510,8 +525,8 @@ out: if (NULL != pIcdSurface->real_icd_surfaces) { i = 0; for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) { - if ((VkSurfaceKHR)NULL != pIcdSurface->real_icd_surfaces[i] && NULL != icd_term->DestroySurfaceKHR) { - icd_term->DestroySurfaceKHR(icd_term->instance, pIcdSurface->real_icd_surfaces[i], pAllocator); + if ((VkSurfaceKHR)NULL != pIcdSurface->real_icd_surfaces[i] && NULL != icd_term->dispatch.DestroySurfaceKHR) { + icd_term->dispatch.DestroySurfaceKHR(icd_term->instance, pIcdSurface->real_icd_surfaces[i], pAllocator); } } loader_instance_heap_free(ptr_instance, pIcdSurface->real_icd_surfaces); @@ -543,17 +558,17 @@ VKAPI_ATTR VkBool32 VKAPI_CALL terminator_GetPhysicalDeviceWin32PresentationSupp struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance; if (!ptr_instance->wsi_win32_surface_enabled) { loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_win32_surface extension not enabled. " - "vkGetPhysicalDeviceWin32PresentationSupportKHR not executed!\n"); + "VK_KHR_win32_surface extension not enabled. vkGetPhysicalDeviceWin32PresentationSupportKHR not executed!\n"); return VK_SUCCESS; } - // Next, if so, proceed with the implementation of this function: - assert(icd_term->GetPhysicalDeviceWin32PresentationSupportKHR && - "loader: null GetPhysicalDeviceWin32PresentationSupportKHR ICD " - "pointer"); + if (NULL == icd_term->dispatch.GetPhysicalDeviceWin32PresentationSupportKHR) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD for selected physical device is not exporting vkGetPhysicalDeviceWin32PresentationSupportKHR!\n"); + assert(false && "loader: null GetPhysicalDeviceWin32PresentationSupportKHR ICD pointer"); + } - return icd_term->GetPhysicalDeviceWin32PresentationSupportKHR(phys_dev_term->phys_dev, queueFamilyIndex); + return icd_term->dispatch.GetPhysicalDeviceWin32PresentationSupportKHR(phys_dev_term->phys_dev, queueFamilyIndex); } #endif // VK_USE_PLATFORM_WIN32_KHR @@ -585,8 +600,7 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateMirSurfaceKHR(VkInstance instanc struct loader_instance *ptr_instance = loader_get_instance(instance); if (!ptr_instance->wsi_mir_surface_enabled) { loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_mir_surface extension not enabled. " - "vkCreateMirSurfaceKHR not executed!\n"); + "VK_KHR_mir_surface extension not enabled. vkCreateMirSurfaceKHR not executed!\n"); vkRes = VK_ERROR_EXTENSION_NOT_PRESENT; goto out; } @@ -605,9 +619,9 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateMirSurfaceKHR(VkInstance instanc // Loop through each ICD and determine if they need to create a surface for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) { if (icd_term->scanned_icd->interface_version >= ICD_VER_SUPPORTS_ICD_SURFACE_KHR) { - if (NULL != icd_term->CreateMirSurfaceKHR) { - vkRes = - icd_term->CreateMirSurfaceKHR(icd_term->instance, pCreateInfo, pAllocator, &pIcdSurface->real_icd_surfaces[i]); + if (NULL != icd_term->dispatch.CreateMirSurfaceKHR) { + vkRes = icd_term->dispatch.CreateMirSurfaceKHR(icd_term->instance, pCreateInfo, pAllocator, + &pIcdSurface->real_icd_surfaces[i]); if (VK_SUCCESS != vkRes) { goto out; } @@ -623,8 +637,8 @@ out: if (NULL != pIcdSurface->real_icd_surfaces) { i = 0; for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) { - if ((VkSurfaceKHR)NULL != pIcdSurface->real_icd_surfaces[i] && NULL != icd_term->DestroySurfaceKHR) { - icd_term->DestroySurfaceKHR(icd_term->instance, pIcdSurface->real_icd_surfaces[i], pAllocator); + if ((VkSurfaceKHR)NULL != pIcdSurface->real_icd_surfaces[i] && NULL != icd_term->dispatch.DestroySurfaceKHR) { + icd_term->dispatch.DestroySurfaceKHR(icd_term->instance, pIcdSurface->real_icd_surfaces[i], pAllocator); } } loader_instance_heap_free(ptr_instance, pIcdSurface->real_icd_surfaces); @@ -658,25 +672,23 @@ VKAPI_ATTR VkBool32 VKAPI_CALL terminator_GetPhysicalDeviceMirPresentationSuppor struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance; if (!ptr_instance->wsi_mir_surface_enabled) { loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_mir_surface extension not enabled. " - "vkGetPhysicalDeviceMirPresentationSupportKHR not executed!\n"); + "VK_KHR_mir_surface extension not enabled. vkGetPhysicalDeviceMirPresentationSupportKHR not executed!\n"); return VK_SUCCESS; } - // Next, if so, proceed with the implementation of this function: - assert(icd_term->GetPhysicalDeviceMirPresentationSupportKHR && - "loader: null GetPhysicalDeviceMirPresentationSupportKHR ICD pointer"); + if (NULL == icd_term->dispatch.GetPhysicalDeviceMirPresentationSupportKHR) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD for selected physical device is not exporting vkGetPhysicalDeviceMirPresentationSupportKHR!\n"); + assert(false && "loader: null GetPhysicalDeviceMirPresentationSupportKHR ICD pointer"); + } - return icd_term->GetPhysicalDeviceMirPresentationSupportKHR(phys_dev_term->phys_dev, queueFamilyIndex, connection); + return icd_term->dispatch.GetPhysicalDeviceMirPresentationSupportKHR(phys_dev_term->phys_dev, queueFamilyIndex, connection); } #endif // VK_USE_PLATFORM_MIR_KHR #ifdef VK_USE_PLATFORM_WAYLAND_KHR -/* - * This is the trampoline entrypoint - * for CreateWaylandSurfaceKHR - */ +// This is the trampoline entrypoint for CreateWaylandSurfaceKHR LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateWaylandSurfaceKHR(VkInstance instance, const VkWaylandSurfaceCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, @@ -701,8 +713,7 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateWaylandSurfaceKHR(VkInstance ins struct loader_instance *ptr_instance = loader_get_instance(instance); if (!ptr_instance->wsi_wayland_surface_enabled) { loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_wayland_surface extension not enabled. " - "vkCreateWaylandSurfaceKHR not executed!\n"); + "VK_KHR_wayland_surface extension not enabled. vkCreateWaylandSurfaceKHR not executed!\n"); vkRes = VK_ERROR_EXTENSION_NOT_PRESENT; goto out; } @@ -721,9 +732,9 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateWaylandSurfaceKHR(VkInstance ins // Loop through each ICD and determine if they need to create a surface for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) { if (icd_term->scanned_icd->interface_version >= ICD_VER_SUPPORTS_ICD_SURFACE_KHR) { - if (NULL != icd_term->CreateWaylandSurfaceKHR) { - vkRes = icd_term->CreateWaylandSurfaceKHR(icd_term->instance, pCreateInfo, pAllocator, - &pIcdSurface->real_icd_surfaces[i]); + if (NULL != icd_term->dispatch.CreateWaylandSurfaceKHR) { + vkRes = icd_term->dispatch.CreateWaylandSurfaceKHR(icd_term->instance, pCreateInfo, pAllocator, + &pIcdSurface->real_icd_surfaces[i]); if (VK_SUCCESS != vkRes) { goto out; } @@ -739,8 +750,8 @@ out: if (NULL != pIcdSurface->real_icd_surfaces) { i = 0; for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) { - if ((VkSurfaceKHR)NULL != pIcdSurface->real_icd_surfaces[i] && NULL != icd_term->DestroySurfaceKHR) { - icd_term->DestroySurfaceKHR(icd_term->instance, pIcdSurface->real_icd_surfaces[i], pAllocator); + if ((VkSurfaceKHR)NULL != pIcdSurface->real_icd_surfaces[i] && NULL != icd_term->dispatch.DestroySurfaceKHR) { + icd_term->dispatch.DestroySurfaceKHR(icd_term->instance, pIcdSurface->real_icd_surfaces[i], pAllocator); } } loader_instance_heap_free(ptr_instance, pIcdSurface->real_icd_surfaces); @@ -773,18 +784,19 @@ VKAPI_ATTR VkBool32 VKAPI_CALL terminator_GetPhysicalDeviceWaylandPresentationSu struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance; if (!ptr_instance->wsi_wayland_surface_enabled) { - loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_wayland_surface extension not enabled. " - "vkGetPhysicalDeviceWaylandPresentationSupportKHR not executed!\n"); + loader_log( + ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "VK_KHR_wayland_surface extension not enabled. vkGetPhysicalDeviceWaylandPresentationSupportKHR not executed!\n"); return VK_SUCCESS; } - // Next, if so, proceed with the implementation of this function: - assert(icd_term->GetPhysicalDeviceWaylandPresentationSupportKHR && - "loader: null GetPhysicalDeviceWaylandPresentationSupportKHR ICD " - "pointer"); + if (NULL == icd_term->dispatch.GetPhysicalDeviceWaylandPresentationSupportKHR) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD for selected physical device is not exporting vkGetPhysicalDeviceWaylandPresentationSupportKHR!\n"); + assert(false && "loader: null GetPhysicalDeviceWaylandPresentationSupportKHR ICD pointer"); + } - return icd_term->GetPhysicalDeviceWaylandPresentationSupportKHR(phys_dev_term->phys_dev, queueFamilyIndex, display); + return icd_term->dispatch.GetPhysicalDeviceWaylandPresentationSupportKHR(phys_dev_term->phys_dev, queueFamilyIndex, display); } #endif // VK_USE_PLATFORM_WAYLAND_KHR @@ -816,8 +828,7 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateXcbSurfaceKHR(VkInstance instanc struct loader_instance *ptr_instance = loader_get_instance(instance); if (!ptr_instance->wsi_xcb_surface_enabled) { loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_xcb_surface extension not enabled. " - "vkCreateXcbSurfaceKHR not executed!\n"); + "VK_KHR_xcb_surface extension not enabled. vkCreateXcbSurfaceKHR not executed!\n"); vkRes = VK_ERROR_EXTENSION_NOT_PRESENT; goto out; } @@ -836,9 +847,9 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateXcbSurfaceKHR(VkInstance instanc // Loop through each ICD and determine if they need to create a surface for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) { if (icd_term->scanned_icd->interface_version >= ICD_VER_SUPPORTS_ICD_SURFACE_KHR) { - if (NULL != icd_term->CreateXcbSurfaceKHR) { - vkRes = - icd_term->CreateXcbSurfaceKHR(icd_term->instance, pCreateInfo, pAllocator, &pIcdSurface->real_icd_surfaces[i]); + if (NULL != icd_term->dispatch.CreateXcbSurfaceKHR) { + vkRes = icd_term->dispatch.CreateXcbSurfaceKHR(icd_term->instance, pCreateInfo, pAllocator, + &pIcdSurface->real_icd_surfaces[i]); if (VK_SUCCESS != vkRes) { goto out; } @@ -854,8 +865,8 @@ out: if (NULL != pIcdSurface->real_icd_surfaces) { i = 0; for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) { - if ((VkSurfaceKHR)NULL != pIcdSurface->real_icd_surfaces[i] && NULL != icd_term->DestroySurfaceKHR) { - icd_term->DestroySurfaceKHR(icd_term->instance, pIcdSurface->real_icd_surfaces[i], pAllocator); + if ((VkSurfaceKHR)NULL != pIcdSurface->real_icd_surfaces[i] && NULL != icd_term->dispatch.DestroySurfaceKHR) { + icd_term->dispatch.DestroySurfaceKHR(icd_term->instance, pIcdSurface->real_icd_surfaces[i], pAllocator); } } loader_instance_heap_free(ptr_instance, pIcdSurface->real_icd_surfaces); @@ -891,16 +902,18 @@ VKAPI_ATTR VkBool32 VKAPI_CALL terminator_GetPhysicalDeviceXcbPresentationSuppor struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance; if (!ptr_instance->wsi_xcb_surface_enabled) { loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_xcb_surface extension not enabled. " - "vkGetPhysicalDeviceXcbPresentationSupportKHR not executed!\n"); + "VK_KHR_xcb_surface extension not enabled. vkGetPhysicalDeviceXcbPresentationSupportKHR not executed!\n"); return VK_SUCCESS; } - // Next, if so, proceed with the implementation of this function: - assert(icd_term->GetPhysicalDeviceXcbPresentationSupportKHR && - "loader: null GetPhysicalDeviceXcbPresentationSupportKHR ICD pointer"); + if (NULL == icd_term->dispatch.GetPhysicalDeviceXcbPresentationSupportKHR) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD for selected physical device is not exporting vkGetPhysicalDeviceXcbPresentationSupportKHR!\n"); + assert(false && "loader: null GetPhysicalDeviceXcbPresentationSupportKHR ICD pointer"); + } - return icd_term->GetPhysicalDeviceXcbPresentationSupportKHR(phys_dev_term->phys_dev, queueFamilyIndex, connection, visual_id); + return icd_term->dispatch.GetPhysicalDeviceXcbPresentationSupportKHR(phys_dev_term->phys_dev, queueFamilyIndex, connection, + visual_id); } #endif // VK_USE_PLATFORM_XCB_KHR @@ -932,8 +945,7 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateXlibSurfaceKHR(VkInstance instan struct loader_instance *ptr_instance = loader_get_instance(instance); if (!ptr_instance->wsi_xlib_surface_enabled) { loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_xlib_surface extension not enabled. " - "vkCreateXlibSurfaceKHR not executed!\n"); + "VK_KHR_xlib_surface extension not enabled. vkCreateXlibSurfaceKHR not executed!\n"); vkRes = VK_ERROR_EXTENSION_NOT_PRESENT; goto out; } @@ -952,9 +964,9 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateXlibSurfaceKHR(VkInstance instan // Loop through each ICD and determine if they need to create a surface for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) { if (icd_term->scanned_icd->interface_version >= ICD_VER_SUPPORTS_ICD_SURFACE_KHR) { - if (NULL != icd_term->CreateXlibSurfaceKHR) { - vkRes = - icd_term->CreateXlibSurfaceKHR(icd_term->instance, pCreateInfo, pAllocator, &pIcdSurface->real_icd_surfaces[i]); + if (NULL != icd_term->dispatch.CreateXlibSurfaceKHR) { + vkRes = icd_term->dispatch.CreateXlibSurfaceKHR(icd_term->instance, pCreateInfo, pAllocator, + &pIcdSurface->real_icd_surfaces[i]); if (VK_SUCCESS != vkRes) { goto out; } @@ -970,8 +982,8 @@ out: if (NULL != pIcdSurface->real_icd_surfaces) { i = 0; for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) { - if ((VkSurfaceKHR)NULL != pIcdSurface->real_icd_surfaces[i] && NULL != icd_term->DestroySurfaceKHR) { - icd_term->DestroySurfaceKHR(icd_term->instance, pIcdSurface->real_icd_surfaces[i], pAllocator); + if ((VkSurfaceKHR)NULL != pIcdSurface->real_icd_surfaces[i] && NULL != icd_term->dispatch.DestroySurfaceKHR) { + icd_term->dispatch.DestroySurfaceKHR(icd_term->instance, pIcdSurface->real_icd_surfaces[i], pAllocator); } } loader_instance_heap_free(ptr_instance, pIcdSurface->real_icd_surfaces); @@ -1005,16 +1017,17 @@ VKAPI_ATTR VkBool32 VKAPI_CALL terminator_GetPhysicalDeviceXlibPresentationSuppo struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance; if (!ptr_instance->wsi_xlib_surface_enabled) { loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_xlib_surface extension not enabled. " - "vkGetPhysicalDeviceXlibPresentationSupportKHR not executed!\n"); + "VK_KHR_xlib_surface extension not enabled. vkGetPhysicalDeviceXlibPresentationSupportKHR not executed!\n"); return VK_SUCCESS; } - // Next, if so, proceed with the implementation of this function: - assert(icd_term->GetPhysicalDeviceXlibPresentationSupportKHR && - "loader: null GetPhysicalDeviceXlibPresentationSupportKHR ICD pointer"); + if (NULL == icd_term->dispatch.GetPhysicalDeviceXlibPresentationSupportKHR) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD for selected physical device is not exporting vkGetPhysicalDeviceXlibPresentationSupportKHR!\n"); + assert(false && "loader: null GetPhysicalDeviceXlibPresentationSupportKHR ICD pointer"); + } - return icd_term->GetPhysicalDeviceXlibPresentationSupportKHR(phys_dev_term->phys_dev, queueFamilyIndex, dpy, visualID); + return icd_term->dispatch.GetPhysicalDeviceXlibPresentationSupportKHR(phys_dev_term->phys_dev, queueFamilyIndex, dpy, visualID); } #endif // VK_USE_PLATFORM_XLIB_KHR @@ -1041,8 +1054,7 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateAndroidSurfaceKHR(VkInstance ins struct loader_instance *ptr_instance = loader_get_instance(instance); if (!ptr_instance->wsi_display_enabled) { loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_display extension not enabled. " - "vkCreateAndroidSurfaceKHR not executed!\n"); + "VK_KHR_display extension not enabled. vkCreateAndroidSurfaceKHR not executed!\n"); return VK_ERROR_EXTENSION_NOT_PRESENT; } @@ -1084,15 +1096,17 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceDisplayPropertiesKHR( struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance; if (!ptr_instance->wsi_display_enabled) { loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_display extension not enabled. " - "vkGetPhysicalDeviceDisplayPropertiesKHR not executed!\n"); + "VK_KHR_display extension not enabled. vkGetPhysicalDeviceDisplayPropertiesKHR not executed!\n"); return VK_SUCCESS; } - // Next, if so, proceed with the implementation of this function: - assert(icd_term->GetPhysicalDeviceDisplayPropertiesKHR && "loader: null GetPhysicalDeviceDisplayPropertiesKHR ICD pointer"); + if (NULL == icd_term->dispatch.GetPhysicalDeviceDisplayPropertiesKHR) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD for selected physical device is not exporting vkGetPhysicalDeviceDisplayPropertiesKHR!\n"); + assert(false && "loader: null GetPhysicalDeviceDisplayPropertiesKHR ICD pointer"); + } - return icd_term->GetPhysicalDeviceDisplayPropertiesKHR(phys_dev_term->phys_dev, pPropertyCount, pProperties); + return icd_term->dispatch.GetPhysicalDeviceDisplayPropertiesKHR(phys_dev_term->phys_dev, pPropertyCount, pProperties); } LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceDisplayPlanePropertiesKHR( @@ -1113,16 +1127,17 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceDisplayPlanePropertie struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance; if (!ptr_instance->wsi_display_enabled) { loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_display extension not enabled. " - "vkGetPhysicalDeviceDisplayPlanePropertiesKHR not executed!\n"); + "VK_KHR_display extension not enabled. vkGetPhysicalDeviceDisplayPlanePropertiesKHR not executed!\n"); return VK_SUCCESS; } - // Next, if so, proceed with the implementation of this function: - assert(icd_term->GetPhysicalDeviceDisplayPlanePropertiesKHR && - "loader: null GetPhysicalDeviceDisplayPlanePropertiesKHR ICD pointer"); + if (NULL == icd_term->dispatch.GetPhysicalDeviceDisplayPlanePropertiesKHR) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD for selected physical device is not exporting vkGetPhysicalDeviceDisplayPlanePropertiesKHR!\n"); + assert(false && "loader: null GetPhysicalDeviceDisplayPlanePropertiesKHR ICD pointer"); + } - return icd_term->GetPhysicalDeviceDisplayPlanePropertiesKHR(phys_dev_term->phys_dev, pPropertyCount, pProperties); + return icd_term->dispatch.GetPhysicalDeviceDisplayPlanePropertiesKHR(phys_dev_term->phys_dev, pPropertyCount, pProperties); } LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetDisplayPlaneSupportedDisplaysKHR(VkPhysicalDevice physicalDevice, @@ -1143,15 +1158,17 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_GetDisplayPlaneSupportedDisplaysKHR(Vk struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance; if (!ptr_instance->wsi_display_enabled) { loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_display extension not enabled. " - "vkGetDisplayPlaneSupportedDisplaysKHR not executed!\n"); + "VK_KHR_display extension not enabled. vkGetDisplayPlaneSupportedDisplaysKHR not executed!\n"); return VK_SUCCESS; } - // Next, if so, proceed with the implementation of this function: - assert(icd_term->GetDisplayPlaneSupportedDisplaysKHR && "loader: null GetDisplayPlaneSupportedDisplaysKHR ICD pointer"); + if (NULL == icd_term->dispatch.GetDisplayPlaneSupportedDisplaysKHR) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD for selected physical device is not exporting vkGetDisplayPlaneSupportedDisplaysKHR!\n"); + assert(false && "loader: null GetDisplayPlaneSupportedDisplaysKHR ICD pointer"); + } - return icd_term->GetDisplayPlaneSupportedDisplaysKHR(phys_dev_term->phys_dev, planeIndex, pDisplayCount, pDisplays); + return icd_term->dispatch.GetDisplayPlaneSupportedDisplaysKHR(phys_dev_term->phys_dev, planeIndex, pDisplayCount, pDisplays); } LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetDisplayModePropertiesKHR(VkPhysicalDevice physicalDevice, VkDisplayKHR display, @@ -1173,15 +1190,17 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_GetDisplayModePropertiesKHR(VkPhysical struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance; if (!ptr_instance->wsi_display_enabled) { loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_display extension not enabled. " - "vkGetDisplayModePropertiesKHR not executed!\n"); + "VK_KHR_display extension not enabled. vkGetDisplayModePropertiesKHR not executed!\n"); return VK_SUCCESS; } - // Next, if so, proceed with the implementation of this function: - assert(icd_term->GetDisplayModePropertiesKHR && "loader: null GetDisplayModePropertiesKHR ICD pointer"); + if (NULL == icd_term->dispatch.GetDisplayModePropertiesKHR) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD for selected physical device is not exporting vkGetDisplayModePropertiesKHR!\n"); + assert(false && "loader: null GetDisplayModePropertiesKHR ICD pointer"); + } - return icd_term->GetDisplayModePropertiesKHR(phys_dev_term->phys_dev, display, pPropertyCount, pProperties); + return icd_term->dispatch.GetDisplayModePropertiesKHR(phys_dev_term->phys_dev, display, pPropertyCount, pProperties); } LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateDisplayModeKHR(VkPhysicalDevice physicalDevice, VkDisplayKHR display, @@ -1204,15 +1223,17 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDisplayModeKHR(VkPhysicalDevice struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance; if (!ptr_instance->wsi_display_enabled) { loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_display extension not enabled. " - "vkCreateDisplayModeKHR not executed!\n"); + "VK_KHR_display extension not enabled. vkCreateDisplayModeKHR not executed!\n"); return VK_ERROR_EXTENSION_NOT_PRESENT; } - // Next, if so, proceed with the implementation of this function: - assert(icd_term->CreateDisplayModeKHR && "loader: null CreateDisplayModeKHR ICD pointer"); + if (NULL == icd_term->dispatch.CreateDisplayModeKHR) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD for selected physical device is not exporting vkCreateDisplayModeKHR!\n"); + assert(false && "loader: null CreateDisplayModeKHR ICD pointer"); + } - return icd_term->CreateDisplayModeKHR(phys_dev_term->phys_dev, display, pCreateInfo, pAllocator, pMode); + return icd_term->dispatch.CreateDisplayModeKHR(phys_dev_term->phys_dev, display, pCreateInfo, pAllocator, pMode); } LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetDisplayPlaneCapabilitiesKHR(VkPhysicalDevice physicalDevice, @@ -1234,15 +1255,17 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_GetDisplayPlaneCapabilitiesKHR(VkPhysi struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance; if (!ptr_instance->wsi_display_enabled) { loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_display extension not enabled. " - "vkGetDisplayPlaneCapabilitiesKHR not executed!\n"); + "VK_KHR_display extension not enabled. vkGetDisplayPlaneCapabilitiesKHR not executed!\n"); return VK_SUCCESS; } - // Next, if so, proceed with the implementation of this function: - assert(icd_term->GetDisplayPlaneCapabilitiesKHR && "loader: null GetDisplayPlaneCapabilitiesKHR ICD pointer"); + if (NULL == icd_term->dispatch.GetDisplayPlaneCapabilitiesKHR) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD for selected physical device is not exporting vkGetDisplayPlaneCapabilitiesKHR!\n"); + assert(false && "loader: null GetDisplayPlaneCapabilitiesKHR ICD pointer"); + } - return icd_term->GetDisplayPlaneCapabilitiesKHR(phys_dev_term->phys_dev, mode, planeIndex, pCapabilities); + return icd_term->dispatch.GetDisplayPlaneCapabilitiesKHR(phys_dev_term->phys_dev, mode, planeIndex, pCapabilities); } LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateDisplayPlaneSurfaceKHR(VkInstance instance, @@ -1268,8 +1291,7 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDisplayPlaneSurfaceKHR(VkInstanc if (!inst->wsi_display_enabled) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_surface extension not enabled. " - "vkCreateDisplayPlaneSurfaceKHR not executed!\n"); + "VK_KHR_surface extension not enabled. vkCreateDisplayPlaneSurfaceKHR not executed!\n"); vkRes = VK_ERROR_EXTENSION_NOT_PRESENT; goto out; } @@ -1293,9 +1315,9 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDisplayPlaneSurfaceKHR(VkInstanc // Loop through each ICD and determine if they need to create a surface for (struct loader_icd_term *icd_term = inst->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) { if (icd_term->scanned_icd->interface_version >= ICD_VER_SUPPORTS_ICD_SURFACE_KHR) { - if (NULL != icd_term->CreateDisplayPlaneSurfaceKHR) { - vkRes = icd_term->CreateDisplayPlaneSurfaceKHR(icd_term->instance, pCreateInfo, pAllocator, - &pIcdSurface->real_icd_surfaces[i]); + if (NULL != icd_term->dispatch.CreateDisplayPlaneSurfaceKHR) { + vkRes = icd_term->dispatch.CreateDisplayPlaneSurfaceKHR(icd_term->instance, pCreateInfo, pAllocator, + &pIcdSurface->real_icd_surfaces[i]); if (VK_SUCCESS != vkRes) { goto out; } @@ -1311,8 +1333,8 @@ out: if (NULL != pIcdSurface->real_icd_surfaces) { i = 0; for (struct loader_icd_term *icd_term = inst->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) { - if ((VkSurfaceKHR)NULL != pIcdSurface->real_icd_surfaces[i] && NULL != icd_term->DestroySurfaceKHR) { - icd_term->DestroySurfaceKHR(icd_term->instance, pIcdSurface->real_icd_surfaces[i], pAllocator); + if ((VkSurfaceKHR)NULL != pIcdSurface->real_icd_surfaces[i] && NULL != icd_term->dispatch.DestroySurfaceKHR) { + icd_term->dispatch.DestroySurfaceKHR(icd_term->instance, pIcdSurface->real_icd_surfaces[i], pAllocator); } } loader_instance_heap_free(inst, pIcdSurface->real_icd_surfaces); @@ -1334,14 +1356,14 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateSharedSwapchainsKHR(VkDevic return disp->CreateSharedSwapchainsKHR(device, swapchainCount, pCreateInfos, pAllocator, pSwapchains); } -VKAPI_ATTR VkResult VKAPI_CALL terminator_vkCreateSharedSwapchainsKHR(VkDevice device, uint32_t swapchainCount, - const VkSwapchainCreateInfoKHR *pCreateInfos, - const VkAllocationCallbacks *pAllocator, - VkSwapchainKHR *pSwapchains) { +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateSharedSwapchainsKHR(VkDevice device, uint32_t swapchainCount, + const VkSwapchainCreateInfoKHR *pCreateInfos, + const VkAllocationCallbacks *pAllocator, + VkSwapchainKHR *pSwapchains) { uint32_t icd_index = 0; struct loader_device *dev; struct loader_icd_term *icd_term = loader_get_icd_and_device(device, &dev, &icd_index); - if (NULL != icd_term && NULL != icd_term->CreateSharedSwapchainsKHR) { + if (NULL != icd_term && NULL != icd_term->dispatch.CreateSharedSwapchainsKHR) { VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)pCreateInfos->surface; if (NULL != icd_surface->real_icd_surfaces) { if ((VkSurfaceKHR)NULL != icd_surface->real_icd_surfaces[icd_index]) { @@ -1356,10 +1378,10 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_vkCreateSharedSwapchainsKHR(VkDevice d for (uint32_t sc = 0; sc < swapchainCount; sc++) { pCreateCopy[sc].surface = icd_surface->real_icd_surfaces[icd_index]; } - return icd_term->CreateSharedSwapchainsKHR(device, swapchainCount, pCreateCopy, pAllocator, pSwapchains); + return icd_term->dispatch.CreateSharedSwapchainsKHR(device, swapchainCount, pCreateCopy, pAllocator, pSwapchains); } } - return icd_term->CreateSharedSwapchainsKHR(device, swapchainCount, pCreateInfos, pAllocator, pSwapchains); + return icd_term->dispatch.CreateSharedSwapchainsKHR(device, swapchainCount, pCreateInfos, pAllocator, pSwapchains); } return VK_SUCCESS; } diff --git a/loader/wsi.h b/loader/wsi.h index 5a13bf44..519a7aac 100644 --- a/loader/wsi.h +++ b/loader/wsi.h @@ -56,8 +56,8 @@ bool wsi_swapchain_instance_gpa(struct loader_instance *ptr_instance, const char void wsi_create_instance(struct loader_instance *ptr_instance, const VkInstanceCreateInfo *pCreateInfo); bool wsi_unsupported_instance_extension(const VkExtensionProperties *ext_prop); -VKAPI_ATTR VkResult VKAPI_CALL terminator_vkCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR *pCreateInfo, - const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchain); +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchain); VKAPI_ATTR void VKAPI_CALL terminator_DestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks *pAllocator); @@ -137,9 +137,9 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDisplayPlaneSurfaceKHR(VkInstanc const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface); -VKAPI_ATTR VkResult VKAPI_CALL terminator_vkCreateSharedSwapchainsKHR(VkDevice device, uint32_t swapchainCount, - const VkSwapchainCreateInfoKHR *pCreateInfos, - const VkAllocationCallbacks *pAllocator, - VkSwapchainKHR *pSwapchains); +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateSharedSwapchainsKHR(VkDevice device, uint32_t swapchainCount, + const VkSwapchainCreateInfoKHR *pCreateInfos, + const VkAllocationCallbacks *pAllocator, + VkSwapchainKHR *pSwapchains); -#endif /* WSI_H */ +#endif // WSI_H diff --git a/scripts/dispatch_table_generator.py b/scripts/dispatch_table_helper_generator.py index 09b9f016..971eba7c 100644 --- a/scripts/dispatch_table_generator.py +++ b/scripts/dispatch_table_helper_generator.py @@ -1,9 +1,9 @@ #!/usr/bin/python3 -i # -# Copyright (c) 2015-2016 The Khronos Group Inc. -# Copyright (c) 2015-2016 Valve Corporation -# Copyright (c) 2015-2016 LunarG, Inc. -# Copyright (c) 2015-2016 Google Inc. +# Copyright (c) 2015-2017 The Khronos Group Inc. +# Copyright (c) 2015-2017 Valve Corporation +# Copyright (c) 2015-2017 LunarG, Inc. +# Copyright (c) 2015-2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -25,8 +25,8 @@ from generator import * from collections import namedtuple # -# DispatchTableOutputGeneratorOptions - subclass of GeneratorOptions. -class DispatchTableOutputGeneratorOptions(GeneratorOptions): +# DispatchTableHelperOutputGeneratorOptions - subclass of GeneratorOptions. +class DispatchTableHelperOutputGeneratorOptions(GeneratorOptions): def __init__(self, filename = None, directory = '.', @@ -63,9 +63,9 @@ class DispatchTableOutputGeneratorOptions(GeneratorOptions): self.apientryp = apientryp self.alignFuncParam = alignFuncParam # -# DispatchTableOutputGenerator - subclass of OutputGenerator. +# DispatchTableHelperOutputGenerator - subclass of OutputGenerator. # Generates dispatch table helper header files for LVL -class DispatchTableOutputGenerator(OutputGenerator): +class DispatchTableHelperOutputGenerator(OutputGenerator): """Generate dispatch table helper header based on XML element attributes""" def __init__(self, errFile = sys.stderr, @@ -85,13 +85,13 @@ class DispatchTableOutputGenerator(OutputGenerator): write(s, file=self.outFile) # File Comment file_comment = '// *** THIS FILE IS GENERATED - DO NOT EDIT ***\n' - file_comment += '// See dispatch_table_generator.py for modifications\n' + file_comment += '// See dispatch_helper_generator.py for modifications\n' write(file_comment, file=self.outFile) # Copyright Notice copyright = '/*\n' - copyright += ' * Copyright (c) 2015-2016 The Khronos Group Inc.\n' - copyright += ' * Copyright (c) 2015-2016 Valve Corporation\n' - copyright += ' * Copyright (c) 2015-2016 LunarG, Inc.\n' + copyright += ' * Copyright (c) 2015-2017 The Khronos Group Inc.\n' + copyright += ' * Copyright (c) 2015-2017 Valve Corporation\n' + copyright += ' * Copyright (c) 2015-2017 LunarG, Inc.\n' copyright += ' *\n' copyright += ' * Licensed under the Apache License, Version 2.0 (the "License");\n' copyright += ' * you may not use this file except in compliance with the License.\n' @@ -123,8 +123,8 @@ class DispatchTableOutputGenerator(OutputGenerator): device_table = '' instance_table = '' - device_table += self.OutputDispatchTable('device') - instance_table += self.OutputDispatchTable('instance') + device_table += self.OutputDispatchTableHelper('device') + instance_table += self.OutputDispatchTableHelper('instance') write(device_table, file=self.outFile); write("\n", file=self.outFile) @@ -170,7 +170,7 @@ class DispatchTableOutputGenerator(OutputGenerator): return (type, name) # # Create a dispatch table from the appropriate list and return it as a string - def OutputDispatchTable(self, table_type): + def OutputDispatchTableHelper(self, table_type): entries = [] table = '' if table_type == 'device': diff --git a/scripts/helper_file_generator.py b/scripts/helper_file_generator.py index 39a9aa8c..97fde4be 100644 --- a/scripts/helper_file_generator.py +++ b/scripts/helper_file_generator.py @@ -212,7 +212,7 @@ class HelperFileOutputGenerator(OutputGenerator): decoratedName = '{}/{}'.format(*match.group(2, 3)) else: # Matches expressions similar to 'latexmath : [dataSize \over 4]' - match = re.match(r'latexmath\s*\:\s*\[\s*\s*(\w+)\s*\\over\s*(\d+)\s*\s*\]', source) + match = re.match(r'latexmath\s*\:\s*\[\s*(\w+)\s*\\over\s*(\d+)\s*\]', source) name = match.group(1) decoratedName = '{}/{}'.format(*match.group(1, 2)) return name, decoratedName diff --git a/scripts/loader_extension_generator.py b/scripts/loader_extension_generator.py new file mode 100644 index 00000000..105073d1 --- /dev/null +++ b/scripts/loader_extension_generator.py @@ -0,0 +1,1470 @@ +#!/usr/bin/python3 -i +# +# Copyright (c) 2015-2017 The Khronos Group Inc. +# Copyright (c) 2015-2017 Valve Corporation +# Copyright (c) 2015-2017 LunarG, Inc. +# Copyright (c) 2015-2017 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Author: Mark Young <marky@lunarg.com> + +import os,re,sys +import xml.etree.ElementTree as etree +from generator import * +from collections import namedtuple + +WSI_EXT_NAMES = ['VK_KHR_surface', + 'VK_KHR_display', + 'VK_KHR_xlib_surface', + 'VK_KHR_xcb_surface', + 'VK_KHR_wayland_surface', + 'VK_KHR_mir_surface', + 'VK_KHR_win32_surface', + 'VK_KHR_android_surface', + 'VK_KHR_swapchain', + 'VK_KHR_display_swapchain'] + +AVOID_EXT_NAMES = ['VK_EXT_debug_report'] + +DEVICE_CMDS_NEED_TERM = ['vkGetDeviceProcAddr', + 'vkCreateSwapchainKHR', + 'vkCreateSharedSwapchainsKHR', + 'vkGetDeviceGroupSurfacePresentModesKHX', + 'vkDebugMarkerSetObjectTagEXT', + 'vkDebugMarkerSetObjectNameEXT'] + +# +# LoaderExtensionGeneratorOptions - subclass of GeneratorOptions. +class LoaderExtensionGeneratorOptions(GeneratorOptions): + def __init__(self, + filename = None, + directory = '.', + apiname = None, + profile = None, + versions = '.*', + emitversions = '.*', + defaultExtensions = None, + addExtensions = None, + removeExtensions = None, + sortProcedure = regSortFeatures, + prefixText = "", + genFuncPointers = True, + protectFile = True, + protectFeature = True, + protectProto = None, + protectProtoStr = None, + apicall = '', + apientry = '', + apientryp = '', + alignFuncParam = 0, + currentExtension = '', + extensionOfInterest = 0): + GeneratorOptions.__init__(self, filename, directory, apiname, profile, + versions, emitversions, defaultExtensions, + addExtensions, removeExtensions, sortProcedure) + self.prefixText = prefixText + self.genFuncPointers = genFuncPointers + self.prefixText = None + self.protectFile = protectFile + self.protectFeature = protectFeature + self.protectProto = protectProto + self.protectProtoStr = protectProtoStr + self.apicall = apicall + self.apientry = apientry + self.apientryp = apientryp + self.alignFuncParam = alignFuncParam +# +# LoaderExtensionOutputGenerator - subclass of OutputGenerator. +# Generates dispatch table helper header files for LVL +class LoaderExtensionOutputGenerator(OutputGenerator): + """Generate dispatch table helper header based on XML element attributes""" + def __init__(self, + errFile = sys.stderr, + warnFile = sys.stderr, + diagFile = sys.stdout): + OutputGenerator.__init__(self, errFile, warnFile, diagFile) + + # Internal state - accumulators for different inner block text + self.ext_instance_dispatch_list = [] # List of extension entries for instance dispatch list + self.ext_device_dispatch_list = [] # List of extension entries for device dispatch list + self.core_commands = [] # List of CommandData records for core Vulkan commands + self.ext_commands = [] # List of CommandData records for extension Vulkan commands + self.CommandParam = namedtuple('CommandParam', ['type', 'name', 'cdecl']) + self.CommandData = namedtuple('CommandData', ['name', 'ext_name', 'ext_type', 'protect', 'return_type', 'handle_type', 'params', 'cdecl']) + self.instanceExtensions = [] + self.ExtensionData = namedtuple('ExtensionData', ['name', 'type', 'protect', 'num_commands']) + + # + # Called once at the beginning of each run + def beginFile(self, genOpts): + OutputGenerator.beginFile(self, genOpts) + + # User-supplied prefix text, if any (list of strings) + if (genOpts.prefixText): + for s in genOpts.prefixText: + write(s, file=self.outFile) + + # File Comment + file_comment = '// *** THIS FILE IS GENERATED - DO NOT EDIT ***\n' + file_comment += '// See loader_extension_generator.py for modifications\n' + write(file_comment, file=self.outFile) + + # Copyright Notice + copyright = '/*\n' + copyright += ' * Copyright (c) 2015-2017 The Khronos Group Inc.\n' + copyright += ' * Copyright (c) 2015-2017 Valve Corporation\n' + copyright += ' * Copyright (c) 2015-2017 LunarG, Inc.\n' + copyright += ' *\n' + copyright += ' * Licensed under the Apache License, Version 2.0 (the "License");\n' + copyright += ' * you may not use this file except in compliance with the License.\n' + copyright += ' * You may obtain a copy of the License at\n' + copyright += ' *\n' + copyright += ' * http://www.apache.org/licenses/LICENSE-2.0\n' + copyright += ' *\n' + copyright += ' * Unless required by applicable law or agreed to in writing, software\n' + copyright += ' * distributed under the License is distributed on an "AS IS" BASIS,\n' + copyright += ' * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n' + copyright += ' * See the License for the specific language governing permissions and\n' + copyright += ' * limitations under the License.\n' + copyright += ' *\n' + copyright += ' * Author: Mark Lobodzinski <mark@lunarg.com>\n' + copyright += ' * Author: Mark Young <marky@lunarg.com>\n' + copyright += ' */\n' + + preamble = '' + + if self.genOpts.filename == 'vk_loader_extensions.h': + preamble += '#pragma once\n' + + elif self.genOpts.filename == 'vk_loader_extensions.c': + preamble += '#define _GNU_SOURCE\n' + preamble += '#include <stdio.h>\n' + preamble += '#include <stdlib.h>\n' + preamble += '#include <string.h>\n' + preamble += '#include "vk_loader_platform.h"\n' + preamble += '#include "loader.h"\n' + preamble += '#include "vk_loader_extensions.h"\n' + preamble += '#include <vulkan/vk_icd.h>\n' + preamble += '#include "wsi.h"\n' + preamble += '#include "debug_report.h"\n' + + elif self.genOpts.filename == 'vk_layer_dispatch_table.h': + preamble += '#pragma once\n' + preamble += '\n' + preamble += 'typedef PFN_vkVoidFunction (VKAPI_PTR *PFN_GetPhysicalDeviceProcAddr)(VkInstance instance, const char* pName);\n' + + write(copyright, file=self.outFile) + write(preamble, file=self.outFile) + + # + # Write generate and write dispatch tables to output file + def endFile(self): + file_data = '' + + if self.genOpts.filename == 'vk_loader_extensions.h': + file_data += self.OutputPrototypesInHeader() + file_data += self.OutputLoaderTerminators() + file_data += self.OutputIcdDispatchTable() + file_data += self.OutputIcdExtensionEnableUnion() + + elif self.genOpts.filename == 'vk_loader_extensions.c': + file_data += self.OutputUtilitiesInSource() + file_data += self.OutputIcdDispatchTableInit() + file_data += self.OutputLoaderDispatchTables() + file_data += self.OutputLoaderLookupFunc() + file_data += self.CreateTrampTermFuncs() + file_data += self.InstExtensionGPA() + file_data += self.InstantExtensionCreate() + file_data += self.DeviceExtensionGetTerminator() + file_data += self.InitInstLoaderExtensionDispatchTable() + file_data += self.OutputInstantExtensionWhitelistArray() + + elif self.genOpts.filename == 'vk_layer_dispatch_table.h': + file_data += self.OutputLayerInstanceDispatchTable() + file_data += self.OutputLayerDeviceDispatchTable() + + write(file_data, file=self.outFile); + + # Finish processing in superclass + OutputGenerator.endFile(self) + + def beginFeature(self, interface, emit): + # Start processing in superclass + OutputGenerator.beginFeature(self, interface, emit) + + self.currentExtension = '' + self.type = interface.get('type') + self.num_commands = 0 + + name = interface.get('name') + self.currentExtension = name + + # + # Process commands, adding to appropriate dispatch tables + def genCmd(self, cmdinfo, name): + OutputGenerator.genCmd(self, cmdinfo, name) + + # Get first param type + params = cmdinfo.elem.findall('param') + info = self.getTypeNameTuple(params[0]) + + self.num_commands += 1 + + if 'android' not in name: + self.AddCommandToDispatchList(self.currentExtension, self.type, name, cmdinfo, info[0]) + + def endFeature(self): + + if 'android' not in self.currentExtension: + self.instanceExtensions.append(self.ExtensionData(name=self.currentExtension, + type=self.type, + protect=self.featureExtraProtect, + num_commands=self.num_commands)) + + # Finish processing in superclass + OutputGenerator.endFeature(self) + + # + # Retrieve the value of the len tag + def getLen(self, param): + result = None + len = param.attrib.get('len') + if len and len != 'null-terminated': + # For string arrays, 'len' can look like 'count,null-terminated', + # indicating that we have a null terminated array of strings. We + # strip the null-terminated from the 'len' field and only return + # the parameter specifying the string count + if 'null-terminated' in len: + result = len.split(',')[0] + else: + result = len + result = str(result).replace('::', '->') + return result + + # + # Determine if this API should be ignored or added to the instance or device dispatch table + def AddCommandToDispatchList(self, extension_name, extension_type, name, cmdinfo, handle_type): + handle = self.registry.tree.find("types/type/[name='" + handle_type + "'][@category='handle']") + + return_type = cmdinfo.elem.find('proto/type') + if (return_type != None and return_type.text == 'void'): + return_type = None + + cmd_params = [] + + # Generate a list of commands for use in printing the necessary + # core instance terminator prototypes + params = cmdinfo.elem.findall('param') + lens = set() + for param in params: + len = self.getLen(param) + if len: + lens.add(len) + paramsInfo = [] + for param in params: + paramInfo = self.getTypeNameTuple(param) + param_type = paramInfo[0] + param_name = paramInfo[1] + param_cdecl = self.makeCParamDecl(param, 0) + cmd_params.append(self.CommandParam(type=param_type, name=param_name, + cdecl=param_cdecl)) + + if handle != None and handle_type != 'VkInstance' and handle_type != 'VkPhysicalDevice': + # The Core Vulkan code will be wrapped in a feature called VK_VERSION_#_# + # For example: VK_VERSION_1_0 wraps the core 1.0 Vulkan functionality + if 'VK_VERSION_' in extension_name: + self.core_commands.append( + self.CommandData(name=name, ext_name=extension_name, + ext_type='device', + protect=self.featureExtraProtect, + return_type = return_type, + handle_type = handle_type, + params = cmd_params, + cdecl=self.makeCDecls(cmdinfo.elem)[0])) + else: + self.ext_device_dispatch_list.append((name, self.featureExtraProtect)) + self.ext_commands.append( + self.CommandData(name=name, ext_name=extension_name, + ext_type=extension_type, + protect=self.featureExtraProtect, + return_type = return_type, + handle_type = handle_type, + params = cmd_params, + cdecl=self.makeCDecls(cmdinfo.elem)[0])) + else: + # The Core Vulkan code will be wrapped in a feature called VK_VERSION_#_# + # For example: VK_VERSION_1_0 wraps the core 1.0 Vulkan functionality + if 'VK_VERSION_' in extension_name: + self.core_commands.append( + self.CommandData(name=name, ext_name=extension_name, + ext_type='instance', + protect=self.featureExtraProtect, + return_type = return_type, + handle_type = handle_type, + params = cmd_params, + cdecl=self.makeCDecls(cmdinfo.elem)[0])) + + else: + self.ext_instance_dispatch_list.append((name, self.featureExtraProtect)) + self.ext_commands.append( + self.CommandData(name=name, ext_name=extension_name, + ext_type=extension_type, + protect=self.featureExtraProtect, + return_type = return_type, + handle_type = handle_type, + params = cmd_params, + cdecl=self.makeCDecls(cmdinfo.elem)[0])) + + # + # Retrieve the type and name for a parameter + def getTypeNameTuple(self, param): + type = '' + name = '' + for elem in param: + if elem.tag == 'type': + type = noneStr(elem.text) + elif elem.tag == 'name': + name = noneStr(elem.text) + return (type, name) + + def OutputPrototypesInHeader(self): + protos = '' + protos += '// Structures defined externally, but used here\n' + protos += 'struct loader_instance;\n' + protos += 'struct loader_icd_term;\n' + protos += 'struct loader_dev_dispatch_table;\n' + protos += '\n' + protos += '// Device extension error function\n' + protos += 'VKAPI_ATTR VkResult VKAPI_CALL vkDevExtError(VkDevice dev);\n' + protos += '\n' + protos += '// Extension interception for vkGetInstanceProcAddr function, so we can return\n' + protos += '// the appropriate information for any instance extensions we know about.\n' + protos += 'bool extension_instance_gpa(struct loader_instance *ptr_instance, const char *name, void **addr);\n' + protos += '\n' + protos += '// Extension interception for vkCreateInstance function, so we can properly\n' + protos += '// detect and enable any instance extension information for extensions we know\n' + protos += '// about.\n' + protos += 'void extensions_create_instance(struct loader_instance *ptr_instance, const VkInstanceCreateInfo *pCreateInfo);\n' + protos += '\n' + protos += '// Extension interception for vkGetDeviceProcAddr function, so we can return\n' + protos += '// an appropriate terminator if this is one of those few device commands requiring\n' + protos += '// a terminator.\n' + protos += 'PFN_vkVoidFunction get_extension_device_proc_terminator(const char *pName);\n' + protos += '\n' + protos += '// Dispatch table properly filled in with appropriate terminators for the\n' + protos += '// supported extensions.\n' + protos += 'extern const VkLayerInstanceDispatchTable instance_disp;\n' + protos += '\n' + protos += '// Array of extension strings for instance extensions we support.\n' + protos += 'extern const char *const LOADER_INSTANCE_EXTENSIONS[];\n' + protos += '\n' + protos += 'VKAPI_ATTR bool VKAPI_CALL loader_icd_init_entries(struct loader_icd_term *icd_term, VkInstance inst,\n' + protos += ' const PFN_vkGetInstanceProcAddr fp_gipa);\n' + protos += '\n' + protos += '// Init Device function pointer dispatch table with core commands\n' + protos += 'VKAPI_ATTR void VKAPI_CALL loader_init_device_dispatch_table(struct loader_dev_dispatch_table *dev_table, PFN_vkGetDeviceProcAddr gpa,\n' + protos += ' VkDevice dev);\n' + protos += '\n' + protos += '// Init Device function pointer dispatch table with extension commands\n' + protos += 'VKAPI_ATTR void VKAPI_CALL loader_init_device_extension_dispatch_table(struct loader_dev_dispatch_table *dev_table,\n' + protos += ' PFN_vkGetDeviceProcAddr gpa, VkDevice dev);\n' + protos += '\n' + protos += '// Init Instance function pointer dispatch table with core commands\n' + protos += 'VKAPI_ATTR void VKAPI_CALL loader_init_instance_core_dispatch_table(VkLayerInstanceDispatchTable *table, PFN_vkGetInstanceProcAddr gpa,\n' + protos += ' VkInstance inst);\n' + protos += '\n' + protos += '// Init Instance function pointer dispatch table with core commands\n' + protos += 'VKAPI_ATTR void VKAPI_CALL loader_init_instance_extension_dispatch_table(VkLayerInstanceDispatchTable *table, PFN_vkGetInstanceProcAddr gpa,\n' + protos += ' VkInstance inst);\n' + protos += '\n' + protos += '// Device command lookup function\n' + protos += 'VKAPI_ATTR void* VKAPI_CALL loader_lookup_device_dispatch_table(const VkLayerDispatchTable *table, const char *name);\n' + protos += '\n' + protos += '// Instance command lookup function\n' + protos += 'VKAPI_ATTR void* VKAPI_CALL loader_lookup_instance_dispatch_table(const VkLayerInstanceDispatchTable *table, const char *name,\n' + protos += ' bool *found_name);\n' + protos += '\n' + protos += 'VKAPI_ATTR bool VKAPI_CALL loader_icd_init_entries(struct loader_icd_term *icd_term, VkInstance inst,\n' + protos += ' const PFN_vkGetInstanceProcAddr fp_gipa);\n' + protos += '\n' + return protos + + def OutputUtilitiesInSource(self): + protos = '' + protos += '// Device extension error function\n' + protos += 'VKAPI_ATTR VkResult VKAPI_CALL vkDevExtError(VkDevice dev) {\n' + protos += ' struct loader_device *found_dev;\n' + protos += ' // The device going in is a trampoline device\n' + protos += ' struct loader_icd_term *icd_term = loader_get_icd_and_device(dev, &found_dev, NULL);\n' + protos += '\n' + protos += ' if (icd_term)\n' + protos += ' loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,\n' + protos += ' "Bad destination in loader trampoline dispatch,"\n' + protos += ' "Are layers and extensions that you are calling enabled?");\n' + protos += ' return VK_ERROR_EXTENSION_NOT_PRESENT;\n' + protos += '}\n\n' + return protos + + # + # Create a layer instance dispatch table from the appropriate list and return it as a string + def OutputLayerInstanceDispatchTable(self): + commands = [] + table = '' + cur_extension_name = '' + + table += '// Instance function pointer dispatch table\n' + table += 'typedef struct VkLayerInstanceDispatchTable_ {\n' + + # First add in an entry for GetPhysicalDeviceProcAddr. This will not + # ever show up in the XML or header, so we have to manually add it. + table += ' // Manually add in GetPhysicalDeviceProcAddr entry\n' + table += ' PFN_GetPhysicalDeviceProcAddr GetPhysicalDeviceProcAddr;\n' + + for x in range(0, 2): + if x == 0: + commands = self.core_commands + else: + commands = self.ext_commands + + for cur_cmd in commands: + is_inst_handle_type = cur_cmd.ext_type == 'instance' or cur_cmd.handle_type == 'VkInstance' or cur_cmd.handle_type == 'VkPhysicalDevice' + if is_inst_handle_type: + + if cur_cmd.ext_name != cur_extension_name: + if 'VK_VERSION_' in cur_cmd.ext_name: + table += '\n // ---- Core %s commands\n' % cur_cmd.ext_name[11:] + else: + table += '\n // ---- %s extension commands\n' % cur_cmd.ext_name + cur_extension_name = cur_cmd.ext_name + + # Remove 'vk' from proto name + base_name = cur_cmd.name[2:] + + if cur_cmd.protect is not None: + table += '#ifdef %s\n' % cur_cmd.protect + + table += ' PFN_%s %s;\n' % (cur_cmd.name, base_name) + + if cur_cmd.protect is not None: + table += '#endif // %s\n' % cur_cmd.protect + + table += '} VkLayerInstanceDispatchTable;\n\n' + return table + + # + # Create a layer device dispatch table from the appropriate list and return it as a string + def OutputLayerDeviceDispatchTable(self): + commands = [] + table = '' + cur_extension_name = '' + + table += '// Device function pointer dispatch table\n' + table += 'typedef struct VkLayerDispatchTable_ {\n' + + for x in range(0, 2): + if x == 0: + commands = self.core_commands + else: + commands = self.ext_commands + + for cur_cmd in commands: + is_inst_handle_type = cur_cmd.ext_type == 'instance' or cur_cmd.handle_type == 'VkInstance' or cur_cmd.handle_type == 'VkPhysicalDevice' + if not is_inst_handle_type: + + if cur_cmd.ext_name != cur_extension_name: + if 'VK_VERSION_' in cur_cmd.ext_name: + table += '\n // ---- Core %s commands\n' % cur_cmd.ext_name[11:] + else: + table += '\n // ---- %s extension commands\n' % cur_cmd.ext_name + cur_extension_name = cur_cmd.ext_name + + # Remove 'vk' from proto name + base_name = cur_cmd.name[2:] + + if cur_cmd.protect is not None: + table += '#ifdef %s\n' % cur_cmd.protect + + table += ' PFN_%s %s;\n' % (cur_cmd.name, base_name) + + if cur_cmd.protect is not None: + table += '#endif // %s\n' % cur_cmd.protect + + table += '} VkLayerDispatchTable;\n\n' + return table + + # + # Create a dispatch table from the appropriate list and return it as a string + def OutputIcdDispatchTable(self): + commands = [] + table = '' + cur_extension_name = '' + + table += '// ICD function pointer dispatch table\n' + table += 'struct loader_icd_term_dispatch {\n' + + for x in range(0, 2): + if x == 0: + commands = self.core_commands + else: + commands = self.ext_commands + + for cur_cmd in commands: + is_inst_handle_type = cur_cmd.ext_type == 'instance' or cur_cmd.handle_type == 'VkInstance' or cur_cmd.handle_type == 'VkPhysicalDevice' + if ((is_inst_handle_type or cur_cmd.name in DEVICE_CMDS_NEED_TERM) and + (cur_cmd.name != 'vkGetInstanceProcAddr' and cur_cmd.name != 'vkEnumerateDeviceLayerProperties')): + + if cur_cmd.ext_name != cur_extension_name: + if 'VK_VERSION_' in cur_cmd.ext_name: + table += '\n // ---- Core %s commands\n' % cur_cmd.ext_name[11:] + else: + table += '\n // ---- %s extension commands\n' % cur_cmd.ext_name + cur_extension_name = cur_cmd.ext_name + + # Remove 'vk' from proto name + base_name = cur_cmd.name[2:] + + if cur_cmd.protect is not None: + table += '#ifdef %s\n' % cur_cmd.protect + + table += ' PFN_%s %s;\n' % (cur_cmd.name, base_name) + + if cur_cmd.protect is not None: + table += '#endif // %s\n' % cur_cmd.protect + + table += '};\n\n' + return table + + # + # Init a dispatch table from the appropriate list and return it as a string + def OutputIcdDispatchTableInit(self): + commands = [] + cur_extension_name = '' + + table = '' + table += 'VKAPI_ATTR bool VKAPI_CALL loader_icd_init_entries(struct loader_icd_term *icd_term, VkInstance inst,\n' + table += ' const PFN_vkGetInstanceProcAddr fp_gipa) {\n' + table += '\n' + table += '#define LOOKUP_GIPA(func, required) \\\n' + table += ' do { \\\n' + table += ' icd_term->dispatch.func = (PFN_vk##func)fp_gipa(inst, "vk" #func); \\\n' + table += ' if (!icd_term->dispatch.func && required) { \\\n' + table += ' loader_log((struct loader_instance *)inst, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, \\\n' + table += ' loader_platform_get_proc_address_error("vk" #func)); \\\n' + table += ' return false; \\\n' + table += ' } \\\n' + table += ' } while (0)\n' + table += '\n' + + skip_gipa_commands = ['vkGetInstanceProcAddr', + 'vkEnumerateDeviceLayerProperties', + 'vkCreateInstance', + 'vkEnumerateInstanceExtensionProperties', + 'vkEnumerateInstanceLayerProperties', + ] + + for x in range(0, 2): + if x == 0: + commands = self.core_commands + else: + commands = self.ext_commands + + for cur_cmd in commands: + is_inst_handle_type = cur_cmd.ext_type == 'instance' or cur_cmd.handle_type == 'VkInstance' or cur_cmd.handle_type == 'VkPhysicalDevice' + if ((is_inst_handle_type or cur_cmd.name in DEVICE_CMDS_NEED_TERM) and (cur_cmd.name not in skip_gipa_commands)): + + if cur_cmd.ext_name != cur_extension_name: + if 'VK_VERSION_' in cur_cmd.ext_name: + table += '\n // ---- Core %s\n' % cur_cmd.ext_name[11:] + else: + table += '\n // ---- %s extension commands\n' % cur_cmd.ext_name + cur_extension_name = cur_cmd.ext_name + + # Remove 'vk' from proto name + base_name = cur_cmd.name[2:] + + if cur_cmd.protect is not None: + table += '#ifdef %s\n' % cur_cmd.protect + + # The Core Vulkan code will be wrapped in a feature called VK_VERSION_#_# + # For example: VK_VERSION_1_0 wraps the core 1.0 Vulkan functionality + if x == 0: + table += ' LOOKUP_GIPA(%s, true);\n' % (base_name) + else: + table += ' LOOKUP_GIPA(%s, false);\n' % (base_name) + + if cur_cmd.protect is not None: + table += '#endif // %s\n' % cur_cmd.protect + + table += '\n' + table += '#undef LOOKUP_GIPA\n' + table += '\n' + table += ' return true;\n' + table += '};\n\n' + return table + + # + # Create the extension enable union + def OutputIcdExtensionEnableUnion(self): + extensions = self.instanceExtensions + + union = '' + union += 'union loader_instance_extension_enables {\n' + union += ' struct {\n' + for ext in extensions: + if ('VK_VERSION_' in ext.name or ext.name in WSI_EXT_NAMES or + ext.type == 'device' or ext.num_commands == 0): + continue + + union += ' uint8_t %s : 1;\n' % ext.name[3:].lower() + + union += ' };\n' + union += ' uint64_t padding[4];\n' + union += '};\n\n' + return union + + # + # Creates the prototypes for the loader's core instance command terminators + def OutputLoaderTerminators(self): + terminators = '' + terminators += '// Loader core instance terminators\n' + + for cur_cmd in self.core_commands: + is_inst_handle_type = cur_cmd.ext_type == 'instance' or cur_cmd.handle_type == 'VkInstance' or cur_cmd.handle_type == 'VkPhysicalDevice' + if is_inst_handle_type: + mod_string = '' + new_terminator = cur_cmd.cdecl + mod_string = new_terminator.replace("VKAPI_CALL vk", "VKAPI_CALL terminator_") + + if (cur_cmd.protect != None): + terminators += '#ifdef %s\n' % cur_cmd.protect + + terminators += mod_string + terminators += '\n' + + if (cur_cmd.protect != None): + terminators += '#endif // %s\n' % cur_cmd.protect + + terminators += '\n' + return terminators + + # + # Creates code to initialize the various dispatch tables + def OutputLoaderDispatchTables(self): + commands = [] + tables = '' + gpa_param = '' + cur_type = '' + cur_extension_name = '' + + for x in range(0, 4): + if x == 0: + cur_type = 'device' + gpa_param = 'dev' + commands = self.core_commands + + tables += '// Init Device function pointer dispatch table with core commands\n' + tables += 'VKAPI_ATTR void VKAPI_CALL loader_init_device_dispatch_table(struct loader_dev_dispatch_table *dev_table, PFN_vkGetDeviceProcAddr gpa,\n' + tables += ' VkDevice dev) {\n' + tables += ' VkLayerDispatchTable *table = &dev_table->core_dispatch;\n' + tables += ' for (uint32_t i = 0; i < MAX_NUM_UNKNOWN_EXTS; i++) dev_table->ext_dispatch.dev_ext[i] = (PFN_vkDevExt)vkDevExtError;\n' + tables += '\n' + + elif x == 1: + cur_type = 'device' + gpa_param = 'dev' + commands = self.ext_commands + + tables += '// Init Device function pointer dispatch table with extension commands\n' + tables += 'VKAPI_ATTR void VKAPI_CALL loader_init_device_extension_dispatch_table(struct loader_dev_dispatch_table *dev_table,\n' + tables += ' PFN_vkGetDeviceProcAddr gpa, VkDevice dev) {\n' + tables += ' VkLayerDispatchTable *table = &dev_table->core_dispatch;\n' + tables += '\n' + + elif x == 2: + cur_type = 'instance' + gpa_param = 'inst' + commands = self.core_commands + + tables += '// Init Instance function pointer dispatch table with core commands\n' + tables += 'VKAPI_ATTR void VKAPI_CALL loader_init_instance_core_dispatch_table(VkLayerInstanceDispatchTable *table, PFN_vkGetInstanceProcAddr gpa,\n' + tables += ' VkInstance inst) {\n' + + else: + cur_type = 'instance' + gpa_param = 'inst' + commands = self.ext_commands + + tables += '// Init Instance function pointer dispatch table with core commands\n' + tables += 'VKAPI_ATTR void VKAPI_CALL loader_init_instance_extension_dispatch_table(VkLayerInstanceDispatchTable *table, PFN_vkGetInstanceProcAddr gpa,\n' + tables += ' VkInstance inst) {\n' + + for cur_cmd in commands: + is_inst_handle_type = cur_cmd.ext_type == 'instance' or cur_cmd.handle_type == 'VkInstance' or cur_cmd.handle_type == 'VkPhysicalDevice' + if ((cur_type == 'instance' and is_inst_handle_type) or (cur_type == 'device' and not is_inst_handle_type)): + if cur_cmd.ext_name != cur_extension_name: + if 'VK_VERSION_' in cur_cmd.ext_name: + tables += '\n // ---- Core %s commands\n' % cur_cmd.ext_name[11:] + else: + tables += '\n // ---- %s extension commands\n' % cur_cmd.ext_name + cur_extension_name = cur_cmd.ext_name + + # Remove 'vk' from proto name + base_name = cur_cmd.name[2:] + + # Names to skip + if (base_name == 'CreateInstance' or base_name == 'CreateDevice' or + base_name == 'EnumerateInstanceExtensionProperties' or + base_name == 'EnumerateInstanceLayerProperties'): + continue + + if cur_cmd.protect is not None: + tables += '#ifdef %s\n' % cur_cmd.protect + + tables += ' table->%s = (PFN_%s)gpa(%s, "%s");\n' % (base_name, cur_cmd.name, gpa_param, cur_cmd.name) + + if cur_cmd.protect is not None: + tables += '#endif // %s\n' % cur_cmd.protect + + tables += '}\n\n' + return tables + + # + # Create a lookup table function from the appropriate list of entrypoints and + # return it as a string + def OutputLoaderLookupFunc(self): + commands = [] + tables = '' + cur_type = '' + cur_extension_name = '' + + for x in range(0, 2): + if x == 0: + cur_type = 'device' + + tables += '// Device command lookup function\n' + tables += 'VKAPI_ATTR void* VKAPI_CALL loader_lookup_device_dispatch_table(const VkLayerDispatchTable *table, const char *name) {\n' + tables += ' if (!name || name[0] != \'v\' || name[1] != \'k\') return NULL;\n' + tables += '\n' + tables += ' name += 2;\n' + else: + cur_type = 'instance' + + tables += '// Instance command lookup function\n' + tables += 'VKAPI_ATTR void* VKAPI_CALL loader_lookup_instance_dispatch_table(const VkLayerInstanceDispatchTable *table, const char *name,\n' + tables += ' bool *found_name) {\n' + tables += ' if (!name || name[0] != \'v\' || name[1] != \'k\') {\n' + tables += ' *found_name = false;\n' + tables += ' return NULL;\n' + tables += ' }\n' + tables += '\n' + tables += ' *found_name = true;\n' + tables += ' name += 2;\n' + + for y in range(0, 2): + if y == 0: + commands = self.core_commands + else: + commands = self.ext_commands + + for cur_cmd in commands: + is_inst_handle_type = cur_cmd.ext_type == 'instance' or cur_cmd.handle_type == 'VkInstance' or cur_cmd.handle_type == 'VkPhysicalDevice' + if ((cur_type == 'instance' and is_inst_handle_type) or (cur_type == 'device' and not is_inst_handle_type)): + + if cur_cmd.ext_name != cur_extension_name: + if 'VK_VERSION_' in cur_cmd.ext_name: + tables += '\n // ---- Core %s commands\n' % cur_cmd.ext_name[11:] + else: + tables += '\n // ---- %s extension commands\n' % cur_cmd.ext_name + cur_extension_name = cur_cmd.ext_name + + # Remove 'vk' from proto name + base_name = cur_cmd.name[2:] + + if (base_name == 'CreateInstance' or base_name == 'CreateDevice' or + base_name == 'EnumerateInstanceExtensionProperties' or + base_name == 'EnumerateInstanceLayerProperties'): + continue + + if cur_cmd.protect is not None: + tables += '#ifdef %s\n' % cur_cmd.protect + + tables += ' if (!strcmp(name, "%s")) return (void *)table->%s;\n' % (base_name, base_name) + + if cur_cmd.protect is not None: + tables += '#endif // %s\n' % cur_cmd.protect + + tables += '\n' + if x == 1: + tables += ' *found_name = false;\n' + tables += ' return NULL;\n' + tables += '}\n\n' + return tables + + # + # Several functions need a manual trampoline/terminator + def AddManualTrampTermFuncs(self): + funcs = '' + + # vkEnumeratePhysicalDeviceGroupsKHX + funcs += '\n// ---- Manually added trampoline/terminator functison\n\n' + funcs += 'VKAPI_ATTR VkResult VKAPI_CALL vkEnumeratePhysicalDeviceGroupsKHX(\n' + funcs += ' VkInstance instance, uint32_t *pPhysicalDeviceGroupCount,\n' + funcs += ' VkPhysicalDeviceGroupPropertiesKHX *pPhysicalDeviceGroupProperties) {\n' + funcs += ' VkResult res = VK_SUCCESS;\n' + funcs += ' struct loader_instance *inst = NULL;\n' + funcs += '\n' + funcs += ' loader_platform_thread_lock_mutex(&loader_lock);\n' + funcs += '\n' + funcs += ' inst = loader_get_instance(instance);\n' + funcs += ' if (NULL == inst) {\n' + funcs += ' res = VK_ERROR_INITIALIZATION_FAILED;\n' + funcs += ' goto out;\n' + funcs += ' }\n' + funcs += '\n' + funcs += ' if (pPhysicalDeviceGroupProperties == NULL || 0 == inst->total_gpu_count) {\n' + funcs += ' VkResult setup_res = setupLoaderTrampPhysDevs(instance);\n' + funcs += ' if (VK_SUCCESS != setup_res) {\n' + funcs += ' res = setup_res;\n' + funcs += ' goto out;\n' + funcs += ' }\n' + funcs += ' }\n' + funcs += '\n' + funcs += ' res = inst->disp->layer_inst_disp.EnumeratePhysicalDeviceGroupsKHX(\n' + funcs += ' instance, pPhysicalDeviceGroupCount, pPhysicalDeviceGroupProperties);\n' + funcs += ' if ((VK_SUCCESS != res && VK_INCOMPLETE != res) ||\n' + funcs += ' NULL == pPhysicalDeviceGroupProperties) {\n' + funcs += ' goto out;\n' + funcs += ' }\n' + funcs += '\n' + funcs += ' for (uint32_t group = 0; group < *pPhysicalDeviceGroupCount; group++) {\n' + funcs += ' for (uint32_t dev = 0;' + funcs += ' dev < pPhysicalDeviceGroupProperties[group].physicalDeviceCount; dev++) {\n' + funcs += ' for (uint32_t tramp = 0; tramp < inst->total_gpu_count; tramp++) {\n' + funcs += ' if (inst->phys_devs_tramp[tramp]->phys_dev ==\n' + funcs += ' pPhysicalDeviceGroupProperties[group].physicalDevices[dev]) {\n' + funcs += ' pPhysicalDeviceGroupProperties[group].physicalDevices[dev] =\n' + funcs += ' (VkPhysicalDevice)inst->phys_devs_tramp[tramp];\n' + funcs += ' }\n' + funcs += ' }\n' + funcs += ' }\n' + funcs += ' }\n' + funcs += '\n' + funcs += 'out:\n' + funcs += '\n' + funcs += ' loader_platform_thread_unlock_mutex(&loader_lock);\n' + funcs += ' return res;\n' + funcs += '}\n\n' + funcs += 'VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumeratePhysicalDeviceGroupsKHX(\n' + funcs += ' VkInstance instance, uint32_t *pPhysicalDeviceGroupCount,\n' + funcs += ' VkPhysicalDeviceGroupPropertiesKHX *pPhysicalDeviceGroupProperties) {\n' + funcs += ' struct loader_instance *inst = loader_get_instance(instance);\n' + funcs += ' VkResult res = VK_SUCCESS;\n' + funcs += ' uint32_t total_group_count = 0;\n' + funcs += ' uint32_t max_group_count = *pPhysicalDeviceGroupCount;\n' + funcs += ' uint32_t i = 0;\n' + funcs += '\n' + funcs += ' // We have to loop through all ICDs which may be capable of handling this\n' + funcs += ' // call and sum all the possible physical device groups together.\n' + funcs += ' struct loader_icd_term *icd_term = inst->icd_terms;\n' + funcs += ' while (NULL != icd_term) {\n' + funcs += ' if (NULL != icd_term->dispatch.EnumeratePhysicalDeviceGroupsKHX) {\n' + funcs += ' uint32_t cur_group_count = 0;\n' + funcs += ' res = icd_term->dispatch.EnumeratePhysicalDeviceGroupsKHX(\n' + funcs += ' icd_term->instance, &cur_group_count, NULL);\n' + funcs += ' if (res != VK_SUCCESS) {\n' + funcs += ' break;\n' + funcs += ' } else if (NULL != pPhysicalDeviceGroupProperties && max_group_count > total_group_count) {\n' + funcs += '\n' + funcs += ' uint32_t remain_count = max_group_count - total_group_count;\n' + funcs += ' res = icd_term->dispatch.EnumeratePhysicalDeviceGroupsKHX(\n' + funcs += ' icd_term->instance, &remain_count,\n' + funcs += ' &pPhysicalDeviceGroupProperties[total_group_count]);\n' + funcs += ' if (res != VK_SUCCESS) {\n' + funcs += ' break;\n' + funcs += ' }\n' + funcs += ' }\n' + funcs += ' total_group_count += cur_group_count;\n' + funcs += ' } else {\n' + funcs += ' // For ICDs which don\'t directly support this, create a group for each physical device\n' + funcs += ' for (uint32_t j = 0; j < inst->total_gpu_count; j++) {\n' + funcs += ' if (inst->phys_devs_term[j]->icd_index == i) {\n' + funcs += ' if (NULL != pPhysicalDeviceGroupProperties && max_group_count > total_group_count) {\n' + funcs += ' pPhysicalDeviceGroupProperties[total_group_count].physicalDeviceCount = 1;\n' + funcs += ' pPhysicalDeviceGroupProperties[total_group_count].physicalDevices[0] =\n' + funcs += ' inst->phys_devs_term[j]->phys_dev;\n' + funcs += ' }\n' + funcs += ' total_group_count++;\n' + funcs += ' }\n' + funcs += ' }\n' + funcs += ' }\n' + funcs += ' icd_term = icd_term->next;\n' + funcs += ' i++;\n' + funcs += ' }\n' + funcs += '\n' + funcs += ' *pPhysicalDeviceGroupCount = total_group_count;\n' + funcs += '\n' + funcs += ' // Replace the physical devices with the value from the loader terminator\n' + funcs += ' // so we can de-reference them if needed.\n' + funcs += ' if (NULL != pPhysicalDeviceGroupProperties) {\n' + funcs += ' for (uint32_t group = 0; group < max_group_count; group++) {\n' + funcs += ' VkPhysicalDeviceGroupPropertiesKHX *cur_props = &pPhysicalDeviceGroupProperties[group];\n' + funcs += ' for (i = 0; i < cur_props->physicalDeviceCount; i++) {\n' + funcs += ' for (uint32_t term = 0; term < inst->total_gpu_count; term++) {\n' + funcs += ' if (inst->phys_devs_term[term]->phys_dev == cur_props->physicalDevices[i]) {\n' + funcs += ' cur_props->physicalDevices[i] = (VkPhysicalDevice)inst->phys_devs_term[term];\n' + funcs += ' }\n' + funcs += ' }\n' + funcs += ' }\n' + funcs += ' }\n' + funcs += '\n' + funcs += ' if (VK_SUCCESS == res && max_group_count < total_group_count) {\n' + funcs += ' res = VK_INCOMPLETE;\n' + funcs += ' }\n' + funcs += ' }\n' + funcs += '\n' + funcs += ' return res;\n' + funcs += '}\n\n' + funcs += 'VKAPI_ATTR VkResult VKAPI_CALL\n' + funcs += 'vkGetPhysicalDeviceExternalImageFormatPropertiesNV(\n' + funcs += ' VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type,\n' + funcs += ' VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags,\n' + funcs += ' VkExternalMemoryHandleTypeFlagsNV externalHandleType,\n' + funcs += ' VkExternalImageFormatPropertiesNV *pExternalImageFormatProperties) {\n' + funcs += ' const VkLayerInstanceDispatchTable *disp;\n' + funcs += ' VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice);\n' + funcs += ' disp = loader_get_instance_layer_dispatch(physicalDevice);\n' + funcs += '\n' + funcs += ' return disp->GetPhysicalDeviceExternalImageFormatPropertiesNV(\n' + funcs += ' unwrapped_phys_dev, format, type, tiling, usage, flags,\n' + funcs += ' externalHandleType, pExternalImageFormatProperties);\n' + funcs += '}\n' + funcs += '\n' + funcs += 'VKAPI_ATTR VkResult VKAPI_CALL\n' + funcs += 'terminator_GetPhysicalDeviceExternalImageFormatPropertiesNV(\n' + funcs += ' VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type,\n' + funcs += ' VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags,\n' + funcs += ' VkExternalMemoryHandleTypeFlagsNV externalHandleType,\n' + funcs += ' VkExternalImageFormatPropertiesNV *pExternalImageFormatProperties) {\n' + funcs += ' struct loader_physical_device_term *phys_dev_term =\n' + funcs += ' (struct loader_physical_device_term *)physicalDevice;\n' + funcs += ' struct loader_icd_term *icd_term = phys_dev_term->this_icd_term;\n' + funcs += '\n' + funcs += ' if (!icd_term->dispatch.GetPhysicalDeviceExternalImageFormatPropertiesNV) {\n' + funcs += ' if (externalHandleType) {\n' + funcs += ' return VK_ERROR_FORMAT_NOT_SUPPORTED;\n' + funcs += ' }\n' + funcs += '\n' + funcs += ' if (!icd_term->dispatch.GetPhysicalDeviceImageFormatProperties) {\n' + funcs += ' return VK_ERROR_INITIALIZATION_FAILED;\n' + funcs += ' }\n' + funcs += '\n' + funcs += ' pExternalImageFormatProperties->externalMemoryFeatures = 0;\n' + funcs += ' pExternalImageFormatProperties->exportFromImportedHandleTypes = 0;\n' + funcs += ' pExternalImageFormatProperties->compatibleHandleTypes = 0;\n' + funcs += '\n' + funcs += ' return icd_term->dispatch.GetPhysicalDeviceImageFormatProperties(\n' + funcs += ' phys_dev_term->phys_dev, format, type, tiling, usage, flags,\n' + funcs += ' &pExternalImageFormatProperties->imageFormatProperties);\n' + funcs += ' }\n' + funcs += '\n' + funcs += ' return icd_term->dispatch.GetPhysicalDeviceExternalImageFormatPropertiesNV(\n' + funcs += ' phys_dev_term->phys_dev, format, type, tiling, usage, flags,\n' + funcs += ' externalHandleType, pExternalImageFormatProperties);\n' + funcs += '}\n\n' + return funcs + + # + # Create the appropriate trampoline (and possibly terminator) functinos + def CreateTrampTermFuncs(self): + entries = [] + funcs = '' + cur_extension_name = '' + + # Some extensions have to be manually added. Skip those in the automatic + # generation. They will be manually added later. + manual_ext_commands = ['vkEnumeratePhysicalDeviceGroupsKHX', + 'vkGetPhysicalDeviceExternalImageFormatPropertiesNV'] + + for ext_cmd in self.ext_commands: + if (ext_cmd.ext_name in WSI_EXT_NAMES or + ext_cmd.ext_name in AVOID_EXT_NAMES or + ext_cmd.name in manual_ext_commands): + continue + + if ext_cmd.ext_name != cur_extension_name: + if 'VK_VERSION_' in ext_cmd.ext_name: + funcs += '\n// ---- Core %s trampoline/terminators\n\n' % ext_cmd.ext_name[11:] + else: + funcs += '\n// ---- %s extension trampoline/terminators\n\n' % ext_cmd.ext_name + cur_extension_name = ext_cmd.ext_name + + if ext_cmd.protect is not None: + funcs += '#ifdef %s\n' % ext_cmd.protect + + tramp_header = ext_cmd.cdecl.replace(";", " {\n") + return_prefix = ' ' + base_name = ext_cmd.name[2:] + has_surface = 0 + requires_terminator = 0 + surface_var_name = '' + phys_dev_var_name = '' + has_return_type = False + + for param in ext_cmd.params: + if param.type == 'VkSurfaceKHR': + has_surface = 1 + surface_var_name = param.name + requires_terminator = 1 + if param.type == 'VkPhysicalDevice': + requires_terminator = 1 + phys_dev_var_name = param.name + + if (ext_cmd.return_type != None): + return_prefix += 'return ' + has_return_type = True + + if (ext_cmd.ext_type == 'instance' or ext_cmd.handle_type == 'VkPhysicalDevice' or + 'DebugMarkerSetObject' in ext_cmd.name or ext_cmd.name in DEVICE_CMDS_NEED_TERM): + requires_terminator = 1 + + if requires_terminator == 1: + term_header = tramp_header.replace("VKAPI_CALL vk", "VKAPI_CALL terminator_") + + funcs += tramp_header + + if ext_cmd.handle_type == 'VkPhysicalDevice': + funcs += ' const VkLayerInstanceDispatchTable *disp;\n' + funcs += ' VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(%s);\n' % (phys_dev_var_name) + funcs += ' disp = loader_get_instance_layer_dispatch(%s);\n' % (phys_dev_var_name) + elif ext_cmd.handle_type == 'VkInstance': + funcs += '#error("Not implemented. Likely needs to be manually generated!");\n' + else: + funcs += ' const VkLayerDispatchTable *disp = loader_get_dispatch(' + funcs += ext_cmd.params[0].name + funcs += ');\n' + + if 'DebugMarkerSetObject' in ext_cmd.name: + funcs += ' // If this is a physical device, we have to replace it with the proper one for the next call.\n' + funcs += ' if (%s->objectType == VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT) {\n' % (ext_cmd.params[1].name) + funcs += ' struct loader_physical_device_tramp *phys_dev_tramp = (struct loader_physical_device_tramp *)(uintptr_t)%s->object;\n' % (ext_cmd.params[1].name) + funcs += ' %s->object = (uint64_t)(uintptr_t)phys_dev_tramp->phys_dev;\n' % (ext_cmd.params[1].name) + funcs += ' }\n' + + funcs += return_prefix + funcs += 'disp->' + funcs += base_name + funcs += '(' + count = 0 + for param in ext_cmd.params: + if count != 0: + funcs += ', ' + + if param.type == 'VkPhysicalDevice': + funcs += 'unwrapped_phys_dev' + else: + funcs += param.name + + count += 1 + funcs += ');\n' + funcs += '}\n\n' + + funcs += term_header + if ext_cmd.handle_type == 'VkPhysicalDevice': + funcs += ' struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)%s;\n' % (phys_dev_var_name) + funcs += ' struct loader_icd_term *icd_term = phys_dev_term->this_icd_term;\n' + funcs += ' if (NULL == icd_term->dispatch.' + funcs += base_name + funcs += ') {\n' + funcs += ' loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,\n' + funcs += ' "ICD associated with VkPhysicalDevice does not support ' + funcs += base_name + funcs += '");\n' + + if has_surface == 1: + funcs += ' VkIcdSurface *icd_surface = (VkIcdSurface *)(surface);\n' + funcs += ' uint8_t icd_index = phys_dev_term->icd_index;\n' + funcs += ' if (NULL != icd_surface->real_icd_surfaces) {\n' + funcs += ' if (NULL != (void *)icd_surface->real_icd_surfaces[icd_index]) {\n' + funcs += ' return icd_term->dispatch.' + funcs += base_name + funcs += '(' + count = 0 + for param in ext_cmd.params: + if count != 0: + funcs += ', ' + + if param.type == 'VkPhysicalDevice': + funcs += 'phys_dev_term->phys_dev' + elif param.type == 'VkSurfaceKHR': + funcs += 'icd_surface->real_icd_surfaces[icd_index]' + else: + funcs += param.name + + count += 1 + funcs += ');\n' + funcs += ' }\n' + funcs += ' }\n' + + funcs += ' }\n' + + funcs += return_prefix + funcs += 'icd_term->dispatch.' + funcs += base_name + funcs += '(' + count = 0 + for param in ext_cmd.params: + if count != 0: + funcs += ', ' + + if param.type == 'VkPhysicalDevice': + funcs += 'phys_dev_term->phys_dev' + else: + funcs += param.name + + count += 1 + funcs += ');\n' + + elif has_surface == 1 and ext_cmd.ext_type == 'device': + funcs += ' uint32_t icd_index = 0;\n' + funcs += ' struct loader_device *dev;\n' + funcs += ' struct loader_icd_term *icd_term = loader_get_icd_and_device(device, &dev, &icd_index);\n' + funcs += ' if (NULL != icd_term && NULL != icd_term->dispatch.%s) {\n' % base_name + funcs += ' VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)%s;\n' % (surface_var_name) + funcs += ' if (NULL != icd_surface->real_icd_surfaces) {\n' + funcs += ' if ((VkSurfaceKHR)NULL != icd_surface->real_icd_surfaces[icd_index]) {\n' + funcs += ' %sicd_term->dispatch.%s(' % (return_prefix, base_name) + count = 0 + for param in ext_cmd.params: + if count != 0: + funcs += ', ' + + if param.type == 'VkSurfaceKHR': + funcs += 'icd_surface->real_icd_surfaces[icd_index]' + else: + funcs += param.name + + count += 1 + funcs += ');\n' + if not has_return_type: + funcs += ' return;\n' + funcs += ' }\n' + funcs += ' }\n' + funcs += ' %sicd_term->dispatch.%s(' % (return_prefix, base_name) + count = 0 + for param in ext_cmd.params: + if count != 0: + funcs += ', ' + funcs += param.name + count += 1 + funcs += ');\n' + funcs += ' }\n' + if has_return_type: + funcs += ' return VK_SUCCESS;\n' + + elif ext_cmd.handle_type == 'VkInstance': + funcs += '#error("Not implemented. Likely needs to be manually generated!");\n' + + elif 'DebugMarkerSetObject' in ext_cmd.name: + funcs += ' uint32_t icd_index = 0;\n' + funcs += ' struct loader_device *dev;\n' + funcs += ' struct loader_icd_term *icd_term = loader_get_icd_and_device(%s, &dev, &icd_index);\n' % (ext_cmd.params[0].name) + funcs += ' if (NULL != icd_term && NULL != icd_term->dispatch.' + funcs += base_name + funcs += ') {\n' + funcs += ' // If this is a physical device, we have to replace it with the proper one for the next call.\n' + funcs += ' if (%s->objectType == VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT) {\n' % (ext_cmd.params[1].name) + funcs += ' struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)(uintptr_t)%s->object;\n' % (ext_cmd.params[1].name) + funcs += ' %s->object = (uint64_t)(uintptr_t)phys_dev_term->phys_dev;\n' % (ext_cmd.params[1].name) + funcs += ' // If this is a KHR_surface, and the ICD has created its own, we have to replace it with the proper one for the next call.\n' + funcs += ' } else if (%s->objectType == VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT) {\n' % (ext_cmd.params[1].name) + funcs += ' if (NULL != icd_term && NULL != icd_term->dispatch.CreateSwapchainKHR) {\n' + funcs += ' VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)%s->object;\n' % (ext_cmd.params[1].name) + funcs += ' if (NULL != icd_surface->real_icd_surfaces) {\n' + funcs += ' %s->object = (uint64_t)icd_surface->real_icd_surfaces[icd_index];\n' % (ext_cmd.params[1].name) + funcs += ' }\n' + funcs += ' }\n' + funcs += ' }\n' + funcs += ' return icd_term->dispatch.' + funcs += base_name + funcs += '(' + count = 0 + for param in ext_cmd.params: + if count != 0: + funcs += ', ' + + if param.type == 'VkPhysicalDevice': + funcs += 'phys_dev_term->phys_dev' + elif param.type == 'VkSurfaceKHR': + funcs += 'icd_surface->real_icd_surfaces[icd_index]' + else: + funcs += param.name + count += 1 + + funcs += ');\n' + funcs += ' } else {\n' + funcs += ' return VK_SUCCESS;\n' + funcs += ' }\n' + + else: + funcs += '#error("Unknown error path!");\n' + + funcs += '}\n\n' + else: + funcs += tramp_header + + funcs += ' const VkLayerDispatchTable *disp = loader_get_dispatch(' + funcs += ext_cmd.params[0].name + funcs += ');\n' + + funcs += return_prefix + funcs += 'disp->' + funcs += base_name + funcs += '(' + count = 0 + for param in ext_cmd.params: + if count != 0: + funcs += ', ' + funcs += param.name + count += 1 + funcs += ');\n' + funcs += '}\n\n' + + if ext_cmd.protect is not None: + funcs += '#endif // %s\n' % ext_cmd.protect + + funcs += self.AddManualTrampTermFuncs() + return funcs + + + # + # Create a function for the extension GPA call + def InstExtensionGPA(self): + entries = [] + gpa_func = '' + cur_extension_name = '' + + gpa_func += '// GPA helpers for extensions\n' + gpa_func += 'bool extension_instance_gpa(struct loader_instance *ptr_instance, const char *name, void **addr) {\n' + gpa_func += ' *addr = NULL;\n\n' + + for cur_cmd in self.ext_commands: + if ('VK_VERSION_' in cur_cmd.ext_name or + cur_cmd.ext_name in WSI_EXT_NAMES or + cur_cmd.ext_name in AVOID_EXT_NAMES): + continue + + if cur_cmd.ext_name != cur_extension_name: + gpa_func += '\n // ---- %s extension commands\n' % cur_cmd.ext_name + cur_extension_name = cur_cmd.ext_name + + if cur_cmd.protect is not None: + gpa_func += '#ifdef %s\n' % cur_cmd.protect + + if (cur_cmd.ext_type == 'instance'): + gpa_func += ' if (!strcmp("%s", name)) {\n' % (cur_cmd.name) + gpa_func += ' *addr = (ptr_instance->enabled_known_extensions.' + gpa_func += cur_cmd.ext_name[3:].lower() + gpa_func += ' == 1)\n' + gpa_func += ' ? (void *)%s\n' % (cur_cmd.name) + gpa_func += ' : NULL;\n' + gpa_func += ' return true;\n' + gpa_func += ' }\n' + else: + gpa_func += ' if (!strcmp("%s", name)) {\n' % (cur_cmd.name) + gpa_func += ' *addr = (void *)%s;\n' % (cur_cmd.name) + gpa_func += ' return true;\n' + gpa_func += ' }\n' + + if cur_cmd.protect is not None: + gpa_func += '#endif // %s\n' % cur_cmd.protect + + gpa_func += ' return false;\n' + gpa_func += '}\n\n' + + return gpa_func + + # + # Create the extension name init function + def InstantExtensionCreate(self): + entries = [] + entries = self.instanceExtensions + count = 0 + cur_extension_name = '' + + create_func = '' + create_func += '// A function that can be used to query enabled extensions during a vkCreateInstance call\n' + create_func += 'void extensions_create_instance(struct loader_instance *ptr_instance, const VkInstanceCreateInfo *pCreateInfo) {\n' + create_func += ' for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) {\n' + for ext in entries: + if ('VK_VERSION_' in ext.name or ext.name in WSI_EXT_NAMES or + ext.name in AVOID_EXT_NAMES or ext.type == 'device' or + ext.num_commands == 0): + continue + + if ext.name != cur_extension_name: + create_func += '\n // ---- %s extension commands\n' % ext.name + cur_extension_name = ext.name + + if ext.protect is not None: + create_func += '#ifdef %s\n' % ext.protect + if count == 0: + create_func += ' if (0 == strcmp(pCreateInfo->ppEnabledExtensionNames[i], ' + else: + create_func += ' } else if (0 == strcmp(pCreateInfo->ppEnabledExtensionNames[i], ' + + if 'VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES2' == ext.name.upper(): + create_func += 'VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME)) {\n' + else: + create_func += ext.name.upper() + create_func += '_EXTENSION_NAME)) {\n' + + create_func += ' ptr_instance->enabled_known_extensions.' + create_func += ext.name[3:].lower() + create_func += ' = 1;\n' + + if ext.protect is not None: + create_func += '#endif // %s\n' % ext.protect + count += 1 + + create_func += ' }\n' + create_func += ' }\n' + create_func += '}\n\n' + return create_func + + # + # Create code to initialize a dispatch table from the appropriate list of + # extension entrypoints and return it as a string + def DeviceExtensionGetTerminator(self): + term_func = '' + cur_extension_name = '' + + term_func += '// Some device commands still need a terminator because the loader needs to unwrap something about them.\n' + term_func += '// In many cases, the item needing unwrapping is a VkPhysicalDevice or VkSurfaceKHR object. But there may be other items\n' + term_func += '// in the future.\n' + term_func += 'PFN_vkVoidFunction get_extension_device_proc_terminator(const char *pName) {\n' + term_func += ' PFN_vkVoidFunction addr = NULL;\n' + + count = 0 + for ext_cmd in self.ext_commands: + if ext_cmd.name in DEVICE_CMDS_NEED_TERM: + if ext_cmd.ext_name != cur_extension_name: + if 'VK_VERSION_' in ext_cmd.ext_name: + term_func += '\n // ---- Core %s commands\n' % ext_cmd.ext_name[11:] + else: + term_func += '\n // ---- %s extension commands\n' % ext_cmd.ext_name + cur_extension_name = ext_cmd.ext_name + + if ext_cmd.protect is not None: + term_func += '#ifdef %s\n' % ext_cmd.protect + + if count == 0: + term_func += ' if' + else: + term_func += ' } else if' + term_func += '(!strcmp(pName, "%s")) {\n' % (ext_cmd.name) + term_func += ' addr = (PFN_vkVoidFunction)terminator_%s;\n' % (ext_cmd.name[2:]) + + if ext_cmd.protect is not None: + term_func += '#endif // %s\n' % ext_cmd.protect + + count += 1 + + if count > 0: + term_func += ' }\n' + + term_func += ' return addr;\n' + term_func += '}\n\n' + + return term_func + + # + # Create code to initialize a dispatch table from the appropriate list of + # core and extension entrypoints and return it as a string + def InitInstLoaderExtensionDispatchTable(self): + commands = [] + table = '' + cur_extension_name = '' + + table += '// This table contains the loader\'s instance dispatch table, which contains\n' + table += '// default functions if no instance layers are activated. This contains\n' + table += '// pointers to "terminator functions".\n' + table += 'const VkLayerInstanceDispatchTable instance_disp = {\n' + + for x in range(0, 2): + if x == 0: + commands = self.core_commands + else: + commands = self.ext_commands + + for cur_cmd in commands: + if cur_cmd.ext_type == 'instance': + if cur_cmd.ext_name != cur_extension_name: + if 'VK_VERSION_' in cur_cmd.ext_name: + table += '\n // ---- Core %s commands\n' % cur_cmd.ext_name[11:] + else: + table += '\n // ---- %s extension commands\n' % cur_cmd.ext_name + cur_extension_name = cur_cmd.ext_name + + # Remove 'vk' from proto name + base_name = cur_cmd.name[2:] + + if (base_name == 'CreateInstance' or base_name == 'CreateDevice' or + base_name == 'EnumerateInstanceExtensionProperties' or + base_name == 'EnumerateInstanceLayerProperties'): + continue + + if cur_cmd.protect is not None: + table += '#ifdef %s\n' % cur_cmd.protect + + if base_name == 'GetInstanceProcAddr': + table += ' .%s = %s,\n' % (base_name, cur_cmd.name) + else: + table += ' .%s = terminator_%s,\n' % (base_name, base_name) + + if cur_cmd.protect is not None: + table += '#endif // %s\n' % cur_cmd.protect + table += '};\n\n' + + return table + + # + # Create the extension name whitelist array + def OutputInstantExtensionWhitelistArray(self): + extensions = self.instanceExtensions + + table = '' + table += '// A null-terminated list of all of the instance extensions supported by the loader.\n' + table += '// If an instance extension name is not in this list, but it is exported by one or more of the\n' + table += '// ICDs detected by the loader, then the extension name not in the list will be filtered out\n' + table += '// before passing the list of extensions to the application.\n' + table += 'const char *const LOADER_INSTANCE_EXTENSIONS[] = {\n' + for ext in extensions: + if ext.type == 'device' or 'VK_VERSION_' in ext.name: + continue + + if ext.protect is not None: + table += '#ifdef %s\n' % ext.protect + table += ' ' + + if 'VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES2' == ext.name.upper(): + table += 'VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME,\n' + else: + table += ext.name.upper() + table += '_EXTENSION_NAME,\n' + + if ext.protect is not None: + table += '#endif // %s\n' % ext.protect + table += ' NULL };\n' + return table + diff --git a/scripts/lvl_genvk.py b/scripts/lvl_genvk.py index 0be5d3ea..0789b66c 100644 --- a/scripts/lvl_genvk.py +++ b/scripts/lvl_genvk.py @@ -22,8 +22,9 @@ from cgenerator import CGeneratorOptions, COutputGenerator from threading_generator import ThreadGeneratorOptions, ThreadOutputGenerator from parameter_validation_generator import ParamCheckerGeneratorOptions, ParamCheckerOutputGenerator from unique_objects_generator import UniqueObjectsGeneratorOptions, UniqueObjectsOutputGenerator -from dispatch_table_generator import DispatchTableOutputGenerator, DispatchTableOutputGeneratorOptions +from dispatch_table_helper_generator import DispatchTableHelperOutputGenerator, DispatchTableHelperOutputGeneratorOptions from helper_file_generator import HelperFileOutputGenerator, HelperFileOutputGeneratorOptions +from loader_extension_generator import LoaderExtensionOutputGenerator, LoaderExtensionGeneratorOptions # Simple timer functions startTime = None @@ -162,11 +163,10 @@ def makeGenOpts(extensions = [], removeExtensions = [], protect = True, director alignFuncParam = 48) ] - # Options for dispatch table helper generator genOpts['vk_dispatch_table_helper.h'] = [ - DispatchTableOutputGenerator, - DispatchTableOutputGeneratorOptions( + DispatchTableHelperOutputGenerator, + DispatchTableHelperOutputGeneratorOptions( filename = 'vk_dispatch_table_helper.h', directory = directory, apiname = 'vulkan', @@ -184,6 +184,69 @@ def makeGenOpts(extensions = [], removeExtensions = [], protect = True, director alignFuncParam = 48) ] + # Options for Layer dispatch table generator + genOpts['vk_layer_dispatch_table.h'] = [ + LoaderExtensionOutputGenerator, + LoaderExtensionGeneratorOptions( + filename = 'vk_layer_dispatch_table.h', + directory = directory, + apiname = 'vulkan', + profile = None, + versions = allVersions, + emitversions = allVersions, + defaultExtensions = 'vulkan', + addExtensions = addExtensions, + removeExtensions = removeExtensions, + prefixText = prefixStrings + vkPrefixStrings, + protectFeature = False, + apicall = 'VKAPI_ATTR ', + apientry = 'VKAPI_CALL ', + apientryp = 'VKAPI_PTR *', + alignFuncParam = 48) + ] + + # Options for loader extension source generator + genOpts['vk_loader_extensions.h'] = [ + LoaderExtensionOutputGenerator, + LoaderExtensionGeneratorOptions( + filename = 'vk_loader_extensions.h', + directory = directory, + apiname = 'vulkan', + profile = None, + versions = allVersions, + emitversions = allVersions, + defaultExtensions = 'vulkan', + addExtensions = addExtensions, + removeExtensions = removeExtensions, + prefixText = prefixStrings + vkPrefixStrings, + protectFeature = False, + apicall = 'VKAPI_ATTR ', + apientry = 'VKAPI_CALL ', + apientryp = 'VKAPI_PTR *', + alignFuncParam = 48) + ] + + # Options for loader extension source generator + genOpts['vk_loader_extensions.c'] = [ + LoaderExtensionOutputGenerator, + LoaderExtensionGeneratorOptions( + filename = 'vk_loader_extensions.c', + directory = directory, + apiname = 'vulkan', + profile = None, + versions = allVersions, + emitversions = allVersions, + defaultExtensions = 'vulkan', + addExtensions = addExtensions, + removeExtensions = removeExtensions, + prefixText = prefixStrings + vkPrefixStrings, + protectFeature = False, + apicall = 'VKAPI_ATTR ', + apientry = 'VKAPI_CALL ', + apientryp = 'VKAPI_PTR *', + alignFuncParam = 48) + ] + # Helper file generator options for vk_enum_string_helper.h genOpts['vk_enum_string_helper.h'] = [ HelperFileOutputGenerator, diff --git a/scripts/parameter_validation_generator.py b/scripts/parameter_validation_generator.py index c4b32051..adcc4ab5 100644 --- a/scripts/parameter_validation_generator.py +++ b/scripts/parameter_validation_generator.py @@ -587,7 +587,7 @@ class ParamCheckerOutputGenerator(OutputGenerator): decoratedName = '{}({}/{})'.format(*match.group(1, 2, 3)) else: # Matches expressions similar to 'latexmath : [dataSize \over 4]' - match = re.match(r'latexmath\s*\:\s*\[\s*\s*(\w+)\s*\\over\s*(\d+)\s*\s*\]', source) + match = re.match(r'latexmath\s*\:\s*\[\s*(\w+)\s*\\over\s*(\d+)\s*\]', source) name = match.group(1) decoratedName = '{}/{}'.format(*match.group(1, 2)) return name, decoratedName diff --git a/scripts/vk.xml b/scripts/vk.xml index b0b73f1b..e319443d 100644 --- a/scripts/vk.xml +++ b/scripts/vk.xml @@ -63,6 +63,7 @@ maintained in the master branch of the Khronos Vulkan GitHub project. <tag name="TIZEN" author="Samsung Electronics Co., Ltd." contact="Alon Or-bach @alonorbach"/> <tag name="RENDERDOC" author="RenderDoc (renderdoc.org)" contact="baldurk@baldurk.org"/> <tag name="NN" author="Nintendo Co., Ltd." contact="Yasuhiro Yoshioka @yoshioka_yasuhiro"/> + <tag name="MVK" author="The Brenwill Workshop Ltd." contact="Bill Hollings @billhollings"/> <tag name="KHR" author="Khronos" contact="Tom Olson @tom.olson"/> <tag name="EXT" author="Multivendor" contact="Jon Leech @oddhack"/> <tag name="MESA" author="Mesa open source project" contact="Chad Versace @chadversary, Daniel Stone @fooishbar, David Airlie @airlied, Jason Ekstrand @jekstrand"/> @@ -95,6 +96,7 @@ maintained in the master branch of the Khronos Vulkan GitHub project. <type requires="windows.h" name="HANDLE"/> <type requires="windows.h" name="SECURITY_ATTRIBUTES"/> <type requires="windows.h" name="DWORD"/> + <type requires="windows.h" name="LPCWSTR"/> <type requires="xcb/xcb.h" name="xcb_connection_t"/> <type requires="xcb/xcb.h" name="xcb_visualid_t"/> <type requires="xcb/xcb.h" name="xcb_window_t"/> @@ -110,7 +112,7 @@ maintained in the master branch of the Khronos Vulkan GitHub project. <type category="define">// Vulkan 1.0 version number #define <name>VK_API_VERSION_1_0</name> <type>VK_MAKE_VERSION</type>(1, 0, 0)</type> <!-- The patch version here should never be set to anything other than 0 --> <type category="define">// Version of this file -#define <name>VK_HEADER_VERSION</name> 41</type> +#define <name>VK_HEADER_VERSION</name> 42</type> <type category="define"> #define <name>VK_DEFINE_HANDLE</name>(object) typedef struct object##_T* object;</type> @@ -142,6 +144,7 @@ maintained in the master branch of the Khronos Vulkan GitHub project. <type requires="vk_platform" name="uint64_t"/> <type requires="vk_platform" name="int32_t"/> <type requires="vk_platform" name="size_t"/> + <type name="int"/> <!-- Bitmask types --> <type category="bitmask">typedef <type>VkFlags</type> <name>VkFramebufferCreateFlags</name>;</type> <!-- creation flags --> <type category="bitmask">typedef <type>VkFlags</type> <name>VkQueryPoolCreateFlags</name>;</type> <!-- creation flags --> @@ -159,7 +162,7 @@ maintained in the master branch of the Khronos Vulkan GitHub project. <type category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineInputAssemblyStateCreateFlags</name>;</type><!-- creation flags --> <type category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineVertexInputStateCreateFlags</name>;</type> <!-- creation flags --> <type category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineShaderStageCreateFlags</name>;</type> <!-- creation flags --> - <type category="bitmask">typedef <type>VkFlags</type> <name>VkDescriptorSetLayoutCreateFlags</name>;</type> <!-- creation flags --> + <type requires="VkDescriptorSetLayoutCreateFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkDescriptorSetLayoutCreateFlags</name>;</type> <!-- creation flags --> <type category="bitmask">typedef <type>VkFlags</type> <name>VkBufferViewCreateFlags</name>;</type> <!-- creation flags --> <type category="bitmask">typedef <type>VkFlags</type> <name>VkInstanceCreateFlags</name>;</type> <!-- creation flags --> <type category="bitmask">typedef <type>VkFlags</type> <name>VkDeviceCreateFlags</name>;</type> <!-- creation flags --> @@ -192,7 +195,7 @@ maintained in the master branch of the Khronos Vulkan GitHub project. <type requires="VkImageAspectFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkImageAspectFlags</name>;</type> <!-- Bitmask of image aspects --> <type requires="VkSparseMemoryBindFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkSparseMemoryBindFlags</name>;</type> <!-- Sparse memory bind flags --> <type requires="VkSparseImageFormatFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkSparseImageFormatFlags</name>;</type> <!-- Sparse image memory requirements flags --> - <type category="bitmask">typedef <type>VkFlags</type> <name>VkSubpassDescriptionFlags</name>;</type> <!-- Subpass description flags --> + <type requires="VkSubpassDescriptionFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkSubpassDescriptionFlags</name>;</type> <!-- Subpass description flags --> <type requires="VkPipelineStageFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineStageFlags</name>;</type> <!-- Pipeline stages --> <type requires="VkSampleCountFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkSampleCountFlags</name>;</type> <!-- Pipeline stages --> <type requires="VkAttachmentDescriptionFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkAttachmentDescriptionFlags</name>;</type> <!-- Render pass attachment description flags --> @@ -205,26 +208,38 @@ maintained in the master branch of the Khronos Vulkan GitHub project. <type requires="VkIndirectCommandsLayoutUsageFlagBitsNVX" category="bitmask">typedef <type>VkFlags</type> <name>VkIndirectCommandsLayoutUsageFlagsNVX</name>;</type> <!-- Device generated commands usage flags --> <type requires="VkObjectEntryUsageFlagBitsNVX" category="bitmask">typedef <type>VkFlags</type> <name>VkObjectEntryUsageFlagsNVX</name>;</type> <!-- Object usage flags --> + <type category="bitmask">typedef <type>VkFlags</type> <name>VkDescriptorUpdateTemplateCreateFlagsKHR</name>;</type> <!-- Descriptor update template creation flags --> <!-- WSI extensions --> <type requires="VkCompositeAlphaFlagBitsKHR" category="bitmask">typedef <type>VkFlags</type> <name>VkCompositeAlphaFlagsKHR</name>;</type> <type requires="VkDisplayPlaneAlphaFlagBitsKHR" category="bitmask">typedef <type>VkFlags</type> <name>VkDisplayPlaneAlphaFlagsKHR</name>;</type> <type requires="VkSurfaceTransformFlagBitsKHR" category="bitmask">typedef <type>VkFlags</type> <name>VkSurfaceTransformFlagsKHR</name>;</type> - <type category="bitmask">typedef <type>VkFlags</type> <name>VkSwapchainCreateFlagsKHR</name>;</type> <!-- creation flags --> + <type requires="VkSwapchainCreateFlagBitsKHR" category="bitmask">typedef <type>VkFlags</type> <name>VkSwapchainCreateFlagsKHR</name>;</type> <!-- creation flags --> <type category="bitmask">typedef <type>VkFlags</type> <name>VkDisplayModeCreateFlagsKHR</name>;</type> <!-- creation flags --> <type category="bitmask">typedef <type>VkFlags</type> <name>VkDisplaySurfaceCreateFlagsKHR</name>;</type> <!-- creation flags --> <type category="bitmask">typedef <type>VkFlags</type> <name>VkAndroidSurfaceCreateFlagsKHR</name>;</type> <!-- creation flags --> <type category="bitmask">typedef <type>VkFlags</type> <name>VkMirSurfaceCreateFlagsKHR</name>;</type> <!-- creation flags --> - <type category="bitmask">typedef <type>VkFlags</type> <name>VkViSurfaceCreateFlagsNN</name>;</type> <!-- creation flags --> + <type category="bitmask">typedef <type>VkFlags</type> <name>VkViSurfaceCreateFlagsNN</name>;</type> <!-- creation flags --> <type category="bitmask">typedef <type>VkFlags</type> <name>VkWaylandSurfaceCreateFlagsKHR</name>;</type> <!-- creation flags --> <type category="bitmask">typedef <type>VkFlags</type> <name>VkWin32SurfaceCreateFlagsKHR</name>;</type> <!-- creation flags --> <type category="bitmask">typedef <type>VkFlags</type> <name>VkXlibSurfaceCreateFlagsKHR</name>;</type> <!-- creation flags --> <type category="bitmask">typedef <type>VkFlags</type> <name>VkXcbSurfaceCreateFlagsKHR</name>;</type> <!-- creation flags --> + <type category="bitmask">typedef <type>VkFlags</type> <name>VkIOSSurfaceCreateFlagsMVK</name>;</type> <!-- creation flags --> + <type category="bitmask">typedef <type>VkFlags</type> <name>VkMacOSSurfaceCreateFlagsMVK</name>;</type> <!-- creation flags --> + <type requires="VkPeerMemoryFeatureFlagBitsKHX" category="bitmask">typedef <type>VkFlags</type> <name>VkPeerMemoryFeatureFlagsKHX</name>;</type> <!-- Peer memory feature flags --> + <type requires="VkMemoryAllocateFlagBitsKHX" category="bitmask">typedef <type>VkFlags</type> <name>VkMemoryAllocateFlagsKHX</name>;</type> <!-- Memory allocation flags --> + <type requires="VkDeviceGroupPresentModeFlagBitsKHX" category="bitmask">typedef <type>VkFlags</type> <name>VkDeviceGroupPresentModeFlagsKHX</name>;</type><!-- Device group present mode flags --> <type requires="VkDebugReportFlagBitsEXT" category="bitmask">typedef <type>VkFlags</type> <name>VkDebugReportFlagsEXT</name>;</type> <type category="bitmask">typedef <type>VkFlags</type> <name>VkCommandPoolTrimFlagsKHR</name>;</type> <type requires="VkExternalMemoryHandleTypeFlagBitsNV" category="bitmask">typedef <type>VkFlags</type> <name>VkExternalMemoryHandleTypeFlagsNV</name>;</type> <type requires="VkExternalMemoryFeatureFlagBitsNV" category="bitmask">typedef <type>VkFlags</type> <name>VkExternalMemoryFeatureFlagsNV</name>;</type> + <type requires="VkExternalMemoryHandleTypeFlagBitsKHX" category="bitmask">typedef <type>VkFlags</type> <name>VkExternalMemoryHandleTypeFlagsKHX</name>;</type> + <type requires="VkExternalMemoryFeatureFlagBitsKHX" category="bitmask">typedef <type>VkFlags</type> <name>VkExternalMemoryFeatureFlagsKHX</name>;</type> + <type requires="VkExternalSemaphoreHandleTypeFlagBitsKHX" category="bitmask">typedef <type>VkFlags</type> <name>VkExternalSemaphoreHandleTypeFlagsKHX</name>;</type> + <type requires="VkExternalSemaphoreFeatureFlagBitsKHX" category="bitmask">typedef <type>VkFlags</type> <name>VkExternalSemaphoreFeatureFlagsKHX</name>;</type> <type requires="VkSurfaceCounterFlagBitsEXT" category="bitmask">typedef <type>VkFlags</type> <name>VkSurfaceCounterFlagsEXT</name>;</type> + <type category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineViewportSwizzleStateCreateFlagsNV</name>;</type> <!-- creation flags (no bits yet) --> + <type category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineDiscardRectangleStateCreateFlagsEXT</name>;</type> <!-- creation flags (no bits yet) --> <!-- Types which can be void pointers or class pointers, selected at compile time --> <type category="handle"><type>VK_DEFINE_HANDLE</type>(<name>VkInstance</name>)</type> @@ -254,6 +269,7 @@ maintained in the master branch of the Khronos Vulkan GitHub project. <type category="handle" parent="VkDevice"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkPipelineCache</name>)</type> <type category="handle" parent="VkDevice"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkObjectTableNVX</name>)</type> <type category="handle" parent="VkDevice"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkIndirectCommandsLayoutNVX</name>)</type> + <type category="handle" parent="VkDevice"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkDescriptorUpdateTemplateKHR</name>)</type> <!-- WSI extensions --> <type category="handle"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkDisplayKHR</name>)</type> @@ -353,6 +369,10 @@ maintained in the master branch of the Khronos Vulkan GitHub project. <type name="VkIndirectCommandsTokenTypeNVX" category="enum"/> <type name="VkObjectEntryUsageFlagBitsNVX" category="enum"/> <type name="VkObjectEntryTypeNVX" category="enum"/> + <type name="VkDescriptorUpdateTemplateTypeKHR" category="enum"/> + <type name="VkViewportCoordinateSwizzleNV" category="enum"/> + <type name="VkDiscardRectangleModeEXT" category="enum"/> + <type name="VkSubpassDescriptionFlagBits" category="enum"/> <!-- WSI extensions --> <type name="VkColorSpaceKHR" category="enum"/> <type name="VkCompositeAlphaFlagBitsKHR" category="enum"/> @@ -366,10 +386,18 @@ maintained in the master branch of the Khronos Vulkan GitHub project. <type name="VkExternalMemoryHandleTypeFlagBitsNV" category="enum"/> <type name="VkExternalMemoryFeatureFlagBitsNV" category="enum"/> <type name="VkValidationCheckEXT" category="enum"/> + <type name="VkExternalMemoryHandleTypeFlagBitsKHX" category="enum"/> + <type name="VkExternalMemoryFeatureFlagBitsKHX" category="enum"/> + <type name="VkExternalSemaphoreHandleTypeFlagBitsKHX" category="enum"/> + <type name="VkExternalSemaphoreFeatureFlagBitsKHX" category="enum"/> <type name="VkSurfaceCounterFlagBitsEXT" category="enum"/> <type name="VkDisplayPowerStateEXT" category="enum"/> <type name="VkDeviceEventTypeEXT" category="enum"/> <type name="VkDisplayEventTypeEXT" category="enum"/> + <type name="VkPeerMemoryFeatureFlagBitsKHX" category="enum"/> + <type name="VkMemoryAllocateFlagBitsKHX" category="enum"/> + <type name="VkDeviceGroupPresentModeFlagBitsKHX" category="enum"/> + <type name="VkSwapchainCreateFlagBitsKHR" category="enum"/> <!-- The PFN_vk*Function types are used by VkAllocationCallbacks below --> <type category="funcpointer">typedef void (VKAPI_PTR *<name>PFN_vkInternalAllocationNotification</name>)( @@ -505,7 +533,7 @@ maintained in the master branch of the Khronos Vulkan GitHub project. </type> <type category="struct" name="VkDeviceCreateInfo"> <member values="VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member> - <member validextensionstructs="VkPhysicalDeviceFeatures2KHR">const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member validextensionstructs="VkPhysicalDeviceFeatures2KHR,VkPhysicalDeviceMultiviewFeaturesKHX,VkDeviceGroupDeviceCreateInfoKHX">const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> <member optional="true"><type>VkDeviceCreateFlags</type> <name>flags</name></member> <!-- Reserved --> <member><type>uint32_t</type> <name>queueCreateInfoCount</name></member> <member len="queueCreateInfoCount">const <type>VkDeviceQueueCreateInfo</type>* <name>pQueueCreateInfos</name></member> @@ -539,7 +567,7 @@ maintained in the master branch of the Khronos Vulkan GitHub project. </type> <type category="struct" name="VkMemoryAllocateInfo"> <member values="VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO"><type>VkStructureType</type> <name>sType</name></member> - <member validextensionstructs="VkDedicatedAllocationMemoryAllocateInfoNV">const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member validextensionstructs="VkDedicatedAllocationMemoryAllocateInfoNV,VkMemoryAllocateFlagsInfoKHX">const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> <member><type>VkDeviceSize</type> <name>allocationSize</name></member> <!-- Size of memory allocation --> <member><type>uint32_t</type> <name>memoryTypeIndex</name></member> <!-- Index of the of the memory type to allocate from --> </type> @@ -688,7 +716,7 @@ maintained in the master branch of the Khronos Vulkan GitHub project. </type> <type category="struct" name="VkImageCreateInfo"> <member values="VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member> - <member validextensionstructs="VkDedicatedAllocationImageCreateInfoNV">const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure. --> + <member validextensionstructs="VkDedicatedAllocationImageCreateInfoNV,VkImageSwapchainCreateInfoKHX">const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure. --> <member optional="true"><type>VkImageCreateFlags</type> <name>flags</name></member> <!-- Image creation flags --> <member><type>VkImageType</type> <name>imageType</name></member> <member><type>VkFormat</type> <name>format</name></member> @@ -757,7 +785,7 @@ maintained in the master branch of the Khronos Vulkan GitHub project. </type> <type category="struct" name="VkBindSparseInfo"> <member values="VK_STRUCTURE_TYPE_BIND_SPARSE_INFO"><type>VkStructureType</type> <name>sType</name></member> - <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure. --> + <member validextensionstructs="VkDeviceGroupBindSparseInfoKHX">const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure. --> <member optional="true"><type>uint32_t</type> <name>waitSemaphoreCount</name></member> <member len="waitSemaphoreCount">const <type>VkSemaphore</type>* <name>pWaitSemaphores</name></member> <member optional="true"><type>uint32_t</type> <name>bufferBindCount</name></member> @@ -901,7 +929,7 @@ maintained in the master branch of the Khronos Vulkan GitHub project. </type> <type category="struct" name="VkPipelineViewportStateCreateInfo"> <member values="VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member> - <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member validextensionstructs="VkPipelineViewportWScalingStateCreateInfoNV">const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> <member optional="true"><type>VkPipelineViewportStateCreateFlags</type> <name>flags</name></member> <!-- Reserved --> <member><type>uint32_t</type> <name>viewportCount</name></member> <member noautovalidity="true" optional="true" len="viewportCount">const <type>VkViewport</type>* <name>pViewports</name></member> @@ -1071,13 +1099,13 @@ maintained in the master branch of the Khronos Vulkan GitHub project. </type> <type category="struct" name="VkCommandBufferBeginInfo"> <member values="VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO"><type>VkStructureType</type> <name>sType</name></member> - <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member validextensionstructs="VkDeviceGroupCommandBufferBeginInfoKHX">const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> <member optional="true"><type>VkCommandBufferUsageFlags</type> <name>flags</name></member> <!-- Command buffer usage flags --> <member optional="true" noautovalidity="true">const <type>VkCommandBufferInheritanceInfo</type>* <name>pInheritanceInfo</name></member> <!-- Pointer to inheritance info for secondary command buffers --> </type> <type category="struct" name="VkRenderPassBeginInfo"> <member values="VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO"><type>VkStructureType</type> <name>sType</name></member> - <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member validextensionstructs="VkDeviceGroupRenderPassBeginInfoKHX">const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> <member><type>VkRenderPass</type> <name>renderPass</name></member> <member><type>VkFramebuffer</type> <name>framebuffer</name></member> <member><type>VkRect2D</type> <name>renderArea</name></member> @@ -1384,7 +1412,7 @@ maintained in the master branch of the Khronos Vulkan GitHub project. </type> <type category="struct" name="VkSubmitInfo"> <member values="VK_STRUCTURE_TYPE_SUBMIT_INFO"><type>VkStructureType</type> <name>sType</name></member> - <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member validextensionstructs="VkWin32KeyedMutexAcquireReleaseInfoNV,VkWin32KeyedMutexAcquireReleaseInfoKHX,VkD3D12FenceSubmitInfoKHX,VkDeviceGroupSubmitInfoKHX">const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> <member optional="true"><type>uint32_t</type> <name>waitSemaphoreCount</name></member> <member len="waitSemaphoreCount">const <type>VkSemaphore</type>* <name>pWaitSemaphores</name></member> <member len="waitSemaphoreCount">const <type>VkPipelineStageFlags</type>* <name>pWaitDstStageMask</name></member> @@ -1516,7 +1544,7 @@ maintained in the master branch of the Khronos Vulkan GitHub project. </type> <type category="struct" name="VkSwapchainCreateInfoKHR"> <member values="VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member> - <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member validextensionstructs="VkDeviceGroupSwapchainCreateInfoKHX">const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> <member optional="true"><type>VkSwapchainCreateFlagsKHR</type> <name>flags</name></member> <!-- Reserved --> <member><type>VkSurfaceKHR</type> <name>surface</name></member> <!-- The swapchain's target surface --> <member><type>uint32_t</type> <name>minImageCount</name></member> <!-- Minimum number of presentation images the application needs --> @@ -1536,10 +1564,10 @@ maintained in the master branch of the Khronos Vulkan GitHub project. </type> <type category="struct" name="VkPresentInfoKHR"> <member values="VK_STRUCTURE_TYPE_PRESENT_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member> - <member validextensionstructs="VkDisplayPresentInfoKHR">const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member validextensionstructs="VkDeviceGroupPresentInfoKHX">const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> <member optional="true"><type>uint32_t</type> <name>waitSemaphoreCount</name></member> <!-- Number of semaphores to wait for before presenting --> <member optional="true" len="waitSemaphoreCount">const <type>VkSemaphore</type>* <name>pWaitSemaphores</name></member> <!-- Semaphores to wait for before presenting --> - <member><type>uint32_t</type> <name>swapchainCount</name></member> <!-- Number of swap chains to present in this call --> + <member><type>uint32_t</type> <name>swapchainCount</name></member> <!-- Number of swapchains to present in this call --> <member len="swapchainCount">const <type>VkSwapchainKHR</type>* <name>pSwapchains</name></member> <!-- Swapchains to present an image from --> <member len="swapchainCount">const <type>uint32_t</type>* <name>pImageIndices</name></member> <!-- Indices of which presentable images to present --> <member optional="true" len="swapchainCount"><type>VkResult</type>* <name>pResults</name></member> <!-- Optional (i.e. if non-NULL) VkResult for each swapchain --> @@ -1639,7 +1667,6 @@ maintained in the master branch of the Khronos Vulkan GitHub project. <member len="releaseCount">const <type>VkDeviceMemory</type>* <name>pReleaseSyncs</name></member> <member len="releaseCount">const <type>uint64_t</type>* <name>pReleaseKeys</name></member> </type> - <type category="struct" name="VkDeviceGeneratedCommandsFeaturesNVX"> <member values="VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_FEATURES_NVX"><type>VkStructureType</type> <name>sType</name></member> <member>const <type>void</type>* <name>pNext</name></member> @@ -1742,12 +1769,12 @@ maintained in the master branch of the Khronos Vulkan GitHub project. </type> <type category="struct" name="VkPhysicalDeviceFeatures2KHR"> <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR"><type>VkStructureType</type> <name>sType</name></member> - <member><type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member validextensionstructs="VkPhysicalDeviceMultiviewFeaturesKHX"><type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> <member><type>VkPhysicalDeviceFeatures</type> <name>features</name></member> </type> <type category="struct" name="VkPhysicalDeviceProperties2KHR" returnedonly="true"> <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR"><type>VkStructureType</type> <name>sType</name></member> - <member><type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member validextensionstructs="VkPhysicalDevicePushDescriptorPropertiesKHR,VkPhysicalDeviceIDPropertiesKHX,VkPhysicalDeviceMultiviewPropertiesKHX,VkPhysicalDeviceDiscardRectanglePropertiesEXT,VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX"><type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> <member><type>VkPhysicalDeviceProperties</type> <name>properties</name></member> </type> <type category="struct" name="VkFormatProperties2KHR" returnedonly="true"> @@ -1757,12 +1784,12 @@ maintained in the master branch of the Khronos Vulkan GitHub project. </type> <type category="struct" name="VkImageFormatProperties2KHR" returnedonly="true"> <member values="VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR"><type>VkStructureType</type> <name>sType</name></member> - <member><type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member validextensionstructs="VkExternalImageFormatPropertiesKHX"><type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> <member><type>VkImageFormatProperties</type> <name>imageFormatProperties</name></member> </type> <type category="struct" name="VkPhysicalDeviceImageFormatInfo2KHR"> <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHR"><type>VkStructureType</type> <name>sType</name></member> - <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member validextensionstructs="VkPhysicalDeviceExternalImageFormatInfoKHX">const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> <member><type>VkFormat</type> <name>format</name></member> <member><type>VkImageType</type> <name>type</name></member> <member><type>VkImageTiling</type> <name>tiling</name></member> @@ -1793,6 +1820,189 @@ maintained in the master branch of the Khronos Vulkan GitHub project. <member><type>VkImageUsageFlags</type> <name>usage</name></member> <member><type>VkImageTiling</type> <name>tiling</name></member> </type> + <type category="struct" name="VkPhysicalDevicePushDescriptorPropertiesKHR"> + <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR"><type>VkStructureType</type> <name>sType</name></member> + <member><type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member><type>uint32_t</type> <name>maxPushDescriptors</name></member> + </type> + <type category="struct" name="VkPhysicalDeviceProperties2KHX" returnedonly="true"> + <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member validextensionstructs="VkPhysicalDeviceIDPropertiesKHX"><type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member><type>VkPhysicalDeviceProperties</type> <name>properties</name></member> + </type> + <type category="struct" name="VkImageFormatProperties2KHX" returnedonly="true"> + <member values="VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member validextensionstructs="VkExternalImageFormatPropertiesKHX"><type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member><type>VkImageFormatProperties</type> <name>imageFormatProperties</name></member> + </type> + <type category="struct" name="VkPhysicalDeviceImageFormatInfo2KHX"> + <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member validextensionstructs="VkPhysicalDeviceExternalImageFormatInfoKHX">const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member><type>VkFormat</type> <name>format</name></member> + <member><type>VkImageType</type> <name>type</name></member> + <member><type>VkImageTiling</type> <name>tiling</name></member> + <member><type>VkImageUsageFlags</type> <name>usage</name></member> + <member optional="true"><type>VkImageCreateFlags</type> <name>flags</name></member> + </type> + <type category="struct" name="VkExternalMemoryPropertiesKHX" returnedonly="true"> + <member><type>VkExternalMemoryFeatureFlagsKHX</type> <name>externalMemoryFeatures</name></member> + <member optional="true"><type>VkExternalMemoryHandleTypeFlagsKHX</type> <name>exportFromImportedHandleTypes</name></member> + <member><type>VkExternalMemoryHandleTypeFlagsKHX</type> <name>compatibleHandleTypes</name></member> + </type> + <type category="struct" name="VkPhysicalDeviceExternalImageFormatInfoKHX"> + <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member optional="true"><type>VkExternalMemoryHandleTypeFlagBitsKHX</type> <name>handleType</name></member> + </type> + <type category="struct" name="VkExternalImageFormatPropertiesKHX" returnedonly="true"> + <member values="VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member><type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member><type>VkExternalMemoryPropertiesKHX</type> <name>externalMemoryProperties</name></member> + </type> + <type category="struct" name="VkPhysicalDeviceExternalBufferInfoKHX"> + <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member optional="true"><type>VkBufferCreateFlags</type> <name>flags</name></member> + <member><type>VkBufferUsageFlags</type> <name>usage</name></member> + <member><type>VkExternalMemoryHandleTypeFlagBitsKHX</type> <name>handleType</name></member> + </type> + <type category="struct" name="VkExternalBufferPropertiesKHX" returnedonly="true"> + <member values="VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member><type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member><type>VkExternalMemoryPropertiesKHX</type> <name>externalMemoryProperties</name></member> + </type> + <type category="struct" name="VkPhysicalDeviceIDPropertiesKHX" returnedonly="true"> + <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member><type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member><type>uint8_t</type> <name>deviceUUID</name>[<enum>VK_UUID_SIZE</enum>]</member> + <member><type>uint8_t</type> <name>driverUUID</name>[<enum>VK_UUID_SIZE</enum>]</member> + <member><type>uint8_t</type> <name>deviceLUID</name>[<enum>VK_LUID_SIZE_KHX</enum>]</member> + <member><type>VkBool32</type> <name>deviceLUIDValid</name></member> + </type> + <type category="struct" name="VkExternalMemoryImageCreateInfoKHX"> + <member values="VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member><type>VkExternalMemoryHandleTypeFlagsKHX</type> <name>handleTypes</name></member> + </type> + <type category="struct" name="VkExternalMemoryBufferCreateInfoKHX"> + <member values="VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member optional="true"><type>VkExternalMemoryHandleTypeFlagsKHX</type> <name>handleTypes</name></member> + </type> + <type category="struct" name="VkExportMemoryAllocateInfoKHX"> + <member values="VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member optional="true"><type>VkExternalMemoryHandleTypeFlagsKHX</type> <name>handleTypes</name></member> + </type> + <type category="struct" name="VkImportMemoryWin32HandleInfoKHX"> + <member values="VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member optional="true"><type>VkExternalMemoryHandleTypeFlagBitsKHX</type> <name>handleType</name></member> + <member><type>HANDLE</type> <name>handle</name></member> + </type> + <type category="struct" name="VkExportMemoryWin32HandleInfoKHX"> + <member values="VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member optional="true">const <type>SECURITY_ATTRIBUTES</type>* <name>pAttributes</name></member> + <member><type>DWORD</type> <name>dwAccess</name></member> + <member><type>LPCWSTR</type> <name>name</name></member> + </type> + <type category="struct" name="VkMemoryWin32HandlePropertiesKHX" returnedonly="true"> + <member values="VK_STRUCTURE_TYPE_MEMORY_WIN32_HANDLE_PROPERTIES_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member><type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member><type>uint32_t</type> <name>memoryTypeBits</name></member> + </type> + <type category="struct" name="VkImportMemoryFdInfoKHX"> + <member values="VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member optional="true"><type>VkExternalMemoryHandleTypeFlagBitsKHX</type> <name>handleType</name></member> + <member><type>int</type> <name>fd</name></member> + </type> + <type category="struct" name="VkMemoryFdPropertiesKHX" returnedonly="true"> + <member values="VK_STRUCTURE_TYPE_MEMORY_FD_PROPERTIES_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member><type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member><type>uint32_t</type> <name>memoryTypeBits</name></member> + </type> + <type category="struct" name="VkWin32KeyedMutexAcquireReleaseInfoKHX"> + <member values="VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member optional="true"><type>uint32_t</type> <name>acquireCount</name></member> + <member len="acquireCount">const <type>VkDeviceMemory</type>* <name>pAcquireSyncs</name></member> + <member len="acquireCount">const <type>uint64_t</type>* <name>pAcquireKeys</name></member> + <member len="acquireCount">const <type>uint32_t</type>* <name>pAcquireTimeouts</name></member> + <member optional="true"><type>uint32_t</type> <name>releaseCount</name></member> + <member len="releaseCount">const <type>VkDeviceMemory</type>* <name>pReleaseSyncs</name></member> + <member len="releaseCount">const <type>uint64_t</type>* <name>pReleaseKeys</name></member> + </type> + <type category="struct" name="VkPhysicalDeviceExternalSemaphoreInfoKHX"> + <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member><type>VkExternalSemaphoreHandleTypeFlagBitsKHX</type> <name>handleType</name></member> + </type> + <type category="struct" name="VkExternalSemaphorePropertiesKHX" returnedonly="true"> + <member values="VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member><type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member><type>VkExternalSemaphoreHandleTypeFlagsKHX</type> <name>exportFromImportedHandleTypes</name></member> + <member><type>VkExternalSemaphoreHandleTypeFlagsKHX</type> <name>compatibleHandleTypes</name></member> + <member optional="true"><type>VkExternalSemaphoreFeatureFlagsKHX</type> <name>externalSemaphoreFeatures</name></member> + </type> + <type category="struct" name="VkExportSemaphoreCreateInfoKHX"> + <member values="VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member optional="true"><type>VkExternalSemaphoreHandleTypeFlagsKHX</type> <name>handleTypes</name></member> + </type> + <type category="struct" name="VkImportSemaphoreWin32HandleInfoKHX"> + <member values="VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member><type>VkSemaphore</type> <name>semaphore</name></member> + <member><type>VkExternalSemaphoreHandleTypeFlagsKHX</type> <name>handleType</name></member> + <member><type>HANDLE</type> <name>handle</name></member> + </type> + <type category="struct" name="VkExportSemaphoreWin32HandleInfoKHX"> + <member values="VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member optional="true">const <type>SECURITY_ATTRIBUTES</type>* <name>pAttributes</name></member> + <member><type>DWORD</type> <name>dwAccess</name></member> + <member><type>LPCWSTR</type> <name>name</name></member> + </type> + <type category="struct" name="VkD3D12FenceSubmitInfoKHX"> + <member values="VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member optional="true"><type>uint32_t</type> <name>waitSemaphoreValuesCount</name></member> + <member optional="true" len="waitSemaphoreValuesCount">const <type>uint64_t</type>* <name>pWaitSemaphoreValues</name></member> + <member optional="true"><type>uint32_t</type> <name>signalSemaphoreValuesCount</name></member> + <member optional="true" len="signalSemaphoreValuesCount">const <type>uint64_t</type>* <name>pSignalSemaphoreValues</name></member> + </type> + <type category="struct" name="VkImportSemaphoreFdInfoKHX"> + <member values="VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member><type>VkSemaphore</type> <name>semaphore</name></member> + <member><type>VkExternalSemaphoreHandleTypeFlagBitsKHX</type> <name>handleType</name></member> + <member><type>int</type> <name>fd</name></member> + </type> + <type category="struct" name="VkPhysicalDeviceMultiviewFeaturesKHX"> + <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member><type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member><type>VkBool32</type> <name>multiview</name></member> <!-- Multiple views in a renderpass --> + <member><type>VkBool32</type> <name>multiviewGeometryShader</name></member> <!-- Multiple views in a renderpass w/ geometry shader --> + <member><type>VkBool32</type> <name>multiviewTessellationShader</name></member> <!-- Multiple views in a renderpass w/ tessellation shader --> + </type> + <type category="struct" name="VkPhysicalDeviceMultiviewPropertiesKHX" returnedonly="true"> + <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member><type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member><type>uint32_t</type> <name>maxMultiviewViewCount</name></member> <!-- max number of views in a subpass --> + <member><type>uint32_t</type> <name>maxMultiviewInstanceIndex</name></member> <!-- max instance index for a draw in a multiview subpass --> + </type> + <type category="struct" name="VkRenderPassMultiviewCreateInfoKHX"> + <member values="VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member optional="true"><type>uint32_t</type> <name>subpassCount</name></member> + <member len="subpassCount">const <type>uint32_t</type>* <name>pViewMasks</name></member> + <member optional="true"><type>uint32_t</type> <name>dependencyCount</name></member> + <member len="dependencyCount">const <type>int32_t</type>* <name>pViewOffsets</name></member> + <member optional="true"><type>uint32_t</type> <name>correlationMaskCount</name></member> + <member len="correlationMaskCount">const <type>uint32_t</type>* <name>pCorrelationMasks</name></member> + </type> <type category="struct" name="VkSurfaceCapabilities2EXT" returnedonly="true"> <member values="VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES2_EXT"><type>VkStructureType</type> <name>sType</name></member> <member><type>void</type>* <name>pNext</name></member> @@ -1828,6 +2038,131 @@ maintained in the master branch of the Khronos Vulkan GitHub project. <member>const <type>void</type>* <name>pNext</name></member> <member optional="true"><type>VkSurfaceCounterFlagsEXT</type> <name>surfaceCounters</name></member> </type> + <type category="struct" name="VkPhysicalDeviceGroupPropertiesKHX" returnedonly="true"> + <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member><type>uint32_t</type> <name>physicalDeviceCount</name></member> + <member><type>VkPhysicalDevice</type> <name>physicalDevices</name>[<enum>VK_MAX_DEVICE_GROUP_SIZE_KHX</enum>]</member> + <member><type>VkBool32</type> <name>subsetAllocation</name></member> + </type> + <type category="struct" name="VkMemoryAllocateFlagsInfoKHX"> + <member values="VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member optional="true"><type>VkMemoryAllocateFlagsKHX</type> <name>flags</name></member> + <member><type>uint32_t</type> <name>deviceMask</name></member> + </type> + <type category="struct" name="VkBindBufferMemoryInfoKHX"> + <member values="VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member><type>VkBuffer</type> <name>buffer</name></member> + <member><type>VkDeviceMemory</type> <name>memory</name></member> + <member><type>VkDeviceSize</type> <name>memoryOffset</name></member> + <member optional="true"><type>uint32_t</type> <name>deviceIndexCount</name></member> + <member len="deviceIndexCount">const <type>uint32_t</type>* <name>pDeviceIndices</name></member> + </type> + <type category="struct" name="VkBindImageMemoryInfoKHX"> + <member values="VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member validextensionstructs="VkBindImageMemorySwapchainInfoKHX">const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member><type>VkImage</type> <name>image</name></member> + <member><type>VkDeviceMemory</type> <name>memory</name></member> + <member><type>VkDeviceSize</type> <name>memoryOffset</name></member> + <member optional="true"><type>uint32_t</type> <name>deviceIndexCount</name></member> + <member len="deviceIndexCount">const <type>uint32_t</type>* <name>pDeviceIndices</name></member> + <member optional="true"><type>uint32_t</type> <name>SFRRectCount</name></member> + <member len="SFRRectCount">const <type>VkRect2D</type>* <name>pSFRRects</name></member> + </type> + <type category="struct" name="VkDeviceGroupRenderPassBeginInfoKHX"> + <member values="VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member><type>uint32_t</type> <name>deviceMask</name></member> + <member optional="true"><type>uint32_t</type> <name>deviceRenderAreaCount</name></member> + <member len="deviceRenderAreaCount">const <type>VkRect2D</type>* <name>pDeviceRenderAreas</name></member> + </type> + <type category="struct" name="VkDeviceGroupCommandBufferBeginInfoKHX"> + <member values="VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member><type>uint32_t</type> <name>deviceMask</name></member> + </type> + <type category="struct" name="VkDeviceGroupSubmitInfoKHX"> + <member values="VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member optional="true"><type>uint32_t</type> <name>waitSemaphoreCount</name></member> + <member len="waitSemaphoreCount">const <type>uint32_t</type>* <name>pWaitSemaphoreDeviceIndices</name></member> + <member optional="true"><type>uint32_t</type> <name>commandBufferCount</name></member> + <member len="commandBufferCount">const <type>uint32_t</type>* <name>pCommandBufferDeviceMasks</name></member> + <member optional="true"><type>uint32_t</type> <name>signalSemaphoreCount</name></member> + <member len="signalSemaphoreCount">const <type>uint32_t</type>* <name>pSignalSemaphoreDeviceIndices</name></member> + </type> + <type category="struct" name="VkDeviceGroupBindSparseInfoKHX"> + <member values="VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member><type>uint32_t</type> <name>resourceDeviceIndex</name></member> + <member><type>uint32_t</type> <name>memoryDeviceIndex</name></member> + </type> + <type category="struct" name="VkDeviceGroupPresentCapabilitiesKHX" returnedonly="true"> + <member values="VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member><type>uint32_t</type> <name>presentMask</name>[<enum>VK_MAX_DEVICE_GROUP_SIZE_KHX</enum>]</member> + <member><type>VkDeviceGroupPresentModeFlagsKHX</type> <name>modes</name></member> + </type> + <type category="struct" name="VkImageSwapchainCreateInfoKHX"> + <member values="VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member optional="true"><type>VkSwapchainKHR</type> <name>swapchain</name></member> + </type> + <type category="struct" name="VkBindImageMemorySwapchainInfoKHX"> + <member values="VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member externsync="true"><type>VkSwapchainKHR</type> <name>swapchain</name></member> + <member><type>uint32_t</type> <name>imageIndex</name></member> + </type> + <type category="struct" name="VkAcquireNextImageInfoKHX"> + <member values="VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member externsync="true"><type>VkSwapchainKHR</type> <name>swapchain</name></member> + <member><type>uint64_t</type> <name>timeout</name></member> + <member optional="true" externsync="true"><type>VkSemaphore</type> <name>semaphore</name></member> + <member optional="true" externsync="true"><type>VkFence</type> <name>fence</name></member> + <member><type>uint32_t</type> <name>deviceMask</name></member> + </type> + <type category="struct" name="VkDeviceGroupPresentInfoKHX"> + <member values="VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member optional="true"><type>uint32_t</type> <name>swapchainCount</name></member> + <member len="swapchainCount">const <type>uint32_t</type>* <name>pDeviceMasks</name></member> + <member><type>VkDeviceGroupPresentModeFlagBitsKHX</type> <name>mode</name></member> + </type> + <type category="struct" name="VkDeviceGroupDeviceCreateInfoKHX"> + <member values="VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member optional="true"><type>uint32_t</type> <name>physicalDeviceCount</name></member> + <member len="physicalDeviceCount">const <type>VkPhysicalDevice</type>* <name>pPhysicalDevices</name></member> + </type> + <type category="struct" name="VkDeviceGroupSwapchainCreateInfoKHX"> + <member values="VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHX"><type>VkStructureType</type> <name>sType</name></member> + <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member><type>VkDeviceGroupPresentModeFlagsKHX</type> <name>modes</name></member> + </type> + <type category="struct" name="VkDescriptorUpdateTemplateEntryKHR"> + <member><type>uint32_t</type> <name>dstBinding</name></member> <!-- Binding within the destination descriptor set to write --> + <member><type>uint32_t</type> <name>dstArrayElement</name></member> <!-- Array element within the destination binding to write --> + <member><type>uint32_t</type> <name>descriptorCount</name></member> <!-- Number of descriptors to write --> + <member><type>VkDescriptorType</type> <name>descriptorType</name></member> <!-- Descriptor type to write --> + <member><type>size_t</type> <name>offset</name></member> <!-- Offset into pData where the descriptors to update are stored --> + <member><type>size_t</type> <name>stride</name></member> <!-- Stride between two descriptors in pData when writing more than one descriptor --> + </type> + <type category="struct" name="VkDescriptorUpdateTemplateCreateInfoKHR"> + <member values="VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member> + <member><type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member optional="true"><type>VkDescriptorUpdateTemplateCreateFlagsKHR</type> <name>flags</name></member> <!-- Reserved --> + <member><type>uint32_t</type> <name>descriptorUpdateEntryCount</name></member> <!-- Number of descriptor update entries to use for the update template --> + <member len="descriptorUpdateEntryCount">const <type>VkDescriptorUpdateTemplateEntryKHR</type>* <name>pDescriptorUpdateEntries</name></member> <!-- Descriptor update entries for the template --> + <member><type>VkDescriptorUpdateTemplateTypeKHR</type> <name>templateType</name></member> + <member optional="true"><type>VkDescriptorSetLayout</type> <name>descriptorSetLayout</name></member> + <member optional="true"><type>VkPipelineBindPoint</type> <name>pipelineBindPoint</name></member> + <member optional="true"><type>VkPipelineLayout</type><name>pipelineLayout</name></member> <!-- If used for push descriptors, this is the only allowed layout --> + <member optional="true"><type>uint32_t</type> <name>set</name></member> + </type> <type category="struct" name="VkXYColorEXT"> <!-- chromaticity coordinate --> <member><type>float</type> <name>x</name></member> @@ -1842,6 +2177,60 @@ maintained in the master branch of the Khronos Vulkan GitHub project. <member><type>float</type> <name>maxLuminance</name></member> <!-- Display maximum luminance --> <member><type>float</type> <name>minLuminance</name></member> <!-- Display minimum luminance --> </type> + <type category="struct" name="VkIOSSurfaceCreateInfoMVK"> + <member values="VK_STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK"><type>VkStructureType</type> <name>sType</name></member> + <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member optional="true"><type>VkIOSSurfaceCreateFlagsMVK</type> <name>flags</name></member> <!-- Reserved --> + <member>const <type>void</type>* <name>pView</name></member> + </type> + <type category="struct" name="VkMacOSSurfaceCreateInfoMVK"> + <member values="VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK"><type>VkStructureType</type> <name>sType</name></member> + <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member optional="true"><type>VkMacOSSurfaceCreateFlagsMVK</type> <name>flags</name></member> <!-- Reserved --> + <member>const <type>void</type>* <name>pView</name></member> + </type> + <type category="struct" name="VkViewportWScalingNV"> + <member><type>float</type> <name>xcoeff</name></member> + <member><type>float</type> <name>ycoeff</name></member> + </type> + <type category="struct" name="VkPipelineViewportWScalingStateCreateInfoNV"> + <member values="VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV"><type>VkStructureType</type> <name>sType</name></member> + <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member><type>VkBool32</type> <name>viewportWScalingEnable</name></member> + <member><type>uint32_t</type> <name>viewportCount</name></member> + <member noautovalidity="true" len="viewportCount">const <type>VkViewportWScalingNV</type>* <name>pViewportWScalings</name></member> + </type> + <type category="struct" name="VkViewportSwizzleNV"> + <member><type>VkViewportCoordinateSwizzleNV</type> <name>x</name></member> + <member><type>VkViewportCoordinateSwizzleNV</type> <name>y</name></member> + <member><type>VkViewportCoordinateSwizzleNV</type> <name>z</name></member> + <member><type>VkViewportCoordinateSwizzleNV</type> <name>w</name></member> + </type> + <type category="struct" name="VkPipelineViewportSwizzleStateCreateInfoNV"> + <member values="VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV"><type>VkStructureType</type> <name>sType</name></member> + <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member optional="true"><type>VkPipelineViewportSwizzleStateCreateFlagsNV</type> <name>flags</name></member> <!-- Reserved --> + <member><type>uint32_t</type> <name>viewportCount</name></member> + <member noautovalidity="true" optional="true" len="viewportCount">const <type>VkViewportSwizzleNV</type>* <name>pViewportSwizzles</name></member> + </type> + <type category="struct" name="VkPhysicalDeviceDiscardRectanglePropertiesEXT"> + <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT"><type>VkStructureType</type> <name>sType</name></member> + <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member><type>uint32_t</type> <name>maxDiscardRectangles</name></member> <!-- max number of active discard rectangles --> + </type> + <type category="struct" name="VkPipelineDiscardRectangleStateCreateInfoEXT"> + <member values="VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member> + <member>const <type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member optional="true"><type>VkPipelineDiscardRectangleStateCreateFlagsEXT</type> <name>flags</name></member> <!-- Reserved --> + <member><type>VkDiscardRectangleModeEXT</type> <name>discardRectangleMode</name></member> + <member optional="true"><type>uint32_t</type> <name>discardRectangleCount</name></member> + <member noautovalidity="true" optional="true" len="discardRectangleCount">const <type>VkRect2D</type>* <name>pDiscardRectangles</name></member> + </type> + <type category="struct" name="VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX" returnedonly="true"> + <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX"><type>VkStructureType</type> <name>sType</name></member> + <member><type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure --> + <member><type>VkBool32</type> <name>perViewPositionAllComponents</name></member> + </type> </types> <!-- SECTION: Vulkan enumerant (token) definitions. --> @@ -1850,6 +2239,7 @@ maintained in the master branch of the Khronos Vulkan GitHub project. <!-- This is part of the header boilerplate --> <enum value="256" name="VK_MAX_PHYSICAL_DEVICE_NAME_SIZE"/> <enum value="16" name="VK_UUID_SIZE"/> + <enum value="8" name="VK_LUID_SIZE_KHX"/> <enum value="256" name="VK_MAX_EXTENSION_NAME_SIZE"/> <enum value="256" name="VK_MAX_DESCRIPTION_SIZE"/> <enum value="32" name="VK_MAX_MEMORY_TYPES"/> @@ -1862,7 +2252,9 @@ maintained in the master branch of the Khronos Vulkan GitHub project. <enum value="1" name="VK_TRUE"/> <enum value="0" name="VK_FALSE"/> <enum value="(~0U)" name="VK_QUEUE_FAMILY_IGNORED"/> + <enum value="(~0U-1)" name="VK_QUEUE_FAMILY_EXTERNAL_KHX"/> <enum value="(~0U)" name="VK_SUBPASS_EXTERNAL"/> + <enum value="32" name="VK_MAX_DEVICE_GROUP_SIZE_KHX"/> </enums> <!-- Unlike OpenGL, most tokens in Vulkan are actual typed enumerants in @@ -2370,6 +2762,10 @@ maintained in the master branch of the Khronos Vulkan GitHub project. <enum value="7" name="VK_DYNAMIC_STATE_STENCIL_WRITE_MASK"/> <enum value="8" name="VK_DYNAMIC_STATE_STENCIL_REFERENCE"/> </enums> + <enums name="VkDescriptorUpdateTemplateTypeKHR" type="enum"> + <enum value="0" name="VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR" comment="Create descriptor update template for descriptor set updates"/> + <enum value="1" name="VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR" comment="Create descriptor update template for pushed descriptor updates"/> + </enums> <!-- Flags --> <enums name="VkQueueFlagBits" type="bitmask"> @@ -2697,6 +3093,33 @@ maintained in the master branch of the Khronos Vulkan GitHub project. <enum value="3" name="VK_OBJECT_ENTRY_VERTEX_BUFFER_NVX"/> <enum value="4" name="VK_OBJECT_ENTRY_PUSH_CONSTANT_NVX"/> </enums> + <enums name="VkDescriptorSetLayoutCreateFlagBits" type="bitmask"> + </enums> + <enums name="VkExternalMemoryHandleTypeFlagBitsKHX" type="bitmask"> + <enum bitpos="0" name="VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHX"/> + <enum bitpos="1" name="VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHX"/> + <enum bitpos="2" name="VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHX"/> + <enum bitpos="3" name="VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT_KHX"/> + <enum bitpos="4" name="VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT_KHX"/> + <enum bitpos="5" name="VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT_KHX"/> + <enum bitpos="6" name="VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT_KHX"/> + </enums> + <enums name="VkExternalMemoryFeatureFlagBitsKHX" type="bitmask"> + <enum bitpos="0" name="VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_KHX"/> + <enum bitpos="1" name="VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_KHX"/> + <enum bitpos="2" name="VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_KHX"/> + </enums> + <enums name="VkExternalSemaphoreHandleTypeFlagBitsKHX" type="bitmask"> + <enum bitpos="0" name="VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT_KHX"/> + <enum bitpos="1" name="VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHX"/> + <enum bitpos="2" name="VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHX"/> + <enum bitpos="3" name="VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT_KHX"/> + <enum bitpos="4" name="VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_FENCE_FD_BIT_KHX"/> + </enums> + <enums name="VkExternalSemaphoreFeatureFlagBitsKHX" type="bitmask"> + <enum bitpos="0" name="VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT_KHX"/> + <enum bitpos="1" name="VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT_KHX"/> + </enums> <enums name="VkSurfaceCounterFlagBitsEXT" type="bitmask"> <enum bitpos="0" name="VK_SURFACE_COUNTER_VBLANK_EXT"/> </enums> @@ -2711,6 +3134,39 @@ maintained in the master branch of the Khronos Vulkan GitHub project. <enums name="VkDisplayEventTypeEXT" type="enum"> <enum value="0" name="VK_DISPLAY_EVENT_TYPE_FIRST_PIXEL_OUT_EXT"/> </enums> + <enums name="VkPeerMemoryFeatureFlagBitsKHX" type="bitmask"> + <enum bitpos="0" name="VK_PEER_MEMORY_FEATURE_COPY_SRC_BIT_KHX" comment="Can read with vkCmdCopy commands"/> + <enum bitpos="1" name="VK_PEER_MEMORY_FEATURE_COPY_DST_BIT_KHX" comment="Can write with vkCmdCopy commands"/> + <enum bitpos="2" name="VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT_KHX" comment="Can read with any access type/command"/> + <enum bitpos="3" name="VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT_KHX" comment="Can write with and access type/command"/> + </enums> + <enums name="VkMemoryAllocateFlagBitsKHX" type="bitmask"> + <enum bitpos="0" name="VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT_KHX" comment="Force allocation on specific devices"/> + </enums> + <enums name="VkDeviceGroupPresentModeFlagBitsKHX" type="bitmask"> + <enum bitpos="0" name="VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHX" comment="Present from local memory"/> + <enum bitpos="1" name="VK_DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHX" comment="Present from remote memory"/> + <enum bitpos="2" name="VK_DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHX" comment="Present sum of local and/or remote memory"/> + <enum bitpos="3" name="VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHX" comment="Each physical device presents from local memory"/> + </enums> + <enums name="VkSwapchainCreateFlagBitsKHR" type="bitmask"> + </enums> + <enums name="VkViewportCoordinateSwizzleNV" type="enum"> + <enum value="0" name="VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_X_NV"/> + <enum value="1" name="VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_X_NV"/> + <enum value="2" name="VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_Y_NV"/> + <enum value="3" name="VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_Y_NV"/> + <enum value="4" name="VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_Z_NV"/> + <enum value="5" name="VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_Z_NV"/> + <enum value="6" name="VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_W_NV"/> + <enum value="7" name="VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_W_NV"/> + </enums> + <enums name="VkDiscardRectangleModeEXT" type="enum"> + <enum value="0" name="VK_DISCARD_RECTANGLE_MODE_INCLUSIVE_EXT"/> + <enum value="1" name="VK_DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT"/> + </enums> + <enums name="VkSubpassDescriptionFlagBits" type="bitmask"> + </enums> <!-- SECTION: Vulkan command definitions --> <commands> @@ -2839,7 +3295,7 @@ maintained in the master branch of the Khronos Vulkan GitHub project. <param>all sname:VkQueue objects created from pname:device</param> </implicitexternsyncparams> </command> - <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_TOO_MANY_OBJECTS"> + <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_TOO_MANY_OBJECTS,VK_ERROR_INVALID_EXTERNAL_HANDLE_KHX"> <proto><type>VkResult</type> <name>vkAllocateMemory</name></proto> <param><type>VkDevice</type> <name>device</name></param> <param>const <type>VkMemoryAllocateInfo</type>* <name>pAllocateInfo</name></param> @@ -3216,7 +3672,7 @@ maintained in the master branch of the Khronos Vulkan GitHub project. <param>any sname:VkDescriptorSet objects allocated from pname:descriptorPool</param> </implicitexternsyncparams> </command> - <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_FRAGMENTED_POOL"> + <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_FRAGMENTED_POOL,VK_ERROR_OUT_OF_POOL_MEMORY_KHR"> <proto><type>VkResult</type> <name>vkAllocateDescriptorSets</name></proto> <param><type>VkDevice</type> <name>device</name></param> <param externsync="pAllocateInfo::descriptorPool">const <type>VkDescriptorSetAllocateInfo</type>* <name>pAllocateInfo</name></param> @@ -3444,9 +3900,9 @@ maintained in the master branch of the Khronos Vulkan GitHub project. <command queues="compute" renderpass="outside" cmdbufferlevel="primary,secondary" pipeline="compute"> <proto><type>void</type> <name>vkCmdDispatch</name></proto> <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param> - <param><type>uint32_t</type> <name>x</name></param> - <param><type>uint32_t</type> <name>y</name></param> - <param><type>uint32_t</type> <name>z</name></param> + <param><type>uint32_t</type> <name>groupCountX</name></param> + <param><type>uint32_t</type> <name>groupCountY</name></param> + <param><type>uint32_t</type> <name>groupCountZ</name></param> </command> <command queues="compute" renderpass="outside" cmdbufferlevel="primary,secondary" pipeline="compute"> <proto><type>void</type> <name>vkCmdDispatchIndirect</name></proto> @@ -4047,12 +4503,96 @@ maintained in the master branch of the Khronos Vulkan GitHub project. <param optional="false,true"><type>uint32_t</type>* <name>pPropertyCount</name></param> <param optional="true" len="pPropertyCount"><type>VkSparseImageFormatProperties2KHR</type>* <name>pProperties</name></param> </command> + <command queues="graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary"> + <proto><type>void</type> <name>vkCmdPushDescriptorSetKHR</name></proto> + <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param> + <param><type>VkPipelineBindPoint</type> <name>pipelineBindPoint</name></param> + <param><type>VkPipelineLayout</type> <name>layout</name></param> + <param><type>uint32_t</type> <name>set</name></param> + <param><type>uint32_t</type> <name>descriptorWriteCount</name></param> + <param len="descriptorWriteCount">const <type>VkWriteDescriptorSet</type>* <name>pDescriptorWrites</name></param> + </command> <command> <proto><type>void</type> <name>vkTrimCommandPoolKHR</name></proto> <param><type>VkDevice</type> <name>device</name></param> <param externsync="true"><type>VkCommandPool</type> <name>commandPool</name></param> <param optional="true"><type>VkCommandPoolTrimFlagsKHR</type> <name>flags</name></param> </command> + <command> + <proto><type>void</type> <name>vkGetPhysicalDeviceProperties2KHX</name></proto> + <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param> + <param><type>VkPhysicalDeviceProperties2KHX</type>* <name>pProperties</name></param> + </command> + <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_FORMAT_NOT_SUPPORTED"> + <proto><type>VkResult</type> <name>vkGetPhysicalDeviceImageFormatProperties2KHX</name></proto> + <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param> + <param>const <type>VkPhysicalDeviceImageFormatInfo2KHX</type>* <name>pImageFormatInfo</name></param> + <param><type>VkImageFormatProperties2KHX</type>* <name>pImageFormatProperties</name></param> + </command> + <command> + <proto><type>void</type> <name>vkGetPhysicalDeviceExternalBufferPropertiesKHX</name></proto> + <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param> + <param>const <type>VkPhysicalDeviceExternalBufferInfoKHX</type>* <name>pExternalBufferInfo</name></param> + <param><type>VkExternalBufferPropertiesKHX</type>* <name>pExternalBufferProperties</name></param> + </command> + <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_TOO_MANY_OBJECTS,VK_ERROR_OUT_OF_HOST_MEMORY"> + <proto><type>VkResult</type> <name>vkGetMemoryWin32HandleKHX</name></proto> + <param><type>VkDevice</type> <name>device</name></param> + <param><type>VkDeviceMemory</type> <name>memory</name></param> + <param><type>VkExternalMemoryHandleTypeFlagBitsKHX</type> <name>handleType</name></param> + <param><type>HANDLE</type>* <name>pHandle</name></param> + </command> + <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_INVALID_EXTERNAL_HANDLE_KHX"> + <proto><type>VkResult</type> <name>vkGetMemoryWin32HandlePropertiesKHX</name></proto> + <param><type>VkDevice</type> <name>device</name></param> + <param><type>VkExternalMemoryHandleTypeFlagBitsKHX</type> <name>handleType</name></param> + <param><type>HANDLE</type> <name>handle</name></param> + <param><type>VkMemoryWin32HandlePropertiesKHX</type>* <name>pMemoryWin32HandleProperties</name></param> + </command> + <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_TOO_MANY_OBJECTS,VK_ERROR_OUT_OF_HOST_MEMORY"> + <proto><type>VkResult</type> <name>vkGetMemoryFdKHX</name></proto> + <param><type>VkDevice</type> <name>device</name></param> + <param><type>VkDeviceMemory</type> <name>memory</name></param> + <param><type>VkExternalMemoryHandleTypeFlagBitsKHX</type> <name>handleType</name></param> + <param><type>int</type>* <name>pFd</name></param> + </command> + <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_INVALID_EXTERNAL_HANDLE_KHX"> + <proto><type>VkResult</type> <name>vkGetMemoryFdPropertiesKHX</name></proto> + <param><type>VkDevice</type> <name>device</name></param> + <param><type>VkExternalMemoryHandleTypeFlagBitsKHX</type> <name>handleType</name></param> + <param><type>int</type> <name>fd</name></param> + <param><type>VkMemoryFdPropertiesKHX</type>* <name>pMemoryFdProperties</name></param> + </command> + <command> + <proto><type>void</type> <name>vkGetPhysicalDeviceExternalSemaphorePropertiesKHX</name></proto> + <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param> + <param>const <type>VkPhysicalDeviceExternalSemaphoreInfoKHX</type>* <name>pExternalSemaphoreInfo</name></param> + <param><type>VkExternalSemaphorePropertiesKHX</type>* <name>pExternalSemaphoreProperties</name></param> + </command> + <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_TOO_MANY_OBJECTS,VK_ERROR_OUT_OF_HOST_MEMORY"> + <proto><type>VkResult</type> <name>vkGetSemaphoreWin32HandleKHX</name></proto> + <param><type>VkDevice</type> <name>device</name></param> + <param><type>VkSemaphore</type> <name>semaphore</name></param> + <param><type>VkExternalSemaphoreHandleTypeFlagBitsKHX</type> <name>handleType</name></param> + <param><type>HANDLE</type>* <name>pHandle</name></param> + </command> + <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_INVALID_EXTERNAL_HANDLE_KHX"> + <proto><type>VkResult</type> <name>vkImportSemaphoreWin32HandleKHX</name></proto> + <param><type>VkDevice</type> <name>device</name></param> + <param>const <type>VkImportSemaphoreWin32HandleInfoKHX</type>* <name>pImportSemaphoreWin32HandleInfo</name></param> + </command> + <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_TOO_MANY_OBJECTS,VK_ERROR_OUT_OF_HOST_MEMORY"> + <proto><type>VkResult</type> <name>vkGetSemaphoreFdKHX</name></proto> + <param><type>VkDevice</type> <name>device</name></param> + <param><type>VkSemaphore</type> <name>semaphore</name></param> + <param><type>VkExternalSemaphoreHandleTypeFlagBitsKHX</type> <name>handleType</name></param> + <param><type>int</type>* <name>pFd</name></param> + </command> + <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_INVALID_EXTERNAL_HANDLE_KHX"> + <proto><type>VkResult</type> <name>vkImportSemaphoreFdKHX</name></proto> + <param><type>VkDevice</type> <name>device</name></param> + <param>const <type>VkImportSemaphoreFdInfoKHX</type>* <name>pImportSemaphoreFdInfo</name></param> + </command> <command successcodes="VK_SUCCESS"> <proto><type>VkResult</type> <name>vkReleaseDisplayEXT</name></proto> <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param> @@ -4105,6 +4645,99 @@ maintained in the master branch of the Khronos Vulkan GitHub project. <param><type>VkSurfaceKHR</type> <name>surface</name></param> <param><type>VkSurfaceCapabilities2EXT</type>* <name>pSurfaceCapabilities</name></param> </command> + <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_INITIALIZATION_FAILED"> + <proto><type>VkResult</type> <name>vkEnumeratePhysicalDeviceGroupsKHX</name></proto> + <param><type>VkInstance</type> <name>instance</name></param> + <param optional="false,true"><type>uint32_t</type>* <name>pPhysicalDeviceGroupCount</name></param> + <param optional="true" len="pPhysicalDeviceGroupCount"><type>VkPhysicalDeviceGroupPropertiesKHX</type>* <name>pPhysicalDeviceGroupProperties</name></param> + </command> + <command> + <proto><type>void</type> <name>vkGetDeviceGroupPeerMemoryFeaturesKHX</name></proto> + <param><type>VkDevice</type> <name>device</name></param> + <param><type>uint32_t</type> <name>heapIndex</name></param> + <param><type>uint32_t</type> <name>localDeviceIndex</name></param> + <param><type>uint32_t</type> <name>remoteDeviceIndex</name></param> + <param><type>VkPeerMemoryFeatureFlagsKHX</type>* <name>pPeerMemoryFeatures</name></param> + </command> + <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY"> + <proto><type>VkResult</type> <name>vkBindBufferMemory2KHX</name></proto> + <param><type>VkDevice</type> <name>device</name></param> + <param><type>uint32_t</type> <name>bindInfoCount</name></param> + <param len="bindInfoCount">const <type>VkBindBufferMemoryInfoKHX</type>* <name>pBindInfos</name></param> + </command> + <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY"> + <proto><type>VkResult</type> <name>vkBindImageMemory2KHX</name></proto> + <param><type>VkDevice</type> <name>device</name></param> + <param><type>uint32_t</type> <name>bindInfoCount</name></param> + <param len="bindInfoCount">const <type>VkBindImageMemoryInfoKHX</type>* <name>pBindInfos</name></param> + </command> + <command queues="graphics,compute,transfer" renderpass="both" cmdbufferlevel="primary,secondary"> + <proto><type>void</type> <name>vkCmdSetDeviceMaskKHX</name></proto> + <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param> + <param><type>uint32_t</type> <name>deviceMask</name></param> + </command> + <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY"> + <proto><type>VkResult</type> <name>vkGetDeviceGroupPresentCapabilitiesKHX</name></proto> + <param><type>VkDevice</type> <name>device</name></param> + <param><type>VkDeviceGroupPresentCapabilitiesKHX</type>* <name>pDeviceGroupPresentCapabilities</name></param> + </command> + <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_SURFACE_LOST_KHR"> + <proto><type>VkResult</type> <name>vkGetDeviceGroupSurfacePresentModesKHX</name></proto> + <param><type>VkDevice</type> <name>device</name></param> + <param externsync="true"><type>VkSurfaceKHR</type> <name>surface</name></param> + <param><type>VkDeviceGroupPresentModeFlagsKHX</type>* <name>pModes</name></param> + </command> + <command successcodes="VK_SUCCESS,VK_TIMEOUT,VK_NOT_READY,VK_SUBOPTIMAL_KHR" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_DEVICE_LOST,VK_ERROR_OUT_OF_DATE_KHR,VK_ERROR_SURFACE_LOST_KHR"> + <proto><type>VkResult</type> <name>vkAcquireNextImage2KHX</name></proto> + <param><type>VkDevice</type> <name>device</name></param> + <param>const <type>VkAcquireNextImageInfoKHX</type>* <name>pAcquireInfo</name></param> + <param><type>uint32_t</type>* <name>pImageIndex</name></param> + </command> + <command queues="compute" renderpass="outside" cmdbufferlevel="primary,secondary"> + <proto><type>void</type> <name>vkCmdDispatchBaseKHX</name></proto> + <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param> + <param><type>uint32_t</type> <name>baseGroupX</name></param> + <param><type>uint32_t</type> <name>baseGroupY</name></param> + <param><type>uint32_t</type> <name>baseGroupZ</name></param> + <param><type>uint32_t</type> <name>groupCountX</name></param> + <param><type>uint32_t</type> <name>groupCountY</name></param> + <param><type>uint32_t</type> <name>groupCountZ</name></param> + </command> + <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY"> + <proto><type>VkResult</type> <name>vkGetPhysicalDevicePresentRectanglesKHX</name></proto> + <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param> + <param externsync="true"><type>VkSurfaceKHR</type> <name>surface</name></param> + <param optional="false,true"><type>uint32_t</type>* <name>pRectCount</name></param> + <param optional="true" len="pRectCount"><type>VkRect2D</type>* <name>pRects</name></param> + </command> + <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY"> + <proto><type>VkResult</type> <name>vkCreateDescriptorUpdateTemplateKHR</name></proto> + <param><type>VkDevice</type> <name>device</name></param> + <param>const <type>VkDescriptorUpdateTemplateCreateInfoKHR</type>* <name>pCreateInfo</name></param> + <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param> + <param><type>VkDescriptorUpdateTemplateKHR</type>* <name>pDescriptorUpdateTemplate</name></param> + </command> + <command> + <proto><type>void</type> <name>vkDestroyDescriptorUpdateTemplateKHR</name></proto> + <param><type>VkDevice</type> <name>device</name></param> + <param optional="true" externsync="true"><type>VkDescriptorUpdateTemplateKHR</type> <name>descriptorUpdateTemplate</name></param> + <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param> + </command> + <command> + <proto><type>void</type> <name>vkUpdateDescriptorSetWithTemplateKHR</name></proto> + <param><type>VkDevice</type> <name>device</name></param> + <param externsync="true"><type>VkDescriptorSet</type> <name>descriptorSet</name></param> + <param><type>VkDescriptorUpdateTemplateKHR</type> <name>descriptorUpdateTemplate</name></param> + <param>const <type>void</type>* <name>pData</name></param> + </command> + <command queues="graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary"> + <proto><type>void</type> <name>vkCmdPushDescriptorSetWithTemplateKHR</name></proto> + <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param> + <param><type>VkDescriptorUpdateTemplateKHR</type> <name>descriptorUpdateTemplate</name></param> + <param><type>VkPipelineLayout</type> <name>layout</name></param> + <param><type>uint32_t</type> <name>set</name></param> + <param>const <type>void</type>* <name>pData</name></param> + </command> <command> <proto><type>void</type> <name>vkSetSMPTE2086MetadataEXT</name></proto> <param><type>VkDevice</type> <name>device</name></param> @@ -4112,6 +4745,34 @@ maintained in the master branch of the Khronos Vulkan GitHub project. <param len="swapchainCount">const <type>VkSwapchainKHR</type>* <name>pSwapchains</name></param> <!-- Swapchains to present an image from --> <param len="swapchainCount">const <type>VkSMPTE2086MetadataEXT</type>* <name>pMetadata</name></param> </command> + <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_NATIVE_WINDOW_IN_USE_KHR"> + <proto><type>VkResult</type> <name>vkCreateIOSSurfaceMVK</name></proto> + <param><type>VkInstance</type> <name>instance</name></param> + <param>const <type>VkIOSSurfaceCreateInfoMVK</type>* <name>pCreateInfo</name></param> + <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param> + <param><type>VkSurfaceKHR</type>* <name>pSurface</name></param> + </command> + <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_NATIVE_WINDOW_IN_USE_KHR"> + <proto><type>VkResult</type> <name>vkCreateMacOSSurfaceMVK</name></proto> + <param><type>VkInstance</type> <name>instance</name></param> + <param>const <type>VkMacOSSurfaceCreateInfoMVK</type>* <name>pCreateInfo</name></param> + <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param> + <param><type>VkSurfaceKHR</type>* <name>pSurface</name></param> + </command> + <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary"> + <proto><type>void</type> <name>vkCmdSetViewportWScalingNV</name></proto> + <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param> + <param><type>uint32_t</type> <name>firstViewport</name></param> + <param><type>uint32_t</type> <name>viewportCount</name></param> + <param len="viewportCount" noautovalidity="true">const <type>VkViewportWScalingNV</type>* <name>pViewportWScalings</name></param> + </command> + <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary"> + <proto><type>void</type> <name>vkCmdSetDiscardRectangleEXT</name></proto> + <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param> + <param><type>uint32_t</type> <name>firstDiscardRectangle</name></param> + <param><type>uint32_t</type> <name>discardRectangleCount</name></param> + <param len="discardRectangleCount">const <type>VkRect2D</type>* <name>pDiscardRectangles</name></param> + </command> </commands> <!-- SECTION: Vulkan API interface definitions --> @@ -4770,10 +5431,17 @@ maintained in the master branch of the Khronos Vulkan GitHub project. <enum value=""VK_NV_extension_53"" name="VK_NV_EXTENSION_53_EXTENSION_NAME"/> </require> </extension> - <extension name="VK_NV_extension_54" number="54" author="NVIDIA" contact="Jeff Bolz @jbolz" supported="disabled"> + <extension name="VK_KHX_multiview" number="54" type="device" author="NVIDIA" requires="VK_KHR_get_physical_device_properties2" contact="Jeff Bolz @jbolz" supported="vulkan"> <require> - <enum value="0" name="VK_NV_EXTENSION_54_SPEC_VERSION"/> - <enum value=""VK_NV_extension_54"" name="VK_NV_EXTENSION_54_EXTENSION_NAME"/> + <enum value="1" name="VK_KHX_MULTIVIEW_SPEC_VERSION"/> + <enum value=""VK_KHX_multiview"" name="VK_KHX_MULTIVIEW_EXTENSION_NAME"/> + <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO_KHX"/> + <enum offset="1" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES_KHX"/> + <enum offset="2" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES_KHX"/> + <enum bitpos="1" extends="VkDependencyFlagBits" name="VK_DEPENDENCY_VIEW_LOCAL_BIT_KHX"/> + <type name="VkRenderPassMultiviewCreateInfoKHX"/> + <type name="VkPhysicalDeviceMultiviewFeaturesKHX"/> + <type name="VkPhysicalDeviceMultiviewPropertiesKHX"/> </require> </extension> <extension name="VK_IMG_format_pvrtc" number="55" type="device" author="IMG" contact="Tobias Hector @tobias" supported="vulkan"> @@ -4862,10 +5530,56 @@ maintained in the master branch of the Khronos Vulkan GitHub project. <command name="vkGetPhysicalDeviceSparseImageFormatProperties2KHR"/> </require> </extension> - <extension name="VK_KHR_extension_61" number="61" author="KHR" contact="Jeff Bolz @jbolz" supported="disabled"> + <extension name="VK_KHX_device_group" number="61" type="device" author="KHX" requires="VK_KHR_swapchain" contact="Jeff Bolz @jbolz" supported="vulkan"> <require> - <enum value="0" name="VK_KHR_EXTENSION_61_SPEC_VERSION"/> - <enum value=""VK_KHR_extension_61"" name="VK_KHR_EXTENSION_61_EXTENSION_NAME"/> + <enum value="1" name="VK_KHX_DEVICE_GROUP_SPEC_VERSION"/> + <enum value=""VK_KHX_device_group"" name="VK_KHX_DEVICE_GROUP_EXTENSION_NAME"/> + <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO_KHX"/> + <enum offset="1" extends="VkStructureType" name="VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO_KHX"/> + <enum offset="2" extends="VkStructureType" name="VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHX"/> + <enum offset="3" extends="VkStructureType" name="VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO_KHX"/> + <enum offset="4" extends="VkStructureType" name="VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO_KHX"/> + <enum offset="5" extends="VkStructureType" name="VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO_KHX"/> + <enum offset="6" extends="VkStructureType" name="VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO_KHX"/> + <enum offset="7" extends="VkStructureType" name="VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHX"/> + <enum offset="8" extends="VkStructureType" name="VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHX"/> + <enum offset="9" extends="VkStructureType" name="VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHX"/> + <enum offset="10" extends="VkStructureType" name="VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHX"/> + <enum offset="11" extends="VkStructureType" name="VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHX"/> + <enum offset="12" extends="VkStructureType" name="VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHX"/> + <type name="VkPeerMemoryFeatureFlagsKHX"/> + <type name="VkPeerMemoryFeatureFlagBitsKHX"/> + <type name="VkMemoryAllocateFlagsKHX"/> + <type name="VkMemoryAllocateFlagBitsKHX"/> + <type name="VkDeviceGroupPresentModeFlagBitsKHX"/> + <type name="VkDeviceGroupPresentModeFlagsKHX"/> + <type name="VkMemoryAllocateFlagsInfoKHX"/> + <type name="VkBindBufferMemoryInfoKHX"/> + <type name="VkBindImageMemoryInfoKHX"/> + <type name="VkDeviceGroupRenderPassBeginInfoKHX"/> + <type name="VkDeviceGroupCommandBufferBeginInfoKHX"/> + <type name="VkDeviceGroupSubmitInfoKHX"/> + <type name="VkDeviceGroupBindSparseInfoKHX"/> + <type name="VkDeviceGroupPresentCapabilitiesKHX"/> + <type name="VkImageSwapchainCreateInfoKHX"/> + <type name="VkBindImageMemorySwapchainInfoKHX"/> + <type name="VkAcquireNextImageInfoKHX"/> + <type name="VkDeviceGroupPresentInfoKHX"/> + <type name="VkDeviceGroupSwapchainCreateInfoKHX"/> + <command name="vkGetDeviceGroupPeerMemoryFeaturesKHX"/> + <command name="vkBindBufferMemory2KHX"/> + <command name="vkBindImageMemory2KHX"/> + <command name="vkCmdSetDeviceMaskKHX"/> + <command name="vkGetDeviceGroupPresentCapabilitiesKHX"/> + <command name="vkGetDeviceGroupSurfacePresentModesKHX"/> + <command name="vkAcquireNextImage2KHX"/> + <command name="vkCmdDispatchBaseKHX"/> + <command name="vkGetPhysicalDevicePresentRectanglesKHX"/> + <enum bitpos="6" extends="VkImageCreateFlagBits" name="VK_IMAGE_CREATE_BIND_SFR_BIT_KHX" comment="Allows using VkBindImageMemoryInfoKHX::pSFRRects when binding memory to the image"/> + <enum bitpos="3" extends="VkPipelineCreateFlagBits" name="VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT_KHX"/> + <enum bitpos="4" extends="VkPipelineCreateFlagBits" name="VK_PIPELINE_CREATE_DISPATCH_BASE_KHX"/> + <enum bitpos="2" extends="VkDependencyFlagBits" name="VK_DEPENDENCY_DEVICE_GROUP_BIT_KHX" comment="Dependency is across devices"/> + <enum bitpos="0" extends="VkSwapchainCreateFlagBitsKHR" name="VK_SWAPCHAIN_CREATE_BIND_SFR_BIT_KHX" comment="Allow images with VK_IMAGE_CREATE_BIND_SFR_BIT_KHX"/> </require> </extension> <extension name="VK_EXT_validation_flags" number="62" type="instance" author="Google, Inc." contact="Tobin Ehlis @tobine" supported="vulkan"> @@ -4933,70 +5647,157 @@ maintained in the master branch of the Khronos Vulkan GitHub project. <command name="vkTrimCommandPoolKHR"/> </require> </extension> - <extension name="VK_KHR_extension_71" number="71" author="KHR" contact="Jeff Bolz @jbolz" supported="disabled"> + <extension name="VK_KHX_device_group_creation" number="71" type="instance" author="KHX" contact="Jeff Bolz @jbolz" supported="vulkan"> <require> - <enum value="0" name="VK_KHR_EXTENSION_71_SPEC_VERSION"/> - <enum value=""VK_KHR_extension_71"" name="VK_KHR_EXTENSION_71_EXTENSION_NAME"/> + <enum value="1" name="VK_KHX_DEVICE_GROUP_CREATION_SPEC_VERSION"/> + <enum value=""VK_KHX_device_group_creation"" name="VK_KHX_DEVICE_GROUP_CREATION_EXTENSION_NAME"/> + <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES_KHX"/> + <enum offset="1" extends="VkStructureType" name="VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO_KHX"/> + <enum name="VK_MAX_DEVICE_GROUP_SIZE_KHX"/> + <type name="VkPhysicalDeviceGroupPropertiesKHX"/> + <type name="VkDeviceGroupDeviceCreateInfoKHX"/> + <command name="vkEnumeratePhysicalDeviceGroupsKHX"/> + <enum bitpos="1" extends="VkMemoryHeapFlagBits" name="VK_MEMORY_HEAP_MULTI_INSTANCE_BIT_KHX" comment="If set, heap allocations allocate multiple instances by default"/> </require> </extension> - <extension name="VK_KHR_extension_72" number="72" author="KHR" contact="James Jones @cubanismo" supported="disable"> + <extension name="VK_KHX_external_memory_capabilities" number="72" type="instance" author="KHX" requires="VK_KHR_get_physical_device_properties2" contact="James Jones @cubanismo" supported="vulkan"> <require> - <enum value="0" name="VK_KHR_EXTENSION_72_SPEC_VERSION"/> - <enum value=""VK_KHR_extension_72"" name="VK_KHR_EXTENSION_72_EXTENSION_NAME"/> + <enum value="1" name="VK_KHX_EXTERNAL_MEMORY_CAPABILITIES_SPEC_VERSION"/> + <enum value=""VK_KHX_external_memory_capabilities"" name="VK_KHX_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME"/> + <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO_KHX"/> + <enum offset="1" extends="VkStructureType" name="VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES_KHX"/> + <enum offset="2" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO_KHX"/> + <enum offset="3" extends="VkStructureType" name="VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES_KHX"/> + <enum offset="4" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES_KHX"/> + <enum offset="5" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHX"/> <!-- KHX-only. Remove for KHR --> + <enum offset="6" extends="VkStructureType" name="VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHX"/> <!-- KHX-only. Remove for KHR --> + <enum offset="7" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHX"/> <!-- KHX-only. Remove for KHR --> + <enum name="VK_LUID_SIZE_KHX"/> + <type name="VkExternalMemoryHandleTypeFlagsKHX"/> + <type name="VkExternalMemoryHandleTypeFlagBitsKHX"/> + <type name="VkExternalMemoryFeatureFlagsKHX"/> + <type name="VkExternalMemoryFeatureFlagBitsKHX"/> + <type name="VkExternalMemoryPropertiesKHX"/> + <type name="VkPhysicalDeviceExternalImageFormatInfoKHX"/> + <type name="VkExternalImageFormatPropertiesKHX"/> + <type name="VkPhysicalDeviceExternalBufferInfoKHX"/> + <type name="VkExternalBufferPropertiesKHX"/> + <type name="VkPhysicalDeviceIDPropertiesKHX"/> + <type name="VkPhysicalDeviceProperties2KHX"/> <!-- KHX-only. Remove for KHR --> + <type name="VkImageFormatProperties2KHX"/> <!-- KHX-only. Remove for KHR --> + <type name="VkPhysicalDeviceImageFormatInfo2KHX"/> <!-- KHX-only. Remove for KHR --> + <command name="vkGetPhysicalDeviceExternalBufferPropertiesKHX"/> + <command name="vkGetPhysicalDeviceProperties2KHX"/> <!-- KHX-only. Remove for KHR --> + <command name="vkGetPhysicalDeviceImageFormatProperties2KHX"/> <!-- KHX-only. Remove for KHR --> </require> </extension> - <extension name="VK_KHR_extension_73" number="73" author="KHR" contact="James Jones @cubanismo" supported="disable"> + <extension name="VK_KHX_external_memory" number="73" type="device" requires="VK_KHX_external_memory_capabilities" author="KHX" contact="James Jones @cubanismo" supported="vulkan"> <require> - <enum value="0" name="VK_KHR_EXTENSION_73_SPEC_VERSION"/> - <enum value=""VK_KHR_extension_73"" name="VK_KHR_EXTENSION_73_EXTENSION_NAME"/> + <enum value="1" name="VK_KHX_EXTERNAL_MEMORY_SPEC_VERSION"/> + <enum value=""VK_KHX_external_memory"" name="VK_KHX_EXTERNAL_MEMORY_EXTENSION_NAME"/> + <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO_KHX"/> + <enum offset="1" extends="VkStructureType" name="VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_KHX"/> + <enum offset="2" extends="VkStructureType" name="VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHX"/> + <enum offset="3" dir="-" extends="VkResult" name="VK_ERROR_INVALID_EXTERNAL_HANDLE_KHX"/> + <enum name="VK_QUEUE_FAMILY_EXTERNAL_KHX"/> + <type name="VkExternalMemoryImageCreateInfoKHX"/> + <type name="VkExternalMemoryBufferCreateInfoKHX"/> + <type name="VkExportMemoryAllocateInfoKHX"/> </require> </extension> - <extension name="VK_KHR_extension_74" number="74" author="KHR" contact="James Jones @cubanismo" supported="disable"> + <extension name="VK_KHX_external_memory_win32" number="74" type="device" requires="VK_KHX_external_memory_capabilities,VK_KHX_external_memory" author="KHX" contact="James Jones @cubanismo" protect="VK_USE_PLATFORM_WIN32_KHR" supported="vulkan"> <require> - <enum value="0" name="VK_KHR_EXTENSION_74_SPEC_VERSION"/> - <enum value=""VK_KHR_extension_74"" name="VK_KHR_EXTENSION_74_EXTENSION_NAME"/> + <enum value="1" name="VK_KHX_EXTERNAL_MEMORY_WIN32_SPEC_VERSION"/> + <enum value=""VK_KHX_external_memory_win32"" name="VK_KHX_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME"/> + <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHX"/> + <enum offset="1" extends="VkStructureType" name="VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHX"/> + <enum offset="2" extends="VkStructureType" name="VK_STRUCTURE_TYPE_MEMORY_WIN32_HANDLE_PROPERTIES_KHX"/> + <type name="VkImportMemoryWin32HandleInfoKHX"/> + <type name="VkExportMemoryWin32HandleInfoKHX"/> + <type name="VkMemoryWin32HandlePropertiesKHX"/> + <command name="vkGetMemoryWin32HandleKHX"/> + <command name="vkGetMemoryWin32HandlePropertiesKHX"/> </require> </extension> - <extension name="VK_KHR_extension_75" number="75" author="KHR" contact="James Jones @cubanismo" supported="disable"> + <extension name="VK_KHX_external_memory_fd" number="75" type="device" requires="VK_KHX_external_memory_capabilities,VK_KHX_external_memory" author="KHX" contact="James Jones @cubanismo" supported="vulkan"> <require> - <enum value="0" name="VK_KHR_EXTENSION_75_SPEC_VERSION"/> - <enum value=""VK_KHR_extension_75"" name="VK_KHR_EXTENSION_75_EXTENSION_NAME"/> + <enum value="1" name="VK_KHX_EXTERNAL_MEMORY_FD_SPEC_VERSION"/> + <enum value=""VK_KHX_external_memory_fd"" name="VK_KHX_EXTERNAL_MEMORY_FD_EXTENSION_NAME"/> + <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHX"/> + <enum offset="1" extends="VkStructureType" name="VK_STRUCTURE_TYPE_MEMORY_FD_PROPERTIES_KHX"/> + <type name="VkImportMemoryFdInfoKHX"/> + <type name="VkMemoryFdPropertiesKHX"/> + <command name="vkGetMemoryFdKHX"/> + <command name="vkGetMemoryFdPropertiesKHX"/> </require> </extension> - <extension name="VK_KHR_extension_76" number="76" author="KHR" contact="James Jones @cubanismo" supported="disable"> + <extension name="VK_KHX_win32_keyed_mutex" number="76" type="device" requires="VK_KHX_external_memory_capabilities,VK_KHX_external_memory,VK_KHX_external_memory_win32" author="KHX" contact="Carsten Rohde" protect="VK_USE_PLATFORM_WIN32_KHR" supported="vulkan"> <require> - <enum value="0" name="VK_KHR_EXTENSION_76_SPEC_VERSION"/> - <enum value=""VK_KHR_extension_76"" name="VK_KHR_EXTENSION_76_EXTENSION_NAME"/> + <enum value="1" name="VK_KHX_WIN32_KEYED_MUTEX_SPEC_VERSION"/> + <enum value=""VK_KHX_win32_keyed_mutex"" name="VK_KHX_WIN32_KEYED_MUTEX_EXTENSION_NAME"/> + <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHX"/> + <type name="VkWin32KeyedMutexAcquireReleaseInfoKHX"/> </require> </extension> - <extension name="VK_KHR_extension_77" number="77" author="KHR" contact="James Jones @cubanismo" supported="disable"> + <extension name="VK_KHX_external_semaphore_capabilities" number="77" type="instance" author="KHX" requires="VK_KHR_get_physical_device_properties2" contact="James Jones @cubanismo" supported="vulkan"> <require> - <enum value="0" name="VK_KHR_EXTENSION_77_SPEC_VERSION"/> - <enum value=""VK_KHR_extension_77"" name="VK_KHR_EXTENSION_77_EXTENSION_NAME"/> + <enum value="1" name="VK_KHX_EXTERNAL_SEMAPHORE_CAPABILITIES_SPEC_VERSION"/> + <enum value=""VK_KHX_external_semaphore_capabilities"" name="VK_KHX_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME"/> + <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO_KHX"/> + <enum offset="1" extends="VkStructureType" name="VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES_KHX"/> + <enum name="VK_LUID_SIZE_KHX"/> + <type name="VkExternalSemaphoreHandleTypeFlagsKHX"/> + <type name="VkExternalSemaphoreHandleTypeFlagBitsKHX"/> + <type name="VkExternalSemaphoreFeatureFlagsKHX"/> + <type name="VkExternalSemaphoreFeatureFlagBitsKHX"/> + <type name="VkPhysicalDeviceExternalSemaphoreInfoKHX"/> + <type name="VkExternalSemaphorePropertiesKHX"/> + <type name="VkPhysicalDeviceIDPropertiesKHX"/> + <type name="VkPhysicalDeviceProperties2KHX"/> <!-- KHX-only. Remove for KHR --> + <command name="vkGetPhysicalDeviceExternalSemaphorePropertiesKHX"/> + <command name="vkGetPhysicalDeviceProperties2KHX"/> <!-- KHX-only. Remove for KHR --> </require> </extension> - <extension name="VK_KHR_extension_78" number="78" author="KHR" contact="James Jones @cubanismo" supported="disable"> + <extension name="VK_KHX_external_semaphore" number="78" type="device" requires="VK_KHX_external_semaphore_capabilities" author="KHX" contact="James Jones @cubanismo" supported="vulkan"> <require> - <enum value="0" name="VK_KHR_EXTENSION_78_SPEC_VERSION"/> - <enum value=""VK_KHR_extension_78"" name="VK_KHR_EXTENSION_78_EXTENSION_NAME"/> + <enum value="1" name="VK_KHX_EXTERNAL_SEMAPHORE_SPEC_VERSION"/> + <enum value=""VK_KHX_external_semaphore"" name="VK_KHX_EXTERNAL_SEMAPHORE_EXTENSION_NAME"/> + <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO_KHX"/> + <type name="VkExportSemaphoreCreateInfoKHX"/> </require> </extension> - <extension name="VK_KHR_extension_79" number="79" author="KHR" contact="James Jones @cubanismo" supported="disable"> + <extension name="VK_KHX_external_semaphore_win32" number="79" type="device" requires="VK_KHX_external_semaphore_capabilities,VK_KHX_external_semaphore" author="KHX" contact="James Jones @cubanismo" protect="VK_USE_PLATFORM_WIN32_KHX" supported="vulkan"> <require> - <enum value="0" name="VK_KHR_EXTENSION_79_SPEC_VERSION"/> - <enum value=""VK_KHR_extension_79"" name="VK_KHR_EXTENSION_79_EXTENSION_NAME"/> + <enum value="1" name="VK_KHX_EXTERNAL_SEMAPHORE_WIN32_SPEC_VERSION"/> + <enum value=""VK_KHX_external_semaphore_win32"" name="VK_KHX_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME"/> + <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHX"/> + <enum offset="1" extends="VkStructureType" name="VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHX"/> + <enum offset="2" extends="VkStructureType" name="VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHX"/> + <type name="VkImportSemaphoreWin32HandleInfoKHX"/> + <type name="VkExportSemaphoreWin32HandleInfoKHX"/> + <type name="VkD3D12FenceSubmitInfoKHX"/> + <command name="vkImportSemaphoreWin32HandleKHX"/> + <command name="vkGetSemaphoreWin32HandleKHX"/> </require> </extension> - <extension name="VK_KHR_extension_80" number="80" author="KHR" contact="James Jones @cubanismo" supported="disable"> + <extension name="VK_KHX_external_semaphore_fd" number="80" type="device" requires="VK_KHX_external_semaphore_capabilities,VK_KHX_external_semaphore" author="KHX" contact="James Jones @cubanismo" supported="vulkan"> <require> - <enum value="0" name="VK_KHR_EXTENSION_80_SPEC_VERSION"/> - <enum value=""VK_KHR_extension_80"" name="VK_KHR_EXTENSION_80_EXTENSION_NAME"/> + <enum value="1" name="VK_KHX_EXTERNAL_SEMAPHORE_FD_SPEC_VERSION"/> + <enum value=""VK_KHX_external_semaphore_fd"" name="VK_KHX_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME"/> + <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHX"/> + <type name="VkImportSemaphoreFdInfoKHX"/> + <command name="vkImportSemaphoreFdKHX"/> + <command name="vkGetSemaphoreFdKHX"/> </require> </extension> - <extension name="VK_KHR_extension_81" number="81" author="KHR" contact="Jeff Bolz @jbolz" supported="disabled"> + <extension name="VK_KHR_push_descriptor" number="81" type="device" author="KHR" requires="VK_KHR_get_physical_device_properties2" contact="Jeff Bolz @jbolz" supported="vulkan"> <require> - <enum value="0" name="VK_KHR_EXTENSION_81_SPEC_VERSION"/> - <enum value=""VK_KHR_extension_81"" name="VK_KHR_EXTENSION_81_EXTENSION_NAME"/> + <enum value="1" name="VK_KHR_PUSH_DESCRIPTOR_SPEC_VERSION"/> + <enum value=""VK_KHR_push_descriptor"" name="VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME"/> + <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR"/> + <enum bitpos="0" extends="VkDescriptorSetLayoutCreateFlagBits" name="VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR" comment="Descriptors are pushed via flink:vkCmdPushDescriptorSetKHR"/> + <command name="vkCmdPushDescriptorSetKHR"/> + <type name="VkPhysicalDevicePushDescriptorPropertiesKHR"/> </require> </extension> <extension name="VK_KHR_extension_82" number="82" author="KHR" contact="Jeff Bolz @jbolz" supported="disabled"> @@ -5023,10 +5824,19 @@ maintained in the master branch of the Khronos Vulkan GitHub project. <enum value=""VK_KHR_extension_85"" name="VK_KHR_EXTENSION_85_EXTENSION_NAME"/> </require> </extension> - <extension name="VK_KHR_extension_86" number="86" author="KHR" contact="Markus Tavenrath @mtavenrath" supported="disabled"> - <require> - <enum value="0" name="VK_KHR_EXTENSION_86_SPEC_VERSION"/> - <enum value=""VK_KHR_extension_86"" name="VK_KHR_EXTENSION_86_EXTENSION_NAME"/> + <extension name="VK_KHR_descriptor_update_template" number="86" type="device" author="KHR" contact="Markus Tavenrath @mtavenrath" supported="vulkan"> + <require> + <enum value="1" name="VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_SPEC_VERSION"/> + <enum value=""VK_KHR_descriptor_update_template"" name="VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME"/> + <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHR"/> + <command name="vkCreateDescriptorUpdateTemplateKHR"/> + <command name="vkDestroyDescriptorUpdateTemplateKHR"/> + <command name="vkUpdateDescriptorSetWithTemplateKHR"/> + <command name="vkCmdPushDescriptorSetWithTemplateKHR"/> + <type name="VkDescriptorUpdateTemplateCreateFlagsKHR"/> + <type name="VkDescriptorUpdateTemplateTypeKHR"/> + <type name="VkDescriptorUpdateTemplateEntryKHR"/> + <type name="VkDescriptorUpdateTemplateCreateInfoKHR"/> </require> </extension> <extension name="VK_NVX_device_generated_commands" number="87" type="device" author="NVIDIA" contact="Christoph Kubisch @pixeljetstream" supported="vulkan"> @@ -5075,12 +5885,17 @@ maintained in the master branch of the Khronos Vulkan GitHub project. <command name="vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX"/> </require> </extension> - <extension name="VK_KHR_extension_88" number="88" author="NV" contact="Eric Werness @ewerness" supported="disabled"> - <require> - <enum value="0" name="VK_KHR_EXTENSION_88_SPEC_VERSION"/> - <enum value=""VK_KHR_extension_88"" name="VK_KHR_EXTENSION_88_EXTENSION_NAME"/> - </require> - </extension> + <extension name="VK_NV_clip_space_w_scaling" number="88" type="device" author="NV" contact="Eric Werness @ewerness" supported="vulkan"> + <require> + <enum value="1" name="VK_NV_CLIP_SPACE_W_SCALING_SPEC_VERSION"/> + <enum value=""VK_NV_clip_space_w_scaling"" name="VK_NV_CLIP_SPACE_W_SCALING_EXTENSION_NAME"/> + <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV"/> + <enum offset="0" extends="VkDynamicState" name="VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV"/> + <type name="VkViewportWScalingNV"/> + <type name="VkPipelineViewportWScalingStateCreateInfoNV"/> + <command name="vkCmdSetViewportWScalingNV"/> + </require> + </extension> <extension name="VK_EXT_direct_mode_display" number="89" type="instance" requires="VK_KHR_display" author="NVIDIA" contact="James Jones @cubanismo" supported="vulkan"> <require> <enum value="1" name="VK_EXT_DIRECT_MODE_DISPLAY_SPEC_VERSION"/> @@ -5140,40 +5955,57 @@ maintained in the master branch of the Khronos Vulkan GitHub project. <enum value=""VK_KHR_extension_94"" name="VK_KHR_EXTENSION_94_EXTENSION_NAME"/> </require> </extension> - <extension name="VK_NV_extension_95" number="95" author="NVIDIA" contact="Daniel Koch @dgkoch" supported="disabled"> + <extension name="VK_NV_sample_mask_override_coverage" number="95" type="device" author="NVIDIA" contact="Piers Daniell @pdaniell" supported="vulkan"> <require> - <enum value="0" name="VK_NV_EXTENSION_95_SPEC_VERSION"/> - <enum value=""VK_NV_extension_95"" name="VK_NV_EXTENSION_95_EXTENSION_NAME"/> + <enum value="1" name="VK_NV_SAMPLE_MASK_OVERRIDE_COVERAGE_SPEC_VERSION"/> + <enum value=""VK_NV_sample_mask_override_coverage"" name="VK_NV_SAMPLE_MASK_OVERRIDE_COVERAGE_EXTENSION_NAME"/> </require> </extension> - <extension name="VK_NV_extension_96" number="96" author="NVIDIA" contact="Daniel Koch @dgkoch" supported="disabled"> + <extension name="VK_NV_geometry_shader_passthrough" number="96" type="device" author="NVIDIA" contact="Daniel Koch @dgkoch" supported="vulkan"> <require> - <enum value="0" name="VK_NV_EXTENSION_96_SPEC_VERSION"/> - <enum value=""VK_NV_extension_96"" name="VK_NV_EXTENSION_96_EXTENSION_NAME"/> + <enum value="1" name="VK_NV_GEOMETRY_SHADER_PASSTHROUGH_SPEC_VERSION"/> + <enum value=""VK_NV_geometry_shader_passthrough"" name="VK_NV_GEOMETRY_SHADER_PASSTHROUGH_EXTENSION_NAME"/> </require> </extension> - <extension name="VK_NV_extension_97" number="97" author="NVIDIA" contact="Daniel Koch @dgkoch" supported="disabled"> + <extension name="VK_NV_viewport_array2" number="97" type="device" author="NVIDIA" contact="Daniel Koch @dgkoch" supported="vulkan"> <require> - <enum value="0" name="VK_NV_EXTENSION_97_SPEC_VERSION"/> - <enum value=""VK_NV_extension_97"" name="VK_NV_EXTENSION_97_EXTENSION_NAME"/> + <enum value="1" name="VK_NV_VIEWPORT_ARRAY2_SPEC_VERSION"/> + <enum value=""VK_NV_viewport_array2"" name="VK_NV_VIEWPORT_ARRAY2_EXTENSION_NAME"/> </require> </extension> - <extension name="VK_NV_extension_98" number="98" author="NVIDIA" contact="Daniel Koch @dgkoch" supported="disabled"> + <extension name="VK_NVX_multiview_per_view_attributes" number="98" type="device" author="NVIDIA" contact="Jeff Bolz @jbolz" supported="vulkan"> <require> - <enum value="0" name="VK_NV_EXTENSION_98_SPEC_VERSION"/> - <enum value=""VK_NV_extension_98"" name="VK_NV_EXTENSION_98_EXTENSION_NAME"/> + <enum value="1" name="VK_NVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_SPEC_VERSION"/> + <enum value=""VK_NVX_multiview_per_view_attributes"" name="VK_NVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_EXTENSION_NAME"/> + <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX"/> + <enum bitpos="0" extends="VkSubpassDescriptionFlagBits" name="VK_SUBPASS_DESCRIPTION_PER_VIEW_ATTRIBUTES_BIT_NVX"/> + <enum bitpos="1" extends="VkSubpassDescriptionFlagBits" name="VK_SUBPASS_DESCRIPTION_PER_VIEW_POSITION_X_ONLY_BIT_NVX"/> + <type name="VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX"/> </require> </extension> - <extension name="VK_NV_extension_99" number="99" author="NVIDIA" contact="Daniel Koch @dgkoch" supported="disabled"> + <extension name="VK_NV_viewport_swizzle" number="99" type="device" author="NVIDIA" contact="Piers Daniell @pdaniell" supported="vulkan"> <require> - <enum value="0" name="VK_NV_EXTENSION_99_SPEC_VERSION"/> - <enum value=""VK_NV_extension_99"" name="VK_NV_EXTENSION_99_EXTENSION_NAME"/> + <enum value="1" name="VK_NV_VIEWPORT_SWIZZLE_SPEC_VERSION"/> + <enum value=""VK_NV_viewport_swizzle"" name="VK_NV_VIEWPORT_SWIZZLE_EXTENSION_NAME"/> + <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV"/> + <type name="VkViewportSwizzleNV"/> + <type name="VkViewportCoordinateSwizzleNV"/> + <type name="VkPipelineViewportSwizzleStateCreateInfoNV"/> + <type name="VkPipelineViewportSwizzleStateCreateFlagsNV"/> </require> </extension> - <extension name="VK_NV_extension_100" number="100" author="NVIDIA" contact="Daniel Koch @dgkoch" supported="disabled"> + <extension name="VK_EXT_discard_rectangles" number="100" type="device" requires="VK_KHR_get_physical_device_properties2" author="NVIDIA" contact="Piers Daniell @pdaniell" supported="vulkan"> <require> - <enum value="0" name="VK_NV_EXTENSION_100_SPEC_VERSION"/> - <enum value=""VK_NV_extension_100"" name="VK_NV_EXTENSION_100_EXTENSION_NAME"/> + <enum value="1" name="VK_EXT_DISCARD_RECTANGLES_SPEC_VERSION"/> + <enum value=""VK_EXT_discard_rectangles"" name="VK_EXT_DISCARD_RECTANGLES_EXTENSION_NAME"/> + <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT"/> + <enum offset="1" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT"/> + <enum offset="0" extends="VkDynamicState" name="VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT"/> + <type name="VkPhysicalDeviceDiscardRectanglePropertiesEXT"/> + <type name="VkPipelineDiscardRectangleStateCreateInfoEXT"/> + <type name="VkPipelineDiscardRectangleStateCreateFlagsEXT"/> + <type name="VkDiscardRectangleModeEXT"/> + <command name="vkCmdSetDiscardRectangleEXT"/> </require> </extension> <extension name="VK_NV_extension_101" number="101" author="NVIDIA" contact="Daniel Koch @dgkoch" supported="disabled"> @@ -5323,7 +6155,32 @@ maintained in the master branch of the Khronos Vulkan GitHub project. <enum value=""VK_KHR_extension_122"" name="VK_KHR_EXTENSION_122_EXTENSION_NAME"/> </require> </extension> - <!-- padding 123-125, for unpublished extensions under review --> + <extension name="VK_MVK_ios_surface" number="123" type="instance" requires="VK_KHR_surface" protect="VK_USE_PLATFORM_IOS_MVK" supported="vulkan" author="MVK" contact="Bill Hollings @billhollings"> + <require> + <enum value="1" name="VK_MVK_IOS_SURFACE_SPEC_VERSION"/> + <enum value=""VK_MVK_ios_surface"" name="VK_MVK_IOS_SURFACE_EXTENSION_NAME"/> + <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK"/> + <type name="VkIOSSurfaceCreateFlagsMVK"/> + <type name="VkIOSSurfaceCreateInfoMVK"/> + <command name="vkCreateIOSSurfaceMVK"/> + </require> + </extension> + <extension name="VK_MVK_macos_surface" number="124" type="instance" requires="VK_KHR_surface" protect="VK_USE_PLATFORM_MACOS_MVK" supported="vulkan" author="MVK" contact="Bill Hollings @billhollings"> + <require> + <enum value="1" name="VK_MVK_MACOS_SURFACE_SPEC_VERSION"/> + <enum value=""VK_MVK_macos_surface"" name="VK_MVK_MACOS_SURFACE_EXTENSION_NAME"/> + <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK"/> + <type name="VkMacOSSurfaceCreateFlagsMVK"/> + <type name="VkMacOSSurfaceCreateInfoMVK"/> + <command name="vkCreateMacOSSurfaceMVK"/> + </require> + </extension> + <extension name="VK_MVK_moltenvk" number="125" type="instance" author="MVK" contact="Bill Hollings @billhollings" supported="disabled"> + <require> + <enum value="0" name="VK_MVK_MOLTENVK_SPEC_VERSION"/> + <enum value=""VK_MVK_moltenvk"" name="VK_MVK_MOLTENVK_EXTENSION_NAME"/> + </require> + </extension> <extension name="VK_MESA_extension_126" number="126" author="MESA" contact="Chad Versace @chadversary" supported="disabled"> <require> <enum value="0" name="VK_MESA_EXTENSION_126_SPEC_VERSION"/> diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 5c1c0c0d..d90c08d5 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -67,6 +67,8 @@ include_directories( "${PROJECT_SOURCE_DIR}/layers" ${GLSLANG_SPIRV_INCLUDE_DIR} ${LIBGLM_INCLUDE_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_BINARY_DIR} ) if (NOT WIN32) diff --git a/tests/layers/linux/VkLayer_test.json b/tests/layers/linux/VkLayer_test.json index 0368b9d9..224ee9f3 100644 --- a/tests/layers/linux/VkLayer_test.json +++ b/tests/layers/linux/VkLayer_test.json @@ -4,7 +4,7 @@ "name": "VK_LAYER_LUNARG_test", "type": "GLOBAL", "library_path": "./libVkLayer_test.so", - "api_version": "1.0.41", + "api_version": "1.0.42", "implementation_version": "1", "description": "LunarG Test Layer", "enable_environment": { diff --git a/tests/layers/linux/VkLayer_wrap_objects.json b/tests/layers/linux/VkLayer_wrap_objects.json index c02a40fd..3909e350 100644 --- a/tests/layers/linux/VkLayer_wrap_objects.json +++ b/tests/layers/linux/VkLayer_wrap_objects.json @@ -4,7 +4,7 @@ "name": "VK_LAYER_LUNARG_wrap_objects", "type": "GLOBAL", "library_path": "./libVkLayer_wrap_objects.so", - "api_version": "1.0.41", + "api_version": "1.0.42", "implementation_version": "1", "description": "LunarG Dispatchable Object Wrapping Layer" } diff --git a/tests/layers/windows/VkLayer_test.json b/tests/layers/windows/VkLayer_test.json index f59c5c2f..f4e6e8c6 100644 --- a/tests/layers/windows/VkLayer_test.json +++ b/tests/layers/windows/VkLayer_test.json @@ -4,7 +4,7 @@ "name": "VK_LAYER_LUNARG_test", "type": "GLOBAL", "library_path": ".\\libVkLayer_test.dll", - "api_version": "1.0.41", + "api_version": "1.0.42", "implementation_version": "1", "description": "LunarG Test Layer", "enable_environment": { diff --git a/tests/layers/windows/VkLayer_wrap_objects.json b/tests/layers/windows/VkLayer_wrap_objects.json index cc7cb4f7..f525905a 100644 --- a/tests/layers/windows/VkLayer_wrap_objects.json +++ b/tests/layers/windows/VkLayer_wrap_objects.json @@ -4,7 +4,7 @@ "name": "VK_LAYER_LUNARG_wrap_objects", "type": "GLOBAL", "library_path": ".\\VkLayer_wrap_objects.dll", - "api_version": "1.0.41", + "api_version": "1.0.42", "implementation_version": "1", "description": "LunarG Dispatchable Object Wrapping Layer" } |