From feb98503fecd1c791ef3f179ca01744db1df95dd Mon Sep 17 00:00:00 2001 From: baldurk Date: Sat, 7 May 2016 10:26:32 +0200 Subject: [PATCH] Update vk_layer.h to the latest version --- renderdoc/driver/vulkan/official/vk_layer.h | 75 +++++++++++---------- 1 file changed, 38 insertions(+), 37 deletions(-) diff --git a/renderdoc/driver/vulkan/official/vk_layer.h b/renderdoc/driver/vulkan/official/vk_layer.h index 248704340..cf16b2b7b 100644 --- a/renderdoc/driver/vulkan/official/vk_layer.h +++ b/renderdoc/driver/vulkan/official/vk_layer.h @@ -6,24 +6,17 @@ * Copyright (c) 2015-2016 Valve Corporation * Copyright (c) 2015-2016 LunarG, Inc. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and/or associated documentation files (the "Materials"), to - * deal in the Materials without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Materials, and to permit persons to whom the Materials are - * furnished to do so, subject to the following conditions: + * 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 * - * The above copyright notice(s) and this permission notice shall be included in - * all copies or substantial portions of the Materials. + * http://www.apache.org/licenses/LICENSE-2.0 * - * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE - * USE OR OTHER DEALINGS IN THE MATERIALS. + * 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. * */ @@ -34,7 +27,6 @@ #pragma once #include "vulkan.h" -#include "vk_lunarg_debug_marker.h" #if defined(__GNUC__) && __GNUC__ >= 4 #define VK_LAYER_EXPORT __attribute__((visibility("default"))) #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590) @@ -226,6 +218,20 @@ typedef struct VkLayerInstanceDispatchTable_ { #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; } VkLayerInstanceDispatchTable; // LL node for tree of dbg callback functions @@ -248,24 +254,16 @@ typedef enum VkLayerDbgAction_ { // ------------------------------------------------------------------------------------------------ // CreateInstance and CreateDevice support structures +/* Sub type of structure for instance and device loader ext of CreateInfo. + * When sType == VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO + * or sType == VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO + * then VkLayerFunction indicates struct type pointed to by pNext + */ typedef enum VkLayerFunction_ { VK_LAYER_LINK_INFO = 0, - VK_LAYER_DEVICE_INFO = 1, - VK_LAYER_INSTANCE_INFO = 2 + VK_LOADER_DATA_CALLBACK = 1 } VkLayerFunction; -/* - * When creating the device chain the loader needs to pass - * down information about it's device structure needed at - * the end of the chain. Passing the data via the - * VkLayerInstanceInfo avoids issues with finding the - * exact instance being used. - */ -typedef struct VkLayerInstanceInfo_ { - void *instance_info; - PFN_vkGetInstanceProcAddr pfnNextGetInstanceProcAddr; -} VkLayerInstanceInfo; - typedef struct VkLayerInstanceLink_ { struct VkLayerInstanceLink_ *pNext; PFN_vkGetInstanceProcAddr pfnNextGetInstanceProcAddr; @@ -283,13 +281,18 @@ typedef struct VkLayerDeviceInfo_ { PFN_vkGetInstanceProcAddr pfnNextGetInstanceProcAddr; } VkLayerDeviceInfo; +typedef VkResult (VKAPI_PTR *PFN_vkSetInstanceLoaderData)(VkInstance instance, + void *object); +typedef VkResult (VKAPI_PTR *PFN_vkSetDeviceLoaderData)(VkDevice device, + void *object); + typedef struct { - VkStructureType sType; // VK_STRUCTURE_TYPE_LAYER_INSTANCE_CREATE_INFO + VkStructureType sType; // VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO const void *pNext; VkLayerFunction function; union { VkLayerInstanceLink *pLayerInfo; - VkLayerInstanceInfo instanceInfo; + PFN_vkSetInstanceLoaderData pfnSetInstanceLoaderData; } u; } VkLayerInstanceCreateInfo; @@ -300,14 +303,12 @@ typedef struct VkLayerDeviceLink_ { } VkLayerDeviceLink; typedef struct { - VkStructureType sType; // VK_STRUCTURE_TYPE_LAYER_DEVICE_CREATE_INFO + VkStructureType sType; // VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO const void *pNext; VkLayerFunction function; union { VkLayerDeviceLink *pLayerInfo; - VkLayerDeviceInfo deviceInfo; + PFN_vkSetDeviceLoaderData pfnSetDeviceLoaderData; } u; } VkLayerDeviceCreateInfo; -// ------------------------------------------------------------------------------------------------ -// API functions