343 lines
17 KiB
C
343 lines
17 KiB
C
// *** THIS FILE IS GENERATED - DO NOT EDIT ***
|
|
// See loader_extension_generator.py for modifications
|
|
|
|
/*
|
|
* 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.
|
|
* 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>
|
|
* Author: Mark Young <marky@lunarg.com>
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
// Structures defined externally, but used here
|
|
struct loader_instance;
|
|
struct loader_icd_term;
|
|
struct loader_dev_dispatch_table;
|
|
|
|
// Device extension error function
|
|
VKAPI_ATTR VkResult VKAPI_CALL vkDevExtError(VkDevice dev);
|
|
|
|
// Extension interception for vkGetInstanceProcAddr function, so we can return
|
|
// the appropriate information for any instance extensions we know about.
|
|
bool extension_instance_gpa(struct loader_instance *ptr_instance, const char *name, void **addr);
|
|
|
|
// Extension interception for vkCreateInstance function, so we can properly
|
|
// detect and enable any instance extension information for extensions we know
|
|
// about.
|
|
void extensions_create_instance(struct loader_instance *ptr_instance, const VkInstanceCreateInfo *pCreateInfo);
|
|
|
|
// Extension interception for vkGetDeviceProcAddr function, so we can return
|
|
// an appropriate terminator if this is one of those few device commands requiring
|
|
// a terminator.
|
|
PFN_vkVoidFunction get_extension_device_proc_terminator(const char *pName);
|
|
|
|
// Dispatch table properly filled in with appropriate terminators for the
|
|
// supported extensions.
|
|
extern const VkLayerInstanceDispatchTable instance_disp;
|
|
|
|
// Array of extension strings for instance extensions we support.
|
|
extern const char *const LOADER_INSTANCE_EXTENSIONS[];
|
|
|
|
VKAPI_ATTR bool VKAPI_CALL loader_icd_init_entries(struct loader_icd_term *icd_term, VkInstance inst,
|
|
const PFN_vkGetInstanceProcAddr fp_gipa);
|
|
|
|
// Init Device function pointer dispatch table with core commands
|
|
VKAPI_ATTR void VKAPI_CALL loader_init_device_dispatch_table(struct loader_dev_dispatch_table *dev_table, PFN_vkGetDeviceProcAddr gpa,
|
|
VkDevice dev);
|
|
|
|
// Init Device function pointer dispatch table with extension commands
|
|
VKAPI_ATTR void VKAPI_CALL loader_init_device_extension_dispatch_table(struct loader_dev_dispatch_table *dev_table,
|
|
PFN_vkGetDeviceProcAddr gpa, VkDevice dev);
|
|
|
|
// Init Instance function pointer dispatch table with core commands
|
|
VKAPI_ATTR void VKAPI_CALL loader_init_instance_core_dispatch_table(VkLayerInstanceDispatchTable *table, PFN_vkGetInstanceProcAddr gpa,
|
|
VkInstance inst);
|
|
|
|
// Init Instance function pointer dispatch table with core commands
|
|
VKAPI_ATTR void VKAPI_CALL loader_init_instance_extension_dispatch_table(VkLayerInstanceDispatchTable *table, PFN_vkGetInstanceProcAddr gpa,
|
|
VkInstance inst);
|
|
|
|
// Device command lookup function
|
|
VKAPI_ATTR void* VKAPI_CALL loader_lookup_device_dispatch_table(const VkLayerDispatchTable *table, const char *name);
|
|
|
|
// Instance command lookup function
|
|
VKAPI_ATTR void* VKAPI_CALL loader_lookup_instance_dispatch_table(const VkLayerInstanceDispatchTable *table, const char *name,
|
|
bool *found_name);
|
|
|
|
VKAPI_ATTR bool VKAPI_CALL loader_icd_init_entries(struct loader_icd_term *icd_term, VkInstance inst,
|
|
const PFN_vkGetInstanceProcAddr fp_gipa);
|
|
|
|
// Loader core instance terminators
|
|
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* pFormatProperties);
|
|
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_GetPhysicalDeviceProperties(
|
|
VkPhysicalDevice physicalDevice,
|
|
VkPhysicalDeviceProperties* pProperties);
|
|
VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceQueueFamilyProperties(
|
|
VkPhysicalDevice physicalDevice,
|
|
uint32_t* pQueueFamilyPropertyCount,
|
|
VkQueueFamilyProperties* pQueueFamilyProperties);
|
|
VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceMemoryProperties(
|
|
VkPhysicalDevice physicalDevice,
|
|
VkPhysicalDeviceMemoryProperties* pMemoryProperties);
|
|
VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL terminator_GetInstanceProcAddr(
|
|
VkInstance instance,
|
|
const char* pName);
|
|
VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDevice(
|
|
VkPhysicalDevice physicalDevice,
|
|
const VkDeviceCreateInfo* pCreateInfo,
|
|
const VkAllocationCallbacks* pAllocator,
|
|
VkDevice* pDevice);
|
|
VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumerateInstanceExtensionProperties(
|
|
const VkEnumerateInstanceExtensionPropertiesChain* chain,
|
|
const char* pLayerName,
|
|
uint32_t* pPropertyCount,
|
|
VkExtensionProperties* pProperties);
|
|
VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumerateDeviceExtensionProperties(
|
|
VkPhysicalDevice physicalDevice,
|
|
const char* pLayerName,
|
|
uint32_t* pPropertyCount,
|
|
VkExtensionProperties* pProperties);
|
|
VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumerateInstanceLayerProperties(
|
|
const VkEnumerateInstanceLayerPropertiesChain* chain,
|
|
uint32_t* pPropertyCount,
|
|
VkLayerProperties* pProperties);
|
|
VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumerateDeviceLayerProperties(
|
|
VkPhysicalDevice physicalDevice,
|
|
uint32_t* pPropertyCount,
|
|
VkLayerProperties* pProperties);
|
|
VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceSparseImageFormatProperties(
|
|
VkPhysicalDevice physicalDevice,
|
|
VkFormat format,
|
|
VkImageType type,
|
|
VkSampleCountFlagBits samples,
|
|
VkImageUsageFlags usage,
|
|
VkImageTiling tiling,
|
|
uint32_t* pPropertyCount,
|
|
VkSparseImageFormatProperties* pProperties);
|
|
|
|
// ICD function pointer dispatch table
|
|
struct loader_icd_term_dispatch {
|
|
|
|
// ---- Core 1_0 commands
|
|
PFN_vkCreateInstance CreateInstance;
|
|
PFN_vkDestroyInstance DestroyInstance;
|
|
PFN_vkEnumeratePhysicalDevices EnumeratePhysicalDevices;
|
|
PFN_vkGetPhysicalDeviceFeatures GetPhysicalDeviceFeatures;
|
|
PFN_vkGetPhysicalDeviceFormatProperties GetPhysicalDeviceFormatProperties;
|
|
PFN_vkGetPhysicalDeviceImageFormatProperties GetPhysicalDeviceImageFormatProperties;
|
|
PFN_vkGetPhysicalDeviceProperties GetPhysicalDeviceProperties;
|
|
PFN_vkGetPhysicalDeviceQueueFamilyProperties GetPhysicalDeviceQueueFamilyProperties;
|
|
PFN_vkGetPhysicalDeviceMemoryProperties GetPhysicalDeviceMemoryProperties;
|
|
PFN_vkGetDeviceProcAddr GetDeviceProcAddr;
|
|
PFN_vkCreateDevice CreateDevice;
|
|
PFN_vkEnumerateInstanceExtensionProperties EnumerateInstanceExtensionProperties;
|
|
PFN_vkEnumerateDeviceExtensionProperties EnumerateDeviceExtensionProperties;
|
|
PFN_vkEnumerateInstanceLayerProperties EnumerateInstanceLayerProperties;
|
|
PFN_vkGetPhysicalDeviceSparseImageFormatProperties GetPhysicalDeviceSparseImageFormatProperties;
|
|
|
|
// ---- VK_KHR_surface extension commands
|
|
PFN_vkDestroySurfaceKHR DestroySurfaceKHR;
|
|
PFN_vkGetPhysicalDeviceSurfaceSupportKHR GetPhysicalDeviceSurfaceSupportKHR;
|
|
PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR GetPhysicalDeviceSurfaceCapabilitiesKHR;
|
|
PFN_vkGetPhysicalDeviceSurfaceFormatsKHR GetPhysicalDeviceSurfaceFormatsKHR;
|
|
PFN_vkGetPhysicalDeviceSurfacePresentModesKHR GetPhysicalDeviceSurfacePresentModesKHR;
|
|
|
|
// ---- VK_KHR_swapchain extension commands
|
|
PFN_vkCreateSwapchainKHR CreateSwapchainKHR;
|
|
|
|
// ---- VK_KHR_display extension commands
|
|
PFN_vkGetPhysicalDeviceDisplayPropertiesKHR GetPhysicalDeviceDisplayPropertiesKHR;
|
|
PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR GetPhysicalDeviceDisplayPlanePropertiesKHR;
|
|
PFN_vkGetDisplayPlaneSupportedDisplaysKHR GetDisplayPlaneSupportedDisplaysKHR;
|
|
PFN_vkGetDisplayModePropertiesKHR GetDisplayModePropertiesKHR;
|
|
PFN_vkCreateDisplayModeKHR CreateDisplayModeKHR;
|
|
PFN_vkGetDisplayPlaneCapabilitiesKHR GetDisplayPlaneCapabilitiesKHR;
|
|
PFN_vkCreateDisplayPlaneSurfaceKHR CreateDisplayPlaneSurfaceKHR;
|
|
|
|
// ---- VK_KHR_display_swapchain extension commands
|
|
PFN_vkCreateSharedSwapchainsKHR CreateSharedSwapchainsKHR;
|
|
|
|
// ---- VK_KHR_xlib_surface extension commands
|
|
#ifdef VK_USE_PLATFORM_XLIB_KHR
|
|
PFN_vkCreateXlibSurfaceKHR CreateXlibSurfaceKHR;
|
|
#endif // VK_USE_PLATFORM_XLIB_KHR
|
|
#ifdef VK_USE_PLATFORM_XLIB_KHR
|
|
PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR GetPhysicalDeviceXlibPresentationSupportKHR;
|
|
#endif // VK_USE_PLATFORM_XLIB_KHR
|
|
|
|
// ---- VK_KHR_xcb_surface extension commands
|
|
#ifdef VK_USE_PLATFORM_XCB_KHR
|
|
PFN_vkCreateXcbSurfaceKHR CreateXcbSurfaceKHR;
|
|
#endif // VK_USE_PLATFORM_XCB_KHR
|
|
#ifdef VK_USE_PLATFORM_XCB_KHR
|
|
PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR GetPhysicalDeviceXcbPresentationSupportKHR;
|
|
#endif // VK_USE_PLATFORM_XCB_KHR
|
|
|
|
// ---- VK_KHR_wayland_surface extension commands
|
|
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
|
|
PFN_vkCreateWaylandSurfaceKHR CreateWaylandSurfaceKHR;
|
|
#endif // VK_USE_PLATFORM_WAYLAND_KHR
|
|
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
|
|
PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR GetPhysicalDeviceWaylandPresentationSupportKHR;
|
|
#endif // VK_USE_PLATFORM_WAYLAND_KHR
|
|
|
|
// ---- VK_KHR_mir_surface extension commands
|
|
#ifdef VK_USE_PLATFORM_MIR_KHR
|
|
PFN_vkCreateMirSurfaceKHR CreateMirSurfaceKHR;
|
|
#endif // VK_USE_PLATFORM_MIR_KHR
|
|
#ifdef VK_USE_PLATFORM_MIR_KHR
|
|
PFN_vkGetPhysicalDeviceMirPresentationSupportKHR GetPhysicalDeviceMirPresentationSupportKHR;
|
|
#endif // VK_USE_PLATFORM_MIR_KHR
|
|
|
|
// ---- VK_KHR_android_surface extension commands
|
|
#ifdef VK_USE_PLATFORM_ANDROID_KHR
|
|
PFN_vkCreateAndroidSurfaceKHR CreateAndroidSurfaceKHR;
|
|
#endif // VK_USE_PLATFORM_ANDROID_KHR
|
|
|
|
// ---- VK_KHR_win32_surface extension commands
|
|
#ifdef VK_USE_PLATFORM_WIN32_KHR
|
|
PFN_vkCreateWin32SurfaceKHR CreateWin32SurfaceKHR;
|
|
#endif // VK_USE_PLATFORM_WIN32_KHR
|
|
#ifdef VK_USE_PLATFORM_WIN32_KHR
|
|
PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR GetPhysicalDeviceWin32PresentationSupportKHR;
|
|
#endif // VK_USE_PLATFORM_WIN32_KHR
|
|
|
|
// ---- VK_KHR_get_physical_device_properties2 extension commands
|
|
PFN_vkGetPhysicalDeviceFeatures2KHR GetPhysicalDeviceFeatures2KHR;
|
|
PFN_vkGetPhysicalDeviceProperties2KHR GetPhysicalDeviceProperties2KHR;
|
|
PFN_vkGetPhysicalDeviceFormatProperties2KHR GetPhysicalDeviceFormatProperties2KHR;
|
|
PFN_vkGetPhysicalDeviceImageFormatProperties2KHR GetPhysicalDeviceImageFormatProperties2KHR;
|
|
PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR GetPhysicalDeviceQueueFamilyProperties2KHR;
|
|
PFN_vkGetPhysicalDeviceMemoryProperties2KHR GetPhysicalDeviceMemoryProperties2KHR;
|
|
PFN_vkGetPhysicalDeviceSparseImageFormatProperties2KHR GetPhysicalDeviceSparseImageFormatProperties2KHR;
|
|
|
|
// ---- VK_KHR_external_memory_capabilities extension commands
|
|
PFN_vkGetPhysicalDeviceExternalBufferPropertiesKHR GetPhysicalDeviceExternalBufferPropertiesKHR;
|
|
|
|
// ---- VK_KHR_external_semaphore_capabilities extension commands
|
|
PFN_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR GetPhysicalDeviceExternalSemaphorePropertiesKHR;
|
|
|
|
// ---- VK_KHR_external_fence_capabilities extension commands
|
|
PFN_vkGetPhysicalDeviceExternalFencePropertiesKHR GetPhysicalDeviceExternalFencePropertiesKHR;
|
|
|
|
// ---- VK_KHR_get_surface_capabilities2 extension commands
|
|
PFN_vkGetPhysicalDeviceSurfaceCapabilities2KHR GetPhysicalDeviceSurfaceCapabilities2KHR;
|
|
PFN_vkGetPhysicalDeviceSurfaceFormats2KHR GetPhysicalDeviceSurfaceFormats2KHR;
|
|
|
|
// ---- VK_EXT_debug_report extension commands
|
|
PFN_vkCreateDebugReportCallbackEXT CreateDebugReportCallbackEXT;
|
|
PFN_vkDestroyDebugReportCallbackEXT DestroyDebugReportCallbackEXT;
|
|
PFN_vkDebugReportMessageEXT DebugReportMessageEXT;
|
|
|
|
// ---- VK_EXT_debug_marker extension commands
|
|
PFN_vkDebugMarkerSetObjectTagEXT DebugMarkerSetObjectTagEXT;
|
|
PFN_vkDebugMarkerSetObjectNameEXT DebugMarkerSetObjectNameEXT;
|
|
|
|
// ---- VK_NV_external_memory_capabilities extension commands
|
|
PFN_vkGetPhysicalDeviceExternalImageFormatPropertiesNV GetPhysicalDeviceExternalImageFormatPropertiesNV;
|
|
|
|
// ---- VK_KHX_device_group extension commands
|
|
PFN_vkGetDeviceGroupSurfacePresentModesKHX GetDeviceGroupSurfacePresentModesKHX;
|
|
PFN_vkGetPhysicalDevicePresentRectanglesKHX GetPhysicalDevicePresentRectanglesKHX;
|
|
|
|
// ---- VK_NN_vi_surface extension commands
|
|
#ifdef VK_USE_PLATFORM_VI_NN
|
|
PFN_vkCreateViSurfaceNN CreateViSurfaceNN;
|
|
#endif // VK_USE_PLATFORM_VI_NN
|
|
|
|
// ---- VK_KHX_device_group_creation extension commands
|
|
PFN_vkEnumeratePhysicalDeviceGroupsKHX EnumeratePhysicalDeviceGroupsKHX;
|
|
|
|
// ---- VK_NVX_device_generated_commands extension commands
|
|
PFN_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX GetPhysicalDeviceGeneratedCommandsPropertiesNVX;
|
|
|
|
// ---- VK_EXT_direct_mode_display extension commands
|
|
PFN_vkReleaseDisplayEXT ReleaseDisplayEXT;
|
|
|
|
// ---- VK_EXT_acquire_xlib_display extension commands
|
|
#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT
|
|
PFN_vkAcquireXlibDisplayEXT AcquireXlibDisplayEXT;
|
|
#endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT
|
|
#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT
|
|
PFN_vkGetRandROutputDisplayEXT GetRandROutputDisplayEXT;
|
|
#endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT
|
|
|
|
// ---- VK_EXT_display_surface_counter extension commands
|
|
PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT GetPhysicalDeviceSurfaceCapabilities2EXT;
|
|
|
|
// ---- VK_MVK_ios_surface extension commands
|
|
#ifdef VK_USE_PLATFORM_IOS_MVK
|
|
PFN_vkCreateIOSSurfaceMVK CreateIOSSurfaceMVK;
|
|
#endif // VK_USE_PLATFORM_IOS_MVK
|
|
|
|
// ---- VK_MVK_macos_surface extension commands
|
|
#ifdef VK_USE_PLATFORM_MACOS_MVK
|
|
PFN_vkCreateMacOSSurfaceMVK CreateMacOSSurfaceMVK;
|
|
#endif // VK_USE_PLATFORM_MACOS_MVK
|
|
|
|
// ---- VK_EXT_sample_locations extension commands
|
|
PFN_vkGetPhysicalDeviceMultisamplePropertiesEXT GetPhysicalDeviceMultisamplePropertiesEXT;
|
|
};
|
|
|
|
union loader_instance_extension_enables {
|
|
struct {
|
|
uint8_t khr_get_physical_device_properties2 : 1;
|
|
uint8_t khr_external_memory_capabilities : 1;
|
|
uint8_t khr_external_semaphore_capabilities : 1;
|
|
uint8_t khr_external_fence_capabilities : 1;
|
|
uint8_t khr_get_surface_capabilities2 : 1;
|
|
uint8_t ext_debug_report : 1;
|
|
uint8_t nv_external_memory_capabilities : 1;
|
|
uint8_t nn_vi_surface : 1;
|
|
uint8_t khx_device_group_creation : 1;
|
|
uint8_t ext_direct_mode_display : 1;
|
|
uint8_t ext_acquire_xlib_display : 1;
|
|
uint8_t ext_display_surface_counter : 1;
|
|
uint8_t mvk_ios_surface : 1;
|
|
uint8_t mvk_macos_surface : 1;
|
|
};
|
|
uint64_t padding[4];
|
|
};
|
|
|
|
|