Add static Vulkan loader.

Initial Vulkan support for Windows.
Initial Vulkan support for macOS.
This commit is contained in:
bruvzg 2019-06-22 19:34:26 +03:00
parent 4fe3ee1730
commit eb48be51db
120 changed files with 142158 additions and 357 deletions

View File

@ -34,7 +34,7 @@ matrix:
- name: Linux editor (debug, GCC 9, with Mono)
stage: build
env: PLATFORM=x11 TOOLS=yes TARGET=debug CACHE_NAME=${PLATFORM}-tools-mono-gcc-9 MATRIX_EVAL="CC=gcc-9 && CXX=g++-9" EXTRA_ARGS="module_mono_enabled=yes mono_glue=no warnings=extra werror=yes"
env: PLATFORM=x11 TOOLS=yes TARGET=debug CACHE_NAME=${PLATFORM}-tools-mono-gcc-9 MATRIX_EVAL="CC=gcc-9 && CXX=g++-9" EXTRA_ARGS="module_mono_enabled=yes mono_glue=no warnings=extra"
os: linux
compiler: gcc-9
addons:
@ -49,7 +49,7 @@ matrix:
- name: Linux export template (release, Clang)
stage: build
env: PLATFORM=x11 TOOLS=no TARGET=release CACHE_NAME=${PLATFORM}-clang EXTRA_ARGS="warnings=extra werror=yes"
env: PLATFORM=x11 TOOLS=no TARGET=release CACHE_NAME=${PLATFORM}-clang EXTRA_ARGS="warnings=extra"
os: linux
compiler: clang
addons:
@ -57,15 +57,17 @@ matrix:
packages:
- *linux_deps
- name: Android export template (release_debug, Clang)
stage: build
env: PLATFORM=android TOOLS=no TARGET=release_debug CACHE_NAME=${PLATFORM}-clang EXTRA_ARGS="warnings=extra werror=yes"
os: linux
compiler: clang
addons:
apt:
packages:
- openjdk-8-jdk
# TODO: Android support
# - name: Android export template (release_debug, Clang)
# stage: build
# env: PLATFORM=android TOOLS=no TARGET=release_debug CACHE_NAME=${PLATFORM}-clang EXTRA_ARGS="warnings=extra werror=yes"
# os: linux
# compiler: clang
# addons:
# apt:
# packages:
# - openjdk-8-jdk
- name: macOS editor (debug, Clang)
stage: build
@ -77,28 +79,32 @@ matrix:
packages:
- scons
- name: iOS export template (debug, Clang)
stage: build
env: PLATFORM=iphone TOOLS=no TARGET=debug CACHE_NAME=${PLATFORM}-clang
os: osx
compiler: clang
addons:
homebrew:
packages:
- scons
# TODO: iOS MoltenVK support
- name: Linux headless editor (release_debug, GCC 9, testing project exporting and script running)
stage: build
env: PLATFORM=server TOOLS=yes TARGET=release_debug CACHE_NAME=${PLATFORM}-tools-gcc-9 MATRIX_EVAL="CC=gcc-9 && CXX=g++-9" EXTRA_ARGS="warnings=extra werror=yes" TEST_PROJECT=yes
os: linux
compiler: gcc-9
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- *gcc9_deps
- *linux_deps
# - name: iOS export template (debug, Clang)
# stage: build
# env: PLATFORM=iphone TOOLS=no TARGET=debug CACHE_NAME=${PLATFORM}-clang
# os: osx
# compiler: clang
# addons:
# homebrew:
# packages:
# - scons
# TODO: Dummy/Offscreen rasterizer
# - name: Linux headless editor (release_debug, GCC 9, testing project exporting and script running)
# stage: build
# env: PLATFORM=server TOOLS=yes TARGET=release_debug CACHE_NAME=${PLATFORM}-tools-gcc-9 MATRIX_EVAL="CC=gcc-9 && CXX=g++-9" EXTRA_ARGS="warnings=extra werror=yes" TEST_PROJECT=yes
# os: linux
# compiler: gcc-9
# addons:
# apt:
# sources:
# - ubuntu-toolchain-r-test
# packages:
# - *gcc9_deps
# - *linux_deps
- name: Linux export template (release_debug, GCC 5, without 3D support)
stage: build

View File

@ -167,6 +167,12 @@ Comment: glad
Copyright: 2013-2019, David Herberth
License: Expat
Files: ./thirdparty/glslang/
Comment: glslang
Copyright: 2015-2018 Google, Inc.
2002, NVIDIA Corporation.
License: glslang
Files: ./thirdparty/jpeg_compressor/
Comment: jpeg-compressor
Copyright: 2012, Rich Geldreich
@ -354,6 +360,13 @@ Copyright: 2011, Khaled Mamou
2003-2009, Erwin Coumans
License: BSD-3-clause
Files: ./thirdparty/vulkan/
Comment: Vulkan Ecosystem Components (Vulkan ICD loader and headers)
Copyright: 2015-2016, The Khronos Group Inc.
2015-2016, Valve Corporation
2015-2016, LunarG, Inc.
License: Apache-2.0
Files: ./thirdparty/wslay/
Comment: Wslay
Copyright: 2011-2015, Tatsuhiro Tsujikawa
@ -882,6 +895,112 @@ License: Expat
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
License: glslang
Here, glslang proper means core GLSL parsing, HLSL parsing, and SPIR-V code
generation. Glslang proper requires use of two licenses, one that covers
non-preprocessing and an additional one that covers preprocessing.
.
Bison was removed long ago. You can build glslang from the source grammar,
using tools of your choice, without using bison or any bison files.
.
Other parts, outside of glslang proper, include:
.
- gl_types.h, only needed for OpenGL-like reflection, and can be left out of
a parse and codegen project. See it for its license.
.
- update_glslang_sources.py, which is not part of the project proper and does
not need to be used.
.
- the SPIR-V "remapper", which is optional, but has the same license as
glslang proper
.
- Google tests and SPIR-V tools, and anything in the external subdirectory
are external and optional; see them for their respective licenses.
.
--------------------------------------------------------------------------------
.
The core of glslang-proper, minus the preprocessor is licenced as follows:
.
Copyright (C) 2015-2018 Google, Inc.
Copyright (C) <various other dates and companies>
.
All rights reserved.
.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
.
Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
.
Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
.
Neither the name of 3Dlabs Inc. Ltd. nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
.
--------------------------------------------------------------------------------
.
The preprocessor has the core license stated above, plus an additional licence:
.
Copyright (c) 2002, NVIDIA Corporation.
.
NVIDIA Corporation("NVIDIA") supplies this software to you in
consideration of your agreement to the following terms, and your use,
installation, modification or redistribution of this NVIDIA software
constitutes acceptance of these terms. If you do not agree with these
terms, please do not use, install, modify or redistribute this NVIDIA
software.
.
In consideration of your agreement to abide by the following terms, and
subject to these terms, NVIDIA grants you a personal, non-exclusive
license, under NVIDIA's copyrights in this original NVIDIA software (the
"NVIDIA Software"), to use, reproduce, modify and redistribute the
NVIDIA Software, with or without modifications, in source and/or binary
forms; provided that if you redistribute the NVIDIA Software, you must
retain the copyright notice of NVIDIA, this notice and the following
text and disclaimers in all such redistributions of the NVIDIA Software.
Neither the name, trademarks, service marks nor logos of NVIDIA
Corporation may be used to endorse or promote products derived from the
NVIDIA Software without specific prior written permission from NVIDIA.
Except as expressly stated in this notice, no other rights or licenses
express or implied, are granted by NVIDIA herein, including but not
limited to any patent rights that may be infringed by your derivative
works or by other works in which the NVIDIA Software may be
incorporated. No hardware is licensed hereunder.
.
THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED,
INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE,
NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER
PRODUCTS.
.
IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT,
INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY
OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE
NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT,
TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF
NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
License: FTL
The FreeType Project LICENSE
----------------------------

View File

@ -111,6 +111,9 @@ opts.Add('p', "Platform (alias for 'platform')", '')
opts.Add('platform', "Target platform (%s)" % ('|'.join(platform_list), ), '')
opts.Add(EnumVariable('target', "Compilation target", 'debug', ('debug', 'release_debug', 'release')))
opts.Add(EnumVariable('optimize', "Optimization type", 'speed', ('speed', 'size')))
opts.Add(EnumVariable('renderer', "Renderer type", 'vulkan', ('vulkan', 'opengl')))
opts.Add(BoolVariable('tools', "Build the tools (a.k.a. the Godot editor)", True))
opts.Add(BoolVariable('use_lto', 'Use link-time optimization', False))
opts.Add(BoolVariable('use_precise_math_checks', 'Math checks use very precise epsilon (useful to debug the engine)', False))
@ -154,6 +157,7 @@ opts.Add(BoolVariable('builtin_pcre2_with_jit', "Use JIT compiler for the built-
opts.Add(BoolVariable('builtin_recast', "Use the built-in Recast library", True))
opts.Add(BoolVariable('builtin_rvo2', "Use the built-in RVO2 library", True))
opts.Add(BoolVariable('builtin_squish', "Use the built-in squish library", True))
opts.Add(BoolVariable('builtin_vulkan_loader', "Use the built-in Vulkan loader library", True))
opts.Add(BoolVariable('builtin_xatlas', "Use the built-in xatlas library", True))
opts.Add(BoolVariable('builtin_zlib', "Use the built-in zlib library", True))
opts.Add(BoolVariable('builtin_zstd', "Use the built-in Zstd library", True))

View File

@ -106,6 +106,7 @@ public:
enum VideoDriver {
VIDEO_DRIVER_GLES3,
VIDEO_DRIVER_GLES2,
VIDEO_DRIVER_VULKAN,
};
enum PowerState {

View File

@ -689,6 +689,8 @@ int OS::get_video_driver_count() const {
const char *OS::get_video_driver_name(int p_driver) const {
switch (p_driver) {
case VIDEO_DRIVER_VULKAN:
return "Vulkan";
case VIDEO_DRIVER_GLES2:
return "GLES2";
case VIDEO_DRIVER_GLES3:

View File

@ -183,6 +183,7 @@ public:
enum VideoDriver {
VIDEO_DRIVER_GLES3,
VIDEO_DRIVER_GLES2,
VIDEO_DRIVER_VULKAN,
VIDEO_DRIVER_MAX,
};

View File

@ -22,6 +22,9 @@ SConscript('alsamidi/SCsub')
SConscript('coremidi/SCsub')
SConscript('winmidi/SCsub')
if env["builtin_vulkan_loader"] and not (env["platform"]=="osx" and env['use_static_mvk']):
SConscript('vulkan_loader/SCsub')
# Graphics drivers
if (env["platform"] != "server"):
# SConscript('gles3/SCsub')

View File

@ -1,3 +1,33 @@
/*************************************************************************/
/* rendering_device_vulkan.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS 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 */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "rendering_device_vulkan.h"
#include "core/hashfuncs.h"
#include "core/os/file_access.h"

View File

@ -1,3 +1,33 @@
/*************************************************************************/
/* rendering_device_vulkan.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS 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 */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef RENDERING_DEVICE_VULKAN_H
#define RENDERING_DEVICE_VULKAN_H

View File

@ -1,5 +1,37 @@
/*************************************************************************/
/* vk_mem_alloc.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS 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 */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#define VMA_IMPLEMENTATION
#ifdef DEBUG_ENABLED
#ifndef _MSC_VER
#define _DEBUG
#endif
#endif
#include "vk_mem_alloc.h"

View File

@ -1,3 +1,33 @@
/*************************************************************************/
/* vulkan_context.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS 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 */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "vulkan_context.h"
#include "core/print_string.h"
#include "core/project_settings.h"
@ -222,22 +252,23 @@ Error VulkanContext::_create_physical_device() {
String name = "GodotEngine " + String(VERSION_FULL_NAME);
CharString namecs = name.utf8();
const VkApplicationInfo app = {
.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO,
.pNext = NULL,
.pApplicationName = cs.get_data(),
.applicationVersion = 0,
.pEngineName = namecs.get_data(),
.engineVersion = 0,
.apiVersion = VK_API_VERSION_1_0,
/*sType*/ VK_STRUCTURE_TYPE_APPLICATION_INFO,
/*pNext*/ NULL,
/*pApplicationName*/ cs.get_data(),
/*applicationVersion*/ 0,
/*pEngineName*/ namecs.get_data(),
/*engineVersion*/ 0,
/*apiVersion*/ VK_API_VERSION_1_0,
};
VkInstanceCreateInfo inst_info = {
.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO,
.pNext = NULL,
.pApplicationInfo = &app,
.enabledLayerCount = enabled_layer_count,
.ppEnabledLayerNames = (const char *const *)instance_validation_layers,
.enabledExtensionCount = enabled_extension_count,
.ppEnabledExtensionNames = (const char *const *)extension_names,
/*sType*/ VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO,
/*pNext*/ NULL,
/*flags*/ 0,
/*pApplicationInfo*/ &app,
/*enabledLayerCount*/ enabled_layer_count,
/*ppEnabledLayerNames*/ (const char *const *)instance_validation_layers,
/*enabledExtensionCount*/ enabled_extension_count,
/*ppEnabledExtensionNames*/ (const char *const *)extension_names,
};
/*
@ -447,15 +478,17 @@ Error VulkanContext::_create_device() {
queues[0].flags = 0;
VkDeviceCreateInfo sdevice = {
.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO,
.pNext = NULL,
.queueCreateInfoCount = 1,
.pQueueCreateInfos = queues,
.enabledLayerCount = 0,
.ppEnabledLayerNames = NULL,
.enabledExtensionCount = enabled_extension_count,
.ppEnabledExtensionNames = (const char *const *)extension_names,
.pEnabledFeatures = &physical_device_features, // If specific features are required, pass them in here
/*sType*/ VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO,
/*pNext*/ NULL,
/*flags*/ 0,
/*queueCreateInfoCount*/ 1,
/*pQueueCreateInfos*/ queues,
/*enabledLayerCount*/ 0,
/*ppEnabledLayerNames*/ NULL,
/*enabledExtensionCount*/ enabled_extension_count,
/*ppEnabledExtensionNames*/ (const char *const *)extension_names,
/*pEnabledFeatures*/ &physical_device_features, // If specific features are required, pass them in here
};
if (separate_present_queue) {
queues[1].sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO;
@ -579,15 +612,17 @@ Error VulkanContext::_create_semaphores() {
// Create semaphores to synchronize acquiring presentable buffers before
// rendering and waiting for drawing to be complete before presenting
VkSemaphoreCreateInfo semaphoreCreateInfo = {
.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO,
.pNext = NULL,
.flags = 0,
/*sType*/ VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO,
/*pNext*/ NULL,
/*flags*/ 0,
};
// Create fences that we can use to throttle if we get too far
// ahead of the image presents
VkFenceCreateInfo fence_ci = {
.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, .pNext = NULL, .flags = VK_FENCE_CREATE_SIGNALED_BIT
/*sType*/ VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
/*pNext*/ NULL,
/*flags*/ VK_FENCE_CREATE_SIGNALED_BIT
};
for (uint32_t i = 0; i < FRAME_LAG; i++) {
err = vkCreateFence(device, &fence_ci, NULL, &fences[i]);
@ -828,26 +863,27 @@ Error VulkanContext::_update_swap_chain(Window *window) {
}
VkSwapchainCreateInfoKHR swapchain_ci = {
.sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR,
.pNext = NULL,
.surface = window->surface,
.minImageCount = desiredNumOfSwapchainImages,
.imageFormat = format,
.imageColorSpace = color_space,
.imageExtent = {
.width = swapchainExtent.width,
.height = swapchainExtent.height,
/*sType*/ VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR,
/*pNext*/ NULL,
/*flags*/ 0,
/*surface*/ window->surface,
/*minImageCount*/ desiredNumOfSwapchainImages,
/*imageFormat*/ format,
/*imageColorSpace*/ color_space,
/*imageExtent*/ {
/*width*/ swapchainExtent.width,
/*height*/ swapchainExtent.height,
},
.imageArrayLayers = 1,
.imageUsage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT,
.imageSharingMode = VK_SHARING_MODE_EXCLUSIVE,
.queueFamilyIndexCount = 0,
.pQueueFamilyIndices = NULL,
.preTransform = (VkSurfaceTransformFlagBitsKHR)preTransform,
.compositeAlpha = compositeAlpha,
.presentMode = swapchainPresentMode,
.clipped = true,
.oldSwapchain = NULL,
/*imageArrayLayers*/ 1,
/*imageUsage*/ VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT,
/*imageSharingMode*/ VK_SHARING_MODE_EXCLUSIVE,
/*queueFamilyIndexCount*/ 0,
/*pQueueFamilyIndices*/ NULL,
/*preTransform*/ (VkSurfaceTransformFlagBitsKHR)preTransform,
/*compositeAlpha*/ compositeAlpha,
/*presentMode*/ swapchainPresentMode,
/*clipped*/ true,
/*oldSwapchain*/ NULL,
};
err = fpCreateSwapchainKHR(device, &swapchain_ci, NULL, &window->swapchain);
@ -875,18 +911,25 @@ Error VulkanContext::_update_swap_chain(Window *window) {
for (uint32_t i = 0; i < swapchainImageCount; i++) {
VkImageViewCreateInfo color_image_view = {
.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,
.pNext = NULL,
.flags = 0,
.viewType = VK_IMAGE_VIEW_TYPE_2D,
.format = format,
.components = {
.r = VK_COMPONENT_SWIZZLE_R,
.g = VK_COMPONENT_SWIZZLE_G,
.b = VK_COMPONENT_SWIZZLE_B,
.a = VK_COMPONENT_SWIZZLE_A,
/*sType*/ VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,
/*pNext*/ NULL,
/*flags*/ 0,
/*image*/ swapchainImages[i],
/*viewType*/ VK_IMAGE_VIEW_TYPE_2D,
/*format*/ format,
/*components*/ {
/*r*/ VK_COMPONENT_SWIZZLE_R,
/*g*/ VK_COMPONENT_SWIZZLE_G,
/*b*/ VK_COMPONENT_SWIZZLE_B,
/*a*/ VK_COMPONENT_SWIZZLE_A,
},
/*subresourceRange*/ {
/*aspectMask*/ VK_IMAGE_ASPECT_COLOR_BIT,
/*baseMipLevel*/ 0,
/*levelCount*/ 1,
/*baseArrayLayer*/ 0,
/*layerCount*/ 1
},
.subresourceRange = { .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, .baseMipLevel = 0, .levelCount = 1, .baseArrayLayer = 0, .layerCount = 1 },
};
window->swapchain_image_resources[i].image = swapchainImages[i];
@ -906,44 +949,44 @@ Error VulkanContext::_update_swap_chain(Window *window) {
{
const VkAttachmentDescription attachment = {
.flags = 0,
.format = format,
.samples = VK_SAMPLE_COUNT_1_BIT,
.loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR,
.storeOp = VK_ATTACHMENT_STORE_OP_STORE,
.stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE,
.stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE,
.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED,
.finalLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR,
/*flags*/ 0,
/*format*/ format,
/*samples*/ VK_SAMPLE_COUNT_1_BIT,
/*loadOp*/ VK_ATTACHMENT_LOAD_OP_CLEAR,
/*storeOp*/ VK_ATTACHMENT_STORE_OP_STORE,
/*stencilLoadOp*/ VK_ATTACHMENT_LOAD_OP_DONT_CARE,
/*stencilStoreOp*/ VK_ATTACHMENT_STORE_OP_DONT_CARE,
/*initialLayout*/ VK_IMAGE_LAYOUT_UNDEFINED,
/*finalLayout*/ VK_IMAGE_LAYOUT_PRESENT_SRC_KHR,
};
const VkAttachmentReference color_reference = {
.attachment = 0,
.layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
/*attachment*/ 0,
/*layout*/ VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
};
const VkSubpassDescription subpass = {
.flags = 0,
.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS,
.inputAttachmentCount = 0,
.pInputAttachments = NULL,
.colorAttachmentCount = 1,
.pColorAttachments = &color_reference,
.pResolveAttachments = NULL,
.pDepthStencilAttachment = NULL,
.preserveAttachmentCount = 0,
.pPreserveAttachments = NULL,
/*flags*/ 0,
/*pipelineBindPoint*/ VK_PIPELINE_BIND_POINT_GRAPHICS,
/*inputAttachmentCount*/ 0,
/*pInputAttachments*/ NULL,
/*colorAttachmentCount*/ 1,
/*pColorAttachments*/ &color_reference,
/*pResolveAttachments*/ NULL,
/*pDepthStencilAttachment*/ NULL,
/*preserveAttachmentCount*/ 0,
/*pPreserveAttachments*/ NULL,
};
const VkRenderPassCreateInfo rp_info = {
.sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO,
.pNext = NULL,
.flags = 0,
.attachmentCount = 1,
.pAttachments = &attachment,
.subpassCount = 1,
.pSubpasses = &subpass,
.dependencyCount = 0,
.pDependencies = NULL,
/*sTyp*/ VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO,
/*pNext*/ NULL,
/*flags*/ 0,
/*attachmentCount*/ 1,
/*pAttachments*/ &attachment,
/*subpassCount*/ 1,
/*pSubpasses*/ &subpass,
/*dependencyCount*/ 0,
/*pDependencies*/ NULL,
};
err = vkCreateRenderPass(device, &rp_info, NULL, &window->render_pass);
@ -951,14 +994,15 @@ Error VulkanContext::_update_swap_chain(Window *window) {
for (uint32_t i = 0; i < swapchainImageCount; i++) {
const VkFramebufferCreateInfo fb_info = {
.sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO,
.pNext = NULL,
.renderPass = window->render_pass,
.attachmentCount = 1,
.pAttachments = &window->swapchain_image_resources[i].view,
.width = (uint32_t)window->width,
.height = (uint32_t)window->height,
.layers = 1,
/*sType*/ VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO,
/*pNext*/ NULL,
/*flags*/ 0,
/*renderPass*/ window->render_pass,
/*attachmentCount*/ 1,
/*pAttachments*/ &window->swapchain_image_resources[i].view,
/*width*/ (uint32_t)window->width,
/*height*/ (uint32_t)window->height,
/*layers*/ 1,
};
err = vkCreateFramebuffer(device, &fb_info, NULL, &window->swapchain_image_resources[i].framebuffer);
@ -970,19 +1014,19 @@ Error VulkanContext::_update_swap_chain(Window *window) {
if (separate_present_queue) {
const VkCommandPoolCreateInfo present_cmd_pool_info = {
.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO,
.pNext = NULL,
.flags = 0,
.queueFamilyIndex = present_queue_family_index,
/*sType*/ VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO,
/*pNext*/ NULL,
/*flags*/ 0,
/*queueFamilyIndex*/ present_queue_family_index,
};
err = vkCreateCommandPool(device, &present_cmd_pool_info, NULL, &window->present_cmd_pool);
ERR_FAIL_COND_V(err, ERR_CANT_CREATE);
const VkCommandBufferAllocateInfo present_cmd_info = {
.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO,
.pNext = NULL,
.commandPool = window->present_cmd_pool,
.level = VK_COMMAND_BUFFER_LEVEL_PRIMARY,
.commandBufferCount = 1,
/*sType*/ VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO,
/*pNext*/ NULL,
/*commandPool*/ window->present_cmd_pool,
/*level*/ VK_COMMAND_BUFFER_LEVEL_PRIMARY,
/*commandBufferCount*/ 1,
};
for (uint32_t i = 0; i < swapchainImageCount; i++) {
err = vkAllocateCommandBuffers(device, &present_cmd_info,
@ -990,24 +1034,26 @@ Error VulkanContext::_update_swap_chain(Window *window) {
ERR_FAIL_COND_V(err, ERR_CANT_CREATE);
const VkCommandBufferBeginInfo cmd_buf_info = {
.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,
.pNext = NULL,
.flags = VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT,
.pInheritanceInfo = NULL,
/*sType*/ VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,
/*pNext*/ NULL,
/*flags*/ VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT,
/*pInheritanceInfo*/ NULL,
};
err = vkBeginCommandBuffer(window->swapchain_image_resources[i].graphics_to_present_cmd, &cmd_buf_info);
ERR_FAIL_COND_V(err, ERR_CANT_CREATE);
VkImageMemoryBarrier image_ownership_barrier = { .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
.pNext = NULL,
.srcAccessMask = 0,
.dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT,
.oldLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR,
.newLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR,
.srcQueueFamilyIndex = graphics_queue_family_index,
.dstQueueFamilyIndex = present_queue_family_index,
.image = window->swapchain_image_resources[i].image,
.subresourceRange = { VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1 } };
VkImageMemoryBarrier image_ownership_barrier = {
/*sType*/ VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
/*pNext*/ NULL,
/*srcAccessMask*/ 0,
/*dstAccessMask*/ VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT,
/*oldLayout*/ VK_IMAGE_LAYOUT_PRESENT_SRC_KHR,
/*newLayout*/ VK_IMAGE_LAYOUT_PRESENT_SRC_KHR,
/*srcQueueFamilyIndex*/ graphics_queue_family_index,
/*dstQueueFamilyIndex*/ present_queue_family_index,
/*image*/ window->swapchain_image_resources[i].image,
/*subresourceRange*/ { VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1 }
};
vkCmdPipelineBarrier(window->swapchain_image_resources[i].graphics_to_present_cmd, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, 0, 0, NULL, 0, NULL, 1, &image_ownership_barrier);
@ -1233,13 +1279,13 @@ Error VulkanContext::swap_buffers() {
// If we are using separate queues we have to wait for image ownership,
// otherwise wait for draw complete
VkPresentInfoKHR present = {
.sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR,
.pNext = NULL,
.waitSemaphoreCount = 1,
.pWaitSemaphores = (separate_present_queue) ? &image_ownership_semaphores[frame_index] : &draw_complete_semaphores[frame_index],
.swapchainCount = 0,
.pSwapchains = NULL,
.pImageIndices = NULL,
/*sType*/ VK_STRUCTURE_TYPE_PRESENT_INFO_KHR,
/*pNext*/ NULL,
/*waitSemaphoreCount*/ 1,
/*pWaitSemaphores*/ (separate_present_queue) ? &image_ownership_semaphores[frame_index] : &draw_complete_semaphores[frame_index],
/*swapchainCount*/ 0,
/*pSwapchain*/ NULL,
/*pImageIndices*/ NULL,
};
VkSwapchainKHR *pSwapchains = (VkSwapchainKHR *)alloca(sizeof(VkSwapchainKHR *) * windows.size());
@ -1270,21 +1316,21 @@ Error VulkanContext::swap_buffers() {
uint32_t eighthOfWidth = width / 8;
uint32_t eighthOfHeight = height / 8;
VkRectLayerKHR rect = {
.offset.x = eighthOfWidth,
.offset.y = eighthOfHeight,
.extent.width = eighthOfWidth * 6,
.extent.height = eighthOfHeight * 6,
.layer = 0,
/*offset.x*/ eighthOfWidth,
/*offset.y*/ eighthOfHeight,
/*extent.width*/ eighthOfWidth * 6,
/*extent.height*/ eighthOfHeight * 6,
/*layer*/ 0,
};
VkPresentRegionKHR region = {
.rectangleCount = 1,
.pRectangles = &rect,
/*rectangleCount*/ 1,
/*pRectangles*/ &rect,
};
VkPresentRegionsKHR regions = {
.sType = VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR,
.pNext = present.pNext,
.swapchainCount = present.swapchainCount,
.pRegions = &region,
/*sType*/ VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR,
/*pNext*/ present.pNext,
/*swapchainCount*/ present.swapchainCount,
/*pRegions*/ &region,
};
present.pNext = &regions;
}
@ -1316,10 +1362,10 @@ Error VulkanContext::swap_buffers() {
prev_desired_present_time = ptime.desiredPresentTime;
VkPresentTimesInfoGOOGLE present_time = {
.sType = VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE,
.pNext = present.pNext,
.swapchainCount = present.swapchainCount,
.pTimes = &ptime,
/*sType*/ VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE,
/*pNext*/ present.pNext,
/*swapchainCount*/ present.swapchainCount,
/*pTimes*/ &ptime,
};
if (VK_GOOGLE_display_timing_enabled) {
present.pNext = &present_time;
@ -1392,3 +1438,6 @@ VulkanContext::VulkanContext() {
swapchainImageCount = 0;
last_window_id = 0;
}
VulkanContext::~VulkanContext() {
}

View File

@ -1,3 +1,33 @@
/*************************************************************************/
/* vulkan_context.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS 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 */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef VULKAN_CONTEXT_H
#define VULKAN_CONTEXT_H
@ -174,7 +204,9 @@ public:
Error prepare_buffers();
Error swap_buffers();
Error initialize();
VulkanContext();
virtual ~VulkanContext();
};
#endif // VULKAN_DEVICE_H

View File

@ -0,0 +1,55 @@
#!/usr/bin/env python
Import('env')
env_vlk_ldr = env.Clone()
loader_dir = "#thirdparty/vulkan/loader/"
loader_sources = [
"asm_offset.c",
"dev_ext_trampoline.c",
"phys_dev_ext.c",
"cJSON.c",
"loader.c",
"trampoline.c",
"unknown_ext_chain.c",
"wsi.c",
"debug_utils.c",
"extension_manual.c",
"murmurhash.c"
]
if (env_vlk_ldr["platform"]=="windows"):
loader_sources.append("dirent_on_windows.c")
env_vlk_ldr.AppendUnique(CPPDEFINES = [
'VK_USE_PLATFORM_WIN32_KHR',
'VULKAN_NON_CMAKE_BUILD',
'WIN32_LEAN_AND_MEAN',
'API_NAME=\\"%s\\"' % 'Vulkan'
])
if not env.msvc: #windows 7+, missing in mingw headers
env_vlk_ldr.AppendUnique(CPPDEFINES = [
"CM_GETIDLIST_FILTER_CLASS=0x00000200",
"CM_GETIDLIST_FILTER_PRESENT=0x00000100"
])
elif (env_vlk_ldr["platform"]=="osx"):
env_vlk_ldr.AppendUnique(CPPDEFINES = [
'VK_USE_PLATFORM_MACOS_MVK',
'VULKAN_NON_CMAKE_BUILD',
'SYSCONFDIR=\\"%s\\"' % '/etc',
'FALLBACK_DATA_DIRS=\\"%s\\"' % '/usr/local/share:/usr/share',
'FALLBACK_CONFIG_DIRS=\\"%s\\"' % '/etc/xdg'
])
elif (env_vlk_ldr["platform"]=="x11"):
env_vlk_ldr.AppendUnique(CPPDEFINES = [
'VK_USE_PLATFORM_XLIB_KHR',
'VULKAN_NON_CMAKE_BUILD',
'SYSCONFDIR=\\"%s\\"' % '/etc',
'FALLBACK_DATA_DIRS=\\"%s\\"' % '/usr/local/share:/usr/share',
'FALLBACK_CONFIG_DIRS=\\"%s\\"' % '/etc/xdg'
])
loader_sources = [loader_dir + file for file in loader_sources]
env_thirdparty = env_vlk_ldr.Clone()
env_thirdparty.add_source_files(env.drivers_sources, loader_sources)
env.Prepend(CPPPATH=[loader_dir])

View File

@ -5350,6 +5350,8 @@ void EditorNode::_update_video_driver_color() {
video_driver->add_color_override("font_color", Color::hex(0x5586a4ff));
} else if (video_driver->get_text() == "GLES3") {
video_driver->add_color_override("font_color", Color::hex(0xa5557dff));
} else if (video_driver->get_text() == "Vulkan") {
video_driver->add_color_override("font_color", Color::hex(0xad1128ff));
}
}

View File

@ -989,7 +989,9 @@ Error EditorSceneImporterGLTF::_parse_meshes(GLTFState &state) {
Mesh::PRIMITIVE_TRIANGLES,
Mesh::PRIMITIVE_TRIANGLES,
Mesh::PRIMITIVE_TRIANGLES,
#ifndef _MSC_VER
#warning these will have to be decomposed into proper primitive now that lineloop/strip,etc no longer supported
#endif
};
primitive = primitives2[mode];

View File

@ -991,7 +991,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
OS::get_singleton()->set_cmdline(execpath, main_args);
GLOBAL_DEF("rendering/quality/driver/driver_name", "GLES3");
ProjectSettings::get_singleton()->set_custom_property_info("rendering/quality/driver/driver_name", PropertyInfo(Variant::STRING, "rendering/quality/driver/driver_name", PROPERTY_HINT_ENUM, "GLES2,GLES3"));
ProjectSettings::get_singleton()->set_custom_property_info("rendering/quality/driver/driver_name", PropertyInfo(Variant::STRING, "rendering/quality/driver/driver_name", PROPERTY_HINT_ENUM, "GLES2,GLES3,Vulkan"));
if (video_driver == "") {
video_driver = GLOBAL_GET("rendering/quality/driver/driver_name");
}

View File

@ -0,0 +1,7 @@
{
"file_format_version" : "1.0.0",
"ICD": {
"library_path": "../../../Frameworks/libMoltenVK.dylib",
"api_version" : "1.0.0"
}
}

View File

@ -0,0 +1,7 @@
{
"file_format_version" : "1.0.0",
"ICD": {
"library_path": "../../../Frameworks/libMoltenVK.dylib",
"api_version" : "1.0.0"
}
}

View File

@ -286,7 +286,9 @@ void GDAPI godot_arvr_blit(godot_int p_eye, godot_rid *p_render_target, godot_re
screen_rect.size.x /= 2.0;
screen_rect.position.x += screen_rect.size.x;
}
#ifndef _MSC_VER
#warning this needs to be redone
#endif
#if 0
VSG::rasterizer->blit_render_target_to_screen(*render_target, screen_rect, 0);
#endif
@ -298,7 +300,9 @@ godot_int GDAPI godot_arvr_get_texid(godot_rid *p_render_target) {
RID *render_target = (RID *)p_render_target;
RID eye_texture = VSG::storage->render_target_get_texture(*render_target);
#ifndef _MSC_VER
#warning need to obtain this ID again
#endif
uint32_t texid = 0; //VS::get_singleton()->texture_get_texid(eye_texture);
return texid;

View File

@ -9,46 +9,46 @@ env_glslang = env_modules.Clone()
# Not unbundled so far since not widespread as shared library
thirdparty_dir = "#thirdparty/glslang/"
thirdparty_sources = [
"glslang/MachineIndependent/RemoveTree.cpp",
"glslang/MachineIndependent/ParseHelper.cpp",
"glslang/MachineIndependent/iomapper.cpp",
"glslang/MachineIndependent/propagateNoContraction.cpp",
"glslang/MachineIndependent/Intermediate.cpp",
"glslang/MachineIndependent/linkValidate.cpp",
"glslang/MachineIndependent/attribute.cpp",
"glslang/MachineIndependent/Scan.cpp",
"glslang/MachineIndependent/Initialize.cpp",
"glslang/MachineIndependent/Constant.cpp",
"glslang/MachineIndependent/reflection.cpp",
"glslang/MachineIndependent/limits.cpp",
"glslang/MachineIndependent/preprocessor/PpScanner.cpp",
"glslang/MachineIndependent/preprocessor/PpTokens.cpp",
"glslang/MachineIndependent/preprocessor/PpAtom.cpp",
"glslang/MachineIndependent/preprocessor/PpContext.cpp",
"glslang/MachineIndependent/preprocessor/Pp.cpp",
"glslang/MachineIndependent/InfoSink.cpp",
"glslang/MachineIndependent/intermOut.cpp",
"glslang/MachineIndependent/SymbolTable.cpp",
"glslang/MachineIndependent/glslang_tab.cpp",
"glslang/MachineIndependent/pch.cpp",
"glslang/MachineIndependent/Versions.cpp",
"glslang/MachineIndependent/ShaderLang.cpp",
"glslang/MachineIndependent/parseConst.cpp",
"glslang/MachineIndependent/PoolAlloc.cpp",
"glslang/MachineIndependent/ParseContextBase.cpp",
"glslang/MachineIndependent/IntermTraverse.cpp",
"glslang/GenericCodeGen/Link.cpp",
"glslang/GenericCodeGen/CodeGen.cpp",
"OGLCompilersDLL/InitializeDll.cpp",
"SPIRV/InReadableOrder.cpp",
"SPIRV/GlslangToSpv.cpp",
"SPIRV/SpvBuilder.cpp",
"SPIRV/SpvTools.cpp",
"SPIRV/disassemble.cpp",
"SPIRV/doc.cpp",
"SPIRV/SPVRemapper.cpp",
"SPIRV/SpvPostProcess.cpp",
"SPIRV/Logger.cpp"
"glslang/MachineIndependent/RemoveTree.cpp",
"glslang/MachineIndependent/ParseHelper.cpp",
"glslang/MachineIndependent/iomapper.cpp",
"glslang/MachineIndependent/propagateNoContraction.cpp",
"glslang/MachineIndependent/Intermediate.cpp",
"glslang/MachineIndependent/linkValidate.cpp",
"glslang/MachineIndependent/attribute.cpp",
"glslang/MachineIndependent/Scan.cpp",
"glslang/MachineIndependent/Initialize.cpp",
"glslang/MachineIndependent/Constant.cpp",
"glslang/MachineIndependent/reflection.cpp",
"glslang/MachineIndependent/limits.cpp",
"glslang/MachineIndependent/preprocessor/PpScanner.cpp",
"glslang/MachineIndependent/preprocessor/PpTokens.cpp",
"glslang/MachineIndependent/preprocessor/PpAtom.cpp",
"glslang/MachineIndependent/preprocessor/PpContext.cpp",
"glslang/MachineIndependent/preprocessor/Pp.cpp",
"glslang/MachineIndependent/InfoSink.cpp",
"glslang/MachineIndependent/intermOut.cpp",
"glslang/MachineIndependent/SymbolTable.cpp",
"glslang/MachineIndependent/glslang_tab.cpp",
"glslang/MachineIndependent/pch.cpp",
"glslang/MachineIndependent/Versions.cpp",
"glslang/MachineIndependent/ShaderLang.cpp",
"glslang/MachineIndependent/parseConst.cpp",
"glslang/MachineIndependent/PoolAlloc.cpp",
"glslang/MachineIndependent/ParseContextBase.cpp",
"glslang/MachineIndependent/IntermTraverse.cpp",
"glslang/GenericCodeGen/Link.cpp",
"glslang/GenericCodeGen/CodeGen.cpp",
"OGLCompilersDLL/InitializeDll.cpp",
"SPIRV/InReadableOrder.cpp",
"SPIRV/GlslangToSpv.cpp",
"SPIRV/SpvBuilder.cpp",
"SPIRV/SpvTools.cpp",
"SPIRV/disassemble.cpp",
"SPIRV/doc.cpp",
"SPIRV/SPVRemapper.cpp",
"SPIRV/SpvPostProcess.cpp",
"SPIRV/Logger.cpp"
]
if (env["platform"]=="windows"):
@ -64,5 +64,3 @@ env_glslang.add_source_files(env.modules_sources, thirdparty_sources)
env_glslang.add_source_files(env.modules_sources, "*.cpp")
env.Prepend(CPPPATH=[thirdparty_dir])

View File

@ -36,104 +36,111 @@
#include "thirdparty/glslang/glslang/Public/ShaderLang.h"
static const TBuiltInResource default_builtin_resource = {
.maxLights = 32,
.maxClipPlanes = 6,
.maxTextureUnits = 32,
.maxTextureCoords = 32,
.maxVertexAttribs = 64,
.maxVertexUniformComponents = 4096,
.maxVaryingFloats = 64,
.maxVertexTextureImageUnits = 32,
.maxCombinedTextureImageUnits = 80,
.maxTextureImageUnits = 32,
.maxFragmentUniformComponents = 4096,
.maxDrawBuffers = 32,
.maxVertexUniformVectors = 128,
.maxVaryingVectors = 8,
.maxFragmentUniformVectors = 16,
.maxVertexOutputVectors = 16,
.maxFragmentInputVectors = 15,
.minProgramTexelOffset = -8,
.maxProgramTexelOffset = 7,
.maxClipDistances = 8,
.maxComputeWorkGroupCountX = 65535,
.maxComputeWorkGroupCountY = 65535,
.maxComputeWorkGroupCountZ = 65535,
.maxComputeWorkGroupSizeX = 1024,
.maxComputeWorkGroupSizeY = 1024,
.maxComputeWorkGroupSizeZ = 64,
.maxComputeUniformComponents = 1024,
.maxComputeTextureImageUnits = 16,
.maxComputeImageUniforms = 8,
.maxComputeAtomicCounters = 8,
.maxComputeAtomicCounterBuffers = 1,
.maxVaryingComponents = 60,
.maxVertexOutputComponents = 64,
.maxGeometryInputComponents = 64,
.maxGeometryOutputComponents = 128,
.maxFragmentInputComponents = 128,
.maxImageUnits = 8,
.maxCombinedImageUnitsAndFragmentOutputs = 8,
.maxCombinedShaderOutputResources = 8,
.maxImageSamples = 0,
.maxVertexImageUniforms = 0,
.maxTessControlImageUniforms = 0,
.maxTessEvaluationImageUniforms = 0,
.maxGeometryImageUniforms = 0,
.maxFragmentImageUniforms = 8,
.maxCombinedImageUniforms = 8,
.maxGeometryTextureImageUnits = 16,
.maxGeometryOutputVertices = 256,
.maxGeometryTotalOutputComponents = 1024,
.maxGeometryUniformComponents = 1024,
.maxGeometryVaryingComponents = 64,
.maxTessControlInputComponents = 128,
.maxTessControlOutputComponents = 128,
.maxTessControlTextureImageUnits = 16,
.maxTessControlUniformComponents = 1024,
.maxTessControlTotalOutputComponents = 4096,
.maxTessEvaluationInputComponents = 128,
.maxTessEvaluationOutputComponents = 128,
.maxTessEvaluationTextureImageUnits = 16,
.maxTessEvaluationUniformComponents = 1024,
.maxTessPatchComponents = 120,
.maxPatchVertices = 32,
.maxTessGenLevel = 64,
.maxViewports = 16,
.maxVertexAtomicCounters = 0,
.maxTessControlAtomicCounters = 0,
.maxTessEvaluationAtomicCounters = 0,
.maxGeometryAtomicCounters = 0,
.maxFragmentAtomicCounters = 8,
.maxCombinedAtomicCounters = 8,
.maxAtomicCounterBindings = 1,
.maxVertexAtomicCounterBuffers = 0,
.maxTessControlAtomicCounterBuffers = 0,
.maxTessEvaluationAtomicCounterBuffers = 0,
.maxGeometryAtomicCounterBuffers = 0,
.maxFragmentAtomicCounterBuffers = 1,
.maxCombinedAtomicCounterBuffers = 1,
.maxAtomicCounterBufferSize = 16384,
.maxTransformFeedbackBuffers = 4,
.maxTransformFeedbackInterleavedComponents = 64,
.maxCullDistances = 8,
.maxCombinedClipAndCullDistances = 8,
.maxSamples = 4,
.limits = {
.nonInductiveForLoops = 1,
.whileLoops = 1,
.doWhileLoops = 1,
.generalUniformIndexing = 1,
.generalAttributeMatrixVectorIndexing = 1,
.generalVaryingIndexing = 1,
.generalSamplerIndexing = 1,
.generalVariableIndexing = 1,
.generalConstantMatrixVectorIndexing = 1,
/*maxLights*/ 32,
/*maxClipPlanes*/ 6,
/*maxTextureUnits*/ 32,
/*maxTextureCoords*/ 32,
/*maxVertexAttribs*/ 64,
/*maxVertexUniformComponents*/ 4096,
/*maxVaryingFloats*/ 64,
/*maxVertexTextureImageUnits*/ 32,
/*maxCombinedTextureImageUnits*/ 80,
/*maxTextureImageUnits*/ 32,
/*maxFragmentUniformComponents*/ 4096,
/*maxDrawBuffers*/ 32,
/*maxVertexUniformVectors*/ 128,
/*maxVaryingVectors*/ 8,
/*maxFragmentUniformVectors*/ 16,
/*maxVertexOutputVectors*/ 16,
/*maxFragmentInputVectors*/ 15,
/*minProgramTexelOffset*/ -8,
/*maxProgramTexelOffset*/ 7,
/*maxClipDistances*/ 8,
/*maxComputeWorkGroupCountX*/ 65535,
/*maxComputeWorkGroupCountY*/ 65535,
/*maxComputeWorkGroupCountZ*/ 65535,
/*maxComputeWorkGroupSizeX*/ 1024,
/*maxComputeWorkGroupSizeY*/ 1024,
/*maxComputeWorkGroupSizeZ*/ 64,
/*maxComputeUniformComponents*/ 1024,
/*maxComputeTextureImageUnits*/ 16,
/*maxComputeImageUniforms*/ 8,
/*maxComputeAtomicCounters*/ 8,
/*maxComputeAtomicCounterBuffers*/ 1,
/*maxVaryingComponents*/ 60,
/*maxVertexOutputComponents*/ 64,
/*maxGeometryInputComponents*/ 64,
/*maxGeometryOutputComponents*/ 128,
/*maxFragmentInputComponents*/ 128,
/*maxImageUnits*/ 8,
/*maxCombinedImageUnitsAndFragmentOutputs*/ 8,
/*maxCombinedShaderOutputResources*/ 8,
/*maxImageSamples*/ 0,
/*maxVertexImageUniforms*/ 0,
/*maxTessControlImageUniforms*/ 0,
/*maxTessEvaluationImageUniforms*/ 0,
/*maxGeometryImageUniforms*/ 0,
/*maxFragmentImageUniforms*/ 8,
/*maxCombinedImageUniforms*/ 8,
/*maxGeometryTextureImageUnits*/ 16,
/*maxGeometryOutputVertices*/ 256,
/*maxGeometryTotalOutputComponents*/ 1024,
/*maxGeometryUniformComponents*/ 1024,
/*maxGeometryVaryingComponents*/ 64,
/*maxTessControlInputComponents*/ 128,
/*maxTessControlOutputComponents*/ 128,
/*maxTessControlTextureImageUnits*/ 16,
/*maxTessControlUniformComponents*/ 1024,
/*maxTessControlTotalOutputComponents*/ 4096,
/*maxTessEvaluationInputComponents*/ 128,
/*maxTessEvaluationOutputComponents*/ 128,
/*maxTessEvaluationTextureImageUnits*/ 16,
/*maxTessEvaluationUniformComponents*/ 1024,
/*maxTessPatchComponents*/ 120,
/*maxPatchVertices*/ 32,
/*maxTessGenLevel*/ 64,
/*maxViewports*/ 16,
/*maxVertexAtomicCounters*/ 0,
/*maxTessControlAtomicCounters*/ 0,
/*maxTessEvaluationAtomicCounters*/ 0,
/*maxGeometryAtomicCounters*/ 0,
/*maxFragmentAtomicCounters*/ 8,
/*maxCombinedAtomicCounters*/ 8,
/*maxAtomicCounterBindings*/ 1,
/*maxVertexAtomicCounterBuffers*/ 0,
/*maxTessControlAtomicCounterBuffers*/ 0,
/*maxTessEvaluationAtomicCounterBuffers*/ 0,
/*maxGeometryAtomicCounterBuffers*/ 0,
/*maxFragmentAtomicCounterBuffers*/ 1,
/*maxCombinedAtomicCounterBuffers*/ 1,
/*maxAtomicCounterBufferSize*/ 16384,
/*maxTransformFeedbackBuffers*/ 4,
/*maxTransformFeedbackInterleavedComponents*/ 64,
/*maxCullDistances*/ 8,
/*maxCombinedClipAndCullDistances*/ 8,
/*maxSamples*/ 4,
/*maxMeshOutputVerticesNV*/ 0,
/*maxMeshOutputPrimitivesNV*/ 0,
/*maxMeshWorkGroupSizeX_NV*/ 0,
/*maxMeshWorkGroupSizeY_NV*/ 0,
/*maxMeshWorkGroupSizeZ_NV*/ 0,
/*maxTaskWorkGroupSizeX_NV*/ 0,
/*maxTaskWorkGroupSizeY_NV*/ 0,
/*maxTaskWorkGroupSizeZ_NV*/ 0,
/*maxMeshViewCountNV*/ 0,
/*limits*/ {
/*nonInductiveForLoops*/ 1,
/*whileLoops*/ 1,
/*doWhileLoops*/ 1,
/*generalUniformIndexing*/ 1,
/*generalAttributeMatrixVectorIndexing*/ 1,
/*generalVaryingIndexing*/ 1,
/*generalSamplerIndexing*/ 1,
/*generalVariableIndexing*/ 1,
/*generalConstantMatrixVectorIndexing*/ 1,
}
};
static PoolVector<uint8_t> _compile_shader_glsl(RenderingDevice::ShaderStage p_stage, const String &p_source_code, RenderingDevice::ShaderLanguage p_language, String *r_error) {
PoolVector<uint8_t> ret;

View File

@ -15,6 +15,9 @@ files = [
'power_osx.cpp',
]
if (env["renderer"] == "vulkan"):
files += ['vulkan_context_osx.mm']
prog = env.add_program('#bin/godot', files)
if (env["debug_symbols"] == "full" or env["debug_symbols"] == "yes") and env["separate_debug_symbols"]:

View File

@ -1,5 +1,6 @@
import os
import sys
import subprocess
from methods import detect_darwin_sdk_path
@ -25,6 +26,7 @@ def get_opts():
return [
('osxcross_sdk', 'OSXCross SDK version', 'darwin14'),
('MACOS_SDK_PATH', 'Path to the macOS SDK', ''),
BoolVariable('use_static_mvk', 'Link MoltenVK statically as Level-0 driver (better portability) or use Vulkan ICD loader (enables validation layers)', False),
EnumVariable('debug_symbols', 'Add debugging symbols to release builds', 'yes', ('yes', 'no', 'full')),
BoolVariable('separate_debug_symbols', 'Create a separate file containing debugging symbols', False),
BoolVariable('use_ubsan', 'Use LLVM/GCC compiler undefined behavior sanitizer (UBSAN)', False),
@ -148,9 +150,24 @@ def configure(env):
## Flags
env.Prepend(CPPPATH=['#platform/osx'])
env.Append(CPPDEFINES=['OSX_ENABLED', 'UNIX_ENABLED', 'GLES_ENABLED', 'APPLE_STYLE_KEYS', 'COREAUDIO_ENABLED', 'COREMIDI_ENABLED'])
env.Append(LINKFLAGS=['-framework', 'Cocoa', '-framework', 'Carbon', '-framework', 'OpenGL', '-framework', 'AGL', '-framework', 'AudioUnit', '-framework', 'CoreAudio', '-framework', 'CoreMIDI', '-lz', '-framework', 'IOKit', '-framework', 'ForceFeedback', '-framework', 'AVFoundation', '-framework', 'CoreMedia', '-framework', 'CoreVideo'])
env.Append(LIBS=['pthread'])
env.Append(CPPDEFINES=['OSX_ENABLED', 'UNIX_ENABLED', 'APPLE_STYLE_KEYS', 'COREAUDIO_ENABLED', 'COREMIDI_ENABLED'])
env.Append(LINKFLAGS=['-framework', 'Cocoa', '-framework', 'Carbon', '-framework', 'AudioUnit', '-framework', 'CoreAudio', '-framework', 'CoreMIDI', '-framework', 'IOKit', '-framework', 'ForceFeedback', '-framework', 'CoreVideo', '-framework', 'AVFoundation', '-framework', 'CoreMedia'])
env.Append(LIBS=['pthread', 'z'])
if (env["renderer"] == "vulkan"):
env.Prepend(CPPPATH=['#thirdparty/vulkan/include/', "#thirdparty/vulkan/registry/"])
env.Append(CPPDEFINES=['VULKAN_ENABLED'])
env.Append(LINKFLAGS=['-framework', 'Metal', '-framework', 'QuartzCore', '-framework', 'IOSurface'])
if (env['use_static_mvk']):
env.Append(LINKFLAGS=['-framework', 'MoltenVK'])
elif not env["builtin_vulkan_loader"]:
env.Append(LIBS=['vulkan'])
env.Append(CCFLAGS=['-mmacosx-version-min=10.11'])
env.Append(LINKFLAGS=['-mmacosx-version-min=10.11'])
else:
env.Append(CPPDEFINES=['GLES_ENABLED'])
env.Append(LINKFLAGS=['-framework', 'OpenGL', '-framework', 'AGL'])
env.Append(CCFLAGS=['-mmacosx-version-min=10.9'])
env.Append(LINKFLAGS=['-mmacosx-version-min=10.9'])

View File

@ -36,6 +36,12 @@
#include <unistd.h>
int main(int argc, char **argv) {
#if defined(VULKAN_ENABLED)
//MoltenVK - enable full component swizzling support
setenv("MVK_CONFIG_FULL_IMAGE_VIEW_SWIZZLE", "1", 1);
#endif
int first_arg = 1;
const char *dbg_arg = "-NSDocumentRevisionsDebugMode";
printf("arguments\n");

View File

@ -46,6 +46,11 @@
#include "servers/visual/visual_server_wrap_mt.h"
#include "servers/visual_server.h"
#if defined(VULKAN_ENABLED)
#include "drivers/vulkan/rendering_device_vulkan.h"
#include "platform/osx/vulkan_context_osx.h"
#endif
#include <AppKit/AppKit.h>
#include <AppKit/NSCursor.h>
#include <ApplicationServices/ApplicationServices.h>
@ -93,7 +98,6 @@ public:
void process_events();
void process_key_events();
void *framework;
// pthread_key_t current;
bool mouse_grab;
Point2 mouse_pos;
@ -104,8 +108,17 @@ public:
id window_view;
id autoreleasePool;
id cursor;
#if defined(OPENGL_ENABLED)
void *framework;
NSOpenGLPixelFormat *pixelFormat;
NSOpenGLContext *context;
#endif
#if defined(VULKAN_ENABLED)
VulkanContextOSX *context_vulkan;
RenderingDeviceVulkan *rendering_device;
#endif
bool layered_window;

View File

@ -34,11 +34,19 @@
#include "core/print_string.h"
#include "core/version_generated.gen.h"
#include "dir_access_osx.h"
#if defined(OPENGL_ENABLED)
#include "drivers/gles2/rasterizer_gles2.h"
#include "drivers/gles3/rasterizer_gles3.h"
#endif
#if defined(VULKAN_ENABLED)
#include "servers/visual/rasterizer/rasterizer_rd.h"
#endif
#include "main/main.h"
#include "semaphore_osx.h"
#include "servers/visual/visual_server_raster.h"
#include "servers/visual/visual_server_wrap_mt.h"
#include <mach-o/dyld.h>
@ -52,6 +60,9 @@
#include <os/log.h>
#endif
#import <QuartzCore/CAMetalLayer.h>
#include <vulkan/vulkan_metal.h>
#include <dlfcn.h>
#include <fcntl.h>
#include <libproc.h>
@ -336,11 +347,13 @@ static NSCursor *cursorFromSelector(SEL selector, SEL fallback = nil) {
NSWindow *window = (NSWindow *)[notification object];
CGFloat newBackingScaleFactor = [window backingScaleFactor];
CGFloat oldBackingScaleFactor = [[[notification userInfo] objectForKey:@"NSBackingPropertyOldScaleFactorKey"] doubleValue];
#if defined(OPENGL_ENABLED)
if (OS_OSX::singleton->is_hidpi_allowed()) {
[OS_OSX::singleton->window_view setWantsBestResolutionOpenGLSurface:YES];
} else {
[OS_OSX::singleton->window_view setWantsBestResolutionOpenGLSurface:NO];
}
#endif
if (newBackingScaleFactor != oldBackingScaleFactor) {
//Set new display scale and window size
@ -361,7 +374,9 @@ static NSCursor *cursorFromSelector(SEL selector, SEL fallback = nil) {
}
- (void)windowDidResize:(NSNotification *)notification {
#if defined(OPENGL_ENABLED)
[OS_OSX::singleton->context update];
#endif
const NSRect contentRect = [OS_OSX::singleton->window_view frame];
const NSRect fbRect = contentRect;
@ -370,6 +385,12 @@ static NSCursor *cursorFromSelector(SEL selector, SEL fallback = nil) {
OS_OSX::singleton->window_size.width = fbRect.size.width * displayScale;
OS_OSX::singleton->window_size.height = fbRect.size.height * displayScale;
#if defined(VULKAN_ENABLED)
CALayer* layer = [OS_OSX::singleton->window_view layer];
layer.contentsScale = OS_OSX::singleton->_display_scale();
OS_OSX::singleton->context_vulkan->window_resize(0, OS_OSX::singleton->window_size.width, OS_OSX::singleton->window_size.height);
#endif
if (OS_OSX::singleton->main_loop) {
Main::force_redraw();
//Event retrieval blocks until resize is over. Call Main::iteration() directly.
@ -450,8 +471,12 @@ static NSCursor *cursorFromSelector(SEL selector, SEL fallback = nil) {
bool imeInputEventInProgress;
}
- (void)cancelComposition;
- (CALayer*)makeBackingLayer;
- (BOOL)wantsUpdateLayer;
- (void)updateLayer;
@end
@implementation GodotContentView
@ -462,12 +487,28 @@ static NSCursor *cursorFromSelector(SEL selector, SEL fallback = nil) {
}
}
- (BOOL)wantsUpdateLayer {
return YES;
- (CALayer*)makeBackingLayer {
#if defined(VULKAN_ENABLED)
CALayer* layer = [[CAMetalLayer class] layer];
layer.contentsScale = OS_OSX::singleton->_display_scale();
return layer;
#endif
#if defined(OPENGL_ENABLED)
return [super makeBackingLayer];
#endif
}
- (void)updateLayer {
#if defined(OPENGL_ENABLED)
[OS_OSX::singleton->context update];
#endif
#if defined(VULKAN_ENABLED)
[super updateLayer];
#endif
}
- (BOOL)wantsUpdateLayer {
return YES;
}
- (id)init {
@ -1498,7 +1539,9 @@ Error OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
window_size.height = p_desired.height * displayScale;
if (displayScale > 1.0) {
#if defined(OPENGL_ENABLED)
[window_view setWantsBestResolutionOpenGLSurface:YES];
#endif
//if (current_videomode.resizable)
[window_object setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
} else {
@ -1513,13 +1556,16 @@ Error OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
[window_object setRestorable:NO];
#if defined(OPENGL_ENABLED)
framework = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.opengl"));
ERR_FAIL_COND(!framework);
unsigned int attributeCount = 0;
// OS X needs non-zero color size, so set reasonable values
int colorBits = 32;
// Fail if a robustness strategy was requested
#define ADD_ATTR(x) \
{ attributes[attributeCount++] = x; }
#define ADD_ATTR2(x, y) \
@ -1584,6 +1630,7 @@ Error OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
[context makeCurrentContext];
set_use_vsync(p_desired.use_vsync);
#endif
[NSApp activateIgnoringOtherApps:YES];
@ -1596,6 +1643,7 @@ Error OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
/*** END OSX INITIALIZATION ***/
#if defined(OPENGL_ENABLED)
bool gles3 = true;
if (p_video_driver == VIDEO_DRIVER_GLES2) {
gles3 = false;
@ -1640,6 +1688,19 @@ Error OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
}
video_driver_index = p_video_driver;
#endif
#if defined(VULKAN_ENABLED)
video_driver_index = VIDEO_DRIVER_VULKAN;
context_vulkan = memnew(VulkanContextOSX);
context_vulkan->initialize();
context_vulkan->window_create(window_view, get_video_mode().width, get_video_mode().height);
//temporary
rendering_device = memnew(RenderingDeviceVulkan);
rendering_device->initialize(context_vulkan);
RasterizerRD::make_current();
#endif
visual_server = memnew(VisualServerRaster);
if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) {
@ -1684,6 +1745,14 @@ void OS_OSX::finalize() {
cursors_cache.clear();
visual_server->finish();
memdelete(visual_server);
#if defined(VULKAN_ENABLED)
rendering_device->finalize();
memdelete(rendering_device);
memdelete(context_vulkan);
#endif
//memdelete(rasterizer);
}
@ -1916,7 +1985,6 @@ void OS_OSX::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, c
image->lock();
/* Premultiply the alpha channel */
for (int i = 0; i < len; i++) {
int row_index = floor(i / texture_size.width) + atlas_rect.position.y;
int column_index = (i % int(texture_size.width)) + atlas_rect.position.x;
@ -1971,6 +2039,7 @@ void OS_OSX::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, c
cursors_cache.erase(p_shape);
}
}
void OS_OSX::set_mouse_show(bool p_show) {
@ -2228,13 +2297,15 @@ String OS_OSX::get_clipboard() const {
}
void OS_OSX::release_rendering_thread() {
#if defined(OPENGL_ENABLED)
[NSOpenGLContext clearCurrentContext];
#endif
}
void OS_OSX::make_rendering_thread() {
#if defined(OPENGL_ENABLED)
[context makeCurrentContext];
#endif
}
Error OS_OSX::shell_open(String p_uri) {
@ -2250,6 +2321,10 @@ String OS_OSX::get_locale() const {
void OS_OSX::swap_buffers() {
[context flushBuffer];
#endif
#if defined(VULKAN_ENABLED)
context_vulkan->swap_buffers();
#endif
}
void OS_OSX::wm_minimized(bool p_minimized) {
@ -2659,21 +2734,27 @@ void OS_OSX::set_window_per_pixel_transparency_enabled(bool p_enabled) {
if (layered_window != p_enabled) {
if (p_enabled) {
set_borderless_window(true);
GLint opacity = 0;
[window_object setBackgroundColor:[NSColor clearColor]];
[window_object setOpaque:NO];
[window_object setHasShadow:NO];
#if defined(OPENGL_ENABLED)
GLint opacity = 0;
[context setValues:&opacity forParameter:NSOpenGLCPSurfaceOpacity];
#endif
layered_window = true;
} else {
GLint opacity = 1;
[window_object setBackgroundColor:[NSColor colorWithCalibratedWhite:1 alpha:1]];
[window_object setOpaque:YES];
[window_object setHasShadow:YES];
#if defined(OPENGL_ENABLED)
GLint opacity = 1;
[context setValues:&opacity forParameter:NSOpenGLCPSurfaceOpacity];
#endif
layered_window = false;
}
#if defined(OPENGL_ENABLED)
[context update];
#endif
NSRect frame = [window_object frame];
[window_object setFrame:NSMakeRect(frame.origin.x, frame.origin.y, 1, 1) display:YES];
[window_object setFrame:frame display:YES];
@ -3018,16 +3099,6 @@ OS_OSX::OS_OSX() {
CGEventSourceSetLocalEventsSuppressionInterval(eventSource, 0.0);
/*
if (pthread_key_create(&_Godot.nsgl.current, NULL) != 0) {
_GodotInputError(Godot_PLATFORM_ERROR, "NSGL: Failed to create context TLS");
return GL_FALSE;
}
*/
framework = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.opengl"));
ERR_FAIL_COND(!framework);
// Implicitly create shared NSApplication instance
[GodotApplication sharedApplication];

View File

@ -0,0 +1,48 @@
/*************************************************************************/
/* vulkan_context_osx.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS 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 */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef VULKAN_DEVICE_OSX_H
#define VULKAN_DEVICE_OSX_H
#include "drivers/vulkan/vulkan_context.h"
#include <AppKit/AppKit.h>
class VulkanContextOSX : public VulkanContext {
virtual const char *_get_platform_surface_extension() const;
public:
int window_create(id p_window, int p_width, int p_height);
VulkanContextOSX();
~VulkanContextOSX();
};
#endif // VULKAN_DEVICE_OSX_H

View File

@ -0,0 +1,56 @@
/*************************************************************************/
/* vulkan_context_osx.mm */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS 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 */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "vulkan_context_osx.h"
#include <vulkan/vulkan_macos.h>
const char *VulkanContextOSX::_get_platform_surface_extension() const {
return VK_MVK_MACOS_SURFACE_EXTENSION_NAME;
}
int VulkanContextOSX::window_create(id p_window, int p_width, int p_height) {
VkMacOSSurfaceCreateInfoMVK createInfo;
createInfo.sType = VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK;
createInfo.pNext = NULL;
createInfo.flags = 0;
createInfo.pView = p_window;
VkSurfaceKHR surface;
VkResult err = vkCreateMacOSSurfaceMVK(_get_instance(), &createInfo, NULL, &surface);
ERR_FAIL_COND_V(err, -1);
return _window_create(surface, p_width, p_height);
}
VulkanContextOSX::VulkanContextOSX() {
}
VulkanContextOSX::~VulkanContextOSX() {
}

View File

@ -8,7 +8,6 @@ import platform_windows_builders
common_win = [
"godot_windows.cpp",
"context_gl_windows.cpp",
"crash_handler_windows.cpp",
"os_windows.cpp",
"key_mapping_windows.cpp",
@ -17,6 +16,11 @@ common_win = [
"windows_terminal_logger.cpp"
]
if (env["renderer"] == "vulkan"):
common_win += ["vulkan_context_win.cpp"]
else:
common_win += ["context_gl_windows.cpp"]
res_file = 'godot_res.rc'
res_target = "godot_res" + env["OBJSUFFIX"]
res_obj = env.RES(res_target, res_file)

View File

@ -207,7 +207,7 @@ def configure_msvc(env, manual_msvc_config):
else:
print("Missing environment variable: WindowsSdkDir")
env.AppendUnique(CPPDEFINES = ['WINDOWS_ENABLED', 'OPENGL_ENABLED',
env.AppendUnique(CPPDEFINES = ['WINDOWS_ENABLED',
'WASAPI_ENABLED', 'WINMIDI_ENABLED',
'TYPED_METHOD_BIND',
'WIN32', 'MSVC',
@ -219,10 +219,22 @@ def configure_msvc(env, manual_msvc_config):
## Libs
LIBS = ['winmm', 'opengl32', 'dsound', 'kernel32', 'ole32', 'oleaut32',
LIBS = ['winmm', 'dsound', 'kernel32', 'ole32', 'oleaut32',
'user32', 'gdi32', 'IPHLPAPI', 'Shlwapi', 'wsock32', 'Ws2_32',
'shell32', 'advapi32', 'dinput8', 'dxguid', 'imm32', 'bcrypt','Avrt',
'shell32', 'advapi32', 'dinput8', 'dxguid', 'imm32', 'bcrypt', 'Avrt',
'dwmapi']
if (env["renderer"] == "vulkan"):
env.Prepend(CPPPATH=['#thirdparty/vulkan/include/', "#thirdparty/vulkan/registry/"])
env.AppendUnique(CPPDEFINES = ['VULKAN_ENABLED'])
if not env["builtin_vulkan_loader"]:
LIBS += ['vulkan']
else:
LIBS += ['cfgmgr32']
else:
env.AppendUnique(CPPDEFINES = ['OPENGL_ENABLED'])
LIBS += ['opengl32']
env.Append(LINKFLAGS=[p + env["LIBSUFFIX"] for p in LIBS])
if manual_msvc_config:
@ -345,9 +357,21 @@ def configure_mingw(env):
## Compile flags
env.Append(CCFLAGS=['-mwindows'])
env.Append(CPPDEFINES=['WINDOWS_ENABLED', 'OPENGL_ENABLED', 'WASAPI_ENABLED', 'WINMIDI_ENABLED'])
env.Append(CPPDEFINES=['WINDOWS_ENABLED', 'WASAPI_ENABLED', 'WINMIDI_ENABLED'])
env.Append(CPPDEFINES=[('WINVER', env['target_win_version']), ('_WIN32_WINNT', env['target_win_version'])])
env.Append(LIBS=['mingw32', 'opengl32', 'dsound', 'ole32', 'd3d9', 'winmm', 'gdi32', 'iphlpapi', 'shlwapi', 'wsock32', 'ws2_32', 'kernel32', 'oleaut32', 'dinput8', 'dxguid', 'ksuser', 'imm32', 'bcrypt', 'avrt', 'uuid', 'dwmapi'])
env.Append(LIBS=['mingw32', 'dsound', 'ole32', 'd3d9', 'winmm', 'gdi32', 'iphlpapi', 'shlwapi', 'wsock32', 'ws2_32', 'kernel32', 'oleaut32', 'dinput8', 'dxguid', 'ksuser', 'imm32', 'bcrypt', 'avrt', 'uuid', 'dwmapi'])
if (env["renderer"] == "vulkan"):
env.Prepend(CPPPATH=['#thirdparty/vulkan/include/', "#thirdparty/vulkan/registry/"])
env.Append(CPPDEFINES=['VULKAN_ENABLED'])
if not env["builtin_vulkan_loader"]:
env.Append(LIBS=['vulkan'])
else:
env.Append(LIBS=['cfgmgr32'])
else:
env.Append(CPPDEFINES=['OPENGL_ENABLED'])
env.Append(LIBS=['opengl32'])
env.Append(CPPDEFINES=['MINGW_ENABLED', ('MINGW_HAS_SECURE_API', 1)])

View File

@ -35,8 +35,15 @@
#include "core/io/marshalls.h"
#include "core/version_generated.gen.h"
#if defined(OPENGL_ENABLED)
#include "drivers/gles2/rasterizer_gles2.h"
#include "drivers/gles3/rasterizer_gles3.h"
#endif
#if defined(VULKAN_ENABLED)
#include "servers/visual/rasterizer/rasterizer_rd.h"
#endif
#include "drivers/windows/dir_access_windows.h"
#include "drivers/windows/file_access_windows.h"
#include "drivers/windows/mutex_windows.h"
@ -893,6 +900,9 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
preserve_window_size = false;
set_window_size(Size2(video_mode.width, video_mode.height));
}
#if defined(VULKAN_ENABLED)
context_vulkan->window_resize(0, video_mode.width, video_mode.height);
#endif
}
if (wParam == SIZE_MAXIMIZED) {
@ -1489,7 +1499,18 @@ Error OS_Windows::initialize(const VideoMode &p_desired, int p_video_driver, int
gl_context->set_use_vsync(video_mode.use_vsync);
set_vsync_via_compositor(video_mode.vsync_via_compositor);
#endif
#if defined(VULKAN_ENABLED)
video_driver_index = VIDEO_DRIVER_VULKAN;
context_vulkan = memnew(VulkanContextWindows);
context_vulkan->initialize();
context_vulkan->window_create(hWnd, hInstance, get_video_mode().width, get_video_mode().height);
//temporary
rendering_device = memnew(RenderingDeviceVulkan);
rendering_device->initialize(context_vulkan);
RasterizerRD::make_current();
#endif
visual_server = memnew(VisualServerRaster);
if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) {
visual_server = memnew(VisualServerWrapMT(visual_server, get_render_thread_mode() == RENDER_SEPARATE_THREAD));
@ -1665,6 +1686,13 @@ void OS_Windows::finalize() {
memdelete(gl_context);
#endif
#if defined(VULKAN_ENABLED)
rendering_device->finalize();
memdelete(rendering_device);
memdelete(context_vulkan);
#endif
if (user_proc) {
SetWindowLongPtr(hWnd, GWLP_WNDPROC, (LONG_PTR)user_proc);
};
@ -1965,6 +1993,10 @@ void OS_Windows::set_window_size(const Size2 p_size) {
video_mode.width = w;
video_mode.height = h;
#if defined(VULKAN_ENABLED)
context_vulkan->window_resize(0, video_mode.width, video_mode.height);
#endif
if (video_mode.fullscreen) {
return;
}
@ -3121,18 +3153,24 @@ OS::LatinKeyboardVariant OS_Windows::get_latin_keyboard_variant() const {
}
void OS_Windows::release_rendering_thread() {
#if defined(OPENGL_ENABLED)
gl_context->release_current();
#endif
}
void OS_Windows::make_rendering_thread() {
#if defined(OPENGL_ENABLED)
gl_context->make_current();
#endif
}
void OS_Windows::swap_buffers() {
#if defined(OPENGL_ENABLED)
gl_context->swap_buffers();
#endif
#if defined(VULKAN_ENABLED)
context_vulkan->swap_buffers();
#endif
}
void OS_Windows::force_process_input() {
@ -3299,9 +3337,10 @@ String OS_Windows::get_joy_guid(int p_device) const {
}
void OS_Windows::_set_use_vsync(bool p_enable) {
#if defined(OPENGL_ENABLED)
if (gl_context)
gl_context->set_use_vsync(p_enable);
#endif
}
/*
bool OS_Windows::is_vsync_enabled() const {

View File

@ -31,7 +31,6 @@
#ifndef OS_WINDOWS_H
#define OS_WINDOWS_H
#include "context_gl_windows.h"
#include "core/os/input.h"
#include "core/os/os.h"
#include "core/project_settings.h"
@ -49,6 +48,15 @@
#include "drivers/xaudio2/audio_driver_xaudio2.h"
#endif
#if defined(OPENGL_ENABLED)
#include "context_gl_windows.h"
#endif
#if defined(VULKAN_ENABLED)
#include "drivers/vulkan/rendering_device_vulkan.h"
#include "platform/windows/vulkan_context_win.h"
#endif
#include <fcntl.h>
#include <io.h>
#include <stdio.h>
@ -173,6 +181,12 @@ class OS_Windows : public OS {
#if defined(OPENGL_ENABLED)
ContextGL_Windows *gl_context;
#endif
#if defined(VULKAN_ENABLED)
VulkanContextWindows *context_vulkan;
RenderingDeviceVulkan *rendering_device;
#endif
VisualServer *visual_server;
int pressrc;
HINSTANCE hInstance; // Holds The Instance Of The Application

View File

@ -0,0 +1,57 @@
/*************************************************************************/
/* vulkan_context_win.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS 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 */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "vulkan_context_win.h"
#include <vulkan/vulkan_win32.h>
const char *VulkanContextWindows::_get_platform_surface_extension() const {
return VK_KHR_WIN32_SURFACE_EXTENSION_NAME;
}
int VulkanContextWindows::window_create(HWND p_window, HINSTANCE p_instance, int p_width, int p_height) {
VkWin32SurfaceCreateInfoKHR createInfo;
createInfo.sType = VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR;
createInfo.pNext = NULL;
createInfo.flags = 0;
createInfo.hinstance = p_instance;
createInfo.hwnd = p_window;
VkSurfaceKHR surface;
VkResult err = vkCreateWin32SurfaceKHR(_get_instance(), &createInfo, NULL, &surface);
ERR_FAIL_COND_V(err, -1);
return _window_create(surface, p_width, p_height);
}
VulkanContextWindows::VulkanContextWindows() {
}
VulkanContextWindows::~VulkanContextWindows() {
}

View File

@ -0,0 +1,48 @@
/*************************************************************************/
/* vulkan_context_win.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS 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 */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef VULKAN_DEVICE_WIN_H
#define VULKAN_DEVICE_WIN_H
#include "drivers/vulkan/vulkan_context.h"
#include <windows.h>
class VulkanContextWindows : public VulkanContext {
virtual const char *_get_platform_surface_extension() const;
public:
int window_create(HWND p_window, HINSTANCE p_instance, int p_width, int p_height);
VulkanContextWindows();
~VulkanContextWindows();
};
#endif // VULKAN_DEVICE_WIN_H

View File

@ -319,9 +319,17 @@ def configure(env):
env.Prepend(CPPPATH=['#platform/x11'])
env.Append(CPPDEFINES=['X11_ENABLED', 'UNIX_ENABLED'])
if (env["renderer"] == "vulkan"):
env.Prepend(CPPPATH=['#thirdparty/vulkan/include/', "#thirdparty/vulkan/registry/"])
env.Append(CPPDEFINES=['VULKAN_ENABLED'])
if not env["builtin_vulkan_loader"]:
env.Append(LIBS=['vulkan'])
env.Append(LIBS=['GL', 'pthread'])
else:
env.Append(CPPDEFINES=['OPENGL_ENABLED'])
env.Append(LIBS=['GL'])
env.Append(LIBS=['pthread'])
if (platform.system() == "Linux"):
env.Append(LIBS=['dl'])

View File

@ -1,5 +1,36 @@
/*************************************************************************/
/* vulkan_context_x11.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS 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 */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "vulkan_context_x11.h"
#include <vulkan/vulkan_xlib.h>
const char *VulkanContextX11::_get_platform_surface_extension() const {
return VK_KHR_XLIB_SURFACE_EXTENSION_NAME;
}
@ -21,3 +52,6 @@ int VulkanContextX11::window_create(::Window p_window, Display *p_display, int p
VulkanContextX11::VulkanContextX11() {
}
VulkanContextX11::~VulkanContextX11() {
}

View File

@ -1,3 +1,33 @@
/*************************************************************************/
/* vulkan_context_x11.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS 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 */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef VULKAN_DEVICE_X11_H
#define VULKAN_DEVICE_X11_H
@ -12,6 +42,7 @@ public:
int window_create(::Window p_window, Display *p_display, int p_width, int p_height);
VulkanContextX11();
~VulkanContextX11();
};
#endif // VULKAN_DEVICE_X11_H

View File

@ -363,7 +363,9 @@ bool Sprite::is_pixel_opaque(const Point2 &p_point) const {
if (vflip)
q.y = 1.0f - q.y;
q = q * src_rect.size + src_rect.position;
#ifndef _MSC_VER
#warning this need to be obtained from CanvasItem new repeat mode (but it needs to guess it from hierarchy, need to add a function for that)
#endif
bool is_repeat = false;
bool is_mirrored_repeat = false;
if (is_repeat) {

View File

@ -1,3 +1,33 @@
/*************************************************************************/
/* rasterizer_canvas_rd.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS 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 */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "rasterizer_canvas_rd.h"
#include "core/math/math_funcs.h"
#include "core/project_settings.h"
@ -1318,7 +1348,10 @@ void RasterizerCanvasRD::_render_items(RID p_to_render_target, int p_item_count,
clear_colors.push_back(storage->render_target_get_clear_request_color(p_to_render_target));
storage->render_target_disable_clear_request(p_to_render_target);
}
#ifndef _MSC_VER
#warning TODO obtain from framebuffer format eventually when this is implemented
#endif
RD::FramebufferFormatID fb_format = RD::get_singleton()->framebuffer_get_format(framebuffer);
RD::DrawListID draw_list = RD::get_singleton()->draw_list_begin(framebuffer, clear ? RD::INITIAL_ACTION_CLEAR : RD::INITIAL_ACTION_KEEP_COLOR, RD::FINAL_ACTION_READ_COLOR_DISCARD_DEPTH, clear_colors);

View File

@ -1,3 +1,33 @@
/*************************************************************************/
/* rasterizer_canvas_rd.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS 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 */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef RASTERIZER_CANVAS_RD_H
#define RASTERIZER_CANVAS_RD_H
@ -300,11 +330,6 @@ class RasterizerCanvasRD : public RasterizerCanvas {
float direction[2];
float pad[2];
};
struct ShadowFixPushConstant {
float projection[16];
float far;
float pad[3];
};
struct OccluderPolygon {

View File

@ -1,3 +1,33 @@
/*************************************************************************/
/* rasterizer_rd.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS 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 */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "rasterizer_rd.h"
void RasterizerRD::prepare_for_blitting_render_targets() {
@ -53,7 +83,9 @@ void RasterizerRD::begin_frame(double frame_step) {
void RasterizerRD::end_frame(bool p_swap_buffers) {
RD::get_singleton()->finalize_frame();
#ifndef _MSC_VER
#warning not swapping buffers likely not an option for now, find another way
#endif
OS::get_singleton()->swap_buffers(); //probably should pass some bool to avoid display?
RD::get_singleton()->advance_frame(); //advance frame here, so any new call happens on new frame
}

View File

@ -1,3 +1,33 @@
/*************************************************************************/
/* rasterizer_rd.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS 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 */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef RASTERIZER_RD_H
#define RASTERIZER_RD_H

View File

@ -1 +1,31 @@
/*************************************************************************/
/* rasterizer_scene_forward_rd.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS 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 */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "rasterizer_scene_forward_rd.h"

View File

@ -1,3 +1,33 @@
/*************************************************************************/
/* rasterizer_scene_forward_rd.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS 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 */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef RASTERIZER_SCENE_FORWARD_RD_H
#define RASTERIZER_SCENE_FORWARD_RD_H

View File

@ -1,3 +1,33 @@
/*************************************************************************/
/* rasterizer_storage_rd.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS 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 */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "rasterizer_storage_rd.h"
#include "core/engine.h"
#include "core/project_settings.h"
@ -70,7 +100,9 @@ Ref<Image> RasterizerStorageRD::_validate_texture_format(const Ref<Image> &p_ima
} break;
case Image::FORMAT_RGBA5551: {
r_format.format = RD::DATA_FORMAT_A1R5G5B5_UNORM_PACK16;
#ifndef _MSC_VER
#warning TODO needs something in Texture to convert to this format internally
#endif
r_format.swizzle_r = RD::TEXTURE_SWIZZLE_R;
r_format.swizzle_g = RD::TEXTURE_SWIZZLE_G;
r_format.swizzle_b = RD::TEXTURE_SWIZZLE_B;
@ -156,7 +188,9 @@ Ref<Image> RasterizerStorageRD::_validate_texture_format(const Ref<Image> &p_ima
} break;
case Image::FORMAT_RGBE9995: {
r_format.format = RD::DATA_FORMAT_E5B9G9R9_UFLOAT_PACK32;
#ifndef _MSC_VER
#warning TODO need to make a function in Image to swap bits for this
#endif
r_format.swizzle_r = RD::TEXTURE_SWIZZLE_IDENTITY;
r_format.swizzle_g = RD::TEXTURE_SWIZZLE_IDENTITY;
r_format.swizzle_b = RD::TEXTURE_SWIZZLE_IDENTITY;
@ -539,8 +573,9 @@ RID RasterizerStorageRD::texture_2d_create(const Ref<Image> &p_image) {
texture.is_render_target = false;
texture.rd_view = rd_view;
texture.is_proxy = false;
#ifndef _MSC_VER
#warning texture owner needs a spinlock to make this really callable from any thread
#endif
return texture_owner.make_rid(texture);
}

View File

@ -1,3 +1,33 @@
/*************************************************************************/
/* rasterizer_storage_rd.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS 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 */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef RASTERIZER_STORAGE_RD_H
#define RASTERIZER_STORAGE_RD_H

View File

@ -1,3 +1,33 @@
/*************************************************************************/
/* render_pipeline_vertex_format_cache_rd.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS 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 */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "render_pipeline_vertex_format_cache_rd.h"
#include "core/os/memory.h"

View File

@ -1,3 +1,33 @@
/*************************************************************************/
/* render_pipeline_vertex_format_cache_rd.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS 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 */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef RENDER_PIPELINE_CACHE_RD_H
#define RENDER_PIPELINE_CACHE_RD_H

View File

@ -1,3 +1,33 @@
/*************************************************************************/
/* rendering_device.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS 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 */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "rendering_device.h"
RenderingDevice *RenderingDevice::singleton = NULL;

View File

@ -1,3 +1,33 @@
/*************************************************************************/
/* rendering_device.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS 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 */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef RENDERING_DEVICE_H
#define RENDERING_DEVICE_H

View File

@ -678,7 +678,9 @@ void VisualServerViewport::viewport_set_msaa(RID p_viewport, VS::ViewportMSAA p_
Viewport *viewport = viewport_owner.getornull(p_viewport);
ERR_FAIL_COND(!viewport);
#ifndef _MSC_VER
#warning this will no longer go in the render target, but in the 3D view
#endif
//VSG::storage->render_target_set_msaa(viewport->render_target, p_msaa);
}

View File

@ -1633,7 +1633,9 @@ void VisualServer::_bind_methods() {
ClassDB::bind_method(D_METHOD("sync"), &VisualServer::sync);
ClassDB::bind_method(D_METHOD("draw", "swap_buffers", "frame_step"), &VisualServer::draw, DEFVAL(true), DEFVAL(0.0));
#ifndef _MSC_VER
#warning TODO all texture methods need re-binding
#endif
ClassDB::bind_method(D_METHOD("texture_2d_create", "image"), &VisualServer::texture_2d_create);
ClassDB::bind_method(D_METHOD("texture_2d_get", "texture"), &VisualServer::texture_2d_get);
@ -1921,7 +1923,9 @@ void VisualServer::_bind_methods() {
ClassDB::bind_method(D_METHOD("canvas_create"), &VisualServer::canvas_create);
ClassDB::bind_method(D_METHOD("canvas_set_item_mirroring", "canvas", "item", "mirroring"), &VisualServer::canvas_set_item_mirroring);
ClassDB::bind_method(D_METHOD("canvas_set_modulate", "canvas", "color"), &VisualServer::canvas_set_modulate);
#ifndef _MSC_VER
#warning TODO method bindings need to be fixed
#endif
#if 0
ClassDB::bind_method(D_METHOD("canvas_item_create"), &VisualServer::canvas_item_create);

28
thirdparty/README.md vendored
View File

@ -130,6 +130,15 @@ See the header of glad.c for instructions on how to generate them for
the GLES version Godot targets.
## glslang
- Upstream: https://github.com/KhronosGroup/glslang
- Version: rev.3226
- License: glslang
Important: File `glslang/glslang/Include/Common.h` has
Godot-made change marked with `// -- GODOT --` comments.
## jpeg-compressor
- Upstream: https://github.com/richgel999/jpeg-compressor
@ -250,6 +259,25 @@ changes to ensure they build for Javascript/HTML5. Those
changes are marked with `// -- GODOT --` comments.
## Vulkan Ecosystem Components (Vulkan ICD loader and headers)
- Upstream: https://github.com/KhronosGroup/Vulkan-Loader
- Version: 1.1.113
- License: Apache 2.0
## wslay
- Upstream: https://github.com/tatsuhiro-t/wslay
- Version: 1.1.0
- License: MIT
File extracted from upstream release tarball:
- All `*.c` and `*.h` in `lib/` and `lib/includes/`
- `wslay.h` has a small Godot addition to fix MSVC build.
See `thirdparty/wslay/msvcfix.diff`
## mbedtls
- Upstream: https://tls.mbed.org/

108
thirdparty/glslang/LICENSE.txt vendored Normal file
View File

@ -0,0 +1,108 @@
Here, glslang proper means core GLSL parsing, HLSL parsing, and SPIR-V code
generation. Glslang proper requires use of two licenses, one that covers
non-preprocessing and an additional one that covers preprocessing.
Bison was removed long ago. You can build glslang from the source grammar,
using tools of your choice, without using bison or any bison files.
Other parts, outside of glslang proper, include:
- gl_types.h, only needed for OpenGL-like reflection, and can be left out of
a parse and codegen project. See it for its license.
- update_glslang_sources.py, which is not part of the project proper and does
not need to be used.
- the SPIR-V "remapper", which is optional, but has the same license as
glslang proper
- Google tests and SPIR-V tools, and anything in the external subdirectory
are external and optional; see them for their respective licenses.
--------------------------------------------------------------------------------
The core of glslang-proper, minus the preprocessor is licenced as follows:
//
// Copyright (C) 2015-2018 Google, Inc.
// Copyright (C) <various other dates and companies>
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.
//
// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
--------------------------------------------------------------------------------
The preprocessor has the core license stated above, plus an additional licence:
/****************************************************************************\
Copyright (c) 2002, NVIDIA Corporation.
NVIDIA Corporation("NVIDIA") supplies this software to you in
consideration of your agreement to the following terms, and your use,
installation, modification or redistribution of this NVIDIA software
constitutes acceptance of these terms. If you do not agree with these
terms, please do not use, install, modify or redistribute this NVIDIA
software.
In consideration of your agreement to abide by the following terms, and
subject to these terms, NVIDIA grants you a personal, non-exclusive
license, under NVIDIA's copyrights in this original NVIDIA software (the
"NVIDIA Software"), to use, reproduce, modify and redistribute the
NVIDIA Software, with or without modifications, in source and/or binary
forms; provided that if you redistribute the NVIDIA Software, you must
retain the copyright notice of NVIDIA, this notice and the following
text and disclaimers in all such redistributions of the NVIDIA Software.
Neither the name, trademarks, service marks nor logos of NVIDIA
Corporation may be used to endorse or promote products derived from the
NVIDIA Software without specific prior written permission from NVIDIA.
Except as expressly stated in this notice, no other rights or licenses
express or implied, are granted by NVIDIA herein, including but not
limited to any patent rights that may be infringed by your derivative
works or by other works in which the NVIDIA Software may be
incorporated. No hardware is licensed hereunder.
THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED,
INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE,
NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER
PRODUCTS.
IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT,
INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY
OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE
NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT,
TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF
NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\****************************************************************************/

View File

@ -50,7 +50,9 @@ std::string to_string(const T& val) {
}
#endif
#if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/) || defined MINGW_HAS_SECURE_API
// -- GODOT start --
#if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/) /* || defined MINGW_HAS_SECURE_API*/
// -- GODOT end --
#include <basetsd.h>
#ifndef snprintf
#define snprintf sprintf_s

207
thirdparty/vulkan/LICENSE.txt vendored Executable file
View File

@ -0,0 +1,207 @@
The majority of files in this project use the Apache 2.0 License.
There are a few exceptions and their license can be found in the source.
Any license deviations from Apache 2.0 are "more permissive" licenses.
===========================================================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
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.

View File

@ -0,0 +1,175 @@
//
// File: vk_icd.h
//
/*
* 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.
*
*/
#ifndef VKICD_H
#define VKICD_H
#include "vulkan.h"
#include <stdbool.h>
// Loader-ICD version negotiation API. Versions add the following features:
// Version 0 - Initial. Doesn't support vk_icdGetInstanceProcAddr
// or vk_icdNegotiateLoaderICDInterfaceVersion.
// Version 1 - Add support for vk_icdGetInstanceProcAddr.
// Version 2 - Add Loader/ICD Interface version negotiation
// via vk_icdNegotiateLoaderICDInterfaceVersion.
// Version 3 - Add ICD creation/destruction of KHR_surface objects.
// Version 4 - Add unknown physical device extension qyering via
// vk_icdGetPhysicalDeviceProcAddr.
// Version 5 - Tells ICDs that the loader is now paying attention to the
// application version of Vulkan passed into the ApplicationInfo
// structure during vkCreateInstance. This will tell the ICD
// that if the loader is older, it should automatically fail a
// call for any API version > 1.0. Otherwise, the loader will
// manually determine if it can support the expected version.
#define CURRENT_LOADER_ICD_INTERFACE_VERSION 5
#define MIN_SUPPORTED_LOADER_ICD_INTERFACE_VERSION 0
#define MIN_PHYS_DEV_EXTENSION_ICD_INTERFACE_VERSION 4
typedef VkResult(VKAPI_PTR *PFN_vkNegotiateLoaderICDInterfaceVersion)(uint32_t *pVersion);
// This is defined in vk_layer.h which will be found by the loader, but if an ICD is building against this
// file directly, it won't be found.
#ifndef PFN_GetPhysicalDeviceProcAddr
typedef PFN_vkVoidFunction(VKAPI_PTR *PFN_GetPhysicalDeviceProcAddr)(VkInstance instance, const char *pName);
#endif
/*
* The ICD must reserve space for a pointer for the loader's dispatch
* table, at the start of <each object>.
* The ICD must initialize this variable using the SET_LOADER_MAGIC_VALUE macro.
*/
#define ICD_LOADER_MAGIC 0x01CDC0DE
typedef union {
uintptr_t loaderMagic;
void *loaderData;
} VK_LOADER_DATA;
static inline void set_loader_magic_value(void *pNewObject) {
VK_LOADER_DATA *loader_info = (VK_LOADER_DATA *)pNewObject;
loader_info->loaderMagic = ICD_LOADER_MAGIC;
}
static inline bool valid_loader_magic_value(void *pNewObject) {
const VK_LOADER_DATA *loader_info = (VK_LOADER_DATA *)pNewObject;
return (loader_info->loaderMagic & 0xffffffff) == ICD_LOADER_MAGIC;
}
/*
* Windows and Linux ICDs will treat VkSurfaceKHR as a pointer to a struct that
* contains the platform-specific connection and surface information.
*/
typedef enum {
VK_ICD_WSI_PLATFORM_MIR,
VK_ICD_WSI_PLATFORM_WAYLAND,
VK_ICD_WSI_PLATFORM_WIN32,
VK_ICD_WSI_PLATFORM_XCB,
VK_ICD_WSI_PLATFORM_XLIB,
VK_ICD_WSI_PLATFORM_ANDROID,
VK_ICD_WSI_PLATFORM_MACOS,
VK_ICD_WSI_PLATFORM_IOS,
VK_ICD_WSI_PLATFORM_DISPLAY,
VK_ICD_WSI_PLATFORM_HEADLESS
} VkIcdWsiPlatform;
typedef struct {
VkIcdWsiPlatform platform;
} VkIcdSurfaceBase;
#ifdef VK_USE_PLATFORM_MIR_KHR
typedef struct {
VkIcdSurfaceBase base;
MirConnection *connection;
MirSurface *mirSurface;
} VkIcdSurfaceMir;
#endif // VK_USE_PLATFORM_MIR_KHR
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
typedef struct {
VkIcdSurfaceBase base;
struct wl_display *display;
struct wl_surface *surface;
} VkIcdSurfaceWayland;
#endif // VK_USE_PLATFORM_WAYLAND_KHR
#ifdef VK_USE_PLATFORM_WIN32_KHR
typedef struct {
VkIcdSurfaceBase base;
HINSTANCE hinstance;
HWND hwnd;
} VkIcdSurfaceWin32;
#endif // VK_USE_PLATFORM_WIN32_KHR
#ifdef VK_USE_PLATFORM_XCB_KHR
typedef struct {
VkIcdSurfaceBase base;
xcb_connection_t *connection;
xcb_window_t window;
} VkIcdSurfaceXcb;
#endif // VK_USE_PLATFORM_XCB_KHR
#ifdef VK_USE_PLATFORM_XLIB_KHR
typedef struct {
VkIcdSurfaceBase base;
Display *dpy;
Window window;
} VkIcdSurfaceXlib;
#endif // VK_USE_PLATFORM_XLIB_KHR
#ifdef VK_USE_PLATFORM_ANDROID_KHR
typedef struct {
VkIcdSurfaceBase base;
struct ANativeWindow *window;
} VkIcdSurfaceAndroid;
#endif // VK_USE_PLATFORM_ANDROID_KHR
#ifdef VK_USE_PLATFORM_MACOS_MVK
typedef struct {
VkIcdSurfaceBase base;
const void *pView;
} VkIcdSurfaceMacOS;
#endif // VK_USE_PLATFORM_MACOS_MVK
#ifdef VK_USE_PLATFORM_IOS_MVK
typedef struct {
VkIcdSurfaceBase base;
const void *pView;
} VkIcdSurfaceIOS;
#endif // VK_USE_PLATFORM_IOS_MVK
typedef struct {
VkIcdSurfaceBase base;
VkDisplayModeKHR displayMode;
uint32_t planeIndex;
uint32_t planeStackIndex;
VkSurfaceTransformFlagBitsKHR transform;
float globalAlpha;
VkDisplayPlaneAlphaFlagBitsKHR alphaMode;
VkExtent2D imageExtent;
} VkIcdSurfaceDisplay;
typedef struct {
VkIcdSurfaceBase base;
} VkIcdSurfaceHeadless;
#endif // VKICD_H

View File

@ -0,0 +1,202 @@
//
// File: vk_layer.h
//
/*
* 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.
*
*/
/* Need to define dispatch table
* Core struct can then have ptr to dispatch table at the top
* Along with object ptrs for current and next OBJ
*/
#pragma once
#include "vulkan.h"
#if defined(__GNUC__) && __GNUC__ >= 4
#define VK_LAYER_EXPORT __attribute__((visibility("default")))
#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)
#define VK_LAYER_EXPORT __attribute__((visibility("default")))
#else
#define VK_LAYER_EXPORT
#endif
#define MAX_NUM_UNKNOWN_EXTS 250
// Loader-Layer version negotiation API. Versions add the following features:
// Versions 0/1 - Initial. Doesn't support vk_layerGetPhysicalDeviceProcAddr
// or vk_icdNegotiateLoaderLayerInterfaceVersion.
// Version 2 - Add support for vk_layerGetPhysicalDeviceProcAddr and
// vk_icdNegotiateLoaderLayerInterfaceVersion.
#define CURRENT_LOADER_LAYER_INTERFACE_VERSION 2
#define MIN_SUPPORTED_LOADER_LAYER_INTERFACE_VERSION 1
#define VK_CURRENT_CHAIN_VERSION 1
// Typedef for use in the interfaces below
typedef PFN_vkVoidFunction (VKAPI_PTR *PFN_GetPhysicalDeviceProcAddr)(VkInstance instance, const char* pName);
// Version negotiation values
typedef enum VkNegotiateLayerStructType {
LAYER_NEGOTIATE_UNINTIALIZED = 0,
LAYER_NEGOTIATE_INTERFACE_STRUCT = 1,
} VkNegotiateLayerStructType;
// Version negotiation structures
typedef struct VkNegotiateLayerInterface {
VkNegotiateLayerStructType sType;
void *pNext;
uint32_t loaderLayerInterfaceVersion;
PFN_vkGetInstanceProcAddr pfnGetInstanceProcAddr;
PFN_vkGetDeviceProcAddr pfnGetDeviceProcAddr;
PFN_GetPhysicalDeviceProcAddr pfnGetPhysicalDeviceProcAddr;
} VkNegotiateLayerInterface;
// Version negotiation functions
typedef VkResult (VKAPI_PTR *PFN_vkNegotiateLoaderLayerInterfaceVersion)(VkNegotiateLayerInterface *pVersionStruct);
// Function prototype for unknown physical device extension command
typedef VkResult(VKAPI_PTR *PFN_PhysDevExt)(VkPhysicalDevice phys_device);
// ------------------------------------------------------------------------------------------------
// 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_LOADER_DATA_CALLBACK = 1,
VK_LOADER_LAYER_CREATE_DEVICE_CALLBACK = 2
} VkLayerFunction;
typedef struct VkLayerInstanceLink_ {
struct VkLayerInstanceLink_ *pNext;
PFN_vkGetInstanceProcAddr pfnNextGetInstanceProcAddr;
PFN_GetPhysicalDeviceProcAddr pfnNextGetPhysicalDeviceProcAddr;
} VkLayerInstanceLink;
/*
* 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
* VkLayerDeviceInfo avoids issues with finding the
* exact instance being used.
*/
typedef struct VkLayerDeviceInfo_ {
void *device_info;
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 VkResult (VKAPI_PTR *PFN_vkLayerCreateDevice)(VkInstance instance, VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCreateInfo,
const VkAllocationCallbacks *pAllocator, VkDevice *pDevice, PFN_vkGetInstanceProcAddr layerGIPA, PFN_vkGetDeviceProcAddr *nextGDPA);
typedef void (VKAPI_PTR *PFN_vkLayerDestroyDevice)(VkDevice physicalDevice, const VkAllocationCallbacks *pAllocator, PFN_vkDestroyDevice destroyFunction);
typedef struct {
VkStructureType sType; // VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO
const void *pNext;
VkLayerFunction function;
union {
VkLayerInstanceLink *pLayerInfo;
PFN_vkSetInstanceLoaderData pfnSetInstanceLoaderData;
struct {
PFN_vkLayerCreateDevice pfnLayerCreateDevice;
PFN_vkLayerDestroyDevice pfnLayerDestroyDevice;
} layerDevice;
} u;
} VkLayerInstanceCreateInfo;
typedef struct VkLayerDeviceLink_ {
struct VkLayerDeviceLink_ *pNext;
PFN_vkGetInstanceProcAddr pfnNextGetInstanceProcAddr;
PFN_vkGetDeviceProcAddr pfnNextGetDeviceProcAddr;
} VkLayerDeviceLink;
typedef struct {
VkStructureType sType; // VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO
const void *pNext;
VkLayerFunction function;
union {
VkLayerDeviceLink *pLayerInfo;
PFN_vkSetDeviceLoaderData pfnSetDeviceLoaderData;
} u;
} VkLayerDeviceCreateInfo;
#ifdef __cplusplus
extern "C" {
#endif
VKAPI_ATTR VkResult VKAPI_CALL vkNegotiateLoaderLayerInterfaceVersion(VkNegotiateLayerInterface *pVersionStruct);
typedef enum VkChainType {
VK_CHAIN_TYPE_UNKNOWN = 0,
VK_CHAIN_TYPE_ENUMERATE_INSTANCE_EXTENSION_PROPERTIES = 1,
VK_CHAIN_TYPE_ENUMERATE_INSTANCE_LAYER_PROPERTIES = 2,
VK_CHAIN_TYPE_ENUMERATE_INSTANCE_VERSION = 3,
} VkChainType;
typedef struct VkChainHeader {
VkChainType type;
uint32_t version;
uint32_t size;
} VkChainHeader;
typedef struct VkEnumerateInstanceExtensionPropertiesChain {
VkChainHeader header;
VkResult(VKAPI_PTR *pfnNextLayer)(const struct VkEnumerateInstanceExtensionPropertiesChain *, const char *, uint32_t *,
VkExtensionProperties *);
const struct VkEnumerateInstanceExtensionPropertiesChain *pNextLink;
#if defined(__cplusplus)
inline VkResult CallDown(const char *pLayerName, uint32_t *pPropertyCount, VkExtensionProperties *pProperties) const {
return pfnNextLayer(pNextLink, pLayerName, pPropertyCount, pProperties);
}
#endif
} VkEnumerateInstanceExtensionPropertiesChain;
typedef struct VkEnumerateInstanceLayerPropertiesChain {
VkChainHeader header;
VkResult(VKAPI_PTR *pfnNextLayer)(const struct VkEnumerateInstanceLayerPropertiesChain *, uint32_t *, VkLayerProperties *);
const struct VkEnumerateInstanceLayerPropertiesChain *pNextLink;
#if defined(__cplusplus)
inline VkResult CallDown(uint32_t *pPropertyCount, VkLayerProperties *pProperties) const {
return pfnNextLayer(pNextLink, pPropertyCount, pProperties);
}
#endif
} VkEnumerateInstanceLayerPropertiesChain;
typedef struct VkEnumerateInstanceVersionChain {
VkChainHeader header;
VkResult(VKAPI_PTR *pfnNextLayer)(const struct VkEnumerateInstanceVersionChain *, uint32_t *);
const struct VkEnumerateInstanceVersionChain *pNextLink;
#if defined(__cplusplus)
inline VkResult CallDown(uint32_t *pApiVersion) const {
return pfnNextLayer(pNextLink, pApiVersion);
}
#endif
} VkEnumerateInstanceVersionChain;
#ifdef __cplusplus
}
#endif

View File

@ -0,0 +1,92 @@
//
// File: vk_platform.h
//
/*
** Copyright (c) 2014-2017 The Khronos Group 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.
*/
#ifndef VK_PLATFORM_H_
#define VK_PLATFORM_H_
#ifdef __cplusplus
extern "C"
{
#endif // __cplusplus
/*
***************************************************************************************************
* Platform-specific directives and type declarations
***************************************************************************************************
*/
/* Platform-specific calling convention macros.
*
* Platforms should define these so that Vulkan clients call Vulkan commands
* with the same calling conventions that the Vulkan implementation expects.
*
* VKAPI_ATTR - Placed before the return type in function declarations.
* Useful for C++11 and GCC/Clang-style function attribute syntax.
* VKAPI_CALL - Placed after the return type in function declarations.
* Useful for MSVC-style calling convention syntax.
* VKAPI_PTR - Placed between the '(' and '*' in function pointer types.
*
* Function declaration: VKAPI_ATTR void VKAPI_CALL vkCommand(void);
* Function pointer type: typedef void (VKAPI_PTR *PFN_vkCommand)(void);
*/
#if defined(_WIN32)
// On Windows, Vulkan commands use the stdcall convention
#define VKAPI_ATTR
#define VKAPI_CALL __stdcall
#define VKAPI_PTR VKAPI_CALL
#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH < 7
#error "Vulkan isn't supported for the 'armeabi' NDK ABI"
#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7 && defined(__ARM_32BIT_STATE)
// On Android 32-bit ARM targets, Vulkan functions use the "hardfloat"
// calling convention, i.e. float parameters are passed in registers. This
// is true even if the rest of the application passes floats on the stack,
// as it does by default when compiling for the armeabi-v7a NDK ABI.
#define VKAPI_ATTR __attribute__((pcs("aapcs-vfp")))
#define VKAPI_CALL
#define VKAPI_PTR VKAPI_ATTR
#else
// On other platforms, use the default calling convention
#define VKAPI_ATTR
#define VKAPI_CALL
#define VKAPI_PTR
#endif
#include <stddef.h>
#if !defined(VK_NO_STDINT_H)
#if defined(_MSC_VER) && (_MSC_VER < 1600)
typedef signed __int8 int8_t;
typedef unsigned __int8 uint8_t;
typedef signed __int16 int16_t;
typedef unsigned __int16 uint16_t;
typedef signed __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef signed __int64 int64_t;
typedef unsigned __int64 uint64_t;
#else
#include <stdint.h>
#endif
#endif // !defined(VK_NO_STDINT_H)
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
#endif

View File

@ -0,0 +1,69 @@
//
// File: vk_sdk_platform.h
//
/*
* 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.
*/
#ifndef VK_SDK_PLATFORM_H
#define VK_SDK_PLATFORM_H
#if defined(_WIN32)
#define NOMINMAX
#ifndef __cplusplus
#undef inline
#define inline __inline
#endif // __cplusplus
#if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/)
// C99:
// Microsoft didn't implement C99 in Visual Studio; but started adding it with
// VS2013. However, VS2013 still didn't have snprintf(). The following is a
// work-around (Note: The _CRT_SECURE_NO_WARNINGS macro must be set in the
// "CMakeLists.txt" file).
// NOTE: This is fixed in Visual Studio 2015.
#define snprintf _snprintf
#endif
#define strdup _strdup
#endif // _WIN32
// Check for noexcept support using clang, with fallback to Windows or GCC version numbers
#ifndef NOEXCEPT
#if defined(__clang__)
#if __has_feature(cxx_noexcept)
#define HAS_NOEXCEPT
#endif
#else
#if defined(__GXX_EXPERIMENTAL_CXX0X__) && __GNUC__ * 10 + __GNUC_MINOR__ >= 46
#define HAS_NOEXCEPT
#else
#if defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023026 && defined(_HAS_EXCEPTIONS) && _HAS_EXCEPTIONS
#define HAS_NOEXCEPT
#endif
#endif
#endif
#ifdef HAS_NOEXCEPT
#define NOEXCEPT noexcept
#else
#define NOEXCEPT
#endif
#endif
#endif // VK_SDK_PLATFORM_H

View File

@ -0,0 +1,86 @@
#ifndef VULKAN_H_
#define VULKAN_H_ 1
/*
** Copyright (c) 2015-2019 The Khronos Group 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.
*/
#include "vk_platform.h"
#include "vulkan_core.h"
#ifdef VK_USE_PLATFORM_ANDROID_KHR
#include "vulkan_android.h"
#endif
#ifdef VK_USE_PLATFORM_FUCHSIA
#include <zircon/types.h>
#include "vulkan_fuchsia.h"
#endif
#ifdef VK_USE_PLATFORM_IOS_MVK
#include "vulkan_ios.h"
#endif
#ifdef VK_USE_PLATFORM_MACOS_MVK
#include "vulkan_macos.h"
#endif
#ifdef VK_USE_PLATFORM_METAL_EXT
#include "vulkan_metal.h"
#endif
#ifdef VK_USE_PLATFORM_VI_NN
#include "vulkan_vi.h"
#endif
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
#include <wayland-client.h>
#include "vulkan_wayland.h"
#endif
#ifdef VK_USE_PLATFORM_WIN32_KHR
#include <windows.h>
#include "vulkan_win32.h"
#endif
#ifdef VK_USE_PLATFORM_XCB_KHR
#include <xcb/xcb.h>
#include "vulkan_xcb.h"
#endif
#ifdef VK_USE_PLATFORM_XLIB_KHR
#include <X11/Xlib.h>
#include "vulkan_xlib.h"
#endif
#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT
#include <X11/Xlib.h>
#include <X11/extensions/Xrandr.h>
#include "vulkan_xlib_xrandr.h"
#endif
#ifdef VK_USE_PLATFORM_GGP
#include <ggp_c/vulkan_types.h>
#include "vulkan_ggp.h"
#endif
#endif // VULKAN_H_

58712
thirdparty/vulkan/include/vulkan/vulkan.hpp vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,121 @@
#ifndef VULKAN_ANDROID_H_
#define VULKAN_ANDROID_H_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2015-2019 The Khronos Group 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.
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#define VK_KHR_android_surface 1
struct ANativeWindow;
#define VK_KHR_ANDROID_SURFACE_SPEC_VERSION 6
#define VK_KHR_ANDROID_SURFACE_EXTENSION_NAME "VK_KHR_android_surface"
typedef VkFlags VkAndroidSurfaceCreateFlagsKHR;
typedef struct VkAndroidSurfaceCreateInfoKHR {
VkStructureType sType;
const void* pNext;
VkAndroidSurfaceCreateFlagsKHR flags;
struct ANativeWindow* window;
} VkAndroidSurfaceCreateInfoKHR;
typedef VkResult (VKAPI_PTR *PFN_vkCreateAndroidSurfaceKHR)(VkInstance instance, const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateAndroidSurfaceKHR(
VkInstance instance,
const VkAndroidSurfaceCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
#endif
#define VK_ANDROID_external_memory_android_hardware_buffer 1
struct AHardwareBuffer;
#define VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_SPEC_VERSION 3
#define VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_EXTENSION_NAME "VK_ANDROID_external_memory_android_hardware_buffer"
typedef struct VkAndroidHardwareBufferUsageANDROID {
VkStructureType sType;
void* pNext;
uint64_t androidHardwareBufferUsage;
} VkAndroidHardwareBufferUsageANDROID;
typedef struct VkAndroidHardwareBufferPropertiesANDROID {
VkStructureType sType;
void* pNext;
VkDeviceSize allocationSize;
uint32_t memoryTypeBits;
} VkAndroidHardwareBufferPropertiesANDROID;
typedef struct VkAndroidHardwareBufferFormatPropertiesANDROID {
VkStructureType sType;
void* pNext;
VkFormat format;
uint64_t externalFormat;
VkFormatFeatureFlags formatFeatures;
VkComponentMapping samplerYcbcrConversionComponents;
VkSamplerYcbcrModelConversion suggestedYcbcrModel;
VkSamplerYcbcrRange suggestedYcbcrRange;
VkChromaLocation suggestedXChromaOffset;
VkChromaLocation suggestedYChromaOffset;
} VkAndroidHardwareBufferFormatPropertiesANDROID;
typedef struct VkImportAndroidHardwareBufferInfoANDROID {
VkStructureType sType;
const void* pNext;
struct AHardwareBuffer* buffer;
} VkImportAndroidHardwareBufferInfoANDROID;
typedef struct VkMemoryGetAndroidHardwareBufferInfoANDROID {
VkStructureType sType;
const void* pNext;
VkDeviceMemory memory;
} VkMemoryGetAndroidHardwareBufferInfoANDROID;
typedef struct VkExternalFormatANDROID {
VkStructureType sType;
void* pNext;
uint64_t externalFormat;
} VkExternalFormatANDROID;
typedef VkResult (VKAPI_PTR *PFN_vkGetAndroidHardwareBufferPropertiesANDROID)(VkDevice device, const struct AHardwareBuffer* buffer, VkAndroidHardwareBufferPropertiesANDROID* pProperties);
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryAndroidHardwareBufferANDROID)(VkDevice device, const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, struct AHardwareBuffer** pBuffer);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetAndroidHardwareBufferPropertiesANDROID(
VkDevice device,
const struct AHardwareBuffer* buffer,
VkAndroidHardwareBufferPropertiesANDROID* pProperties);
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryAndroidHardwareBufferANDROID(
VkDevice device,
const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo,
struct AHardwareBuffer** pBuffer);
#endif
#ifdef __cplusplus
}
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,56 @@
#ifndef VULKAN_FUCHSIA_H_
#define VULKAN_FUCHSIA_H_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2015-2019 The Khronos Group 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.
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#define VK_FUCHSIA_imagepipe_surface 1
#define VK_FUCHSIA_IMAGEPIPE_SURFACE_SPEC_VERSION 1
#define VK_FUCHSIA_IMAGEPIPE_SURFACE_EXTENSION_NAME "VK_FUCHSIA_imagepipe_surface"
typedef VkFlags VkImagePipeSurfaceCreateFlagsFUCHSIA;
typedef struct VkImagePipeSurfaceCreateInfoFUCHSIA {
VkStructureType sType;
const void* pNext;
VkImagePipeSurfaceCreateFlagsFUCHSIA flags;
zx_handle_t imagePipeHandle;
} VkImagePipeSurfaceCreateInfoFUCHSIA;
typedef VkResult (VKAPI_PTR *PFN_vkCreateImagePipeSurfaceFUCHSIA)(VkInstance instance, const VkImagePipeSurfaceCreateInfoFUCHSIA* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateImagePipeSurfaceFUCHSIA(
VkInstance instance,
const VkImagePipeSurfaceCreateInfoFUCHSIA* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,67 @@
#ifndef VULKAN_GGP_H_
#define VULKAN_GGP_H_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2015-2019 The Khronos Group 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.
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#define VK_GGP_stream_descriptor_surface 1
#define VK_GGP_STREAM_DESCRIPTOR_SURFACE_SPEC_VERSION 1
#define VK_GGP_STREAM_DESCRIPTOR_SURFACE_EXTENSION_NAME "VK_GGP_stream_descriptor_surface"
typedef VkFlags VkStreamDescriptorSurfaceCreateFlagsGGP;
typedef struct VkStreamDescriptorSurfaceCreateInfoGGP {
VkStructureType sType;
const void* pNext;
VkStreamDescriptorSurfaceCreateFlagsGGP flags;
GgpStreamDescriptor streamDescriptor;
} VkStreamDescriptorSurfaceCreateInfoGGP;
typedef VkResult (VKAPI_PTR *PFN_vkCreateStreamDescriptorSurfaceGGP)(VkInstance instance, const VkStreamDescriptorSurfaceCreateInfoGGP* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateStreamDescriptorSurfaceGGP(
VkInstance instance,
const VkStreamDescriptorSurfaceCreateInfoGGP* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
#endif
#define VK_GGP_frame_token 1
#define VK_GGP_FRAME_TOKEN_SPEC_VERSION 1
#define VK_GGP_FRAME_TOKEN_EXTENSION_NAME "VK_GGP_frame_token"
typedef struct VkPresentFrameTokenGGP {
VkStructureType sType;
const void* pNext;
GgpFrameToken frameToken;
} VkPresentFrameTokenGGP;
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,56 @@
#ifndef VULKAN_IOS_H_
#define VULKAN_IOS_H_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2015-2019 The Khronos Group 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.
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#define VK_MVK_ios_surface 1
#define VK_MVK_IOS_SURFACE_SPEC_VERSION 2
#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
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,56 @@
#ifndef VULKAN_MACOS_H_
#define VULKAN_MACOS_H_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2015-2019 The Khronos Group 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.
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#define VK_MVK_macos_surface 1
#define VK_MVK_MACOS_SURFACE_SPEC_VERSION 2
#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
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,63 @@
#ifndef VULKAN_METAL_H_
#define VULKAN_METAL_H_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2015-2019 The Khronos Group 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.
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#define VK_EXT_metal_surface 1
#ifdef __OBJC__
@class CAMetalLayer;
#else
typedef void CAMetalLayer;
#endif
#define VK_EXT_METAL_SURFACE_SPEC_VERSION 1
#define VK_EXT_METAL_SURFACE_EXTENSION_NAME "VK_EXT_metal_surface"
typedef VkFlags VkMetalSurfaceCreateFlagsEXT;
typedef struct VkMetalSurfaceCreateInfoEXT {
VkStructureType sType;
const void* pNext;
VkMetalSurfaceCreateFlagsEXT flags;
const CAMetalLayer* pLayer;
} VkMetalSurfaceCreateInfoEXT;
typedef VkResult (VKAPI_PTR *PFN_vkCreateMetalSurfaceEXT)(VkInstance instance, const VkMetalSurfaceCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateMetalSurfaceEXT(
VkInstance instance,
const VkMetalSurfaceCreateInfoEXT* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,56 @@
#ifndef VULKAN_VI_H_
#define VULKAN_VI_H_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2015-2019 The Khronos Group 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.
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#define VK_NN_vi_surface 1
#define VK_NN_VI_SURFACE_SPEC_VERSION 1
#define VK_NN_VI_SURFACE_EXTENSION_NAME "VK_NN_vi_surface"
typedef VkFlags VkViSurfaceCreateFlagsNN;
typedef struct VkViSurfaceCreateInfoNN {
VkStructureType sType;
const void* pNext;
VkViSurfaceCreateFlagsNN flags;
void* window;
} VkViSurfaceCreateInfoNN;
typedef VkResult (VKAPI_PTR *PFN_vkCreateViSurfaceNN)(VkInstance instance, const VkViSurfaceCreateInfoNN* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateViSurfaceNN(
VkInstance instance,
const VkViSurfaceCreateInfoNN* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,63 @@
#ifndef VULKAN_WAYLAND_H_
#define VULKAN_WAYLAND_H_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2015-2019 The Khronos Group 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.
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#define VK_KHR_wayland_surface 1
#define VK_KHR_WAYLAND_SURFACE_SPEC_VERSION 6
#define VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME "VK_KHR_wayland_surface"
typedef VkFlags VkWaylandSurfaceCreateFlagsKHR;
typedef struct VkWaylandSurfaceCreateInfoKHR {
VkStructureType sType;
const void* pNext;
VkWaylandSurfaceCreateFlagsKHR flags;
struct wl_display* display;
struct wl_surface* surface;
} VkWaylandSurfaceCreateInfoKHR;
typedef VkResult (VKAPI_PTR *PFN_vkCreateWaylandSurfaceKHR)(VkInstance instance, const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, struct wl_display* display);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateWaylandSurfaceKHR(
VkInstance instance,
const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceWaylandPresentationSupportKHR(
VkPhysicalDevice physicalDevice,
uint32_t queueFamilyIndex,
struct wl_display* display);
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,327 @@
#ifndef VULKAN_WIN32_H_
#define VULKAN_WIN32_H_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2015-2019 The Khronos Group 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.
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#define VK_KHR_win32_surface 1
#define VK_KHR_WIN32_SURFACE_SPEC_VERSION 6
#define VK_KHR_WIN32_SURFACE_EXTENSION_NAME "VK_KHR_win32_surface"
typedef VkFlags VkWin32SurfaceCreateFlagsKHR;
typedef struct VkWin32SurfaceCreateInfoKHR {
VkStructureType sType;
const void* pNext;
VkWin32SurfaceCreateFlagsKHR flags;
HINSTANCE hinstance;
HWND hwnd;
} VkWin32SurfaceCreateInfoKHR;
typedef VkResult (VKAPI_PTR *PFN_vkCreateWin32SurfaceKHR)(VkInstance instance, const VkWin32SurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateWin32SurfaceKHR(
VkInstance instance,
const VkWin32SurfaceCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceWin32PresentationSupportKHR(
VkPhysicalDevice physicalDevice,
uint32_t queueFamilyIndex);
#endif
#define VK_KHR_external_memory_win32 1
#define VK_KHR_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1
#define VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_KHR_external_memory_win32"
typedef struct VkImportMemoryWin32HandleInfoKHR {
VkStructureType sType;
const void* pNext;
VkExternalMemoryHandleTypeFlagBits handleType;
HANDLE handle;
LPCWSTR name;
} VkImportMemoryWin32HandleInfoKHR;
typedef struct VkExportMemoryWin32HandleInfoKHR {
VkStructureType sType;
const void* pNext;
const SECURITY_ATTRIBUTES* pAttributes;
DWORD dwAccess;
LPCWSTR name;
} VkExportMemoryWin32HandleInfoKHR;
typedef struct VkMemoryWin32HandlePropertiesKHR {
VkStructureType sType;
void* pNext;
uint32_t memoryTypeBits;
} VkMemoryWin32HandlePropertiesKHR;
typedef struct VkMemoryGetWin32HandleInfoKHR {
VkStructureType sType;
const void* pNext;
VkDeviceMemory memory;
VkExternalMemoryHandleTypeFlagBits handleType;
} VkMemoryGetWin32HandleInfoKHR;
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandleKHR)(VkDevice device, const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle);
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandlePropertiesKHR)(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE handle, VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandleKHR(
VkDevice device,
const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo,
HANDLE* pHandle);
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandlePropertiesKHR(
VkDevice device,
VkExternalMemoryHandleTypeFlagBits handleType,
HANDLE handle,
VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties);
#endif
#define VK_KHR_win32_keyed_mutex 1
#define VK_KHR_WIN32_KEYED_MUTEX_SPEC_VERSION 1
#define VK_KHR_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_KHR_win32_keyed_mutex"
typedef struct VkWin32KeyedMutexAcquireReleaseInfoKHR {
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;
} VkWin32KeyedMutexAcquireReleaseInfoKHR;
#define VK_KHR_external_semaphore_win32 1
#define VK_KHR_EXTERNAL_SEMAPHORE_WIN32_SPEC_VERSION 1
#define VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME "VK_KHR_external_semaphore_win32"
typedef struct VkImportSemaphoreWin32HandleInfoKHR {
VkStructureType sType;
const void* pNext;
VkSemaphore semaphore;
VkSemaphoreImportFlags flags;
VkExternalSemaphoreHandleTypeFlagBits handleType;
HANDLE handle;
LPCWSTR name;
} VkImportSemaphoreWin32HandleInfoKHR;
typedef struct VkExportSemaphoreWin32HandleInfoKHR {
VkStructureType sType;
const void* pNext;
const SECURITY_ATTRIBUTES* pAttributes;
DWORD dwAccess;
LPCWSTR name;
} VkExportSemaphoreWin32HandleInfoKHR;
typedef struct VkD3D12FenceSubmitInfoKHR {
VkStructureType sType;
const void* pNext;
uint32_t waitSemaphoreValuesCount;
const uint64_t* pWaitSemaphoreValues;
uint32_t signalSemaphoreValuesCount;
const uint64_t* pSignalSemaphoreValues;
} VkD3D12FenceSubmitInfoKHR;
typedef struct VkSemaphoreGetWin32HandleInfoKHR {
VkStructureType sType;
const void* pNext;
VkSemaphore semaphore;
VkExternalSemaphoreHandleTypeFlagBits handleType;
} VkSemaphoreGetWin32HandleInfoKHR;
typedef VkResult (VKAPI_PTR *PFN_vkImportSemaphoreWin32HandleKHR)(VkDevice device, const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo);
typedef VkResult (VKAPI_PTR *PFN_vkGetSemaphoreWin32HandleKHR)(VkDevice device, const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkImportSemaphoreWin32HandleKHR(
VkDevice device,
const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo);
VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreWin32HandleKHR(
VkDevice device,
const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo,
HANDLE* pHandle);
#endif
#define VK_KHR_external_fence_win32 1
#define VK_KHR_EXTERNAL_FENCE_WIN32_SPEC_VERSION 1
#define VK_KHR_EXTERNAL_FENCE_WIN32_EXTENSION_NAME "VK_KHR_external_fence_win32"
typedef struct VkImportFenceWin32HandleInfoKHR {
VkStructureType sType;
const void* pNext;
VkFence fence;
VkFenceImportFlags flags;
VkExternalFenceHandleTypeFlagBits handleType;
HANDLE handle;
LPCWSTR name;
} VkImportFenceWin32HandleInfoKHR;
typedef struct VkExportFenceWin32HandleInfoKHR {
VkStructureType sType;
const void* pNext;
const SECURITY_ATTRIBUTES* pAttributes;
DWORD dwAccess;
LPCWSTR name;
} VkExportFenceWin32HandleInfoKHR;
typedef struct VkFenceGetWin32HandleInfoKHR {
VkStructureType sType;
const void* pNext;
VkFence fence;
VkExternalFenceHandleTypeFlagBits handleType;
} VkFenceGetWin32HandleInfoKHR;
typedef VkResult (VKAPI_PTR *PFN_vkImportFenceWin32HandleKHR)(VkDevice device, const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo);
typedef VkResult (VKAPI_PTR *PFN_vkGetFenceWin32HandleKHR)(VkDevice device, const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkImportFenceWin32HandleKHR(
VkDevice device,
const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo);
VKAPI_ATTR VkResult VKAPI_CALL vkGetFenceWin32HandleKHR(
VkDevice device,
const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo,
HANDLE* pHandle);
#endif
#define VK_NV_external_memory_win32 1
#define VK_NV_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1
#define VK_NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_NV_external_memory_win32"
typedef struct VkImportMemoryWin32HandleInfoNV {
VkStructureType sType;
const void* pNext;
VkExternalMemoryHandleTypeFlagsNV handleType;
HANDLE handle;
} VkImportMemoryWin32HandleInfoNV;
typedef struct VkExportMemoryWin32HandleInfoNV {
VkStructureType sType;
const void* pNext;
const SECURITY_ATTRIBUTES* pAttributes;
DWORD dwAccess;
} VkExportMemoryWin32HandleInfoNV;
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandleNV)(VkDevice device, VkDeviceMemory memory, VkExternalMemoryHandleTypeFlagsNV handleType, HANDLE* pHandle);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandleNV(
VkDevice device,
VkDeviceMemory memory,
VkExternalMemoryHandleTypeFlagsNV handleType,
HANDLE* pHandle);
#endif
#define VK_NV_win32_keyed_mutex 1
#define VK_NV_WIN32_KEYED_MUTEX_SPEC_VERSION 1
#define VK_NV_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_NV_win32_keyed_mutex"
typedef struct VkWin32KeyedMutexAcquireReleaseInfoNV {
VkStructureType sType;
const void* pNext;
uint32_t acquireCount;
const VkDeviceMemory* pAcquireSyncs;
const uint64_t* pAcquireKeys;
const uint32_t* pAcquireTimeoutMilliseconds;
uint32_t releaseCount;
const VkDeviceMemory* pReleaseSyncs;
const uint64_t* pReleaseKeys;
} VkWin32KeyedMutexAcquireReleaseInfoNV;
#define VK_EXT_full_screen_exclusive 1
#define VK_EXT_FULL_SCREEN_EXCLUSIVE_SPEC_VERSION 3
#define VK_EXT_FULL_SCREEN_EXCLUSIVE_EXTENSION_NAME "VK_EXT_full_screen_exclusive"
typedef enum VkFullScreenExclusiveEXT {
VK_FULL_SCREEN_EXCLUSIVE_DEFAULT_EXT = 0,
VK_FULL_SCREEN_EXCLUSIVE_ALLOWED_EXT = 1,
VK_FULL_SCREEN_EXCLUSIVE_DISALLOWED_EXT = 2,
VK_FULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT = 3,
VK_FULL_SCREEN_EXCLUSIVE_BEGIN_RANGE_EXT = VK_FULL_SCREEN_EXCLUSIVE_DEFAULT_EXT,
VK_FULL_SCREEN_EXCLUSIVE_END_RANGE_EXT = VK_FULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT,
VK_FULL_SCREEN_EXCLUSIVE_RANGE_SIZE_EXT = (VK_FULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT - VK_FULL_SCREEN_EXCLUSIVE_DEFAULT_EXT + 1),
VK_FULL_SCREEN_EXCLUSIVE_MAX_ENUM_EXT = 0x7FFFFFFF
} VkFullScreenExclusiveEXT;
typedef struct VkSurfaceFullScreenExclusiveInfoEXT {
VkStructureType sType;
void* pNext;
VkFullScreenExclusiveEXT fullScreenExclusive;
} VkSurfaceFullScreenExclusiveInfoEXT;
typedef struct VkSurfaceCapabilitiesFullScreenExclusiveEXT {
VkStructureType sType;
void* pNext;
VkBool32 fullScreenExclusiveSupported;
} VkSurfaceCapabilitiesFullScreenExclusiveEXT;
typedef struct VkSurfaceFullScreenExclusiveWin32InfoEXT {
VkStructureType sType;
const void* pNext;
HMONITOR hmonitor;
} VkSurfaceFullScreenExclusiveWin32InfoEXT;
typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfacePresentModes2EXT)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, uint32_t* pPresentModeCount, VkPresentModeKHR* pPresentModes);
typedef VkResult (VKAPI_PTR *PFN_vkAcquireFullScreenExclusiveModeEXT)(VkDevice device, VkSwapchainKHR swapchain);
typedef VkResult (VKAPI_PTR *PFN_vkReleaseFullScreenExclusiveModeEXT)(VkDevice device, VkSwapchainKHR swapchain);
typedef VkResult (VKAPI_PTR *PFN_vkGetDeviceGroupSurfacePresentModes2EXT)(VkDevice device, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, VkDeviceGroupPresentModeFlagsKHR* pModes);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfacePresentModes2EXT(
VkPhysicalDevice physicalDevice,
const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
uint32_t* pPresentModeCount,
VkPresentModeKHR* pPresentModes);
VKAPI_ATTR VkResult VKAPI_CALL vkAcquireFullScreenExclusiveModeEXT(
VkDevice device,
VkSwapchainKHR swapchain);
VKAPI_ATTR VkResult VKAPI_CALL vkReleaseFullScreenExclusiveModeEXT(
VkDevice device,
VkSwapchainKHR swapchain);
VKAPI_ATTR VkResult VKAPI_CALL vkGetDeviceGroupSurfacePresentModes2EXT(
VkDevice device,
const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
VkDeviceGroupPresentModeFlagsKHR* pModes);
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,64 @@
#ifndef VULKAN_XCB_H_
#define VULKAN_XCB_H_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2015-2019 The Khronos Group 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.
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#define VK_KHR_xcb_surface 1
#define VK_KHR_XCB_SURFACE_SPEC_VERSION 6
#define VK_KHR_XCB_SURFACE_EXTENSION_NAME "VK_KHR_xcb_surface"
typedef VkFlags VkXcbSurfaceCreateFlagsKHR;
typedef struct VkXcbSurfaceCreateInfoKHR {
VkStructureType sType;
const void* pNext;
VkXcbSurfaceCreateFlagsKHR flags;
xcb_connection_t* connection;
xcb_window_t window;
} VkXcbSurfaceCreateInfoKHR;
typedef VkResult (VKAPI_PTR *PFN_vkCreateXcbSurfaceKHR)(VkInstance instance, const VkXcbSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, xcb_connection_t* connection, xcb_visualid_t visual_id);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateXcbSurfaceKHR(
VkInstance instance,
const VkXcbSurfaceCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceXcbPresentationSupportKHR(
VkPhysicalDevice physicalDevice,
uint32_t queueFamilyIndex,
xcb_connection_t* connection,
xcb_visualid_t visual_id);
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,64 @@
#ifndef VULKAN_XLIB_H_
#define VULKAN_XLIB_H_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2015-2019 The Khronos Group 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.
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#define VK_KHR_xlib_surface 1
#define VK_KHR_XLIB_SURFACE_SPEC_VERSION 6
#define VK_KHR_XLIB_SURFACE_EXTENSION_NAME "VK_KHR_xlib_surface"
typedef VkFlags VkXlibSurfaceCreateFlagsKHR;
typedef struct VkXlibSurfaceCreateInfoKHR {
VkStructureType sType;
const void* pNext;
VkXlibSurfaceCreateFlagsKHR flags;
Display* dpy;
Window window;
} VkXlibSurfaceCreateInfoKHR;
typedef VkResult (VKAPI_PTR *PFN_vkCreateXlibSurfaceKHR)(VkInstance instance, const VkXlibSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, Display* dpy, VisualID visualID);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateXlibSurfaceKHR(
VkInstance instance,
const VkXlibSurfaceCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceXlibPresentationSupportKHR(
VkPhysicalDevice physicalDevice,
uint32_t queueFamilyIndex,
Display* dpy,
VisualID visualID);
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,54 @@
#ifndef VULKAN_XLIB_XRANDR_H_
#define VULKAN_XLIB_XRANDR_H_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2015-2019 The Khronos Group 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.
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#define VK_EXT_acquire_xlib_display 1
#define VK_EXT_ACQUIRE_XLIB_DISPLAY_SPEC_VERSION 1
#define VK_EXT_ACQUIRE_XLIB_DISPLAY_EXTENSION_NAME "VK_EXT_acquire_xlib_display"
typedef VkResult (VKAPI_PTR *PFN_vkAcquireXlibDisplayEXT)(VkPhysicalDevice physicalDevice, Display* dpy, VkDisplayKHR display);
typedef VkResult (VKAPI_PTR *PFN_vkGetRandROutputDisplayEXT)(VkPhysicalDevice physicalDevice, Display* dpy, RROutput rrOutput, VkDisplayKHR* pDisplay);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkAcquireXlibDisplayEXT(
VkPhysicalDevice physicalDevice,
Display* dpy,
VkDisplayKHR display);
VKAPI_ATTR VkResult VKAPI_CALL vkGetRandROutputDisplayEXT(
VkPhysicalDevice physicalDevice,
Display* dpy,
RROutput rrOutput,
VkDisplayKHR* pDisplay);
#endif
#ifdef __cplusplus
}
#endif
#endif

94
thirdparty/vulkan/loader/asm_offset.c vendored Executable file
View File

@ -0,0 +1,94 @@
/*
* Copyright (c) 2017-2018 The Khronos Group Inc.
* Copyright (c) 2017-2018 Valve Corporation
* Copyright (c) 2017-2018 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: Lenny Komow <lenny@lunarg.com>
*/
// This code generates an assembly file which provides offsets to get struct members from assembly code.
#include <stdio.h>
#include "loader.h"
#if !defined(_MSC_VER) || (_MSC_VER >= 1900)
#define SIZE_T_FMT "%-8zu"
#else
#define SIZE_T_FMT "%-8lu"
#endif
struct ValueInfo
{
const char *name;
size_t value;
const char *comment;
};
int main(int argc, char **argv) {
const char *assembler = NULL;
for (int i = 0; i < argc; ++i) {
if (!strcmp(argv[i], "MASM")) {
assembler = "MASM";
} else if (!strcmp(argv[i], "GAS")) {
assembler = "GAS";
}
}
if (assembler == NULL) {
return 1;
}
struct ValueInfo values[] = {
{ .name = "VK_DEBUG_REPORT_ERROR_BIT_EXT", .value = (size_t) VK_DEBUG_REPORT_ERROR_BIT_EXT,
.comment = "The numerical value of the enum value 'VK_DEBUG_REPORT_ERROR_BIT_EXT'" },
{ .name = "PTR_SIZE", .value = sizeof(void*),
.comment = "The size of a pointer" },
{ .name = "HASH_SIZE", .value = sizeof(struct loader_dispatch_hash_entry),
.comment = "The size of a 'loader_dispatch_hash_entry' struct" },
{ .name = "HASH_OFFSET_INSTANCE", .value = offsetof(struct loader_instance, phys_dev_ext_disp_hash),
.comment = "The offset of 'phys_dev_ext_disp_hash' within a 'loader_instance' struct" },
{ .name = "PHYS_DEV_OFFSET_INST_DISPATCH", .value = offsetof(struct loader_instance_dispatch_table, phys_dev_ext),
.comment = "The offset of 'phys_dev_ext' within in 'loader_instance_dispatch_table' struct" },
{ .name = "PHYS_DEV_OFFSET_PHYS_DEV_TRAMP", .value = offsetof(struct loader_physical_device_tramp, phys_dev),
.comment = "The offset of 'phys_dev' within a 'loader_physical_device_tramp' struct" },
{ .name = "ICD_TERM_OFFSET_PHYS_DEV_TERM", .value = offsetof(struct loader_physical_device_term, this_icd_term),
.comment = "The offset of 'this_icd_term' within a 'loader_physical_device_term' struct" },
{ .name = "PHYS_DEV_OFFSET_PHYS_DEV_TERM", .value = offsetof(struct loader_physical_device_term, phys_dev),
.comment = "The offset of 'phys_dev' within a 'loader_physical_device_term' struct" },
{ .name = "INSTANCE_OFFSET_ICD_TERM", .value = offsetof(struct loader_icd_term, this_instance),
.comment = "The offset of 'this_instance' within a 'loader_icd_term' struct" },
{ .name = "DISPATCH_OFFSET_ICD_TERM", .value = offsetof(struct loader_icd_term, phys_dev_ext),
.comment = "The offset of 'phys_dev_ext' within a 'loader_icd_term' struct" },
{ .name = "FUNC_NAME_OFFSET_HASH", .value = offsetof(struct loader_dispatch_hash_entry, func_name),
.comment = "The offset of 'func_name' within a 'loader_dispatch_hash_entry' struct" },
{ .name = "EXT_OFFSET_DEVICE_DISPATCH", .value = offsetof(struct loader_dev_dispatch_table, ext_dispatch),
.comment = "The offset of 'ext_dispatch' within a 'loader_dev_dispatch_table' struct" },
};
FILE *file = fopen("gen_defines.asm", "w");
fprintf(file, "\n");
if (!strcmp(assembler, "MASM")) {
for (size_t i = 0; i < sizeof(values)/sizeof(values[0]); ++i) {
fprintf(file, "%-32s equ " SIZE_T_FMT "; %s\n", values[i].name, values[i].value, values[i].comment);
}
} else if (!strcmp(assembler, "GAS")) {
#ifdef __x86_64__
fprintf(file, ".set X86_64, 1\n");
#endif // __x86_64__
for (size_t i = 0; i < sizeof(values)/sizeof(values[0]); ++i) {
fprintf(file, ".set %-32s, " SIZE_T_FMT "# %s\n", values[i].name, values[i].value, values[i].comment);
}
}
return fclose(file);
}

1215
thirdparty/vulkan/loader/cJSON.c vendored Executable file

File diff suppressed because it is too large Load Diff

174
thirdparty/vulkan/loader/cJSON.h vendored Executable file
View File

@ -0,0 +1,174 @@
/*
Copyright (c) 2009 Dave Gamble
Copyright (c) 2015-2016 The Khronos Group Inc.
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 associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS 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 SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef cJSON__h
#define cJSON__h
#ifdef __cplusplus
extern "C" {
#endif
/* cJSON Types: */
#define cJSON_False 0
#define cJSON_True 1
#define cJSON_NULL 2
#define cJSON_Number 3
#define cJSON_String 4
#define cJSON_Array 5
#define cJSON_Object 6
#define cJSON_IsReference 256
#define cJSON_StringIsConst 512
/* The cJSON structure: */
typedef struct cJSON {
struct cJSON *next, *prev; /* next/prev allow you to walk array/object
chains. Alternatively, use
GetArraySize/GetArrayItem/GetObjectItem */
struct cJSON *child; /* An array or object item will have a child pointer
pointing to a chain of the items in the
array/object. */
int type; /* The type of the item, as above. */
char *valuestring; /* The item's string, if type==cJSON_String */
int valueint; /* The item's number, if type==cJSON_Number */
double valuedouble; /* The item's number, if type==cJSON_Number */
char *string; /* The item's name string, if this item is the child of, or is
in the list of subitems of an object. */
} cJSON;
typedef struct cJSON_Hooks {
void *(*malloc_fn)(size_t sz);
void (*free_fn)(void *ptr);
} cJSON_Hooks;
/* Supply malloc, realloc and free functions to cJSON */
extern void cJSON_InitHooks(cJSON_Hooks *hooks);
/* Supply a block of JSON, and this returns a cJSON object you can interrogate.
* Call cJSON_Delete when finished. */
extern cJSON *cJSON_Parse(const char *value);
/* Render a cJSON entity to text for transfer/storage. Free the char* when
* finished. */
extern char *cJSON_Print(cJSON *item);
/* Render a cJSON entity to text for transfer/storage without any formatting.
* Free the char* when finished. */
extern char *cJSON_PrintUnformatted(cJSON *item);
/* Render a cJSON entity to text using a buffered strategy. prebuffer is a guess
* at the final size. guessing well reduces reallocation. fmt=0 gives
* unformatted, =1 gives formatted */
extern char *cJSON_PrintBuffered(cJSON *item, int prebuffer, int fmt);
/* Delete a cJSON entity and all subentities. */
extern void cJSON_Delete(cJSON *c);
/* Delete an item allocated inside the JSON parser*/
extern void cJSON_Free(void *p);
/* Returns the number of items in an array (or object). */
extern int cJSON_GetArraySize(cJSON *array);
/* Retrieve item number "item" from array "array". Returns NULL if unsuccessful.
*/
extern cJSON *cJSON_GetArrayItem(cJSON *array, int item);
/* Get item "string" from object. Case insensitive. */
extern cJSON *cJSON_GetObjectItem(cJSON *object, const char *string);
/* For analysing failed parses. This returns a pointer to the parse error.
* You'll probably need to look a few chars back to make sense of it. Defined
* when cJSON_Parse() returns 0. 0 when cJSON_Parse() succeeds. */
extern const char *cJSON_GetErrorPtr(void);
/* These calls create a cJSON item of the appropriate type. */
extern cJSON *cJSON_CreateNull(void);
extern cJSON *cJSON_CreateTrue(void);
extern cJSON *cJSON_CreateFalse(void);
extern cJSON *cJSON_CreateBool(int b);
extern cJSON *cJSON_CreateNumber(double num);
extern cJSON *cJSON_CreateString(const char *string);
extern cJSON *cJSON_CreateArray(void);
extern cJSON *cJSON_CreateObject(void);
/* These utilities create an Array of count items. */
extern cJSON *cJSON_CreateIntArray(const int *numbers, int count);
extern cJSON *cJSON_CreateFloatArray(const float *numbers, int count);
extern cJSON *cJSON_CreateDoubleArray(const double *numbers, int count);
extern cJSON *cJSON_CreateStringArray(const char **strings, int count);
/* Append item to the specified array/object. */
extern void cJSON_AddItemToArray(cJSON *array, cJSON *item);
extern void cJSON_AddItemToObject(cJSON *object, const char *string, cJSON *item);
extern void cJSON_AddItemToObjectCS(cJSON *object, const char *string,
cJSON *item); /* Use this when string is definitely const (i.e. a literal,
or as good as), and will definitely survive the cJSON
object */
/* Append reference to item to the specified array/object. Use this when you
* want to add an existing cJSON to a new cJSON, but don't want to corrupt your
* existing cJSON. */
extern void cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item);
extern void cJSON_AddItemReferenceToObject(cJSON *object, const char *string, cJSON *item);
/* Remove/Detatch items from Arrays/Objects. */
extern cJSON *cJSON_DetachItemFromArray(cJSON *array, int which);
extern void cJSON_DeleteItemFromArray(cJSON *array, int which);
extern cJSON *cJSON_DetachItemFromObject(cJSON *object, const char *string);
extern void cJSON_DeleteItemFromObject(cJSON *object, const char *string);
/* Update array items. */
extern void cJSON_InsertItemInArray(cJSON *array, int which, cJSON *newitem); /* Shifts pre-existing items to the right. */
extern void cJSON_ReplaceItemInArray(cJSON *array, int which, cJSON *newitem);
extern void cJSON_ReplaceItemInObject(cJSON *object, const char *string, cJSON *newitem);
/* Duplicate a cJSON item */
extern cJSON *cJSON_Duplicate(cJSON *item, int recurse);
/* Duplicate will create a new, identical cJSON item to the one you pass, in new
memory that will
need to be released. With recurse!=0, it will duplicate any children connected
to the item.
The item->next and ->prev pointers are always zero on return from Duplicate. */
/* ParseWithOpts allows you to require (and check) that the JSON is null
* terminated, and to retrieve the pointer to the final byte parsed. */
extern cJSON *cJSON_ParseWithOpts(const char *value, const char **return_parse_end, int require_null_terminated);
extern void cJSON_Minify(char *json);
/* Macros for creating things quickly. */
#define cJSON_AddNullToObject(object, name) cJSON_AddItemToObject(object, name, cJSON_CreateNull())
#define cJSON_AddTrueToObject(object, name) cJSON_AddItemToObject(object, name, cJSON_CreateTrue())
#define cJSON_AddFalseToObject(object, name) cJSON_AddItemToObject(object, name, cJSON_CreateFalse())
#define cJSON_AddBoolToObject(object, name, b) cJSON_AddItemToObject(object, name, cJSON_CreateBool(b))
#define cJSON_AddNumberToObject(object, name, n) cJSON_AddItemToObject(object, name, cJSON_CreateNumber(n))
#define cJSON_AddStringToObject(object, name, s) cJSON_AddItemToObject(object, name, cJSON_CreateString(s))
/* When assigning an integer value, it needs to be propagated to valuedouble
* too. */
#define cJSON_SetIntValue(object, val) ((object) ? (object)->valueint = (object)->valuedouble = (val) : (val))
#define cJSON_SetNumberValue(object, val) ((object) ? (object)->valueint = (object)->valuedouble = (val) : (val))
#ifdef __cplusplus
}
#endif
#endif

996
thirdparty/vulkan/loader/debug_utils.c vendored Executable file
View File

@ -0,0 +1,996 @@
/*
* Copyright (c) 2015-2017 The Khronos Group Inc.
* Copyright (c) 2015-2017 Valve Corporation
* Copyright (c) 2015-2017 LunarG, Inc.
* Copyright (C) 2015-2016 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: Courtney Goeltzenleuchter <courtney@LunarG.com>
* Author: Jon Ashburn <jon@LunarG.com>
* Author: Mark Young <marky@lunarg.com>
*
*/
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <inttypes.h>
#ifndef WIN32
#include <signal.h>
#else
#endif
#include "vk_loader_platform.h"
#include "debug_utils.h"
#include "vulkan/vk_layer.h"
#include "vk_object_types.h"
// VK_EXT_debug_report related items
VkResult util_CreateDebugUtilsMessenger(struct loader_instance *inst, const VkDebugUtilsMessengerCreateInfoEXT *pCreateInfo,
const VkAllocationCallbacks *pAllocator, VkDebugUtilsMessengerEXT messenger) {
VkLayerDbgFunctionNode *pNewDbgFuncNode = NULL;
#if (DEBUG_DISABLE_APP_ALLOCATORS == 1)
{
#else
if (pAllocator != NULL) {
pNewDbgFuncNode = (VkLayerDbgFunctionNode *)pAllocator->pfnAllocation(pAllocator->pUserData, sizeof(VkLayerDbgFunctionNode),
sizeof(int *), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
} else {
#endif
pNewDbgFuncNode = (VkLayerDbgFunctionNode *)loader_instance_heap_alloc(inst, sizeof(VkLayerDbgFunctionNode),
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
}
if (!pNewDbgFuncNode) {
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
memset(pNewDbgFuncNode, 0, sizeof(VkLayerDbgFunctionNode));
pNewDbgFuncNode->is_messenger = true;
pNewDbgFuncNode->messenger.messenger = messenger;
pNewDbgFuncNode->messenger.pfnUserCallback = pCreateInfo->pfnUserCallback;
pNewDbgFuncNode->messenger.messageSeverity = pCreateInfo->messageSeverity;
pNewDbgFuncNode->messenger.messageType = pCreateInfo->messageType;
pNewDbgFuncNode->pUserData = pCreateInfo->pUserData;
pNewDbgFuncNode->pNext = inst->DbgFunctionHead;
inst->DbgFunctionHead = pNewDbgFuncNode;
return VK_SUCCESS;
}
static VKAPI_ATTR VkResult VKAPI_CALL
debug_utils_CreateDebugUtilsMessengerEXT(VkInstance instance, const VkDebugUtilsMessengerCreateInfoEXT *pCreateInfo,
const VkAllocationCallbacks *pAllocator, VkDebugUtilsMessengerEXT *pMessenger) {
struct loader_instance *inst = loader_get_instance(instance);
loader_platform_thread_lock_mutex(&loader_lock);
VkResult result = inst->disp->layer_inst_disp.CreateDebugUtilsMessengerEXT(instance, pCreateInfo, pAllocator, pMessenger);
loader_platform_thread_unlock_mutex(&loader_lock);
return result;
}
VkBool32 util_SubmitDebugUtilsMessageEXT(const struct loader_instance *inst, VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
VkDebugUtilsMessageTypeFlagsEXT messageTypes,
const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData) {
VkBool32 bail = false;
if (NULL != pCallbackData) {
VkLayerDbgFunctionNode *pTrav = inst->DbgFunctionHead;
VkDebugReportObjectTypeEXT object_type = VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT;
VkDebugReportFlagsEXT object_flags = 0;
uint64_t object_handle = 0;
debug_utils_AnnotFlagsToReportFlags(messageSeverity, messageTypes, &object_flags);
if (0 < pCallbackData->objectCount) {
debug_utils_AnnotObjectToDebugReportObject(pCallbackData->pObjects, &object_type, &object_handle);
}
while (pTrav) {
if (pTrav->is_messenger && (pTrav->messenger.messageSeverity & messageSeverity) &&
(pTrav->messenger.messageType & messageTypes)) {
if (pTrav->messenger.pfnUserCallback(messageSeverity, messageTypes, pCallbackData, pTrav->pUserData)) {
bail = true;
}
}
if (!pTrav->is_messenger && pTrav->report.msgFlags & object_flags) {
if (pTrav->report.pfnMsgCallback(object_flags, object_type, object_handle, 0, pCallbackData->messageIdNumber,
pCallbackData->pMessageIdName, pCallbackData->pMessage, pTrav->pUserData)) {
bail = true;
}
}
pTrav = pTrav->pNext;
}
}
return bail;
}
void util_DestroyDebugUtilsMessenger(struct loader_instance *inst, VkDebugUtilsMessengerEXT messenger,
const VkAllocationCallbacks *pAllocator) {
VkLayerDbgFunctionNode *pTrav = inst->DbgFunctionHead;
VkLayerDbgFunctionNode *pPrev = pTrav;
while (pTrav) {
if (pTrav->is_messenger && pTrav->messenger.messenger == messenger) {
pPrev->pNext = pTrav->pNext;
if (inst->DbgFunctionHead == pTrav) inst->DbgFunctionHead = pTrav->pNext;
#if (DEBUG_DISABLE_APP_ALLOCATORS == 1)
{
#else
if (pAllocator != NULL) {
pAllocator->pfnFree(pAllocator->pUserData, pTrav);
} else {
#endif
loader_instance_heap_free(inst, pTrav);
}
break;
}
pPrev = pTrav;
pTrav = pTrav->pNext;
}
}
// This utility (used by vkInstanceCreateInfo(), looks at a pNext chain. It
// counts any VkDebugUtilsMessengerCreateInfoEXT structs that it finds. It
// then allocates array that can hold that many structs, as well as that many
// VkDebugUtilsMessengerEXT handles. It then copies each
// VkDebugUtilsMessengerCreateInfoEXT, and initializes each handle.
VkResult util_CopyDebugUtilsMessengerCreateInfos(const void *pChain, const VkAllocationCallbacks *pAllocator,
uint32_t *num_messengers, VkDebugUtilsMessengerCreateInfoEXT **infos,
VkDebugUtilsMessengerEXT **messengers) {
uint32_t n = *num_messengers = 0;
VkDebugUtilsMessengerCreateInfoEXT *pInfos = NULL;
VkDebugUtilsMessengerEXT *pMessengers = NULL;
const void *pNext = pChain;
while (pNext) {
// 1st, count the number VkDebugUtilsMessengerCreateInfoEXT:
if (((VkDebugUtilsMessengerCreateInfoEXT *)pNext)->sType == VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT) {
n++;
}
pNext = (void *)((VkDebugUtilsMessengerCreateInfoEXT *)pNext)->pNext;
}
if (n == 0) {
return VK_SUCCESS;
}
// 2nd, allocate memory for each VkDebugUtilsMessengerCreateInfoEXT:
#if (DEBUG_DISABLE_APP_ALLOCATORS == 1)
{
#else
if (pAllocator != NULL) {
pInfos = *infos = ((VkDebugUtilsMessengerCreateInfoEXT *)pAllocator->pfnAllocation(
pAllocator->pUserData, n * sizeof(VkDebugUtilsMessengerCreateInfoEXT), sizeof(void *),
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT));
} else {
#endif
pInfos = *infos = ((VkDebugUtilsMessengerCreateInfoEXT *)malloc(n * sizeof(VkDebugUtilsMessengerCreateInfoEXT)));
}
if (!pInfos) {
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
// 3rd, allocate memory for a unique handle for each callback:
#if (DEBUG_DISABLE_APP_ALLOCATORS == 1)
{
#else
if (pAllocator != NULL) {
pMessengers = *messengers = ((VkDebugUtilsMessengerEXT *)pAllocator->pfnAllocation(
pAllocator->pUserData, n * sizeof(VkDebugUtilsMessengerEXT), sizeof(void *), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT));
if (NULL == pMessengers) {
pAllocator->pfnFree(pAllocator->pUserData, pInfos);
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
} else {
#endif
pMessengers = *messengers = ((VkDebugUtilsMessengerEXT *)malloc(n * sizeof(VkDebugUtilsMessengerEXT)));
if (NULL == pMessengers) {
free(pInfos);
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
}
// 4th, copy each VkDebugUtilsMessengerCreateInfoEXT for use by
// vkDestroyInstance, and assign a unique handle to each messenger (just
// use the address of the copied VkDebugUtilsMessengerCreateInfoEXT):
pNext = pChain;
while (pNext) {
if (((VkInstanceCreateInfo *)pNext)->sType == VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT) {
memcpy(pInfos, pNext, sizeof(VkDebugUtilsMessengerCreateInfoEXT));
*pMessengers++ = (VkDebugUtilsMessengerEXT)(uintptr_t)pInfos++;
}
pNext = (void *)((VkInstanceCreateInfo *)pNext)->pNext;
}
*num_messengers = n;
return VK_SUCCESS;
}
void util_FreeDebugUtilsMessengerCreateInfos(const VkAllocationCallbacks *pAllocator, VkDebugUtilsMessengerCreateInfoEXT *infos,
VkDebugUtilsMessengerEXT *messengers) {
#if (DEBUG_DISABLE_APP_ALLOCATORS == 1)
{
#else
if (pAllocator != NULL) {
pAllocator->pfnFree(pAllocator->pUserData, infos);
pAllocator->pfnFree(pAllocator->pUserData, messengers);
} else {
#endif
free(infos);
free(messengers);
}
}
VkResult util_CreateDebugUtilsMessengers(struct loader_instance *inst, const VkAllocationCallbacks *pAllocator,
uint32_t num_messengers, VkDebugUtilsMessengerCreateInfoEXT *infos,
VkDebugUtilsMessengerEXT *messengers) {
VkResult rtn = VK_SUCCESS;
for (uint32_t i = 0; i < num_messengers; i++) {
rtn = util_CreateDebugUtilsMessenger(inst, &infos[i], pAllocator, messengers[i]);
if (rtn != VK_SUCCESS) {
for (uint32_t j = 0; j < i; j++) {
util_DestroyDebugUtilsMessenger(inst, messengers[j], pAllocator);
}
return rtn;
}
}
return rtn;
}
void util_DestroyDebugUtilsMessengers(struct loader_instance *inst, const VkAllocationCallbacks *pAllocator,
uint32_t num_messengers, VkDebugUtilsMessengerEXT *messengers) {
for (uint32_t i = 0; i < num_messengers; i++) {
util_DestroyDebugUtilsMessenger(inst, messengers[i], pAllocator);
}
}
static VKAPI_ATTR void VKAPI_CALL debug_utils_SubmitDebugUtilsMessageEXT(
VkInstance instance, VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, VkDebugUtilsMessageTypeFlagsEXT messageTypes,
const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData) {
struct loader_instance *inst = loader_get_instance(instance);
inst->disp->layer_inst_disp.SubmitDebugUtilsMessageEXT(instance, messageSeverity, messageTypes, pCallbackData);
}
static VKAPI_ATTR void VKAPI_CALL debug_utils_DestroyDebugUtilsMessengerEXT(VkInstance instance, VkDebugUtilsMessengerEXT messenger,
const VkAllocationCallbacks *pAllocator) {
struct loader_instance *inst = loader_get_instance(instance);
loader_platform_thread_lock_mutex(&loader_lock);
inst->disp->layer_inst_disp.DestroyDebugUtilsMessengerEXT(instance, messenger, pAllocator);
loader_platform_thread_unlock_mutex(&loader_lock);
}
// This is the instance chain terminator function for CreateDebugUtilsMessenger
VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDebugUtilsMessengerEXT(VkInstance instance,
const VkDebugUtilsMessengerCreateInfoEXT *pCreateInfo,
const VkAllocationCallbacks *pAllocator,
VkDebugUtilsMessengerEXT *pMessenger) {
VkDebugUtilsMessengerEXT *icd_info = NULL;
const struct loader_icd_term *icd_term;
struct loader_instance *inst = (struct loader_instance *)instance;
VkResult res = VK_SUCCESS;
uint32_t storage_idx;
VkLayerDbgFunctionNode *pNewDbgFuncNode = NULL;
#if (DEBUG_DISABLE_APP_ALLOCATORS == 1)
{
#else
if (pAllocator != NULL) {
icd_info = ((VkDebugUtilsMessengerEXT *)pAllocator->pfnAllocation(pAllocator->pUserData,
inst->total_icd_count * sizeof(VkDebugUtilsMessengerEXT),
sizeof(void *), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT));
if (icd_info) {
memset(icd_info, 0, inst->total_icd_count * sizeof(VkDebugUtilsMessengerEXT));
}
} else {
#endif
icd_info = calloc(sizeof(VkDebugUtilsMessengerEXT), inst->total_icd_count);
}
if (!icd_info) {
res = VK_ERROR_OUT_OF_HOST_MEMORY;
goto out;
}
storage_idx = 0;
for (icd_term = inst->icd_terms; icd_term; icd_term = icd_term->next) {
if (!icd_term->dispatch.CreateDebugUtilsMessengerEXT) {
continue;
}
res = icd_term->dispatch.CreateDebugUtilsMessengerEXT(icd_term->instance, pCreateInfo, pAllocator, &icd_info[storage_idx]);
if (res != VK_SUCCESS) {
goto out;
}
storage_idx++;
}
// Setup the debug report callback in the terminator since a layer may want
// to grab the information itself (RenderDoc) and then return back to the
// user callback a sub-set of the messages.
#if (DEBUG_DISABLE_APP_ALLOCATORS == 0)
if (pAllocator != NULL) {
pNewDbgFuncNode = (VkLayerDbgFunctionNode *)pAllocator->pfnAllocation(pAllocator->pUserData, sizeof(VkLayerDbgFunctionNode),
sizeof(int *), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
} else {
#else
{
#endif
pNewDbgFuncNode = (VkLayerDbgFunctionNode *)loader_instance_heap_alloc(inst, sizeof(VkLayerDbgFunctionNode),
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
}
if (!pNewDbgFuncNode) {
res = VK_ERROR_OUT_OF_HOST_MEMORY;
goto out;
}
memset(pNewDbgFuncNode, 0, sizeof(VkLayerDbgFunctionNode));
pNewDbgFuncNode->is_messenger = true;
pNewDbgFuncNode->messenger.pfnUserCallback = pCreateInfo->pfnUserCallback;
pNewDbgFuncNode->messenger.messageSeverity = pCreateInfo->messageSeverity;
pNewDbgFuncNode->messenger.messageType = pCreateInfo->messageType;
pNewDbgFuncNode->pUserData = pCreateInfo->pUserData;
pNewDbgFuncNode->pNext = inst->DbgFunctionHead;
inst->DbgFunctionHead = pNewDbgFuncNode;
*(VkDebugUtilsMessengerEXT **)pMessenger = icd_info;
pNewDbgFuncNode->messenger.messenger = *pMessenger;
out:
// Roll back on errors
if (VK_SUCCESS != res) {
storage_idx = 0;
for (icd_term = inst->icd_terms; icd_term; icd_term = icd_term->next) {
if (NULL == icd_term->dispatch.DestroyDebugUtilsMessengerEXT) {
continue;
}
if (icd_info && icd_info[storage_idx]) {
icd_term->dispatch.DestroyDebugUtilsMessengerEXT(icd_term->instance, icd_info[storage_idx], pAllocator);
}
storage_idx++;
}
#if (DEBUG_DISABLE_APP_ALLOCATORS == 1)
{
#else
if (pAllocator != NULL) {
if (NULL != pNewDbgFuncNode) {
pAllocator->pfnFree(pAllocator->pUserData, pNewDbgFuncNode);
}
if (NULL != icd_info) {
pAllocator->pfnFree(pAllocator->pUserData, icd_info);
}
} else {
#endif
if (NULL != pNewDbgFuncNode) {
free(pNewDbgFuncNode);
}
if (NULL != icd_info) {
free(icd_info);
}
}
}
return res;
}
// This is the instance chain terminator function for DestroyDebugUtilsMessenger
VKAPI_ATTR void VKAPI_CALL terminator_DestroyDebugUtilsMessengerEXT(VkInstance instance, VkDebugUtilsMessengerEXT messenger,
const VkAllocationCallbacks *pAllocator) {
uint32_t storage_idx;
VkDebugUtilsMessengerEXT *icd_info;
const struct loader_icd_term *icd_term;
struct loader_instance *inst = (struct loader_instance *)instance;
icd_info = *(VkDebugUtilsMessengerEXT **)&messenger;
storage_idx = 0;
for (icd_term = inst->icd_terms; icd_term; icd_term = icd_term->next) {
if (NULL == icd_term->dispatch.DestroyDebugUtilsMessengerEXT) {
continue;
}
if (icd_info[storage_idx]) {
icd_term->dispatch.DestroyDebugUtilsMessengerEXT(icd_term->instance, icd_info[storage_idx], pAllocator);
}
storage_idx++;
}
util_DestroyDebugUtilsMessenger(inst, messenger, pAllocator);
#if (DEBUG_DISABLE_APP_ALLOCATORS == 1)
{
#else
if (pAllocator != NULL) {
pAllocator->pfnFree(pAllocator->pUserData, icd_info);
} else {
#endif
free(icd_info);
}
}
// This is the instance chain terminator function for SubmitDebugUtilsMessageEXT
VKAPI_ATTR void VKAPI_CALL terminator_SubmitDebugUtilsMessageEXT(VkInstance instance,
VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
VkDebugUtilsMessageTypeFlagsEXT messageTypes,
const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData) {
loader_platform_thread_lock_mutex(&loader_lock);
// NOTE: Just make the callback ourselves because there could be one or more ICDs that support this extension
// and each one will trigger the callback to the user. This would result in multiple callback triggers
// per message. Instead, if we get a messaged up to here, then just trigger the message ourselves and
// return. This would still allow the ICDs to trigger their own messages, but won't get any external ones.
struct loader_instance *inst = (struct loader_instance *)instance;
util_SubmitDebugUtilsMessageEXT(inst, messageSeverity, messageTypes, pCallbackData);
loader_platform_thread_unlock_mutex(&loader_lock);
}
// VK_EXT_debug_report related items
VkResult util_CreateDebugReportCallback(struct loader_instance *inst, VkDebugReportCallbackCreateInfoEXT *pCreateInfo,
const VkAllocationCallbacks *pAllocator, VkDebugReportCallbackEXT callback) {
VkLayerDbgFunctionNode *pNewDbgFuncNode = NULL;
#if (DEBUG_DISABLE_APP_ALLOCATORS == 1)
{
#else
if (pAllocator != NULL) {
pNewDbgFuncNode = (VkLayerDbgFunctionNode *)pAllocator->pfnAllocation(pAllocator->pUserData, sizeof(VkLayerDbgFunctionNode),
sizeof(int *), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
} else {
#endif
pNewDbgFuncNode = (VkLayerDbgFunctionNode *)loader_instance_heap_alloc(inst, sizeof(VkLayerDbgFunctionNode),
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
}
if (!pNewDbgFuncNode) {
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
memset(pNewDbgFuncNode, 0, sizeof(VkLayerDbgFunctionNode));
pNewDbgFuncNode->is_messenger = false;
pNewDbgFuncNode->report.msgCallback = callback;
pNewDbgFuncNode->report.pfnMsgCallback = pCreateInfo->pfnCallback;
pNewDbgFuncNode->report.msgFlags = pCreateInfo->flags;
pNewDbgFuncNode->pUserData = pCreateInfo->pUserData;
pNewDbgFuncNode->pNext = inst->DbgFunctionHead;
inst->DbgFunctionHead = pNewDbgFuncNode;
return VK_SUCCESS;
}
static VKAPI_ATTR VkResult VKAPI_CALL
debug_utils_CreateDebugReportCallbackEXT(VkInstance instance, const VkDebugReportCallbackCreateInfoEXT *pCreateInfo,
const VkAllocationCallbacks *pAllocator, VkDebugReportCallbackEXT *pCallback) {
struct loader_instance *inst = loader_get_instance(instance);
loader_platform_thread_lock_mutex(&loader_lock);
VkResult result = inst->disp->layer_inst_disp.CreateDebugReportCallbackEXT(instance, pCreateInfo, pAllocator, pCallback);
loader_platform_thread_unlock_mutex(&loader_lock);
return result;
}
// Utility function to handle reporting
VkBool32 util_DebugReportMessage(const struct loader_instance *inst, VkFlags msgFlags, VkDebugReportObjectTypeEXT objectType,
uint64_t srcObject, size_t location, int32_t msgCode, const char *pLayerPrefix, const char *pMsg) {
VkBool32 bail = false;
VkLayerDbgFunctionNode *pTrav = inst->DbgFunctionHead;
VkDebugUtilsMessageSeverityFlagBitsEXT severity;
VkDebugUtilsMessageTypeFlagsEXT types;
VkDebugUtilsMessengerCallbackDataEXT callback_data;
VkDebugUtilsObjectNameInfoEXT object_name;
debug_utils_ReportFlagsToAnnotFlags(msgFlags, false, &severity, &types);
debug_utils_ReportObjectToAnnotObject(objectType, srcObject, &object_name);
callback_data.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CALLBACK_DATA_EXT;
callback_data.pNext = NULL;
callback_data.flags = 0;
callback_data.pMessageIdName = pLayerPrefix;
callback_data.messageIdNumber = msgCode;
callback_data.pMessage = pMsg;
callback_data.cmdBufLabelCount = 0;
callback_data.pCmdBufLabels = NULL;
callback_data.queueLabelCount = 0;
callback_data.pQueueLabels = NULL;
callback_data.objectCount = 1;
callback_data.pObjects = &object_name;
while (pTrav) {
if (!pTrav->is_messenger && pTrav->report.msgFlags & msgFlags) {
if (pTrav->report.pfnMsgCallback(msgFlags, objectType, srcObject, location, msgCode, pLayerPrefix, pMsg,
pTrav->pUserData)) {
bail = true;
}
}
if (pTrav->is_messenger && (pTrav->messenger.messageSeverity & severity) && (pTrav->messenger.messageType & types)) {
if (pTrav->messenger.pfnUserCallback(severity, types, &callback_data, pTrav->pUserData)) {
bail = true;
}
}
pTrav = pTrav->pNext;
}
return bail;
}
void util_DestroyDebugReportCallback(struct loader_instance *inst, VkDebugReportCallbackEXT callback,
const VkAllocationCallbacks *pAllocator) {
VkLayerDbgFunctionNode *pTrav = inst->DbgFunctionHead;
VkLayerDbgFunctionNode *pPrev = pTrav;
while (pTrav) {
if (!pTrav->is_messenger && pTrav->report.msgCallback == callback) {
pPrev->pNext = pTrav->pNext;
if (inst->DbgFunctionHead == pTrav) inst->DbgFunctionHead = pTrav->pNext;
#if (DEBUG_DISABLE_APP_ALLOCATORS == 1)
{
#else
if (pAllocator != NULL) {
pAllocator->pfnFree(pAllocator->pUserData, pTrav);
} else {
#endif
loader_instance_heap_free(inst, pTrav);
}
break;
}
pPrev = pTrav;
pTrav = pTrav->pNext;
}
}
// This utility (used by vkInstanceCreateInfo(), looks at a pNext chain. It
// counts any VkDebugReportCallbackCreateInfoEXT structs that it finds. It
// then allocates array that can hold that many structs, as well as that many
// VkDebugReportCallbackEXT handles. It then copies each
// VkDebugReportCallbackCreateInfoEXT, and initializes each handle.
VkResult util_CopyDebugReportCreateInfos(const void *pChain, const VkAllocationCallbacks *pAllocator, uint32_t *num_callbacks,
VkDebugReportCallbackCreateInfoEXT **infos, VkDebugReportCallbackEXT **callbacks) {
uint32_t n = *num_callbacks = 0;
VkDebugReportCallbackCreateInfoEXT *pInfos = NULL;
VkDebugReportCallbackEXT *pCallbacks = NULL;
const void *pNext = pChain;
while (pNext) {
// 1st, count the number VkDebugReportCallbackCreateInfoEXT:
if (((VkDebugReportCallbackCreateInfoEXT *)pNext)->sType == VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT) {
n++;
}
pNext = (void *)((VkDebugReportCallbackCreateInfoEXT *)pNext)->pNext;
}
if (n == 0) {
return VK_SUCCESS;
}
// 2nd, allocate memory for each VkDebugReportCallbackCreateInfoEXT:
#if (DEBUG_DISABLE_APP_ALLOCATORS == 1)
{
#else
if (pAllocator != NULL) {
pInfos = *infos = ((VkDebugReportCallbackCreateInfoEXT *)pAllocator->pfnAllocation(
pAllocator->pUserData, n * sizeof(VkDebugReportCallbackCreateInfoEXT), sizeof(void *),
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT));
} else {
#endif
pInfos = *infos = ((VkDebugReportCallbackCreateInfoEXT *)malloc(n * sizeof(VkDebugReportCallbackCreateInfoEXT)));
}
if (!pInfos) {
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
// 3rd, allocate memory for a unique handle for each callback:
#if (DEBUG_DISABLE_APP_ALLOCATORS == 1)
{
#else
if (pAllocator != NULL) {
pCallbacks = *callbacks = ((VkDebugReportCallbackEXT *)pAllocator->pfnAllocation(
pAllocator->pUserData, n * sizeof(VkDebugReportCallbackEXT), sizeof(void *), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT));
if (!pCallbacks) {
pAllocator->pfnFree(pAllocator->pUserData, pInfos);
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
} else {
#endif
pCallbacks = *callbacks = ((VkDebugReportCallbackEXT *)malloc(n * sizeof(VkDebugReportCallbackEXT)));
if (!pCallbacks) {
free(pInfos);
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
}
// 4th, copy each VkDebugReportCallbackCreateInfoEXT for use by
// vkDestroyInstance, and assign a unique handle to each callback (just
// use the address of the copied VkDebugReportCallbackCreateInfoEXT):
pNext = pChain;
while (pNext) {
if (((VkInstanceCreateInfo *)pNext)->sType == VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT) {
memcpy(pInfos, pNext, sizeof(VkDebugReportCallbackCreateInfoEXT));
*pCallbacks++ = (VkDebugReportCallbackEXT)(uintptr_t)pInfos++;
}
pNext = (void *)((VkInstanceCreateInfo *)pNext)->pNext;
}
*num_callbacks = n;
return VK_SUCCESS;
}
void util_FreeDebugReportCreateInfos(const VkAllocationCallbacks *pAllocator, VkDebugReportCallbackCreateInfoEXT *infos,
VkDebugReportCallbackEXT *callbacks) {
#if (DEBUG_DISABLE_APP_ALLOCATORS == 1)
{
#else
if (pAllocator != NULL) {
pAllocator->pfnFree(pAllocator->pUserData, infos);
pAllocator->pfnFree(pAllocator->pUserData, callbacks);
} else {
#endif
free(infos);
free(callbacks);
}
}
VkResult util_CreateDebugReportCallbacks(struct loader_instance *inst, const VkAllocationCallbacks *pAllocator,
uint32_t num_callbacks, VkDebugReportCallbackCreateInfoEXT *infos,
VkDebugReportCallbackEXT *callbacks) {
VkResult rtn = VK_SUCCESS;
for (uint32_t i = 0; i < num_callbacks; i++) {
rtn = util_CreateDebugReportCallback(inst, &infos[i], pAllocator, callbacks[i]);
if (rtn != VK_SUCCESS) {
for (uint32_t j = 0; j < i; j++) {
util_DestroyDebugReportCallback(inst, callbacks[j], pAllocator);
}
return rtn;
}
}
return rtn;
}
void util_DestroyDebugReportCallbacks(struct loader_instance *inst, const VkAllocationCallbacks *pAllocator, uint32_t num_callbacks,
VkDebugReportCallbackEXT *callbacks) {
for (uint32_t i = 0; i < num_callbacks; i++) {
util_DestroyDebugReportCallback(inst, callbacks[i], pAllocator);
}
}
static VKAPI_ATTR void VKAPI_CALL debug_utils_DestroyDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackEXT callback,
const VkAllocationCallbacks *pAllocator) {
struct loader_instance *inst = loader_get_instance(instance);
loader_platform_thread_lock_mutex(&loader_lock);
inst->disp->layer_inst_disp.DestroyDebugReportCallbackEXT(instance, callback, pAllocator);
loader_platform_thread_unlock_mutex(&loader_lock);
}
static VKAPI_ATTR void VKAPI_CALL debug_utils_DebugReportMessageEXT(VkInstance instance, VkDebugReportFlagsEXT flags,
VkDebugReportObjectTypeEXT objType, uint64_t object,
size_t location, int32_t msgCode, const char *pLayerPrefix,
const char *pMsg) {
struct loader_instance *inst = loader_get_instance(instance);
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_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;
VkResult res = VK_SUCCESS;
uint32_t storage_idx;
VkLayerDbgFunctionNode *pNewDbgFuncNode = NULL;
#if (DEBUG_DISABLE_APP_ALLOCATORS == 1)
{
#else
if (pAllocator != NULL) {
icd_info = ((VkDebugReportCallbackEXT *)pAllocator->pfnAllocation(pAllocator->pUserData,
inst->total_icd_count * sizeof(VkDebugReportCallbackEXT),
sizeof(void *), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT));
if (icd_info) {
memset(icd_info, 0, inst->total_icd_count * sizeof(VkDebugReportCallbackEXT));
}
} else {
#endif
icd_info = calloc(sizeof(VkDebugReportCallbackEXT), inst->total_icd_count);
}
if (!icd_info) {
res = VK_ERROR_OUT_OF_HOST_MEMORY;
goto out;
}
storage_idx = 0;
for (icd_term = inst->icd_terms; icd_term; icd_term = icd_term->next) {
if (!icd_term->dispatch.CreateDebugReportCallbackEXT) {
continue;
}
res = icd_term->dispatch.CreateDebugReportCallbackEXT(icd_term->instance, pCreateInfo, pAllocator, &icd_info[storage_idx]);
if (res != VK_SUCCESS) {
goto out;
}
storage_idx++;
}
// Setup the debug report callback in the terminator since a layer may want
// to grab the information itself (RenderDoc) and then return back to the
// user callback a sub-set of the messages.
#if (DEBUG_DISABLE_APP_ALLOCATORS == 0)
if (pAllocator != NULL) {
pNewDbgFuncNode = (VkLayerDbgFunctionNode *)pAllocator->pfnAllocation(pAllocator->pUserData, sizeof(VkLayerDbgFunctionNode),
sizeof(int *), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
} else {
#else
{
#endif
pNewDbgFuncNode = (VkLayerDbgFunctionNode *)loader_instance_heap_alloc(inst, sizeof(VkLayerDbgFunctionNode),
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
}
if (!pNewDbgFuncNode) {
res = VK_ERROR_OUT_OF_HOST_MEMORY;
goto out;
}
memset(pNewDbgFuncNode, 0, sizeof(VkLayerDbgFunctionNode));
pNewDbgFuncNode->is_messenger = false;
pNewDbgFuncNode->report.pfnMsgCallback = pCreateInfo->pfnCallback;
pNewDbgFuncNode->report.msgFlags = pCreateInfo->flags;
pNewDbgFuncNode->pUserData = pCreateInfo->pUserData;
pNewDbgFuncNode->pNext = inst->DbgFunctionHead;
inst->DbgFunctionHead = pNewDbgFuncNode;
*(VkDebugReportCallbackEXT **)pCallback = icd_info;
pNewDbgFuncNode->report.msgCallback = *pCallback;
out:
// Roll back on errors
if (VK_SUCCESS != res) {
storage_idx = 0;
for (icd_term = inst->icd_terms; icd_term; icd_term = icd_term->next) {
if (NULL == icd_term->dispatch.DestroyDebugReportCallbackEXT) {
continue;
}
if (icd_info && icd_info[storage_idx]) {
icd_term->dispatch.DestroyDebugReportCallbackEXT(icd_term->instance, icd_info[storage_idx], pAllocator);
}
storage_idx++;
}
#if (DEBUG_DISABLE_APP_ALLOCATORS == 1)
{
#else
if (pAllocator != NULL) {
if (NULL != pNewDbgFuncNode) {
pAllocator->pfnFree(pAllocator->pUserData, pNewDbgFuncNode);
}
if (NULL != icd_info) {
pAllocator->pfnFree(pAllocator->pUserData, icd_info);
}
} else {
#endif
if (NULL != pNewDbgFuncNode) {
free(pNewDbgFuncNode);
}
if (NULL != icd_info) {
free(icd_info);
}
}
}
return res;
}
// 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;
struct loader_instance *inst = (struct loader_instance *)instance;
icd_info = *(VkDebugReportCallbackEXT **)&callback;
storage_idx = 0;
for (icd_term = inst->icd_terms; icd_term; icd_term = icd_term->next) {
if (NULL == icd_term->dispatch.DestroyDebugReportCallbackEXT) {
continue;
}
if (icd_info[storage_idx]) {
icd_term->dispatch.DestroyDebugReportCallbackEXT(icd_term->instance, icd_info[storage_idx], pAllocator);
}
storage_idx++;
}
util_DestroyDebugReportCallback(inst, callback, pAllocator);
#if (DEBUG_DISABLE_APP_ALLOCATORS == 1)
{
#else
if (pAllocator != NULL) {
pAllocator->pfnFree(pAllocator->pUserData, icd_info);
} else {
#endif
free(icd_info);
}
}
// 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->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.
util_DebugReportMessage(inst, flags, objType, object, location, msgCode, pLayerPrefix, pMsg);
loader_platform_thread_unlock_mutex(&loader_lock);
}
// General utilities
static const VkExtensionProperties debug_utils_extension_info[] = {
{VK_EXT_DEBUG_REPORT_EXTENSION_NAME, VK_EXT_DEBUG_REPORT_SPEC_VERSION},
{VK_EXT_DEBUG_UTILS_EXTENSION_NAME, VK_EXT_DEBUG_UTILS_SPEC_VERSION},
};
void debug_utils_AddInstanceExtensions(const struct loader_instance *inst, struct loader_extension_list *ext_list) {
loader_add_to_ext_list(inst, ext_list, sizeof(debug_utils_extension_info) / sizeof(VkExtensionProperties),
debug_utils_extension_info);
}
void debug_utils_CreateInstance(struct loader_instance *ptr_instance, const VkInstanceCreateInfo *pCreateInfo) {
ptr_instance->enabled_known_extensions.ext_debug_report = 0;
ptr_instance->enabled_known_extensions.ext_debug_utils = 0;
for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) {
if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_EXT_DEBUG_REPORT_EXTENSION_NAME) == 0) {
ptr_instance->enabled_known_extensions.ext_debug_report = 1;
} else if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_EXT_DEBUG_UTILS_EXTENSION_NAME) == 0) {
ptr_instance->enabled_known_extensions.ext_debug_utils = 1;
}
}
}
bool debug_utils_InstanceGpa(struct loader_instance *ptr_instance, const char *name, void **addr) {
bool ret_type = false;
*addr = NULL;
if (!strcmp("vkCreateDebugReportCallbackEXT", name)) {
*addr = ptr_instance->enabled_known_extensions.ext_debug_report == 1 ? (void *)debug_utils_CreateDebugReportCallbackEXT : NULL;
ret_type = true;
} else if (!strcmp("vkDestroyDebugReportCallbackEXT", name)) {
*addr = ptr_instance->enabled_known_extensions.ext_debug_report == 1 ? (void *)debug_utils_DestroyDebugReportCallbackEXT : NULL;
ret_type = true;
} else if (!strcmp("vkDebugReportMessageEXT", name)) {
*addr = ptr_instance->enabled_known_extensions.ext_debug_report == 1 ? (void *)debug_utils_DebugReportMessageEXT : NULL;
return true;
}
if (!strcmp("vkCreateDebugUtilsMessengerEXT", name)) {
*addr = ptr_instance->enabled_known_extensions.ext_debug_utils == 1 ? (void *)debug_utils_CreateDebugUtilsMessengerEXT : NULL;
ret_type = true;
} else if (!strcmp("vkDestroyDebugUtilsMessengerEXT", name)) {
*addr = ptr_instance->enabled_known_extensions.ext_debug_utils == 1 ? (void *)debug_utils_DestroyDebugUtilsMessengerEXT : NULL;
ret_type = true;
} else if (!strcmp("vkSubmitDebugUtilsMessageEXT", name)) {
*addr = ptr_instance->enabled_known_extensions.ext_debug_utils == 1 ? (void *)debug_utils_SubmitDebugUtilsMessageEXT : NULL;
ret_type = true;
}
return ret_type;
}
bool debug_utils_ReportFlagsToAnnotFlags(VkDebugReportFlagsEXT dr_flags, bool default_flag_is_spec,
VkDebugUtilsMessageSeverityFlagBitsEXT *da_severity,
VkDebugUtilsMessageTypeFlagsEXT *da_type) {
bool type_set = false;
if (NULL == da_severity || NULL == da_type) {
return false;
}
*da_type = 0;
*da_severity = 0;
if ((dr_flags & VK_DEBUG_REPORT_INFORMATION_BIT_EXT) != 0) {
*da_severity = VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT;
*da_type |= VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT;
type_set = true;
} else if ((dr_flags & (VK_DEBUG_REPORT_WARNING_BIT_EXT | VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT)) != 0) {
*da_severity = VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT;
} else if ((dr_flags & VK_DEBUG_REPORT_ERROR_BIT_EXT) != 0) {
*da_severity = VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT;
} else if ((dr_flags & VK_DEBUG_REPORT_DEBUG_BIT_EXT) != 0) {
*da_severity = VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT;
*da_type |= VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT;
type_set = true;
}
if ((dr_flags & VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT) != 0) {
*da_type |= VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT;
} else if (!type_set) {
if (default_flag_is_spec) {
*da_type |= VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT;
} else {
*da_type |= VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT;
}
}
return true;
}
bool debug_utils_AnnotFlagsToReportFlags(VkDebugUtilsMessageSeverityFlagBitsEXT da_severity,
VkDebugUtilsMessageTypeFlagsEXT da_type, VkDebugReportFlagsEXT *dr_flags) {
if (NULL == dr_flags) {
return false;
}
*dr_flags = 0;
if ((da_severity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT) != 0) {
*dr_flags |= VK_DEBUG_REPORT_ERROR_BIT_EXT;
} else if ((da_severity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT) != 0) {
if ((da_type & VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT) != 0) {
*dr_flags |= VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT;
} else {
*dr_flags |= VK_DEBUG_REPORT_WARNING_BIT_EXT;
}
} else if ((da_severity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT) != 0) {
*dr_flags |= VK_DEBUG_REPORT_INFORMATION_BIT_EXT;
} else if ((da_severity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT) != 0) {
*dr_flags |= VK_DEBUG_REPORT_DEBUG_BIT_EXT;
}
return true;
}
bool debug_utils_ReportObjectToAnnotObject(VkDebugReportObjectTypeEXT dr_object_type, uint64_t object_handle,
VkDebugUtilsObjectNameInfoEXT *da_object_name_info) {
if (NULL == da_object_name_info) {
return false;
}
da_object_name_info->sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT;
da_object_name_info->pNext = NULL;
da_object_name_info->objectHandle = (uint64_t)(uintptr_t)object_handle;
da_object_name_info->pObjectName = NULL;
da_object_name_info->objectType = convertDebugReportObjectToCoreObject(dr_object_type);
return true;
}
bool debug_utils_AnnotObjectToDebugReportObject(const VkDebugUtilsObjectNameInfoEXT *da_object_name_info,
VkDebugReportObjectTypeEXT *dr_object_type, uint64_t *dr_object_handle) {
if (NULL == da_object_name_info || NULL == dr_object_type || NULL == dr_object_handle) {
return false;
}
*dr_object_type = convertCoreObjectToDebugReportObject(da_object_name_info->objectType);
*dr_object_handle = da_object_name_info->objectHandle;
return true;
}

101
thirdparty/vulkan/loader/debug_utils.h vendored Executable file
View File

@ -0,0 +1,101 @@
/*
* Copyright (c) 2015-2017 The Khronos Group Inc.
* Copyright (c) 2015-2017 Valve Corporation
* Copyright (c) 2015-2017 LunarG, Inc.
* Copyright (C) 2015-2016 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: Courtney Goeltzenleuchter <courtney@LunarG.com>
* Author: Jon Ashburn <jon@lunarg.com>
* Author: Mark Young <markyk@lunarg.com>
*
*/
#include "vk_loader_platform.h"
#include "loader.h"
// General utilities
void debug_utils_AddInstanceExtensions(const struct loader_instance *inst, struct loader_extension_list *ext_list);
void debug_utils_CreateInstance(struct loader_instance *ptr_instance, const VkInstanceCreateInfo *pCreateInfo);
bool debug_utils_InstanceGpa(struct loader_instance *ptr_instance, const char *name, void **addr);
bool debug_utils_ReportFlagsToAnnotFlags(VkDebugReportFlagsEXT dr_flags, bool default_flag_is_spec,
VkDebugUtilsMessageSeverityFlagBitsEXT *da_severity,
VkDebugUtilsMessageTypeFlagsEXT *da_type);
bool debug_utils_AnnotFlagsToReportFlags(VkDebugUtilsMessageSeverityFlagBitsEXT da_severity,
VkDebugUtilsMessageTypeFlagsEXT da_type, VkDebugReportFlagsEXT *dr_flags);
bool debug_utils_ReportObjectToAnnotObject(VkDebugReportObjectTypeEXT dr_object_type, uint64_t object_handle,
VkDebugUtilsObjectNameInfoEXT *da_object_name_info);
bool debug_utils_AnnotObjectToDebugReportObject(const VkDebugUtilsObjectNameInfoEXT *da_object_name_info,
VkDebugReportObjectTypeEXT *dr_object_type, uint64_t *dr_object_handle);
// VK_EXT_debug_utils related items
VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDebugUtilsMessengerEXT(VkInstance instance,
const VkDebugUtilsMessengerCreateInfoEXT *pCreateInfo,
const VkAllocationCallbacks *pAllocator,
VkDebugUtilsMessengerEXT *pMessenger);
VKAPI_ATTR void VKAPI_CALL terminator_DestroyDebugUtilsMessengerEXT(VkInstance instance, VkDebugUtilsMessengerEXT messenger,
const VkAllocationCallbacks *pAllocator);
VKAPI_ATTR void VKAPI_CALL terminator_SubmitDebugUtilsMessageEXT(VkInstance instance,
VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
VkDebugUtilsMessageTypeFlagsEXT messageTypes,
const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData);
VkResult util_CreateDebugUtilsMessenger(struct loader_instance *inst, const VkDebugUtilsMessengerCreateInfoEXT *pCreateInfo,
const VkAllocationCallbacks *pAllocator, VkDebugUtilsMessengerEXT messenger);
VkResult util_CreateDebugUtilsMessengers(struct loader_instance *inst, const VkAllocationCallbacks *pAllocator,
uint32_t num_messengers, VkDebugUtilsMessengerCreateInfoEXT *infos,
VkDebugUtilsMessengerEXT *messengers);
VkBool32 util_SubmitDebugUtilsMessageEXT(const struct loader_instance *inst, VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
VkDebugUtilsMessageTypeFlagsEXT messageTypes,
const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData);
VkResult util_CopyDebugUtilsMessengerCreateInfos(const void *pChain, const VkAllocationCallbacks *pAllocator,
uint32_t *num_messengers, VkDebugUtilsMessengerCreateInfoEXT **infos,
VkDebugUtilsMessengerEXT **messengers);
void util_DestroyDebugUtilsMessenger(struct loader_instance *inst, VkDebugUtilsMessengerEXT messenger,
const VkAllocationCallbacks *pAllocator);
void util_DestroyDebugUtilsMessengers(struct loader_instance *inst, const VkAllocationCallbacks *pAllocator,
uint32_t num_messengers, VkDebugUtilsMessengerEXT *messengers);
void util_FreeDebugUtilsMessengerCreateInfos(const VkAllocationCallbacks *pAllocator, VkDebugUtilsMessengerCreateInfoEXT *infos,
VkDebugUtilsMessengerEXT *messengers);
// VK_EXT_debug_report related items
VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDebugReportCallbackEXT(VkInstance instance,
const VkDebugReportCallbackCreateInfoEXT *pCreateInfo,
const VkAllocationCallbacks *pAllocator,
VkDebugReportCallbackEXT *pCallback);
VKAPI_ATTR void VKAPI_CALL terminator_DestroyDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackEXT callback,
const VkAllocationCallbacks *pAllocator);
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);
VkResult util_CreateDebugReportCallbacks(struct loader_instance *inst, const VkAllocationCallbacks *pAllocator,
uint32_t num_callbacks, VkDebugReportCallbackCreateInfoEXT *infos,
VkDebugReportCallbackEXT *callbacks);
VkBool32 util_DebugReportMessage(const struct loader_instance *inst, VkFlags msgFlags, VkDebugReportObjectTypeEXT objectType,
uint64_t srcObject, size_t location, int32_t msgCode, const char *pLayerPrefix, const char *pMsg);
VkResult util_CopyDebugReportCreateInfos(const void *pChain, const VkAllocationCallbacks *pAllocator, uint32_t *num_callbacks,
VkDebugReportCallbackCreateInfoEXT **infos, VkDebugReportCallbackEXT **callbacks);
void util_DestroyDebugReportCallback(struct loader_instance *inst, VkDebugReportCallbackEXT callback,
const VkAllocationCallbacks *pAllocator);
void util_DestroyDebugReportCallbacks(struct loader_instance *inst, const VkAllocationCallbacks *pAllocator, uint32_t num_callbacks,
VkDebugReportCallbackEXT *callbacks);
void util_FreeDebugReportCreateInfos(const VkAllocationCallbacks *pAllocator, VkDebugReportCallbackCreateInfoEXT *infos,
VkDebugReportCallbackEXT *callbacks);

538
thirdparty/vulkan/loader/dev_ext_trampoline.c vendored Executable file
View File

@ -0,0 +1,538 @@
/*
* 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: Jon Ashburn <jon@lunarg.com>
* Author: Lenny Komow <lenny@lunarg.com>
*/
#include "vk_loader_platform.h"
#include "loader.h"
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC optimize(3) // force gcc to use tail-calls
#endif
// Clang-format does not understand macros.
// clang-format off
VKAPI_ATTR void VKAPI_CALL vkdev_ext0(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext1(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext2(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext3(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext4(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext5(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext6(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext7(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext8(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext9(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext10(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext11(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext12(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext13(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext14(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext15(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext16(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext17(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext18(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext19(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext20(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext21(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext22(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext23(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext24(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext25(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext26(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext27(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext28(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext29(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext30(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext31(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext32(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext33(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext34(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext35(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext36(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext37(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext38(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext39(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext40(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext41(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext42(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext43(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext44(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext45(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext46(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext47(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext48(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext49(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext50(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext51(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext52(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext53(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext54(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext55(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext56(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext57(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext58(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext59(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext60(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext61(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext62(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext63(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext64(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext65(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext66(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext67(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext68(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext69(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext70(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext71(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext72(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext73(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext74(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext75(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext76(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext77(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext78(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext79(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext80(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext81(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext82(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext83(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext84(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext85(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext86(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext87(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext88(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext89(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext90(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext91(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext92(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext93(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext94(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext95(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext96(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext97(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext98(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext99(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext100(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext101(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext102(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext103(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext104(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext105(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext106(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext107(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext108(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext109(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext110(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext111(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext112(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext113(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext114(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext115(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext116(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext117(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext118(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext119(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext120(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext121(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext122(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext123(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext124(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext125(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext126(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext127(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext128(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext129(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext130(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext131(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext132(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext133(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext134(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext135(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext136(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext137(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext138(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext139(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext140(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext141(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext142(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext143(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext144(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext145(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext146(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext147(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext148(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext149(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext150(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext151(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext152(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext153(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext154(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext155(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext156(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext157(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext158(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext159(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext160(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext161(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext162(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext163(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext164(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext165(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext166(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext167(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext168(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext169(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext170(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext171(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext172(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext173(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext174(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext175(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext176(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext177(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext178(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext179(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext180(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext181(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext182(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext183(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext184(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext185(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext186(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext187(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext188(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext189(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext190(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext191(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext192(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext193(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext194(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext195(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext196(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext197(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext198(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext199(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext200(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext201(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext202(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext203(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext204(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext205(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext206(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext207(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext208(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext209(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext210(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext211(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext212(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext213(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext214(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext215(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext216(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext217(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext218(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext219(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext220(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext221(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext222(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext223(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext224(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext225(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext226(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext227(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext228(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext229(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext230(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext231(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext232(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext233(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext234(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext235(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext236(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext237(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext238(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext239(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext240(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext241(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext242(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext243(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext244(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext245(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext246(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext247(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext248(VkDevice device);
VKAPI_ATTR void VKAPI_CALL vkdev_ext249(VkDevice device);
void *loader_get_dev_ext_trampoline(uint32_t index) {
switch (index) {
#define CASE_HANDLE(num) case num: return vkdev_ext##num
CASE_HANDLE(0);
CASE_HANDLE(1);
CASE_HANDLE(2);
CASE_HANDLE(3);
CASE_HANDLE(4);
CASE_HANDLE(5);
CASE_HANDLE(6);
CASE_HANDLE(7);
CASE_HANDLE(8);
CASE_HANDLE(9);
CASE_HANDLE(10);
CASE_HANDLE(11);
CASE_HANDLE(12);
CASE_HANDLE(13);
CASE_HANDLE(14);
CASE_HANDLE(15);
CASE_HANDLE(16);
CASE_HANDLE(17);
CASE_HANDLE(18);
CASE_HANDLE(19);
CASE_HANDLE(20);
CASE_HANDLE(21);
CASE_HANDLE(22);
CASE_HANDLE(23);
CASE_HANDLE(24);
CASE_HANDLE(25);
CASE_HANDLE(26);
CASE_HANDLE(27);
CASE_HANDLE(28);
CASE_HANDLE(29);
CASE_HANDLE(30);
CASE_HANDLE(31);
CASE_HANDLE(32);
CASE_HANDLE(33);
CASE_HANDLE(34);
CASE_HANDLE(35);
CASE_HANDLE(36);
CASE_HANDLE(37);
CASE_HANDLE(38);
CASE_HANDLE(39);
CASE_HANDLE(40);
CASE_HANDLE(41);
CASE_HANDLE(42);
CASE_HANDLE(43);
CASE_HANDLE(44);
CASE_HANDLE(45);
CASE_HANDLE(46);
CASE_HANDLE(47);
CASE_HANDLE(48);
CASE_HANDLE(49);
CASE_HANDLE(50);
CASE_HANDLE(51);
CASE_HANDLE(52);
CASE_HANDLE(53);
CASE_HANDLE(54);
CASE_HANDLE(55);
CASE_HANDLE(56);
CASE_HANDLE(57);
CASE_HANDLE(58);
CASE_HANDLE(59);
CASE_HANDLE(60);
CASE_HANDLE(61);
CASE_HANDLE(62);
CASE_HANDLE(63);
CASE_HANDLE(64);
CASE_HANDLE(65);
CASE_HANDLE(66);
CASE_HANDLE(67);
CASE_HANDLE(68);
CASE_HANDLE(69);
CASE_HANDLE(70);
CASE_HANDLE(71);
CASE_HANDLE(72);
CASE_HANDLE(73);
CASE_HANDLE(74);
CASE_HANDLE(75);
CASE_HANDLE(76);
CASE_HANDLE(77);
CASE_HANDLE(78);
CASE_HANDLE(79);
CASE_HANDLE(80);
CASE_HANDLE(81);
CASE_HANDLE(82);
CASE_HANDLE(83);
CASE_HANDLE(84);
CASE_HANDLE(85);
CASE_HANDLE(86);
CASE_HANDLE(87);
CASE_HANDLE(88);
CASE_HANDLE(89);
CASE_HANDLE(90);
CASE_HANDLE(91);
CASE_HANDLE(92);
CASE_HANDLE(93);
CASE_HANDLE(94);
CASE_HANDLE(95);
CASE_HANDLE(96);
CASE_HANDLE(97);
CASE_HANDLE(98);
CASE_HANDLE(99);
CASE_HANDLE(100);
CASE_HANDLE(101);
CASE_HANDLE(102);
CASE_HANDLE(103);
CASE_HANDLE(104);
CASE_HANDLE(105);
CASE_HANDLE(106);
CASE_HANDLE(107);
CASE_HANDLE(108);
CASE_HANDLE(109);
CASE_HANDLE(110);
CASE_HANDLE(111);
CASE_HANDLE(112);
CASE_HANDLE(113);
CASE_HANDLE(114);
CASE_HANDLE(115);
CASE_HANDLE(116);
CASE_HANDLE(117);
CASE_HANDLE(118);
CASE_HANDLE(119);
CASE_HANDLE(120);
CASE_HANDLE(121);
CASE_HANDLE(122);
CASE_HANDLE(123);
CASE_HANDLE(124);
CASE_HANDLE(125);
CASE_HANDLE(126);
CASE_HANDLE(127);
CASE_HANDLE(128);
CASE_HANDLE(129);
CASE_HANDLE(130);
CASE_HANDLE(131);
CASE_HANDLE(132);
CASE_HANDLE(133);
CASE_HANDLE(134);
CASE_HANDLE(135);
CASE_HANDLE(136);
CASE_HANDLE(137);
CASE_HANDLE(138);
CASE_HANDLE(139);
CASE_HANDLE(140);
CASE_HANDLE(141);
CASE_HANDLE(142);
CASE_HANDLE(143);
CASE_HANDLE(144);
CASE_HANDLE(145);
CASE_HANDLE(146);
CASE_HANDLE(147);
CASE_HANDLE(148);
CASE_HANDLE(149);
CASE_HANDLE(150);
CASE_HANDLE(151);
CASE_HANDLE(152);
CASE_HANDLE(153);
CASE_HANDLE(154);
CASE_HANDLE(155);
CASE_HANDLE(156);
CASE_HANDLE(157);
CASE_HANDLE(158);
CASE_HANDLE(159);
CASE_HANDLE(160);
CASE_HANDLE(161);
CASE_HANDLE(162);
CASE_HANDLE(163);
CASE_HANDLE(164);
CASE_HANDLE(165);
CASE_HANDLE(166);
CASE_HANDLE(167);
CASE_HANDLE(168);
CASE_HANDLE(169);
CASE_HANDLE(170);
CASE_HANDLE(171);
CASE_HANDLE(172);
CASE_HANDLE(173);
CASE_HANDLE(174);
CASE_HANDLE(175);
CASE_HANDLE(176);
CASE_HANDLE(177);
CASE_HANDLE(178);
CASE_HANDLE(179);
CASE_HANDLE(180);
CASE_HANDLE(181);
CASE_HANDLE(182);
CASE_HANDLE(183);
CASE_HANDLE(184);
CASE_HANDLE(185);
CASE_HANDLE(186);
CASE_HANDLE(187);
CASE_HANDLE(188);
CASE_HANDLE(189);
CASE_HANDLE(190);
CASE_HANDLE(191);
CASE_HANDLE(192);
CASE_HANDLE(193);
CASE_HANDLE(194);
CASE_HANDLE(195);
CASE_HANDLE(196);
CASE_HANDLE(197);
CASE_HANDLE(198);
CASE_HANDLE(199);
CASE_HANDLE(200);
CASE_HANDLE(201);
CASE_HANDLE(202);
CASE_HANDLE(203);
CASE_HANDLE(204);
CASE_HANDLE(205);
CASE_HANDLE(206);
CASE_HANDLE(207);
CASE_HANDLE(208);
CASE_HANDLE(209);
CASE_HANDLE(210);
CASE_HANDLE(211);
CASE_HANDLE(212);
CASE_HANDLE(213);
CASE_HANDLE(214);
CASE_HANDLE(215);
CASE_HANDLE(216);
CASE_HANDLE(217);
CASE_HANDLE(218);
CASE_HANDLE(219);
CASE_HANDLE(220);
CASE_HANDLE(221);
CASE_HANDLE(222);
CASE_HANDLE(223);
CASE_HANDLE(224);
CASE_HANDLE(225);
CASE_HANDLE(226);
CASE_HANDLE(227);
CASE_HANDLE(228);
CASE_HANDLE(229);
CASE_HANDLE(230);
CASE_HANDLE(231);
CASE_HANDLE(232);
CASE_HANDLE(233);
CASE_HANDLE(234);
CASE_HANDLE(235);
CASE_HANDLE(236);
CASE_HANDLE(237);
CASE_HANDLE(238);
CASE_HANDLE(239);
CASE_HANDLE(240);
CASE_HANDLE(241);
CASE_HANDLE(242);
CASE_HANDLE(243);
CASE_HANDLE(244);
CASE_HANDLE(245);
CASE_HANDLE(246);
CASE_HANDLE(247);
CASE_HANDLE(248);
CASE_HANDLE(249);
}
return NULL;
}

128
thirdparty/vulkan/loader/dirent_on_windows.c vendored Executable file
View File

@ -0,0 +1,128 @@
/*
Implementation of POSIX directory browsing functions and types for Win32.
Author: Kevlin Henney (kevlin@acm.org, kevlin@curbralan.com)
History: Created March 1997. Updated June 2003 and July 2012.
Rights: See end of file.
*/
#include "dirent_on_windows.h"
#include <errno.h>
#include <io.h> /* _findfirst and _findnext set errno iff they return -1 */
#include <stdlib.h>
#include <string.h>
#include "vk_loader_platform.h"
#include "loader.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef ptrdiff_t handle_type; /* C99's intptr_t not sufficiently portable */
struct DIR {
handle_type handle; /* -1 for failed rewind */
struct _finddata_t info;
struct dirent result; /* d_name null iff first time */
char *name; /* null-terminated char string */
};
DIR *opendir(const char *name) {
DIR *dir = 0;
if (name && name[0]) {
size_t base_length = strlen(name);
const char *all = /* search pattern must end with suitable wildcard */
strchr("/\\", name[base_length - 1]) ? "*" : "/*";
if ((dir = (DIR *)loader_instance_tls_heap_alloc(sizeof *dir)) != 0 &&
(dir->name = (char *)loader_instance_tls_heap_alloc(base_length + strlen(all) + 1)) != 0) {
strcat(strcpy(dir->name, name), all);
if ((dir->handle = (handle_type)_findfirst(dir->name, &dir->info)) != -1) {
dir->result.d_name = 0;
} else /* rollback */
{
loader_instance_tls_heap_free(dir->name);
loader_instance_tls_heap_free(dir);
dir = 0;
}
} else /* rollback */
{
loader_instance_tls_heap_free(dir);
dir = 0;
errno = ENOMEM;
}
} else {
errno = EINVAL;
}
return dir;
}
int closedir(DIR *dir) {
int result = -1;
if (dir) {
if (dir->handle != -1) {
result = _findclose(dir->handle);
}
loader_instance_tls_heap_free(dir->name);
loader_instance_tls_heap_free(dir);
}
if (result == -1) /* map all errors to EBADF */
{
errno = EBADF;
}
return result;
}
struct dirent *readdir(DIR *dir) {
struct dirent *result = 0;
if (dir && dir->handle != -1) {
if (!dir->result.d_name || _findnext(dir->handle, &dir->info) != -1) {
result = &dir->result;
result->d_name = dir->info.name;
}
} else {
errno = EBADF;
}
return result;
}
void rewinddir(DIR *dir) {
if (dir && dir->handle != -1) {
_findclose(dir->handle);
dir->handle = (handle_type)_findfirst(dir->name, &dir->info);
dir->result.d_name = 0;
} else {
errno = EBADF;
}
}
#ifdef __cplusplus
}
#endif
/*
Copyright Kevlin Henney, 1997, 2003, 2012. All rights reserved.
Copyright (c) 2015 The Khronos Group Inc.
Copyright (c) 2015 Valve Corporation
Copyright (c) 2015 LunarG, Inc.
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose is hereby granted without fee, provided
that this copyright and permissions notice appear in all copies and
derivatives.
This software is supplied "as is" without express or implied warranty.
But that said, if there are any problems please get in touch.
*/

51
thirdparty/vulkan/loader/dirent_on_windows.h vendored Executable file
View File

@ -0,0 +1,51 @@
#ifndef DIRENT_INCLUDED
#define DIRENT_INCLUDED
/*
Declaration of POSIX directory browsing functions and types for Win32.
Author: Kevlin Henney (kevlin@acm.org, kevlin@curbralan.com)
History: Created March 1997. Updated June 2003.
Rights: See end of file.
*/
#ifdef __cplusplus
extern "C" {
#endif
typedef struct DIR DIR;
struct dirent {
char *d_name;
};
DIR *opendir(const char *);
int closedir(DIR *);
struct dirent *readdir(DIR *);
void rewinddir(DIR *);
/*
Copyright Kevlin Henney, 1997, 2003. All rights reserved.
Copyright (c) 2015 The Khronos Group Inc.
Copyright (c) 2015 Valve Corporation
Copyright (c) 2015 LunarG, Inc.
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose is hereby granted without fee, provided
that this copyright and permissions notice appear in all copies and
derivatives.
This software is supplied "as is" without express or implied warranty.
But that said, if there are any problems please get in touch.
*/
#ifdef __cplusplus
}
#endif
#endif

432
thirdparty/vulkan/loader/extension_manual.c vendored Executable file
View File

@ -0,0 +1,432 @@
/*
* 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 Young <marky@lunarg.com>
* Author: Lenny Komow <lenny@lunarg.com>
*/
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "vk_loader_platform.h"
#include "loader.h"
#include "vk_loader_extensions.h"
#include <vulkan/vk_icd.h>
#include "wsi.h"
#include "debug_utils.h"
// ---- Manually added trampoline/terminator functions
// These functions, for whatever reason, require more complex changes than
// can easily be automatically generated.
// ---- VK_KHR_device_group extension trampoline/terminators
VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceCapabilities2KHR(VkPhysicalDevice physicalDevice,
const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo,
VkSurfaceCapabilities2KHR *pSurfaceCapabilities) {
const VkLayerInstanceDispatchTable *disp;
VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice);
disp = loader_get_instance_layer_dispatch(physicalDevice);
return disp->GetPhysicalDeviceSurfaceCapabilities2KHR(unwrapped_phys_dev, pSurfaceInfo, pSurfaceCapabilities);
}
VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfaceCapabilities2KHR(
VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo,
VkSurfaceCapabilities2KHR *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;
VkIcdSurface *icd_surface = (VkIcdSurface *)(pSurfaceInfo->surface);
uint8_t icd_index = phys_dev_term->icd_index;
if (icd_term->dispatch.GetPhysicalDeviceSurfaceCapabilities2KHR != NULL) {
// Pass the call to the driver, possibly unwrapping the ICD surface
if (icd_surface->real_icd_surfaces != NULL && (void *)icd_surface->real_icd_surfaces[icd_index] != NULL) {
VkPhysicalDeviceSurfaceInfo2KHR info_copy = *pSurfaceInfo;
info_copy.surface = icd_surface->real_icd_surfaces[icd_index];
return icd_term->dispatch.GetPhysicalDeviceSurfaceCapabilities2KHR(phys_dev_term->phys_dev, &info_copy,
pSurfaceCapabilities);
} else {
return icd_term->dispatch.GetPhysicalDeviceSurfaceCapabilities2KHR(phys_dev_term->phys_dev, pSurfaceInfo,
pSurfaceCapabilities);
}
} else {
// Emulate the call
loader_log(icd_term->this_instance, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0,
"vkGetPhysicalDeviceSurfaceCapabilities2KHR: Emulating call in ICD \"%s\" using "
"vkGetPhysicalDeviceSurfaceCapabilitiesKHR",
icd_term->scanned_icd->lib_name);
if (pSurfaceInfo->pNext != NULL) {
loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0,
"vkGetPhysicalDeviceSurfaceCapabilities2KHR: Emulation found unrecognized structure type in "
"pSurfaceInfo->pNext - this struct will be ignored");
}
// Write to the VkSurfaceCapabilities2KHR struct
VkSurfaceKHR surface = pSurfaceInfo->surface;
if (icd_surface->real_icd_surfaces != NULL && (void *)icd_surface->real_icd_surfaces[icd_index] != NULL) {
surface = icd_surface->real_icd_surfaces[icd_index];
}
VkResult res = icd_term->dispatch.GetPhysicalDeviceSurfaceCapabilitiesKHR(phys_dev_term->phys_dev, surface,
&pSurfaceCapabilities->surfaceCapabilities);
if (pSurfaceCapabilities->pNext != NULL) {
loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0,
"vkGetPhysicalDeviceSurfaceCapabilities2KHR: Emulation found unrecognized structure type in "
"pSurfaceCapabilities->pNext - this struct will be ignored");
}
return res;
}
}
// ---- VK_NV_external_memory_capabilities extension trampoline/terminators
VKAPI_ATTR VkResult VKAPI_CALL
GetPhysicalDeviceExternalImageFormatPropertiesNV(
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->dispatch.GetPhysicalDeviceExternalImageFormatPropertiesNV) {
if (externalHandleType) {
return VK_ERROR_FORMAT_NOT_SUPPORTED;
}
if (!icd_term->dispatch.GetPhysicalDeviceImageFormatProperties) {
return VK_ERROR_INITIALIZATION_FAILED;
}
pExternalImageFormatProperties->externalMemoryFeatures = 0;
pExternalImageFormatProperties->exportFromImportedHandleTypes = 0;
pExternalImageFormatProperties->compatibleHandleTypes = 0;
return icd_term->dispatch.GetPhysicalDeviceImageFormatProperties(
phys_dev_term->phys_dev, format, type, tiling, usage, flags,
&pExternalImageFormatProperties->imageFormatProperties);
}
return icd_term->dispatch.GetPhysicalDeviceExternalImageFormatPropertiesNV(
phys_dev_term->phys_dev, format, type, tiling, usage, flags,
externalHandleType, pExternalImageFormatProperties);
}
VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice physicalDevice,
const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo,
uint32_t *pSurfaceFormatCount,
VkSurfaceFormat2KHR *pSurfaceFormats) {
const VkLayerInstanceDispatchTable *disp;
VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice);
disp = loader_get_instance_layer_dispatch(physicalDevice);
return disp->GetPhysicalDeviceSurfaceFormats2KHR(unwrapped_phys_dev, pSurfaceInfo, pSurfaceFormatCount, pSurfaceFormats);
}
VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice physicalDevice,
const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo,
uint32_t *pSurfaceFormatCount,
VkSurfaceFormat2KHR *pSurfaceFormats) {
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;
VkIcdSurface *icd_surface = (VkIcdSurface *)(pSurfaceInfo->surface);
uint8_t icd_index = phys_dev_term->icd_index;
if (icd_term->dispatch.GetPhysicalDeviceSurfaceFormats2KHR != NULL) {
// Pass the call to the driver, possibly unwrapping the ICD surface
if (icd_surface->real_icd_surfaces != NULL && (void *)icd_surface->real_icd_surfaces[icd_index] != NULL) {
VkPhysicalDeviceSurfaceInfo2KHR info_copy = *pSurfaceInfo;
info_copy.surface = icd_surface->real_icd_surfaces[icd_index];
return icd_term->dispatch.GetPhysicalDeviceSurfaceFormats2KHR(phys_dev_term->phys_dev, &info_copy, pSurfaceFormatCount,
pSurfaceFormats);
} else {
return icd_term->dispatch.GetPhysicalDeviceSurfaceFormats2KHR(phys_dev_term->phys_dev, pSurfaceInfo,
pSurfaceFormatCount, pSurfaceFormats);
}
} else {
// Emulate the call
loader_log(icd_term->this_instance, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0,
"vkGetPhysicalDeviceSurfaceFormats2KHR: Emulating call in ICD \"%s\" using vkGetPhysicalDeviceSurfaceFormatsKHR",
icd_term->scanned_icd->lib_name);
if (pSurfaceInfo->pNext != NULL) {
loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0,
"vkGetPhysicalDeviceSurfaceFormats2KHR: Emulation found unrecognized structure type in pSurfaceInfo->pNext "
"- this struct will be ignored");
}
VkSurfaceKHR surface = pSurfaceInfo->surface;
if (icd_surface->real_icd_surfaces != NULL && (void *)icd_surface->real_icd_surfaces[icd_index] != NULL) {
surface = icd_surface->real_icd_surfaces[icd_index];
}
if (*pSurfaceFormatCount == 0 || pSurfaceFormats == NULL) {
// Write to pSurfaceFormatCount
return icd_term->dispatch.GetPhysicalDeviceSurfaceFormatsKHR(phys_dev_term->phys_dev, surface, pSurfaceFormatCount,
NULL);
} else {
// Allocate a temporary array for the output of the old function
VkSurfaceFormatKHR *formats = loader_stack_alloc(*pSurfaceFormatCount * sizeof(VkSurfaceFormatKHR));
if (formats == NULL) {
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
VkResult res = icd_term->dispatch.GetPhysicalDeviceSurfaceFormatsKHR(phys_dev_term->phys_dev, surface,
pSurfaceFormatCount, formats);
for (uint32_t i = 0; i < *pSurfaceFormatCount; ++i) {
pSurfaceFormats[i].surfaceFormat = formats[i];
if (pSurfaceFormats[i].pNext != NULL) {
loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0,
"vkGetPhysicalDeviceSurfaceFormats2KHR: Emulation found unrecognized structure type in "
"pSurfaceFormats[%d].pNext - this struct will be ignored",
i);
}
}
return res;
}
}
}
// ---- VK_EXT_display_surface_counter extension trampoline/terminators
VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceCapabilities2EXT(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;
VkIcdSurface *icd_surface = (VkIcdSurface *)(surface);
uint8_t icd_index = phys_dev_term->icd_index;
// Unwrap the surface if needed
VkSurfaceKHR unwrapped_surface = surface;
if (icd_surface->real_icd_surfaces != NULL && (void *)icd_surface->real_icd_surfaces[icd_index] != NULL) {
unwrapped_surface = icd_surface->real_icd_surfaces[icd_index];
}
if (icd_term->dispatch.GetPhysicalDeviceSurfaceCapabilities2EXT != NULL) {
// Pass the call to the driver
return icd_term->dispatch.GetPhysicalDeviceSurfaceCapabilities2EXT(phys_dev_term->phys_dev, unwrapped_surface,
pSurfaceCapabilities);
} else {
// Emulate the call
loader_log(icd_term->this_instance, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0,
"vkGetPhysicalDeviceSurfaceCapabilities2EXT: Emulating call in ICD \"%s\" using "
"vkGetPhysicalDeviceSurfaceCapabilitiesKHR",
icd_term->scanned_icd->lib_name);
VkSurfaceCapabilitiesKHR surface_caps;
VkResult res =
icd_term->dispatch.GetPhysicalDeviceSurfaceCapabilitiesKHR(phys_dev_term->phys_dev, unwrapped_surface, &surface_caps);
pSurfaceCapabilities->minImageCount = surface_caps.minImageCount;
pSurfaceCapabilities->maxImageCount = surface_caps.maxImageCount;
pSurfaceCapabilities->currentExtent = surface_caps.currentExtent;
pSurfaceCapabilities->minImageExtent = surface_caps.minImageExtent;
pSurfaceCapabilities->maxImageExtent = surface_caps.maxImageExtent;
pSurfaceCapabilities->maxImageArrayLayers = surface_caps.maxImageArrayLayers;
pSurfaceCapabilities->supportedTransforms = surface_caps.supportedTransforms;
pSurfaceCapabilities->currentTransform = surface_caps.currentTransform;
pSurfaceCapabilities->supportedCompositeAlpha = surface_caps.supportedCompositeAlpha;
pSurfaceCapabilities->supportedUsageFlags = surface_caps.supportedUsageFlags;
pSurfaceCapabilities->supportedSurfaceCounters = 0;
if (pSurfaceCapabilities->pNext != NULL) {
loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0,
"vkGetPhysicalDeviceSurfaceCapabilities2EXT: Emulation found unrecognized structure type in "
"pSurfaceCapabilities->pNext - this struct will be ignored");
}
return res;
}
}
// ---- VK_EXT_direct_mode_display extension trampoline/terminators
VKAPI_ATTR VkResult VKAPI_CALL ReleaseDisplayEXT(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 (icd_term->dispatch.ReleaseDisplayEXT == NULL) {
loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,
"ICD \"%s\" associated with VkPhysicalDevice does not support vkReleaseDisplayEXT - Consequently, the call is "
"invalid because it should not be possible to acquire a display on this device",
icd_term->scanned_icd->lib_name);
}
return icd_term->dispatch.ReleaseDisplayEXT(phys_dev_term->phys_dev, display);
}
// ---- VK_EXT_acquire_xlib_display extension trampoline/terminators
#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT
VKAPI_ATTR VkResult VKAPI_CALL AcquireXlibDisplayEXT(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 (icd_term->dispatch.AcquireXlibDisplayEXT != NULL) {
// Pass the call to the driver
return icd_term->dispatch.AcquireXlibDisplayEXT(phys_dev_term->phys_dev, dpy, display);
} else {
// Emulate the call
loader_log(icd_term->this_instance, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0,
"vkAcquireXLibDisplayEXT: Emulating call in ICD \"%s\" by returning error", icd_term->scanned_icd->lib_name);
// Fail for the unsupported command
return VK_ERROR_INITIALIZATION_FAILED;
}
}
VKAPI_ATTR VkResult VKAPI_CALL GetRandROutputDisplayEXT(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 (icd_term->dispatch.GetRandROutputDisplayEXT != NULL) {
// Pass the call to the driver
return icd_term->dispatch.GetRandROutputDisplayEXT(phys_dev_term->phys_dev, dpy, rrOutput, pDisplay);
} else {
// Emulate the call
loader_log(icd_term->this_instance, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0,
"vkGetRandROutputDisplayEXT: Emulating call in ICD \"%s\" by returning null display",
icd_term->scanned_icd->lib_name);
// Return a null handle to indicate this can't be done
*pDisplay = VK_NULL_HANDLE;
return VK_SUCCESS;
}
}
#endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT
#ifdef VK_USE_PLATFORM_WIN32_KHR
VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfacePresentModes2EXT(
VkPhysicalDevice physicalDevice,
const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
uint32_t* pPresentModeCount,
VkPresentModeKHR* pPresentModes) {
const VkLayerInstanceDispatchTable *disp;
VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice);
disp = loader_get_instance_layer_dispatch(physicalDevice);
return disp->GetPhysicalDeviceSurfacePresentModes2EXT(unwrapped_phys_dev, pSurfaceInfo, pPresentModeCount, pPresentModes);
}
VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfacePresentModes2EXT(
VkPhysicalDevice physicalDevice,
const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
uint32_t* pPresentModeCount,
VkPresentModeKHR* pPresentModes) {
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->dispatch.GetPhysicalDeviceSurfacePresentModes2EXT) {
loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,
"ICD associated with VkPhysicalDevice does not support GetPhysicalDeviceSurfacePresentModes2EXT");
}
VkIcdSurface *icd_surface = (VkIcdSurface *)(pSurfaceInfo->surface);
uint8_t icd_index = phys_dev_term->icd_index;
if (NULL != icd_surface->real_icd_surfaces && NULL != (void *)icd_surface->real_icd_surfaces[icd_index]) {
const VkPhysicalDeviceSurfaceInfo2KHR surface_info_copy = {
.sType = pSurfaceInfo->sType,
.pNext = pSurfaceInfo->pNext,
.surface = icd_surface->real_icd_surfaces[icd_index],
};
return icd_term->dispatch.GetPhysicalDeviceSurfacePresentModes2EXT(phys_dev_term->phys_dev, &surface_info_copy, pPresentModeCount, pPresentModes);
}
return icd_term->dispatch.GetPhysicalDeviceSurfacePresentModes2EXT(phys_dev_term->phys_dev, pSurfaceInfo, pPresentModeCount, pPresentModes);
}
VKAPI_ATTR VkResult VKAPI_CALL GetDeviceGroupSurfacePresentModes2EXT(
VkDevice device,
const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
VkDeviceGroupPresentModeFlagsKHR* pModes) {
const VkLayerDispatchTable *disp = loader_get_dispatch(device);
return disp->GetDeviceGroupSurfacePresentModes2EXT(device, pSurfaceInfo, pModes);
}
VKAPI_ATTR VkResult VKAPI_CALL terminator_GetDeviceGroupSurfacePresentModes2EXT(
VkDevice device,
const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
VkDeviceGroupPresentModeFlagsKHR* pModes) {
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->dispatch.GetDeviceGroupSurfacePresentModes2EXT) {
VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)pSurfaceInfo->surface;
if (NULL != icd_surface->real_icd_surfaces && (VkSurfaceKHR)NULL != icd_surface->real_icd_surfaces[icd_index]) {
const VkPhysicalDeviceSurfaceInfo2KHR surface_info_copy = {
.sType = pSurfaceInfo->sType,
.pNext = pSurfaceInfo->pNext,
.surface = icd_surface->real_icd_surfaces[icd_index],
};
return icd_term->dispatch.GetDeviceGroupSurfacePresentModes2EXT(device, &surface_info_copy, pModes);
}
return icd_term->dispatch.GetDeviceGroupSurfacePresentModes2EXT(device, pSurfaceInfo, pModes);
}
return VK_SUCCESS;
}
#endif // VK_USE_PLATFORM_WIN32_KHR

106
thirdparty/vulkan/loader/extension_manual.h vendored Executable file
View File

@ -0,0 +1,106 @@
/*
* 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 Young <marky@lunarg.com>
*/
#pragma once
// ---- Manually added trampoline/terminator functions
// These functions, for whatever reason, require more complex changes than
// can easily be automatically generated.
VKAPI_ATTR VkResult VKAPI_CALL
GetPhysicalDeviceExternalImageFormatPropertiesNV(
VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type,
VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags,
VkExternalMemoryHandleTypeFlagsNV externalHandleType,
VkExternalImageFormatPropertiesNV *pExternalImageFormatProperties);
VKAPI_ATTR VkResult VKAPI_CALL
terminator_GetPhysicalDeviceExternalImageFormatPropertiesNV(
VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type,
VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags,
VkExternalMemoryHandleTypeFlagsNV externalHandleType,
VkExternalImageFormatPropertiesNV *pExternalImageFormatProperties);
VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceCapabilities2KHR(VkPhysicalDevice physicalDevice,
const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
VkSurfaceCapabilities2KHR* pSurfaceCapabilities);
VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfaceCapabilities2KHR(
VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
VkSurfaceCapabilities2KHR* pSurfaceCapabilities);
VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice physicalDevice,
const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
uint32_t* pSurfaceFormatCount,
VkSurfaceFormat2KHR* pSurfaceFormats);
VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice physicalDevice,
const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
uint32_t* pSurfaceFormatCount,
VkSurfaceFormat2KHR* pSurfaceFormats);
VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceCapabilities2EXT(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface,
VkSurfaceCapabilities2EXT* pSurfaceCapabilities);
VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfaceCapabilities2EXT(VkPhysicalDevice physicalDevice,
VkSurfaceKHR surface,
VkSurfaceCapabilities2EXT* pSurfaceCapabilities);
VKAPI_ATTR VkResult VKAPI_CALL ReleaseDisplayEXT(VkPhysicalDevice physicalDevice, VkDisplayKHR display);
VKAPI_ATTR VkResult VKAPI_CALL terminator_ReleaseDisplayEXT(VkPhysicalDevice physicalDevice, VkDisplayKHR display);
#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT
VKAPI_ATTR VkResult VKAPI_CALL AcquireXlibDisplayEXT(VkPhysicalDevice physicalDevice, Display* dpy, VkDisplayKHR display);
VKAPI_ATTR VkResult VKAPI_CALL terminator_AcquireXlibDisplayEXT(VkPhysicalDevice physicalDevice, Display* dpy,
VkDisplayKHR display);
VKAPI_ATTR VkResult VKAPI_CALL GetRandROutputDisplayEXT(VkPhysicalDevice physicalDevice, Display* dpy, RROutput rrOutput,
VkDisplayKHR* pDisplay);
VKAPI_ATTR VkResult VKAPI_CALL terminator_GetRandROutputDisplayEXT(VkPhysicalDevice physicalDevice, Display* dpy, RROutput rrOutput,
VkDisplayKHR* pDisplay);
#endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT
#ifdef VK_USE_PLATFORM_WIN32_KHR
VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfacePresentModes2EXT(
VkPhysicalDevice physicalDevice,
const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
uint32_t* pPresentModeCount,
VkPresentModeKHR* pPresentModes);
VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfacePresentModes2EXT(
VkPhysicalDevice physicalDevice,
const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
uint32_t* pPresentModeCount,
VkPresentModeKHR* pPresentModes);
#endif // VK_USE_PLATFORM_WIN32_KHR
VKAPI_ATTR VkResult VKAPI_CALL GetDeviceGroupSurfacePresentModes2EXT(
VkDevice device,
const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
VkDeviceGroupPresentModeFlagsKHR* pModes);
VKAPI_ATTR VkResult VKAPI_CALL terminator_GetDeviceGroupSurfacePresentModes2EXT(
VkDevice device,
const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
VkDeviceGroupPresentModeFlagsKHR* pModes);

233
thirdparty/vulkan/loader/gpa_helper.h vendored Executable file
View File

@ -0,0 +1,233 @@
/*
*
* Copyright (c) 2015 The Khronos Group Inc.
* Copyright (c) 2015 Valve Corporation
* Copyright (c) 2015 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: Jon Ashburn <jon@lunarg.com>
*/
#include <string.h>
#include "debug_utils.h"
#include "wsi.h"
static inline void *trampolineGetProcAddr(struct loader_instance *inst, const char *funcName) {
// Don't include or check global functions
if (!strcmp(funcName, "vkGetInstanceProcAddr")) return vkGetInstanceProcAddr;
if (!strcmp(funcName, "vkDestroyInstance")) return vkDestroyInstance;
if (!strcmp(funcName, "vkEnumeratePhysicalDevices")) return vkEnumeratePhysicalDevices;
if (!strcmp(funcName, "vkGetPhysicalDeviceFeatures")) return vkGetPhysicalDeviceFeatures;
if (!strcmp(funcName, "vkGetPhysicalDeviceFormatProperties")) return vkGetPhysicalDeviceFormatProperties;
if (!strcmp(funcName, "vkGetPhysicalDeviceImageFormatProperties")) return vkGetPhysicalDeviceImageFormatProperties;
if (!strcmp(funcName, "vkGetPhysicalDeviceSparseImageFormatProperties")) return vkGetPhysicalDeviceSparseImageFormatProperties;
if (!strcmp(funcName, "vkGetPhysicalDeviceProperties")) return vkGetPhysicalDeviceProperties;
if (!strcmp(funcName, "vkGetPhysicalDeviceQueueFamilyProperties")) return vkGetPhysicalDeviceQueueFamilyProperties;
if (!strcmp(funcName, "vkGetPhysicalDeviceMemoryProperties")) return vkGetPhysicalDeviceMemoryProperties;
if (!strcmp(funcName, "vkEnumerateDeviceLayerProperties")) return vkEnumerateDeviceLayerProperties;
if (!strcmp(funcName, "vkEnumerateDeviceExtensionProperties")) return vkEnumerateDeviceExtensionProperties;
if (!strcmp(funcName, "vkCreateDevice")) return vkCreateDevice;
if (!strcmp(funcName, "vkGetDeviceProcAddr")) return vkGetDeviceProcAddr;
if (!strcmp(funcName, "vkDestroyDevice")) return vkDestroyDevice;
if (!strcmp(funcName, "vkGetDeviceQueue")) return vkGetDeviceQueue;
if (!strcmp(funcName, "vkQueueSubmit")) return vkQueueSubmit;
if (!strcmp(funcName, "vkQueueWaitIdle")) return vkQueueWaitIdle;
if (!strcmp(funcName, "vkDeviceWaitIdle")) return vkDeviceWaitIdle;
if (!strcmp(funcName, "vkAllocateMemory")) return vkAllocateMemory;
if (!strcmp(funcName, "vkFreeMemory")) return vkFreeMemory;
if (!strcmp(funcName, "vkMapMemory")) return vkMapMemory;
if (!strcmp(funcName, "vkUnmapMemory")) return vkUnmapMemory;
if (!strcmp(funcName, "vkFlushMappedMemoryRanges")) return vkFlushMappedMemoryRanges;
if (!strcmp(funcName, "vkInvalidateMappedMemoryRanges")) return vkInvalidateMappedMemoryRanges;
if (!strcmp(funcName, "vkGetDeviceMemoryCommitment")) return vkGetDeviceMemoryCommitment;
if (!strcmp(funcName, "vkGetImageSparseMemoryRequirements")) return vkGetImageSparseMemoryRequirements;
if (!strcmp(funcName, "vkGetImageMemoryRequirements")) return vkGetImageMemoryRequirements;
if (!strcmp(funcName, "vkGetBufferMemoryRequirements")) return vkGetBufferMemoryRequirements;
if (!strcmp(funcName, "vkBindImageMemory")) return vkBindImageMemory;
if (!strcmp(funcName, "vkBindBufferMemory")) return vkBindBufferMemory;
if (!strcmp(funcName, "vkQueueBindSparse")) return vkQueueBindSparse;
if (!strcmp(funcName, "vkCreateFence")) return vkCreateFence;
if (!strcmp(funcName, "vkDestroyFence")) return vkDestroyFence;
if (!strcmp(funcName, "vkGetFenceStatus")) return vkGetFenceStatus;
if (!strcmp(funcName, "vkResetFences")) return vkResetFences;
if (!strcmp(funcName, "vkWaitForFences")) return vkWaitForFences;
if (!strcmp(funcName, "vkCreateSemaphore")) return vkCreateSemaphore;
if (!strcmp(funcName, "vkDestroySemaphore")) return vkDestroySemaphore;
if (!strcmp(funcName, "vkCreateEvent")) return vkCreateEvent;
if (!strcmp(funcName, "vkDestroyEvent")) return vkDestroyEvent;
if (!strcmp(funcName, "vkGetEventStatus")) return vkGetEventStatus;
if (!strcmp(funcName, "vkSetEvent")) return vkSetEvent;
if (!strcmp(funcName, "vkResetEvent")) return vkResetEvent;
if (!strcmp(funcName, "vkCreateQueryPool")) return vkCreateQueryPool;
if (!strcmp(funcName, "vkDestroyQueryPool")) return vkDestroyQueryPool;
if (!strcmp(funcName, "vkGetQueryPoolResults")) return vkGetQueryPoolResults;
if (!strcmp(funcName, "vkCreateBuffer")) return vkCreateBuffer;
if (!strcmp(funcName, "vkDestroyBuffer")) return vkDestroyBuffer;
if (!strcmp(funcName, "vkCreateBufferView")) return vkCreateBufferView;
if (!strcmp(funcName, "vkDestroyBufferView")) return vkDestroyBufferView;
if (!strcmp(funcName, "vkCreateImage")) return vkCreateImage;
if (!strcmp(funcName, "vkDestroyImage")) return vkDestroyImage;
if (!strcmp(funcName, "vkGetImageSubresourceLayout")) return vkGetImageSubresourceLayout;
if (!strcmp(funcName, "vkCreateImageView")) return vkCreateImageView;
if (!strcmp(funcName, "vkDestroyImageView")) return vkDestroyImageView;
if (!strcmp(funcName, "vkCreateShaderModule")) return vkCreateShaderModule;
if (!strcmp(funcName, "vkDestroyShaderModule")) return vkDestroyShaderModule;
if (!strcmp(funcName, "vkCreatePipelineCache")) return vkCreatePipelineCache;
if (!strcmp(funcName, "vkDestroyPipelineCache")) return vkDestroyPipelineCache;
if (!strcmp(funcName, "vkGetPipelineCacheData")) return vkGetPipelineCacheData;
if (!strcmp(funcName, "vkMergePipelineCaches")) return vkMergePipelineCaches;
if (!strcmp(funcName, "vkCreateGraphicsPipelines")) return vkCreateGraphicsPipelines;
if (!strcmp(funcName, "vkCreateComputePipelines")) return vkCreateComputePipelines;
if (!strcmp(funcName, "vkDestroyPipeline")) return vkDestroyPipeline;
if (!strcmp(funcName, "vkCreatePipelineLayout")) return vkCreatePipelineLayout;
if (!strcmp(funcName, "vkDestroyPipelineLayout")) return vkDestroyPipelineLayout;
if (!strcmp(funcName, "vkCreateSampler")) return vkCreateSampler;
if (!strcmp(funcName, "vkDestroySampler")) return vkDestroySampler;
if (!strcmp(funcName, "vkCreateDescriptorSetLayout")) return vkCreateDescriptorSetLayout;
if (!strcmp(funcName, "vkDestroyDescriptorSetLayout")) return vkDestroyDescriptorSetLayout;
if (!strcmp(funcName, "vkCreateDescriptorPool")) return vkCreateDescriptorPool;
if (!strcmp(funcName, "vkDestroyDescriptorPool")) return vkDestroyDescriptorPool;
if (!strcmp(funcName, "vkResetDescriptorPool")) return vkResetDescriptorPool;
if (!strcmp(funcName, "vkAllocateDescriptorSets")) return vkAllocateDescriptorSets;
if (!strcmp(funcName, "vkFreeDescriptorSets")) return vkFreeDescriptorSets;
if (!strcmp(funcName, "vkUpdateDescriptorSets")) return vkUpdateDescriptorSets;
if (!strcmp(funcName, "vkCreateFramebuffer")) return vkCreateFramebuffer;
if (!strcmp(funcName, "vkDestroyFramebuffer")) return vkDestroyFramebuffer;
if (!strcmp(funcName, "vkCreateRenderPass")) return vkCreateRenderPass;
if (!strcmp(funcName, "vkDestroyRenderPass")) return vkDestroyRenderPass;
if (!strcmp(funcName, "vkGetRenderAreaGranularity")) return vkGetRenderAreaGranularity;
if (!strcmp(funcName, "vkCreateCommandPool")) return vkCreateCommandPool;
if (!strcmp(funcName, "vkDestroyCommandPool")) return vkDestroyCommandPool;
if (!strcmp(funcName, "vkResetCommandPool")) return vkResetCommandPool;
if (!strcmp(funcName, "vkAllocateCommandBuffers")) return vkAllocateCommandBuffers;
if (!strcmp(funcName, "vkFreeCommandBuffers")) return vkFreeCommandBuffers;
if (!strcmp(funcName, "vkBeginCommandBuffer")) return vkBeginCommandBuffer;
if (!strcmp(funcName, "vkEndCommandBuffer")) return vkEndCommandBuffer;
if (!strcmp(funcName, "vkResetCommandBuffer")) return vkResetCommandBuffer;
if (!strcmp(funcName, "vkCmdBindPipeline")) return vkCmdBindPipeline;
if (!strcmp(funcName, "vkCmdBindDescriptorSets")) return vkCmdBindDescriptorSets;
if (!strcmp(funcName, "vkCmdBindVertexBuffers")) return vkCmdBindVertexBuffers;
if (!strcmp(funcName, "vkCmdBindIndexBuffer")) return vkCmdBindIndexBuffer;
if (!strcmp(funcName, "vkCmdSetViewport")) return vkCmdSetViewport;
if (!strcmp(funcName, "vkCmdSetScissor")) return vkCmdSetScissor;
if (!strcmp(funcName, "vkCmdSetLineWidth")) return vkCmdSetLineWidth;
if (!strcmp(funcName, "vkCmdSetDepthBias")) return vkCmdSetDepthBias;
if (!strcmp(funcName, "vkCmdSetBlendConstants")) return vkCmdSetBlendConstants;
if (!strcmp(funcName, "vkCmdSetDepthBounds")) return vkCmdSetDepthBounds;
if (!strcmp(funcName, "vkCmdSetStencilCompareMask")) return vkCmdSetStencilCompareMask;
if (!strcmp(funcName, "vkCmdSetStencilWriteMask")) return vkCmdSetStencilWriteMask;
if (!strcmp(funcName, "vkCmdSetStencilReference")) return vkCmdSetStencilReference;
if (!strcmp(funcName, "vkCmdDraw")) return vkCmdDraw;
if (!strcmp(funcName, "vkCmdDrawIndexed")) return vkCmdDrawIndexed;
if (!strcmp(funcName, "vkCmdDrawIndirect")) return vkCmdDrawIndirect;
if (!strcmp(funcName, "vkCmdDrawIndexedIndirect")) return vkCmdDrawIndexedIndirect;
if (!strcmp(funcName, "vkCmdDispatch")) return vkCmdDispatch;
if (!strcmp(funcName, "vkCmdDispatchIndirect")) return vkCmdDispatchIndirect;
if (!strcmp(funcName, "vkCmdCopyBuffer")) return vkCmdCopyBuffer;
if (!strcmp(funcName, "vkCmdCopyImage")) return vkCmdCopyImage;
if (!strcmp(funcName, "vkCmdBlitImage")) return vkCmdBlitImage;
if (!strcmp(funcName, "vkCmdCopyBufferToImage")) return vkCmdCopyBufferToImage;
if (!strcmp(funcName, "vkCmdCopyImageToBuffer")) return vkCmdCopyImageToBuffer;
if (!strcmp(funcName, "vkCmdUpdateBuffer")) return vkCmdUpdateBuffer;
if (!strcmp(funcName, "vkCmdFillBuffer")) return vkCmdFillBuffer;
if (!strcmp(funcName, "vkCmdClearColorImage")) return vkCmdClearColorImage;
if (!strcmp(funcName, "vkCmdClearDepthStencilImage")) return vkCmdClearDepthStencilImage;
if (!strcmp(funcName, "vkCmdClearAttachments")) return vkCmdClearAttachments;
if (!strcmp(funcName, "vkCmdResolveImage")) return vkCmdResolveImage;
if (!strcmp(funcName, "vkCmdSetEvent")) return vkCmdSetEvent;
if (!strcmp(funcName, "vkCmdResetEvent")) return vkCmdResetEvent;
if (!strcmp(funcName, "vkCmdWaitEvents")) return vkCmdWaitEvents;
if (!strcmp(funcName, "vkCmdPipelineBarrier")) return vkCmdPipelineBarrier;
if (!strcmp(funcName, "vkCmdBeginQuery")) return vkCmdBeginQuery;
if (!strcmp(funcName, "vkCmdEndQuery")) return vkCmdEndQuery;
if (!strcmp(funcName, "vkCmdResetQueryPool")) return vkCmdResetQueryPool;
if (!strcmp(funcName, "vkCmdWriteTimestamp")) return vkCmdWriteTimestamp;
if (!strcmp(funcName, "vkCmdCopyQueryPoolResults")) return vkCmdCopyQueryPoolResults;
if (!strcmp(funcName, "vkCmdPushConstants")) return vkCmdPushConstants;
if (!strcmp(funcName, "vkCmdBeginRenderPass")) return vkCmdBeginRenderPass;
if (!strcmp(funcName, "vkCmdNextSubpass")) return vkCmdNextSubpass;
if (!strcmp(funcName, "vkCmdEndRenderPass")) return vkCmdEndRenderPass;
if (!strcmp(funcName, "vkCmdExecuteCommands")) return vkCmdExecuteCommands;
// Core 1.1 functions
if (!strcmp(funcName, "vkEnumeratePhysicalDeviceGroups")) return vkEnumeratePhysicalDeviceGroups;
if (!strcmp(funcName, "vkGetPhysicalDeviceFeatures2")) return vkGetPhysicalDeviceFeatures2;
if (!strcmp(funcName, "vkGetPhysicalDeviceProperties2")) return vkGetPhysicalDeviceProperties2;
if (!strcmp(funcName, "vkGetPhysicalDeviceFormatProperties2")) return vkGetPhysicalDeviceFormatProperties2;
if (!strcmp(funcName, "vkGetPhysicalDeviceImageFormatProperties2")) return vkGetPhysicalDeviceImageFormatProperties2;
if (!strcmp(funcName, "vkGetPhysicalDeviceQueueFamilyProperties2")) return vkGetPhysicalDeviceQueueFamilyProperties2;
if (!strcmp(funcName, "vkGetPhysicalDeviceMemoryProperties2")) return vkGetPhysicalDeviceMemoryProperties2;
if (!strcmp(funcName, "vkGetPhysicalDeviceSparseImageFormatProperties2"))
return vkGetPhysicalDeviceSparseImageFormatProperties2;
if (!strcmp(funcName, "vkGetPhysicalDeviceExternalBufferProperties")) return vkGetPhysicalDeviceExternalBufferProperties;
if (!strcmp(funcName, "vkGetPhysicalDeviceExternalSemaphoreProperties")) return vkGetPhysicalDeviceExternalSemaphoreProperties;
if (!strcmp(funcName, "vkGetPhysicalDeviceExternalFenceProperties")) return vkGetPhysicalDeviceExternalFenceProperties;
if (!strcmp(funcName, "vkBindBufferMemory2")) return vkBindBufferMemory2;
if (!strcmp(funcName, "vkBindImageMemory2")) return vkBindImageMemory2;
if (!strcmp(funcName, "vkGetDeviceGroupPeerMemoryFeatures")) return vkGetDeviceGroupPeerMemoryFeatures;
if (!strcmp(funcName, "vkCmdSetDeviceMask")) return vkCmdSetDeviceMask;
if (!strcmp(funcName, "vkCmdDispatchBase")) return vkCmdDispatchBase;
if (!strcmp(funcName, "vkGetImageMemoryRequirements2")) return vkGetImageMemoryRequirements2;
if (!strcmp(funcName, "vkTrimCommandPool")) return vkTrimCommandPool;
if (!strcmp(funcName, "vkGetDeviceQueue2")) return vkGetDeviceQueue2;
if (!strcmp(funcName, "vkCreateSamplerYcbcrConversion")) return vkCreateSamplerYcbcrConversion;
if (!strcmp(funcName, "vkDestroySamplerYcbcrConversion")) return vkDestroySamplerYcbcrConversion;
if (!strcmp(funcName, "vkGetDescriptorSetLayoutSupport")) return vkGetDescriptorSetLayoutSupport;
if (!strcmp(funcName, "vkCreateDescriptorUpdateTemplate")) return vkCreateDescriptorUpdateTemplate;
if (!strcmp(funcName, "vkDestroyDescriptorUpdateTemplate")) return vkDestroyDescriptorUpdateTemplate;
if (!strcmp(funcName, "vkUpdateDescriptorSetWithTemplate")) return vkUpdateDescriptorSetWithTemplate;
if (!strcmp(funcName, "vkGetImageSparseMemoryRequirements2")) return vkGetImageSparseMemoryRequirements2;
if (!strcmp(funcName, "vkGetBufferMemoryRequirements2")) return vkGetBufferMemoryRequirements2;
// Instance extensions
void *addr;
if (debug_utils_InstanceGpa(inst, funcName, &addr)) return addr;
if (wsi_swapchain_instance_gpa(inst, funcName, &addr)) return addr;
if (extension_instance_gpa(inst, funcName, &addr)) return addr;
// Unknown physical device extensions
if (loader_phys_dev_ext_gpa(inst, funcName, true, &addr, NULL)) return addr;
// Unknown device extensions
addr = loader_dev_ext_gpa(inst, funcName);
return addr;
}
static inline void *globalGetProcAddr(const char *name) {
if (!name || name[0] != 'v' || name[1] != 'k') return NULL;
name += 2;
if (!strcmp(name, "CreateInstance")) return vkCreateInstance;
if (!strcmp(name, "EnumerateInstanceExtensionProperties")) return vkEnumerateInstanceExtensionProperties;
if (!strcmp(name, "EnumerateInstanceLayerProperties")) return vkEnumerateInstanceLayerProperties;
if (!strcmp(name, "EnumerateInstanceVersion")) return vkEnumerateInstanceVersion;
return NULL;
}
static inline void *loader_non_passthrough_gdpa(const char *name) {
if (!name || name[0] != 'v' || name[1] != 'k') return NULL;
name += 2;
if (!strcmp(name, "GetDeviceProcAddr")) return vkGetDeviceProcAddr;
if (!strcmp(name, "DestroyDevice")) return vkDestroyDevice;
if (!strcmp(name, "GetDeviceQueue")) return vkGetDeviceQueue;
if (!strcmp(name, "GetDeviceQueue2")) return vkGetDeviceQueue2;
if (!strcmp(name, "AllocateCommandBuffers")) return vkAllocateCommandBuffers;
return NULL;
}

7841
thirdparty/vulkan/loader/loader.c vendored Executable file

File diff suppressed because it is too large Load Diff

529
thirdparty/vulkan/loader/loader.h vendored Executable file
View File

@ -0,0 +1,529 @@
/*
*
* Copyright (c) 2014-2019 The Khronos Group Inc.
* Copyright (c) 2014-2019 Valve Corporation
* Copyright (c) 2014-2019 LunarG, Inc.
* Copyright (C) 2015 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: Jon Ashburn <jon@lunarg.com>
* Author: Courtney Goeltzenleuchter <courtney@LunarG.com>
* Author: Chia-I Wu <olvaffe@gmail.com>
* Author: Chia-I Wu <olv@lunarg.com>
* Author: Mark Lobodzinski <mark@LunarG.com>
* Author: Lenny Komow <lenny@lunarg.com>
*
*/
#ifndef LOADER_H
#define LOADER_H
#include <vulkan/vulkan.h>
#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_layer_dispatch_table.h"
#include "vk_loader_extensions.h"
#if defined(__GNUC__) && __GNUC__ >= 4
#define LOADER_EXPORT __attribute__((visibility("default")))
#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)
#define LOADER_EXPORT __attribute__((visibility("default")))
#else
#define LOADER_EXPORT
#endif
// A debug option to disable allocators at compile time to investigate future issues.
#define DEBUG_DISABLE_APP_ALLOCATORS 0
#define MAX_STRING_SIZE 1024
// This is defined in vk_layer.h, but if there's problems we need to create the define
// here.
#ifndef MAX_NUM_UNKNOWN_EXTS
#define MAX_NUM_UNKNOWN_EXTS 250
#endif
enum layer_type_flags {
VK_LAYER_TYPE_FLAG_INSTANCE_LAYER = 0x1, // If not set, indicates Device layer
VK_LAYER_TYPE_FLAG_EXPLICIT_LAYER = 0x2, // If not set, indicates Implicit layer
VK_LAYER_TYPE_FLAG_META_LAYER = 0x4, // If not set, indicates standard layer
};
typedef enum VkStringErrorFlagBits {
VK_STRING_ERROR_NONE = 0x00000000,
VK_STRING_ERROR_LENGTH = 0x00000001,
VK_STRING_ERROR_BAD_DATA = 0x00000002,
} VkStringErrorFlagBits;
typedef VkFlags VkStringErrorFlags;
static const int MaxLoaderStringLength = 256;
static const char UTF8_ONE_BYTE_CODE = 0xC0;
static const char UTF8_ONE_BYTE_MASK = 0xE0;
static const char UTF8_TWO_BYTE_CODE = 0xE0;
static const char UTF8_TWO_BYTE_MASK = 0xF0;
static const char UTF8_THREE_BYTE_CODE = 0xF0;
static const char UTF8_THREE_BYTE_MASK = 0xF8;
static const char UTF8_DATA_BYTE_CODE = 0x80;
static const char UTF8_DATA_BYTE_MASK = 0xC0;
// form of all dynamic lists/arrays
// only the list element should be changed
struct loader_generic_list {
size_t capacity;
uint32_t count;
void *list;
};
struct loader_extension_list {
size_t capacity;
uint32_t count;
VkExtensionProperties *list;
};
struct loader_dev_ext_props {
VkExtensionProperties props;
uint32_t entrypoint_count;
char **entrypoints;
};
struct loader_device_extension_list {
size_t capacity;
uint32_t count;
struct loader_dev_ext_props *list;
};
struct loader_name_value {
char name[MAX_STRING_SIZE];
char value[MAX_STRING_SIZE];
};
struct loader_layer_functions {
char str_gipa[MAX_STRING_SIZE];
char str_gdpa[MAX_STRING_SIZE];
char str_negotiate_interface[MAX_STRING_SIZE];
PFN_vkNegotiateLoaderLayerInterfaceVersion negotiate_layer_interface;
PFN_vkGetInstanceProcAddr get_instance_proc_addr;
PFN_vkGetDeviceProcAddr get_device_proc_addr;
PFN_GetPhysicalDeviceProcAddr get_physical_device_proc_addr;
};
struct loader_override_expiration {
uint16_t year;
uint8_t month;
uint8_t day;
uint8_t hour;
uint8_t minute;
};
struct loader_layer_properties {
VkLayerProperties info;
enum layer_type_flags type_flags;
uint32_t interface_version; // PFN_vkNegotiateLoaderLayerInterfaceVersion
char lib_name[MAX_STRING_SIZE];
loader_platform_dl_handle lib_handle;
struct loader_layer_functions functions;
struct loader_extension_list instance_extension_list;
struct loader_device_extension_list device_extension_list;
struct loader_name_value disable_env_var;
struct loader_name_value enable_env_var;
uint32_t num_component_layers;
char (*component_layer_names)[MAX_STRING_SIZE];
struct {
char enumerate_instance_extension_properties[MAX_STRING_SIZE];
char enumerate_instance_layer_properties[MAX_STRING_SIZE];
char enumerate_instance_version[MAX_STRING_SIZE];
} pre_instance_functions;
uint32_t num_override_paths;
char (*override_paths)[MAX_STRING_SIZE];
bool is_override;
bool has_expiration;
struct loader_override_expiration expiration;
bool keep;
uint32_t num_blacklist_layers;
char (*blacklist_layer_names)[MAX_STRING_SIZE];
};
struct loader_layer_list {
size_t capacity;
uint32_t count;
struct loader_layer_properties *list;
};
struct loader_dispatch_hash_list {
size_t capacity;
uint32_t count;
uint32_t *index; // index into the dev_ext dispatch table
};
// loader_dispatch_hash_entry and loader_dev_ext_dispatch_table.dev_ext have
// one to one correspondence; one loader_dispatch_hash_entry for one dev_ext
// dispatch entry.
// Also have a one to one correspondence with functions in dev_ext_trampoline.c
struct loader_dispatch_hash_entry {
char *func_name;
struct loader_dispatch_hash_list list; // to handle hashing collisions
};
typedef VkResult(VKAPI_PTR *PFN_vkDevExt)(VkDevice device);
struct loader_dev_ext_dispatch_table {
PFN_vkDevExt dev_ext[MAX_NUM_UNKNOWN_EXTS];
};
struct loader_dev_dispatch_table {
VkLayerDispatchTable core_dispatch;
struct loader_dev_ext_dispatch_table ext_dispatch;
};
// per CreateDevice structure
struct loader_device {
struct loader_dev_dispatch_table loader_dispatch;
VkDevice chain_device; // device object from the dispatch chain
VkDevice icd_device; // device object from the icd
struct loader_physical_device_term *phys_dev_term;
// List of activated layers.
// app_ is the version based on exactly what the application asked for.
// This is what must be returned to the application on Enumerate calls.
// expanded_ is the version based on expanding meta-layers into their
// individual component layers. This is what is used internally.
struct loader_layer_list app_activated_layer_list;
struct loader_layer_list expanded_activated_layer_list;
VkAllocationCallbacks alloc_callbacks;
// List of activated device extensions that have terminators implemented in the loader
struct {
bool khr_swapchain_enabled;
bool khr_display_swapchain_enabled;
bool khr_device_group_enabled;
bool ext_debug_marker_enabled;
bool ext_debug_utils_enabled;
bool ext_full_screen_exclusive_enabled;
} extensions;
struct loader_device *next;
};
// 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
struct loader_icd_term_dispatch dispatch;
struct loader_icd_term *next;
PFN_PhysDevExt phys_dev_ext[MAX_NUM_UNKNOWN_EXTS];
};
// Per ICD library structure
struct loader_icd_tramp_list {
size_t capacity;
uint32_t count;
struct loader_scanned_icd *scanned_list;
};
struct loader_instance_dispatch_table {
VkLayerInstanceDispatchTable layer_inst_disp; // must be first entry in structure
// Physical device functions unknown to the loader
PFN_PhysDevExt phys_dev_ext[MAX_NUM_UNKNOWN_EXTS];
};
// Per instance structure
struct loader_instance {
struct loader_instance_dispatch_table *disp; // must be first entry in structure
// Vulkan API version the app is intending to use.
uint16_t app_api_major_version;
uint16_t app_api_minor_version;
// We need to manually track physical devices over time. If the user
// re-queries the information, we don't want to delete old data or
// create new data unless necessary.
uint32_t total_gpu_count;
uint32_t phys_dev_count_term;
struct loader_physical_device_term **phys_devs_term;
uint32_t phys_dev_count_tramp;
struct loader_physical_device_tramp **phys_devs_tramp;
// We also need to manually track physical device groups, but we don't need
// loader specific structures since we have that content in the physical
// device stored internal to the public structures.
uint32_t phys_dev_group_count_term;
struct VkPhysicalDeviceGroupProperties **phys_dev_groups_term;
uint32_t phys_dev_group_count_tramp;
struct VkPhysicalDeviceGroupProperties **phys_dev_groups_tramp;
struct loader_instance *next;
uint32_t total_icd_count;
struct loader_icd_term *icd_terms;
struct loader_icd_tramp_list icd_tramp_list;
struct loader_dispatch_hash_entry dev_ext_disp_hash[MAX_NUM_UNKNOWN_EXTS];
struct loader_dispatch_hash_entry phys_dev_ext_disp_hash[MAX_NUM_UNKNOWN_EXTS];
struct loader_msg_callback_map_entry *icd_msg_callback_map;
struct loader_layer_list instance_layer_list;
bool override_layer_present;
// List of activated layers.
// app_ is the version based on exactly what the application asked for.
// This is what must be returned to the application on Enumerate calls.
// expanded_ is the version based on expanding meta-layers into their
// individual component layers. This is what is used internally.
struct loader_layer_list app_activated_layer_list;
struct loader_layer_list expanded_activated_layer_list;
VkInstance instance; // layers/ICD instance returned to trampoline
struct loader_extension_list ext_list; // icds and loaders extensions
union loader_instance_extension_enables enabled_known_extensions;
VkLayerDbgFunctionNode *DbgFunctionHead;
uint32_t num_tmp_report_callbacks;
VkDebugReportCallbackCreateInfoEXT *tmp_report_create_infos;
VkDebugReportCallbackEXT *tmp_report_callbacks;
uint32_t num_tmp_messengers;
VkDebugUtilsMessengerCreateInfoEXT *tmp_messenger_create_infos;
VkDebugUtilsMessengerEXT *tmp_messengers;
VkAllocationCallbacks alloc_callbacks;
bool wsi_surface_enabled;
#ifdef VK_USE_PLATFORM_WIN32_KHR
bool wsi_win32_surface_enabled;
#endif
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
bool wsi_wayland_surface_enabled;
#endif
#ifdef VK_USE_PLATFORM_XCB_KHR
bool wsi_xcb_surface_enabled;
#endif
#ifdef VK_USE_PLATFORM_XLIB_KHR
bool wsi_xlib_surface_enabled;
#endif
#ifdef VK_USE_PLATFORM_ANDROID_KHR
bool wsi_android_surface_enabled;
#endif
#ifdef VK_USE_PLATFORM_MACOS_MVK
bool wsi_macos_surface_enabled;
#endif
#ifdef VK_USE_PLATFORM_IOS_MVK
bool wsi_ios_surface_enabled;
#endif
bool wsi_headless_surface_enabled;
bool wsi_display_enabled;
bool wsi_display_props2_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
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
struct loader_physical_device_term {
struct loader_instance_dispatch_table *disp; // must be first entry in structure
struct loader_icd_term *this_icd_term;
uint8_t icd_index;
VkPhysicalDevice phys_dev; // object from ICD
};
struct loader_struct {
struct loader_instance *instances;
};
struct loader_scanned_icd {
char *lib_name;
loader_platform_dl_handle handle;
uint32_t api_version;
uint32_t interface_version;
PFN_vkGetInstanceProcAddr GetInstanceProcAddr;
PFN_GetPhysicalDeviceProcAddr GetPhysicalDeviceProcAddr;
PFN_vkCreateInstance CreateInstance;
PFN_vkEnumerateInstanceExtensionProperties EnumerateInstanceExtensionProperties;
};
static inline struct loader_instance *loader_instance(VkInstance instance) { return (struct loader_instance *)instance; }
static inline VkPhysicalDevice loader_unwrap_physical_device(VkPhysicalDevice physicalDevice) {
struct loader_physical_device_tramp *phys_dev = (struct loader_physical_device_tramp *)physicalDevice;
return phys_dev->phys_dev;
}
static inline void loader_set_dispatch(void *obj, const void *data) { *((const void **)obj) = data; }
static inline VkLayerDispatchTable *loader_get_dispatch(const void *obj) { return *((VkLayerDispatchTable **)obj); }
static inline struct loader_dev_dispatch_table *loader_get_dev_dispatch(const void *obj) {
return *((struct loader_dev_dispatch_table **)obj);
}
static inline VkLayerInstanceDispatchTable *loader_get_instance_layer_dispatch(const void *obj) {
return *((VkLayerInstanceDispatchTable **)obj);
}
static inline struct loader_instance_dispatch_table *loader_get_instance_dispatch(const void *obj) {
return *((struct loader_instance_dispatch_table **)obj);
}
static inline void loader_init_dispatch(void *obj, const void *data) {
#ifdef DEBUG
assert(valid_loader_magic_value(obj) &&
"Incompatible ICD, first dword must be initialized to "
"ICD_LOADER_MAGIC. See loader/README.md for details.");
#endif
loader_set_dispatch(obj, data);
}
// Global variables used across files
extern struct loader_struct loader;
extern THREAD_LOCAL_DECL struct loader_instance *tls_instance;
#if defined(_WIN32) && !defined(LOADER_DYNAMIC_LIB)
extern LOADER_PLATFORM_THREAD_ONCE_DEFINITION(once_init);
#endif
extern loader_platform_thread_mutex loader_lock;
extern loader_platform_thread_mutex loader_json_lock;
struct loader_msg_callback_map_entry {
VkDebugReportCallbackEXT icd_obj;
VkDebugReportCallbackEXT loader_obj;
};
// 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,
VkSystemAllocationScope alloc_scope);
void *loader_instance_tls_heap_alloc(size_t size);
void loader_instance_tls_heap_free(void *pMemory);
void *loader_device_heap_alloc(const struct loader_device *device, size_t size, VkSystemAllocationScope allocationScope);
void loader_device_heap_free(const struct loader_device *device, void *pMemory);
void *loader_device_heap_realloc(const struct loader_device *device, void *pMemory, size_t orig_size, size_t size,
VkSystemAllocationScope alloc_scope);
void loader_log(const struct loader_instance *inst, VkFlags msg_type, int32_t msg_code, const char *format, ...);
bool compare_vk_extension_properties(const VkExtensionProperties *op1, const VkExtensionProperties *op2);
VkResult loaderValidateLayers(const struct loader_instance *inst, const uint32_t layer_count,
const char *const *ppEnabledLayerNames, const struct loader_layer_list *list);
VkResult loader_validate_instance_extensions(struct loader_instance *inst, const struct loader_extension_list *icd_exts,
const struct loader_layer_list *instance_layer,
const VkInstanceCreateInfo *pCreateInfo);
void loader_initialize(void);
bool has_vk_extension_property_array(const VkExtensionProperties *vk_ext_prop, const uint32_t count,
const VkExtensionProperties *ext_array);
bool has_vk_extension_property(const VkExtensionProperties *vk_ext_prop, const struct loader_extension_list *ext_list);
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);
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);
VkResult loader_add_device_extensions(const struct loader_instance *inst,
PFN_vkEnumerateDeviceExtensionProperties fpEnumerateDeviceExtensionProperties,
VkPhysicalDevice physical_device, const char *lib_name,
struct loader_extension_list *ext_list);
VkResult loader_init_generic_list(const struct loader_instance *inst, struct loader_generic_list *list_info, size_t element_size);
void loader_destroy_generic_list(const struct loader_instance *inst, struct loader_generic_list *list);
void loaderDestroyLayerList(const struct loader_instance *inst, struct loader_device *device, struct loader_layer_list *layer_list);
void loaderDeleteLayerListAndProperties(const struct loader_instance *inst, struct loader_layer_list *layer_list);
void loaderAddLayerNameToList(const struct loader_instance *inst, const char *name, const enum layer_type_flags type_flags,
const struct loader_layer_list *source_list, struct loader_layer_list *target_list,
struct loader_layer_list *expanded_target_list);
void loader_scanned_icd_clear(const struct loader_instance *inst, struct loader_icd_tramp_list *icd_tramp_list);
VkResult loader_icd_scan(const struct loader_instance *inst, struct loader_icd_tramp_list *icd_tramp_list);
void loaderScanForLayers(struct loader_instance *inst, struct loader_layer_list *instance_layers);
void loaderScanForImplicitLayers(struct loader_instance *inst, struct loader_layer_list *instance_layers);
bool loaderImplicitLayerIsEnabled(const struct loader_instance *inst, const struct loader_layer_properties *prop);
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_icd_term *loader_get_icd_and_device(const VkDevice device, struct loader_device **found_dev, uint32_t *icd_index);
void loader_init_dispatch_dev_ext(struct loader_instance *inst, struct loader_device *dev);
void *loader_dev_ext_gpa(struct loader_instance *inst, const char *funcName);
void *loader_get_dev_ext_trampoline(uint32_t index);
bool loader_phys_dev_ext_gpa(struct loader_instance *inst, const char *funcName, bool perform_checking, void **tramp_addr,
void **term_addr);
void *loader_get_phys_dev_ext_tramp(uint32_t index);
void *loader_get_phys_dev_ext_termin(uint32_t index);
struct loader_instance *loader_get_instance(const VkInstance instance);
void loaderDeactivateLayers(const struct loader_instance *instance, struct loader_device *device, struct loader_layer_list *list);
struct loader_device *loader_create_logical_device(const struct loader_instance *inst, const VkAllocationCallbacks *pAllocator);
void loader_add_logical_device(const struct loader_instance *inst, struct loader_icd_term *icd_term,
struct loader_device *found_dev);
void loader_remove_logical_device(const struct loader_instance *inst, struct loader_icd_term *icd_term,
struct loader_device *found_dev, const VkAllocationCallbacks *pAllocator);
// NOTE: Outside of loader, this entry-point is only provided for error
// cleanup.
void loader_destroy_logical_device(const struct loader_instance *inst, struct loader_device *dev,
const VkAllocationCallbacks *pAllocator);
VkResult loaderEnableInstanceLayers(struct loader_instance *inst, const VkInstanceCreateInfo *pCreateInfo,
const struct loader_layer_list *instance_layers);
VkResult loader_create_instance_chain(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator,
struct loader_instance *inst, VkInstance *created_instance);
void loaderActivateInstanceLayerExtensions(struct loader_instance *inst, VkInstance created_inst);
VKAPI_ATTR VkResult VKAPI_CALL loader_layer_create_device(VkInstance instance, VkPhysicalDevice physicalDevice,
const VkDeviceCreateInfo *pCreateInfo,
const VkAllocationCallbacks *pAllocator, VkDevice *pDevice,
PFN_vkGetInstanceProcAddr layerGIPA, PFN_vkGetDeviceProcAddr *nextGDPA);
VKAPI_ATTR void VKAPI_CALL loader_layer_destroy_device(VkDevice device, const VkAllocationCallbacks *pAllocator,
PFN_vkDestroyDevice destroyFunction);
VkResult loader_create_device_chain(const VkPhysicalDevice pd, const VkDeviceCreateInfo *pCreateInfo,
const VkAllocationCallbacks *pAllocator, const struct loader_instance *inst,
struct loader_device *dev, PFN_vkGetInstanceProcAddr callingLayer,
PFN_vkGetDeviceProcAddr *layerNextGDPA);
VkResult loader_validate_device_extensions(struct loader_instance *this_instance,
const struct loader_layer_list *activated_device_layers,
const struct loader_extension_list *icd_exts, const VkDeviceCreateInfo *pCreateInfo);
VkResult setupLoaderTrampPhysDevs(VkInstance instance);
VkResult setupLoaderTermPhysDevs(struct loader_instance *inst);
VkStringErrorFlags vk_string_validate(const int max_length, const char *char_array);
#endif // LOADER_H

98
thirdparty/vulkan/loader/murmurhash.c vendored Executable file
View File

@ -0,0 +1,98 @@
/**
* `murmurhash.h' - murmurhash
*
* copyright (c) 2014 joseph werle <joseph.werle@gmail.com>
* Copyright (c) 2015-2016 The Khronos Group Inc.
* 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:
*
* The above copyright notice(s) and this permission notice shall be included in
* all copies or substantial portions of the Materials.
*
* 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.
*/
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include "murmurhash.h"
uint32_t murmurhash(const char *key, size_t len, uint32_t seed) {
uint32_t c1 = 0xcc9e2d51;
uint32_t c2 = 0x1b873593;
uint32_t r1 = 15;
uint32_t r2 = 13;
uint32_t m = 5;
uint32_t n = 0xe6546b64;
uint32_t h = 0;
uint32_t k = 0;
uint8_t *d = (uint8_t *)key; // 32 bit extract from `key'
const uint32_t *chunks = NULL;
const uint8_t *tail = NULL; // tail - last 8 bytes
int i = 0;
int l = (int)len / 4; // chunk length
h = seed;
chunks = (const uint32_t *)(d + l * 4); // body
tail = (const uint8_t *)(d + l * 4); // last 8 byte chunk of `key'
// for each 4 byte chunk of `key'
for (i = -l; i != 0; ++i) {
// next 4 byte chunk of `key'
k = chunks[i];
// encode next 4 byte chunk of `key'
k *= c1;
k = (k << r1) | (k >> (32 - r1));
k *= c2;
// append to hash
h ^= k;
h = (h << r2) | (h >> (32 - r2));
h = h * m + n;
}
k = 0;
// remainder
switch (len & 3) { // `len % 4'
case 3:
k ^= (tail[2] << 16);
// fall through
case 2:
k ^= (tail[1] << 8);
// fall through
case 1:
k ^= tail[0];
k *= c1;
k = (k << r1) | (k >> (32 - r1));
k *= c2;
h ^= k;
}
h ^= len;
h ^= (h >> 16);
h *= 0x85ebca6b;
h ^= (h >> 13);
h *= 0xc2b2ae35;
h ^= (h >> 16);
return h;
}

52
thirdparty/vulkan/loader/murmurhash.h vendored Executable file
View File

@ -0,0 +1,52 @@
/**
* `murmurhash.h' - murmurhash
*
* copyright (c) 2014 joseph werle <joseph.werle@gmail.com>
* Copyright (c) 2015-2016 The Khronos Group Inc.
* 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:
*
* The above copyright notice(s) and this permission notice shall be included in
* all copies or substantial portions of the Materials.
*
* 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.
*/
#ifndef MURMURHASH_H
#define MURMURHASH_H 1
#include <stdint.h>
#define MURMURHASH_VERSION "0.0.3"
#ifdef __cplusplus
extern "C" {
#endif
/**
* Returns a murmur hash of `key' based on `seed'
* using the MurmurHash3 algorithm
*/
uint32_t murmurhash(const char *key, size_t len, uint32_t seed);
#ifdef __cplusplus
}
#endif
#endif

1056
thirdparty/vulkan/loader/phys_dev_ext.c vendored Executable file

File diff suppressed because it is too large Load Diff

2480
thirdparty/vulkan/loader/trampoline.c vendored Executable file

File diff suppressed because it is too large Load Diff

819
thirdparty/vulkan/loader/unknown_ext_chain.c vendored Executable file
View File

@ -0,0 +1,819 @@
/*
* Copyright (c) 2017 The Khronos Group Inc.
* Copyright (c) 2017 Valve Corporation
* Copyright (c) 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 Jon Ashburn <jon@lunarg.com>
* Author: Lenny Komow <lenny@lunarg.com>
*/
// This code is used to pass on physical device extensions through the call chain. It must do this without creating a stack frame,
// because the actual parameters of the call are not known. Since the first parameter is known to be a VkPhysicalDevice, it can
// unwrap the physical device, overwriting the wrapped device, and then jump to the next function in the call chain. This code
// attempts to accomplish this by relying on tail-call optimizations, but there is no guarantee that this will work. As a result,
// this code is only compiled on systems where an assembly alternative has not been written.
#include "vk_loader_platform.h"
#include "loader.h"
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC optimize(3) // force gcc to use tail-calls
#endif
// Trampoline function macro for unknown physical device extension command.
#define PhysDevExtTramp(num) \
VKAPI_ATTR void VKAPI_CALL vkPhysDevExtTramp##num(VkPhysicalDevice physical_device) { \
const struct loader_instance_dispatch_table *disp; \
disp = loader_get_instance_dispatch(physical_device); \
disp->phys_dev_ext[num](loader_unwrap_physical_device(physical_device)); \
}
// Terminator function macro for unknown physical device extension command.
#define PhysDevExtTermin(num) \
VKAPI_ATTR void VKAPI_CALL vkPhysDevExtTermin##num(VkPhysicalDevice physical_device) { \
struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physical_device; \
struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; \
struct loader_instance *inst = (struct loader_instance *)icd_term->this_instance; \
if (NULL == icd_term->phys_dev_ext[num]) { \
loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "Extension %s not supported for this physical device", \
inst->phys_dev_ext_disp_hash[num].func_name); \
} \
icd_term->phys_dev_ext[num](phys_dev_term->phys_dev); \
}
// Trampoline function macro for unknown physical device extension command.
#define DevExtTramp(num) \
VKAPI_ATTR void VKAPI_CALL vkdev_ext##num(VkDevice device) { \
const struct loader_dev_dispatch_table *disp; \
disp = loader_get_dev_dispatch(device); \
disp->ext_dispatch.dev_ext[num](device); \
}
// Instantiations of the trampoline
PhysDevExtTramp(0)
PhysDevExtTramp(1)
PhysDevExtTramp(2)
PhysDevExtTramp(3)
PhysDevExtTramp(4)
PhysDevExtTramp(5)
PhysDevExtTramp(6)
PhysDevExtTramp(7)
PhysDevExtTramp(8)
PhysDevExtTramp(9)
PhysDevExtTramp(10)
PhysDevExtTramp(11)
PhysDevExtTramp(12)
PhysDevExtTramp(13)
PhysDevExtTramp(14)
PhysDevExtTramp(15)
PhysDevExtTramp(16)
PhysDevExtTramp(17)
PhysDevExtTramp(18)
PhysDevExtTramp(19)
PhysDevExtTramp(20)
PhysDevExtTramp(21)
PhysDevExtTramp(22)
PhysDevExtTramp(23)
PhysDevExtTramp(24)
PhysDevExtTramp(25)
PhysDevExtTramp(26)
PhysDevExtTramp(27)
PhysDevExtTramp(28)
PhysDevExtTramp(29)
PhysDevExtTramp(30)
PhysDevExtTramp(31)
PhysDevExtTramp(32)
PhysDevExtTramp(33)
PhysDevExtTramp(34)
PhysDevExtTramp(35)
PhysDevExtTramp(36)
PhysDevExtTramp(37)
PhysDevExtTramp(38)
PhysDevExtTramp(39)
PhysDevExtTramp(40)
PhysDevExtTramp(41)
PhysDevExtTramp(42)
PhysDevExtTramp(43)
PhysDevExtTramp(44)
PhysDevExtTramp(45)
PhysDevExtTramp(46)
PhysDevExtTramp(47)
PhysDevExtTramp(48)
PhysDevExtTramp(49)
PhysDevExtTramp(50)
PhysDevExtTramp(51)
PhysDevExtTramp(52)
PhysDevExtTramp(53)
PhysDevExtTramp(54)
PhysDevExtTramp(55)
PhysDevExtTramp(56)
PhysDevExtTramp(57)
PhysDevExtTramp(58)
PhysDevExtTramp(59)
PhysDevExtTramp(60)
PhysDevExtTramp(61)
PhysDevExtTramp(62)
PhysDevExtTramp(63)
PhysDevExtTramp(64)
PhysDevExtTramp(65)
PhysDevExtTramp(66)
PhysDevExtTramp(67)
PhysDevExtTramp(68)
PhysDevExtTramp(69)
PhysDevExtTramp(70)
PhysDevExtTramp(71)
PhysDevExtTramp(72)
PhysDevExtTramp(73)
PhysDevExtTramp(74)
PhysDevExtTramp(75)
PhysDevExtTramp(76)
PhysDevExtTramp(77)
PhysDevExtTramp(78)
PhysDevExtTramp(79)
PhysDevExtTramp(80)
PhysDevExtTramp(81)
PhysDevExtTramp(82)
PhysDevExtTramp(83)
PhysDevExtTramp(84)
PhysDevExtTramp(85)
PhysDevExtTramp(86)
PhysDevExtTramp(87)
PhysDevExtTramp(88)
PhysDevExtTramp(89)
PhysDevExtTramp(90)
PhysDevExtTramp(91)
PhysDevExtTramp(92)
PhysDevExtTramp(93)
PhysDevExtTramp(94)
PhysDevExtTramp(95)
PhysDevExtTramp(96)
PhysDevExtTramp(97)
PhysDevExtTramp(98)
PhysDevExtTramp(99)
PhysDevExtTramp(100)
PhysDevExtTramp(101)
PhysDevExtTramp(102)
PhysDevExtTramp(103)
PhysDevExtTramp(104)
PhysDevExtTramp(105)
PhysDevExtTramp(106)
PhysDevExtTramp(107)
PhysDevExtTramp(108)
PhysDevExtTramp(109)
PhysDevExtTramp(110)
PhysDevExtTramp(111)
PhysDevExtTramp(112)
PhysDevExtTramp(113)
PhysDevExtTramp(114)
PhysDevExtTramp(115)
PhysDevExtTramp(116)
PhysDevExtTramp(117)
PhysDevExtTramp(118)
PhysDevExtTramp(119)
PhysDevExtTramp(120)
PhysDevExtTramp(121)
PhysDevExtTramp(122)
PhysDevExtTramp(123)
PhysDevExtTramp(124)
PhysDevExtTramp(125)
PhysDevExtTramp(126)
PhysDevExtTramp(127)
PhysDevExtTramp(128)
PhysDevExtTramp(129)
PhysDevExtTramp(130)
PhysDevExtTramp(131)
PhysDevExtTramp(132)
PhysDevExtTramp(133)
PhysDevExtTramp(134)
PhysDevExtTramp(135)
PhysDevExtTramp(136)
PhysDevExtTramp(137)
PhysDevExtTramp(138)
PhysDevExtTramp(139)
PhysDevExtTramp(140)
PhysDevExtTramp(141)
PhysDevExtTramp(142)
PhysDevExtTramp(143)
PhysDevExtTramp(144)
PhysDevExtTramp(145)
PhysDevExtTramp(146)
PhysDevExtTramp(147)
PhysDevExtTramp(148)
PhysDevExtTramp(149)
PhysDevExtTramp(150)
PhysDevExtTramp(151)
PhysDevExtTramp(152)
PhysDevExtTramp(153)
PhysDevExtTramp(154)
PhysDevExtTramp(155)
PhysDevExtTramp(156)
PhysDevExtTramp(157)
PhysDevExtTramp(158)
PhysDevExtTramp(159)
PhysDevExtTramp(160)
PhysDevExtTramp(161)
PhysDevExtTramp(162)
PhysDevExtTramp(163)
PhysDevExtTramp(164)
PhysDevExtTramp(165)
PhysDevExtTramp(166)
PhysDevExtTramp(167)
PhysDevExtTramp(168)
PhysDevExtTramp(169)
PhysDevExtTramp(170)
PhysDevExtTramp(171)
PhysDevExtTramp(172)
PhysDevExtTramp(173)
PhysDevExtTramp(174)
PhysDevExtTramp(175)
PhysDevExtTramp(176)
PhysDevExtTramp(177)
PhysDevExtTramp(178)
PhysDevExtTramp(179)
PhysDevExtTramp(180)
PhysDevExtTramp(181)
PhysDevExtTramp(182)
PhysDevExtTramp(183)
PhysDevExtTramp(184)
PhysDevExtTramp(185)
PhysDevExtTramp(186)
PhysDevExtTramp(187)
PhysDevExtTramp(188)
PhysDevExtTramp(189)
PhysDevExtTramp(190)
PhysDevExtTramp(191)
PhysDevExtTramp(192)
PhysDevExtTramp(193)
PhysDevExtTramp(194)
PhysDevExtTramp(195)
PhysDevExtTramp(196)
PhysDevExtTramp(197)
PhysDevExtTramp(198)
PhysDevExtTramp(199)
PhysDevExtTramp(200)
PhysDevExtTramp(201)
PhysDevExtTramp(202)
PhysDevExtTramp(203)
PhysDevExtTramp(204)
PhysDevExtTramp(205)
PhysDevExtTramp(206)
PhysDevExtTramp(207)
PhysDevExtTramp(208)
PhysDevExtTramp(209)
PhysDevExtTramp(210)
PhysDevExtTramp(211)
PhysDevExtTramp(212)
PhysDevExtTramp(213)
PhysDevExtTramp(214)
PhysDevExtTramp(215)
PhysDevExtTramp(216)
PhysDevExtTramp(217)
PhysDevExtTramp(218)
PhysDevExtTramp(219)
PhysDevExtTramp(220)
PhysDevExtTramp(221)
PhysDevExtTramp(222)
PhysDevExtTramp(223)
PhysDevExtTramp(224)
PhysDevExtTramp(225)
PhysDevExtTramp(226)
PhysDevExtTramp(227)
PhysDevExtTramp(228)
PhysDevExtTramp(229)
PhysDevExtTramp(230)
PhysDevExtTramp(231)
PhysDevExtTramp(232)
PhysDevExtTramp(233)
PhysDevExtTramp(234)
PhysDevExtTramp(235)
PhysDevExtTramp(236)
PhysDevExtTramp(237)
PhysDevExtTramp(238)
PhysDevExtTramp(239)
PhysDevExtTramp(240)
PhysDevExtTramp(241)
PhysDevExtTramp(242)
PhysDevExtTramp(243)
PhysDevExtTramp(244)
PhysDevExtTramp(245)
PhysDevExtTramp(246)
PhysDevExtTramp(247)
PhysDevExtTramp(248)
PhysDevExtTramp(249)
// Instantiations of the terminator
PhysDevExtTermin(0)
PhysDevExtTermin(1)
PhysDevExtTermin(2)
PhysDevExtTermin(3)
PhysDevExtTermin(4)
PhysDevExtTermin(5)
PhysDevExtTermin(6)
PhysDevExtTermin(7)
PhysDevExtTermin(8)
PhysDevExtTermin(9)
PhysDevExtTermin(10)
PhysDevExtTermin(11)
PhysDevExtTermin(12)
PhysDevExtTermin(13)
PhysDevExtTermin(14)
PhysDevExtTermin(15)
PhysDevExtTermin(16)
PhysDevExtTermin(17)
PhysDevExtTermin(18)
PhysDevExtTermin(19)
PhysDevExtTermin(20)
PhysDevExtTermin(21)
PhysDevExtTermin(22)
PhysDevExtTermin(23)
PhysDevExtTermin(24)
PhysDevExtTermin(25)
PhysDevExtTermin(26)
PhysDevExtTermin(27)
PhysDevExtTermin(28)
PhysDevExtTermin(29)
PhysDevExtTermin(30)
PhysDevExtTermin(31)
PhysDevExtTermin(32)
PhysDevExtTermin(33)
PhysDevExtTermin(34)
PhysDevExtTermin(35)
PhysDevExtTermin(36)
PhysDevExtTermin(37)
PhysDevExtTermin(38)
PhysDevExtTermin(39)
PhysDevExtTermin(40)
PhysDevExtTermin(41)
PhysDevExtTermin(42)
PhysDevExtTermin(43)
PhysDevExtTermin(44)
PhysDevExtTermin(45)
PhysDevExtTermin(46)
PhysDevExtTermin(47)
PhysDevExtTermin(48)
PhysDevExtTermin(49)
PhysDevExtTermin(50)
PhysDevExtTermin(51)
PhysDevExtTermin(52)
PhysDevExtTermin(53)
PhysDevExtTermin(54)
PhysDevExtTermin(55)
PhysDevExtTermin(56)
PhysDevExtTermin(57)
PhysDevExtTermin(58)
PhysDevExtTermin(59)
PhysDevExtTermin(60)
PhysDevExtTermin(61)
PhysDevExtTermin(62)
PhysDevExtTermin(63)
PhysDevExtTermin(64)
PhysDevExtTermin(65)
PhysDevExtTermin(66)
PhysDevExtTermin(67)
PhysDevExtTermin(68)
PhysDevExtTermin(69)
PhysDevExtTermin(70)
PhysDevExtTermin(71)
PhysDevExtTermin(72)
PhysDevExtTermin(73)
PhysDevExtTermin(74)
PhysDevExtTermin(75)
PhysDevExtTermin(76)
PhysDevExtTermin(77)
PhysDevExtTermin(78)
PhysDevExtTermin(79)
PhysDevExtTermin(80)
PhysDevExtTermin(81)
PhysDevExtTermin(82)
PhysDevExtTermin(83)
PhysDevExtTermin(84)
PhysDevExtTermin(85)
PhysDevExtTermin(86)
PhysDevExtTermin(87)
PhysDevExtTermin(88)
PhysDevExtTermin(89)
PhysDevExtTermin(90)
PhysDevExtTermin(91)
PhysDevExtTermin(92)
PhysDevExtTermin(93)
PhysDevExtTermin(94)
PhysDevExtTermin(95)
PhysDevExtTermin(96)
PhysDevExtTermin(97)
PhysDevExtTermin(98)
PhysDevExtTermin(99)
PhysDevExtTermin(100)
PhysDevExtTermin(101)
PhysDevExtTermin(102)
PhysDevExtTermin(103)
PhysDevExtTermin(104)
PhysDevExtTermin(105)
PhysDevExtTermin(106)
PhysDevExtTermin(107)
PhysDevExtTermin(108)
PhysDevExtTermin(109)
PhysDevExtTermin(110)
PhysDevExtTermin(111)
PhysDevExtTermin(112)
PhysDevExtTermin(113)
PhysDevExtTermin(114)
PhysDevExtTermin(115)
PhysDevExtTermin(116)
PhysDevExtTermin(117)
PhysDevExtTermin(118)
PhysDevExtTermin(119)
PhysDevExtTermin(120)
PhysDevExtTermin(121)
PhysDevExtTermin(122)
PhysDevExtTermin(123)
PhysDevExtTermin(124)
PhysDevExtTermin(125)
PhysDevExtTermin(126)
PhysDevExtTermin(127)
PhysDevExtTermin(128)
PhysDevExtTermin(129)
PhysDevExtTermin(130)
PhysDevExtTermin(131)
PhysDevExtTermin(132)
PhysDevExtTermin(133)
PhysDevExtTermin(134)
PhysDevExtTermin(135)
PhysDevExtTermin(136)
PhysDevExtTermin(137)
PhysDevExtTermin(138)
PhysDevExtTermin(139)
PhysDevExtTermin(140)
PhysDevExtTermin(141)
PhysDevExtTermin(142)
PhysDevExtTermin(143)
PhysDevExtTermin(144)
PhysDevExtTermin(145)
PhysDevExtTermin(146)
PhysDevExtTermin(147)
PhysDevExtTermin(148)
PhysDevExtTermin(149)
PhysDevExtTermin(150)
PhysDevExtTermin(151)
PhysDevExtTermin(152)
PhysDevExtTermin(153)
PhysDevExtTermin(154)
PhysDevExtTermin(155)
PhysDevExtTermin(156)
PhysDevExtTermin(157)
PhysDevExtTermin(158)
PhysDevExtTermin(159)
PhysDevExtTermin(160)
PhysDevExtTermin(161)
PhysDevExtTermin(162)
PhysDevExtTermin(163)
PhysDevExtTermin(164)
PhysDevExtTermin(165)
PhysDevExtTermin(166)
PhysDevExtTermin(167)
PhysDevExtTermin(168)
PhysDevExtTermin(169)
PhysDevExtTermin(170)
PhysDevExtTermin(171)
PhysDevExtTermin(172)
PhysDevExtTermin(173)
PhysDevExtTermin(174)
PhysDevExtTermin(175)
PhysDevExtTermin(176)
PhysDevExtTermin(177)
PhysDevExtTermin(178)
PhysDevExtTermin(179)
PhysDevExtTermin(180)
PhysDevExtTermin(181)
PhysDevExtTermin(182)
PhysDevExtTermin(183)
PhysDevExtTermin(184)
PhysDevExtTermin(185)
PhysDevExtTermin(186)
PhysDevExtTermin(187)
PhysDevExtTermin(188)
PhysDevExtTermin(189)
PhysDevExtTermin(190)
PhysDevExtTermin(191)
PhysDevExtTermin(192)
PhysDevExtTermin(193)
PhysDevExtTermin(194)
PhysDevExtTermin(195)
PhysDevExtTermin(196)
PhysDevExtTermin(197)
PhysDevExtTermin(198)
PhysDevExtTermin(199)
PhysDevExtTermin(200)
PhysDevExtTermin(201)
PhysDevExtTermin(202)
PhysDevExtTermin(203)
PhysDevExtTermin(204)
PhysDevExtTermin(205)
PhysDevExtTermin(206)
PhysDevExtTermin(207)
PhysDevExtTermin(208)
PhysDevExtTermin(209)
PhysDevExtTermin(210)
PhysDevExtTermin(211)
PhysDevExtTermin(212)
PhysDevExtTermin(213)
PhysDevExtTermin(214)
PhysDevExtTermin(215)
PhysDevExtTermin(216)
PhysDevExtTermin(217)
PhysDevExtTermin(218)
PhysDevExtTermin(219)
PhysDevExtTermin(220)
PhysDevExtTermin(221)
PhysDevExtTermin(222)
PhysDevExtTermin(223)
PhysDevExtTermin(224)
PhysDevExtTermin(225)
PhysDevExtTermin(226)
PhysDevExtTermin(227)
PhysDevExtTermin(228)
PhysDevExtTermin(229)
PhysDevExtTermin(230)
PhysDevExtTermin(231)
PhysDevExtTermin(232)
PhysDevExtTermin(233)
PhysDevExtTermin(234)
PhysDevExtTermin(235)
PhysDevExtTermin(236)
PhysDevExtTermin(237)
PhysDevExtTermin(238)
PhysDevExtTermin(239)
PhysDevExtTermin(240)
PhysDevExtTermin(241)
PhysDevExtTermin(242)
PhysDevExtTermin(243)
PhysDevExtTermin(244)
PhysDevExtTermin(245)
PhysDevExtTermin(246)
PhysDevExtTermin(247)
PhysDevExtTermin(248)
PhysDevExtTermin(249)
// Instantiations of the device trampoline
DevExtTramp(0)
DevExtTramp(1)
DevExtTramp(2)
DevExtTramp(3)
DevExtTramp(4)
DevExtTramp(5)
DevExtTramp(6)
DevExtTramp(7)
DevExtTramp(8)
DevExtTramp(9)
DevExtTramp(10)
DevExtTramp(11)
DevExtTramp(12)
DevExtTramp(13)
DevExtTramp(14)
DevExtTramp(15)
DevExtTramp(16)
DevExtTramp(17)
DevExtTramp(18)
DevExtTramp(19)
DevExtTramp(20)
DevExtTramp(21)
DevExtTramp(22)
DevExtTramp(23)
DevExtTramp(24)
DevExtTramp(25)
DevExtTramp(26)
DevExtTramp(27)
DevExtTramp(28)
DevExtTramp(29)
DevExtTramp(30)
DevExtTramp(31)
DevExtTramp(32)
DevExtTramp(33)
DevExtTramp(34)
DevExtTramp(35)
DevExtTramp(36)
DevExtTramp(37)
DevExtTramp(38)
DevExtTramp(39)
DevExtTramp(40)
DevExtTramp(41)
DevExtTramp(42)
DevExtTramp(43)
DevExtTramp(44)
DevExtTramp(45)
DevExtTramp(46)
DevExtTramp(47)
DevExtTramp(48)
DevExtTramp(49)
DevExtTramp(50)
DevExtTramp(51)
DevExtTramp(52)
DevExtTramp(53)
DevExtTramp(54)
DevExtTramp(55)
DevExtTramp(56)
DevExtTramp(57)
DevExtTramp(58)
DevExtTramp(59)
DevExtTramp(60)
DevExtTramp(61)
DevExtTramp(62)
DevExtTramp(63)
DevExtTramp(64)
DevExtTramp(65)
DevExtTramp(66)
DevExtTramp(67)
DevExtTramp(68)
DevExtTramp(69)
DevExtTramp(70)
DevExtTramp(71)
DevExtTramp(72)
DevExtTramp(73)
DevExtTramp(74)
DevExtTramp(75)
DevExtTramp(76)
DevExtTramp(77)
DevExtTramp(78)
DevExtTramp(79)
DevExtTramp(80)
DevExtTramp(81)
DevExtTramp(82)
DevExtTramp(83)
DevExtTramp(84)
DevExtTramp(85)
DevExtTramp(86)
DevExtTramp(87)
DevExtTramp(88)
DevExtTramp(89)
DevExtTramp(90)
DevExtTramp(91)
DevExtTramp(92)
DevExtTramp(93)
DevExtTramp(94)
DevExtTramp(95)
DevExtTramp(96)
DevExtTramp(97)
DevExtTramp(98)
DevExtTramp(99)
DevExtTramp(100)
DevExtTramp(101)
DevExtTramp(102)
DevExtTramp(103)
DevExtTramp(104)
DevExtTramp(105)
DevExtTramp(106)
DevExtTramp(107)
DevExtTramp(108)
DevExtTramp(109)
DevExtTramp(110)
DevExtTramp(111)
DevExtTramp(112)
DevExtTramp(113)
DevExtTramp(114)
DevExtTramp(115)
DevExtTramp(116)
DevExtTramp(117)
DevExtTramp(118)
DevExtTramp(119)
DevExtTramp(120)
DevExtTramp(121)
DevExtTramp(122)
DevExtTramp(123)
DevExtTramp(124)
DevExtTramp(125)
DevExtTramp(126)
DevExtTramp(127)
DevExtTramp(128)
DevExtTramp(129)
DevExtTramp(130)
DevExtTramp(131)
DevExtTramp(132)
DevExtTramp(133)
DevExtTramp(134)
DevExtTramp(135)
DevExtTramp(136)
DevExtTramp(137)
DevExtTramp(138)
DevExtTramp(139)
DevExtTramp(140)
DevExtTramp(141)
DevExtTramp(142)
DevExtTramp(143)
DevExtTramp(144)
DevExtTramp(145)
DevExtTramp(146)
DevExtTramp(147)
DevExtTramp(148)
DevExtTramp(149)
DevExtTramp(150)
DevExtTramp(151)
DevExtTramp(152)
DevExtTramp(153)
DevExtTramp(154)
DevExtTramp(155)
DevExtTramp(156)
DevExtTramp(157)
DevExtTramp(158)
DevExtTramp(159)
DevExtTramp(160)
DevExtTramp(161)
DevExtTramp(162)
DevExtTramp(163)
DevExtTramp(164)
DevExtTramp(165)
DevExtTramp(166)
DevExtTramp(167)
DevExtTramp(168)
DevExtTramp(169)
DevExtTramp(170)
DevExtTramp(171)
DevExtTramp(172)
DevExtTramp(173)
DevExtTramp(174)
DevExtTramp(175)
DevExtTramp(176)
DevExtTramp(177)
DevExtTramp(178)
DevExtTramp(179)
DevExtTramp(180)
DevExtTramp(181)
DevExtTramp(182)
DevExtTramp(183)
DevExtTramp(184)
DevExtTramp(185)
DevExtTramp(186)
DevExtTramp(187)
DevExtTramp(188)
DevExtTramp(189)
DevExtTramp(190)
DevExtTramp(191)
DevExtTramp(192)
DevExtTramp(193)
DevExtTramp(194)
DevExtTramp(195)
DevExtTramp(196)
DevExtTramp(197)
DevExtTramp(198)
DevExtTramp(199)
DevExtTramp(200)
DevExtTramp(201)
DevExtTramp(202)
DevExtTramp(203)
DevExtTramp(204)
DevExtTramp(205)
DevExtTramp(206)
DevExtTramp(207)
DevExtTramp(208)
DevExtTramp(209)
DevExtTramp(210)
DevExtTramp(211)
DevExtTramp(212)
DevExtTramp(213)
DevExtTramp(214)
DevExtTramp(215)
DevExtTramp(216)
DevExtTramp(217)
DevExtTramp(218)
DevExtTramp(219)
DevExtTramp(220)
DevExtTramp(221)
DevExtTramp(222)
DevExtTramp(223)
DevExtTramp(224)
DevExtTramp(225)
DevExtTramp(226)
DevExtTramp(227)
DevExtTramp(228)
DevExtTramp(229)
DevExtTramp(230)
DevExtTramp(231)
DevExtTramp(232)
DevExtTramp(233)
DevExtTramp(234)
DevExtTramp(235)
DevExtTramp(236)
DevExtTramp(237)
DevExtTramp(238)
DevExtTramp(239)
DevExtTramp(240)
DevExtTramp(241)
DevExtTramp(242)
DevExtTramp(243)
DevExtTramp(244)
DevExtTramp(245)
DevExtTramp(246)
DevExtTramp(247)
DevExtTramp(248)
DevExtTramp(249)

View File

@ -0,0 +1,873 @@
#
# Copyright (c) 2017 The Khronos Group Inc.
# Copyright (c) 2017 Valve Corporation
# Copyright (c) 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: Lenny Komow <lenny@lunarg.com>
#
# This code is used to pass on device (including physical device) extensions through the call chain. It must do this without
# creating a stack frame, because the actual parameters of the call are not known. Since the first parameter is known to be a
# VkPhysicalDevice or a dispatchable object it can unwrap the object, possibly overwriting the wrapped physical device, and then
# jump to the next function in the call chain
.intel_syntax noprefix
.include "gen_defines.asm"
.ifdef X86_64
.macro PhysDevExtTramp num
.global vkPhysDevExtTramp\num
vkPhysDevExtTramp\num:
mov rax, [rdi]
mov rdi, [rdi + PHYS_DEV_OFFSET_PHYS_DEV_TRAMP]
jmp [rax + (PHYS_DEV_OFFSET_INST_DISPATCH + (PTR_SIZE * \num))]
.endm
.macro PhysDevExtTermin num
.global vkPhysDevExtTermin\num
vkPhysDevExtTermin\num:
mov rax, [rdi + ICD_TERM_OFFSET_PHYS_DEV_TERM] # Store the loader_icd_term* in rax
cmp qword ptr [rax + (DISPATCH_OFFSET_ICD_TERM + (PTR_SIZE * \num))], 0 # Check if the next function in the chain is NULL
je terminError\num # Go to the error section if it is NULL
mov rdi, [rdi + PHYS_DEV_OFFSET_PHYS_DEV_TERM] # Load the unwrapped VkPhysicalDevice into the first arg
jmp [rax + (DISPATCH_OFFSET_ICD_TERM + (PTR_SIZE * \num))] # Jump to the next function in the chain
terminError\num:
sub rsp, 56 # Create the stack frame
mov rdi, [rax + INSTANCE_OFFSET_ICD_TERM] # Load the loader_instance into rdi (first arg)
mov r8, [rdi + (HASH_OFFSET_INSTANCE + (HASH_SIZE * \num) + FUNC_NAME_OFFSET_HASH)] # Load the func name into r8 (fifth arg)
lea rcx, termin_error_string@GOTPCREL # Load the error string into rcx (fourth arg)
xor edx, edx # Set rdx to zero (third arg)
lea esi, [rdx + VK_DEBUG_REPORT_ERROR_BIT_EXT] # Write the error logging bit to rsi (second arg)
call loader_log # Log the error message before we crash
add rsp, 56 # Clean up the stack frame
mov rax, 0
jmp rax # Crash intentionally by jumping to address zero
.endm
.macro DevExtTramp num
.global vkdev_ext\num
vkdev_ext\num:
mov rax, [rdi] # Dereference the handle to get the dispatch table
jmp [rax + (EXT_OFFSET_DEVICE_DISPATCH + (PTR_SIZE * \num))] # Jump to the appropriate call chain
.endm
.else
.macro PhysDevExtTramp num
.global vkPhysDevExtTramp\num
vkPhysDevExtTramp\num:
mov eax, [esp + 4] # Load the wrapped VkPhysicalDevice into eax
mov ecx, [eax + PHYS_DEV_OFFSET_PHYS_DEV_TRAMP] # Load the unwrapped VkPhysicalDevice into ecx
mov [esp + 4], ecx # Overwrite the wrapped VkPhysicalDevice with the unwrapped one (on the stack)
mov eax, [eax] # Dereference the wrapped VkPhysicalDevice to get the dispatch table in eax
jmp [eax + (PHYS_DEV_OFFSET_INST_DISPATCH + (PTR_SIZE * \num))] # Dereference the wrapped VkPhysicalDevice to get the dispatch table in eax
.endm
.macro PhysDevExtTermin num
.global vkPhysDevExtTermin\num
vkPhysDevExtTermin\num:
mov ecx, [esp + 4] # Move the wrapped VkPhysicalDevice into ecx
mov eax, [ecx + ICD_TERM_OFFSET_PHYS_DEV_TERM] # Store the loader_icd_term* in eax
cmp dword ptr [eax + (DISPATCH_OFFSET_ICD_TERM + (PTR_SIZE * \num))], 0 # Check if the next function in the chain is NULL
je terminError\num # Go to the error section if it is NULL
mov ecx, [ecx + PHYS_DEV_OFFSET_PHYS_DEV_TERM] # Unwrap the VkPhysicalDevice in ecx
mov [esp + 4], ecx # Copy the unwrapped VkPhysicalDevice into the first arg
jmp [eax + (DISPATCH_OFFSET_ICD_TERM + (PTR_SIZE * \num))] # Jump to the next function in the chain
terminError\num:
mov eax, [eax + INSTANCE_OFFSET_ICD_TERM] # Load the loader_instance into eax
push [eax + (HASH_OFFSET_INSTANCE + (HASH_SIZE * \num) + FUNC_NAME_OFFSET_HASH)] # Push the func name (fifth arg)
push offset termin_error_string@GOT # Push the error string (fourth arg)
push 0 # Push zero (third arg)
push VK_DEBUG_REPORT_ERROR_BIT_EXT # Push the error logging bit (second arg)
push eax # Push the loader_instance (first arg)
call loader_log # Log the error message before we crash
add esp, 20 # Clean up the args
mov eax, 0
jmp eax # Crash intentionally by jumping to address zero
.endm
.macro DevExtTramp num
.global vkdev_ext\num
vkdev_ext\num:
mov eax, [esp + 4] # Dereference the handle to get the dispatch table
jmp [eax + (EXT_OFFSET_DEVICE_DISPATCH + (PTR_SIZE * \num))] # Jump to the appropriate call chain
.endm
.endif
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif
.data
termin_error_string:
.string "Extension %s not supported for this physical device"
.text
PhysDevExtTramp 0
PhysDevExtTramp 1
PhysDevExtTramp 2
PhysDevExtTramp 3
PhysDevExtTramp 4
PhysDevExtTramp 5
PhysDevExtTramp 6
PhysDevExtTramp 7
PhysDevExtTramp 8
PhysDevExtTramp 9
PhysDevExtTramp 10
PhysDevExtTramp 11
PhysDevExtTramp 12
PhysDevExtTramp 13
PhysDevExtTramp 14
PhysDevExtTramp 15
PhysDevExtTramp 16
PhysDevExtTramp 17
PhysDevExtTramp 18
PhysDevExtTramp 19
PhysDevExtTramp 20
PhysDevExtTramp 21
PhysDevExtTramp 22
PhysDevExtTramp 23
PhysDevExtTramp 24
PhysDevExtTramp 25
PhysDevExtTramp 26
PhysDevExtTramp 27
PhysDevExtTramp 28
PhysDevExtTramp 29
PhysDevExtTramp 30
PhysDevExtTramp 31
PhysDevExtTramp 32
PhysDevExtTramp 33
PhysDevExtTramp 34
PhysDevExtTramp 35
PhysDevExtTramp 36
PhysDevExtTramp 37
PhysDevExtTramp 38
PhysDevExtTramp 39
PhysDevExtTramp 40
PhysDevExtTramp 41
PhysDevExtTramp 42
PhysDevExtTramp 43
PhysDevExtTramp 44
PhysDevExtTramp 45
PhysDevExtTramp 46
PhysDevExtTramp 47
PhysDevExtTramp 48
PhysDevExtTramp 49
PhysDevExtTramp 50
PhysDevExtTramp 51
PhysDevExtTramp 52
PhysDevExtTramp 53
PhysDevExtTramp 54
PhysDevExtTramp 55
PhysDevExtTramp 56
PhysDevExtTramp 57
PhysDevExtTramp 58
PhysDevExtTramp 59
PhysDevExtTramp 60
PhysDevExtTramp 61
PhysDevExtTramp 62
PhysDevExtTramp 63
PhysDevExtTramp 64
PhysDevExtTramp 65
PhysDevExtTramp 66
PhysDevExtTramp 67
PhysDevExtTramp 68
PhysDevExtTramp 69
PhysDevExtTramp 70
PhysDevExtTramp 71
PhysDevExtTramp 72
PhysDevExtTramp 73
PhysDevExtTramp 74
PhysDevExtTramp 75
PhysDevExtTramp 76
PhysDevExtTramp 77
PhysDevExtTramp 78
PhysDevExtTramp 79
PhysDevExtTramp 80
PhysDevExtTramp 81
PhysDevExtTramp 82
PhysDevExtTramp 83
PhysDevExtTramp 84
PhysDevExtTramp 85
PhysDevExtTramp 86
PhysDevExtTramp 87
PhysDevExtTramp 88
PhysDevExtTramp 89
PhysDevExtTramp 90
PhysDevExtTramp 91
PhysDevExtTramp 92
PhysDevExtTramp 93
PhysDevExtTramp 94
PhysDevExtTramp 95
PhysDevExtTramp 96
PhysDevExtTramp 97
PhysDevExtTramp 98
PhysDevExtTramp 99
PhysDevExtTramp 100
PhysDevExtTramp 101
PhysDevExtTramp 102
PhysDevExtTramp 103
PhysDevExtTramp 104
PhysDevExtTramp 105
PhysDevExtTramp 106
PhysDevExtTramp 107
PhysDevExtTramp 108
PhysDevExtTramp 109
PhysDevExtTramp 110
PhysDevExtTramp 111
PhysDevExtTramp 112
PhysDevExtTramp 113
PhysDevExtTramp 114
PhysDevExtTramp 115
PhysDevExtTramp 116
PhysDevExtTramp 117
PhysDevExtTramp 118
PhysDevExtTramp 119
PhysDevExtTramp 120
PhysDevExtTramp 121
PhysDevExtTramp 122
PhysDevExtTramp 123
PhysDevExtTramp 124
PhysDevExtTramp 125
PhysDevExtTramp 126
PhysDevExtTramp 127
PhysDevExtTramp 128
PhysDevExtTramp 129
PhysDevExtTramp 130
PhysDevExtTramp 131
PhysDevExtTramp 132
PhysDevExtTramp 133
PhysDevExtTramp 134
PhysDevExtTramp 135
PhysDevExtTramp 136
PhysDevExtTramp 137
PhysDevExtTramp 138
PhysDevExtTramp 139
PhysDevExtTramp 140
PhysDevExtTramp 141
PhysDevExtTramp 142
PhysDevExtTramp 143
PhysDevExtTramp 144
PhysDevExtTramp 145
PhysDevExtTramp 146
PhysDevExtTramp 147
PhysDevExtTramp 148
PhysDevExtTramp 149
PhysDevExtTramp 150
PhysDevExtTramp 151
PhysDevExtTramp 152
PhysDevExtTramp 153
PhysDevExtTramp 154
PhysDevExtTramp 155
PhysDevExtTramp 156
PhysDevExtTramp 157
PhysDevExtTramp 158
PhysDevExtTramp 159
PhysDevExtTramp 160
PhysDevExtTramp 161
PhysDevExtTramp 162
PhysDevExtTramp 163
PhysDevExtTramp 164
PhysDevExtTramp 165
PhysDevExtTramp 166
PhysDevExtTramp 167
PhysDevExtTramp 168
PhysDevExtTramp 169
PhysDevExtTramp 170
PhysDevExtTramp 171
PhysDevExtTramp 172
PhysDevExtTramp 173
PhysDevExtTramp 174
PhysDevExtTramp 175
PhysDevExtTramp 176
PhysDevExtTramp 177
PhysDevExtTramp 178
PhysDevExtTramp 179
PhysDevExtTramp 180
PhysDevExtTramp 181
PhysDevExtTramp 182
PhysDevExtTramp 183
PhysDevExtTramp 184
PhysDevExtTramp 185
PhysDevExtTramp 186
PhysDevExtTramp 187
PhysDevExtTramp 188
PhysDevExtTramp 189
PhysDevExtTramp 190
PhysDevExtTramp 191
PhysDevExtTramp 192
PhysDevExtTramp 193
PhysDevExtTramp 194
PhysDevExtTramp 195
PhysDevExtTramp 196
PhysDevExtTramp 197
PhysDevExtTramp 198
PhysDevExtTramp 199
PhysDevExtTramp 200
PhysDevExtTramp 201
PhysDevExtTramp 202
PhysDevExtTramp 203
PhysDevExtTramp 204
PhysDevExtTramp 205
PhysDevExtTramp 206
PhysDevExtTramp 207
PhysDevExtTramp 208
PhysDevExtTramp 209
PhysDevExtTramp 210
PhysDevExtTramp 211
PhysDevExtTramp 212
PhysDevExtTramp 213
PhysDevExtTramp 214
PhysDevExtTramp 215
PhysDevExtTramp 216
PhysDevExtTramp 217
PhysDevExtTramp 218
PhysDevExtTramp 219
PhysDevExtTramp 220
PhysDevExtTramp 221
PhysDevExtTramp 222
PhysDevExtTramp 223
PhysDevExtTramp 224
PhysDevExtTramp 225
PhysDevExtTramp 226
PhysDevExtTramp 227
PhysDevExtTramp 228
PhysDevExtTramp 229
PhysDevExtTramp 230
PhysDevExtTramp 231
PhysDevExtTramp 232
PhysDevExtTramp 233
PhysDevExtTramp 234
PhysDevExtTramp 235
PhysDevExtTramp 236
PhysDevExtTramp 237
PhysDevExtTramp 238
PhysDevExtTramp 239
PhysDevExtTramp 240
PhysDevExtTramp 241
PhysDevExtTramp 242
PhysDevExtTramp 243
PhysDevExtTramp 244
PhysDevExtTramp 245
PhysDevExtTramp 246
PhysDevExtTramp 247
PhysDevExtTramp 248
PhysDevExtTramp 249
PhysDevExtTermin 0
PhysDevExtTermin 1
PhysDevExtTermin 2
PhysDevExtTermin 3
PhysDevExtTermin 4
PhysDevExtTermin 5
PhysDevExtTermin 6
PhysDevExtTermin 7
PhysDevExtTermin 8
PhysDevExtTermin 9
PhysDevExtTermin 10
PhysDevExtTermin 11
PhysDevExtTermin 12
PhysDevExtTermin 13
PhysDevExtTermin 14
PhysDevExtTermin 15
PhysDevExtTermin 16
PhysDevExtTermin 17
PhysDevExtTermin 18
PhysDevExtTermin 19
PhysDevExtTermin 20
PhysDevExtTermin 21
PhysDevExtTermin 22
PhysDevExtTermin 23
PhysDevExtTermin 24
PhysDevExtTermin 25
PhysDevExtTermin 26
PhysDevExtTermin 27
PhysDevExtTermin 28
PhysDevExtTermin 29
PhysDevExtTermin 30
PhysDevExtTermin 31
PhysDevExtTermin 32
PhysDevExtTermin 33
PhysDevExtTermin 34
PhysDevExtTermin 35
PhysDevExtTermin 36
PhysDevExtTermin 37
PhysDevExtTermin 38
PhysDevExtTermin 39
PhysDevExtTermin 40
PhysDevExtTermin 41
PhysDevExtTermin 42
PhysDevExtTermin 43
PhysDevExtTermin 44
PhysDevExtTermin 45
PhysDevExtTermin 46
PhysDevExtTermin 47
PhysDevExtTermin 48
PhysDevExtTermin 49
PhysDevExtTermin 50
PhysDevExtTermin 51
PhysDevExtTermin 52
PhysDevExtTermin 53
PhysDevExtTermin 54
PhysDevExtTermin 55
PhysDevExtTermin 56
PhysDevExtTermin 57
PhysDevExtTermin 58
PhysDevExtTermin 59
PhysDevExtTermin 60
PhysDevExtTermin 61
PhysDevExtTermin 62
PhysDevExtTermin 63
PhysDevExtTermin 64
PhysDevExtTermin 65
PhysDevExtTermin 66
PhysDevExtTermin 67
PhysDevExtTermin 68
PhysDevExtTermin 69
PhysDevExtTermin 70
PhysDevExtTermin 71
PhysDevExtTermin 72
PhysDevExtTermin 73
PhysDevExtTermin 74
PhysDevExtTermin 75
PhysDevExtTermin 76
PhysDevExtTermin 77
PhysDevExtTermin 78
PhysDevExtTermin 79
PhysDevExtTermin 80
PhysDevExtTermin 81
PhysDevExtTermin 82
PhysDevExtTermin 83
PhysDevExtTermin 84
PhysDevExtTermin 85
PhysDevExtTermin 86
PhysDevExtTermin 87
PhysDevExtTermin 88
PhysDevExtTermin 89
PhysDevExtTermin 90
PhysDevExtTermin 91
PhysDevExtTermin 92
PhysDevExtTermin 93
PhysDevExtTermin 94
PhysDevExtTermin 95
PhysDevExtTermin 96
PhysDevExtTermin 97
PhysDevExtTermin 98
PhysDevExtTermin 99
PhysDevExtTermin 100
PhysDevExtTermin 101
PhysDevExtTermin 102
PhysDevExtTermin 103
PhysDevExtTermin 104
PhysDevExtTermin 105
PhysDevExtTermin 106
PhysDevExtTermin 107
PhysDevExtTermin 108
PhysDevExtTermin 109
PhysDevExtTermin 110
PhysDevExtTermin 111
PhysDevExtTermin 112
PhysDevExtTermin 113
PhysDevExtTermin 114
PhysDevExtTermin 115
PhysDevExtTermin 116
PhysDevExtTermin 117
PhysDevExtTermin 118
PhysDevExtTermin 119
PhysDevExtTermin 120
PhysDevExtTermin 121
PhysDevExtTermin 122
PhysDevExtTermin 123
PhysDevExtTermin 124
PhysDevExtTermin 125
PhysDevExtTermin 126
PhysDevExtTermin 127
PhysDevExtTermin 128
PhysDevExtTermin 129
PhysDevExtTermin 130
PhysDevExtTermin 131
PhysDevExtTermin 132
PhysDevExtTermin 133
PhysDevExtTermin 134
PhysDevExtTermin 135
PhysDevExtTermin 136
PhysDevExtTermin 137
PhysDevExtTermin 138
PhysDevExtTermin 139
PhysDevExtTermin 140
PhysDevExtTermin 141
PhysDevExtTermin 142
PhysDevExtTermin 143
PhysDevExtTermin 144
PhysDevExtTermin 145
PhysDevExtTermin 146
PhysDevExtTermin 147
PhysDevExtTermin 148
PhysDevExtTermin 149
PhysDevExtTermin 150
PhysDevExtTermin 151
PhysDevExtTermin 152
PhysDevExtTermin 153
PhysDevExtTermin 154
PhysDevExtTermin 155
PhysDevExtTermin 156
PhysDevExtTermin 157
PhysDevExtTermin 158
PhysDevExtTermin 159
PhysDevExtTermin 160
PhysDevExtTermin 161
PhysDevExtTermin 162
PhysDevExtTermin 163
PhysDevExtTermin 164
PhysDevExtTermin 165
PhysDevExtTermin 166
PhysDevExtTermin 167
PhysDevExtTermin 168
PhysDevExtTermin 169
PhysDevExtTermin 170
PhysDevExtTermin 171
PhysDevExtTermin 172
PhysDevExtTermin 173
PhysDevExtTermin 174
PhysDevExtTermin 175
PhysDevExtTermin 176
PhysDevExtTermin 177
PhysDevExtTermin 178
PhysDevExtTermin 179
PhysDevExtTermin 180
PhysDevExtTermin 181
PhysDevExtTermin 182
PhysDevExtTermin 183
PhysDevExtTermin 184
PhysDevExtTermin 185
PhysDevExtTermin 186
PhysDevExtTermin 187
PhysDevExtTermin 188
PhysDevExtTermin 189
PhysDevExtTermin 190
PhysDevExtTermin 191
PhysDevExtTermin 192
PhysDevExtTermin 193
PhysDevExtTermin 194
PhysDevExtTermin 195
PhysDevExtTermin 196
PhysDevExtTermin 197
PhysDevExtTermin 198
PhysDevExtTermin 199
PhysDevExtTermin 200
PhysDevExtTermin 201
PhysDevExtTermin 202
PhysDevExtTermin 203
PhysDevExtTermin 204
PhysDevExtTermin 205
PhysDevExtTermin 206
PhysDevExtTermin 207
PhysDevExtTermin 208
PhysDevExtTermin 209
PhysDevExtTermin 210
PhysDevExtTermin 211
PhysDevExtTermin 212
PhysDevExtTermin 213
PhysDevExtTermin 214
PhysDevExtTermin 215
PhysDevExtTermin 216
PhysDevExtTermin 217
PhysDevExtTermin 218
PhysDevExtTermin 219
PhysDevExtTermin 220
PhysDevExtTermin 221
PhysDevExtTermin 222
PhysDevExtTermin 223
PhysDevExtTermin 224
PhysDevExtTermin 225
PhysDevExtTermin 226
PhysDevExtTermin 227
PhysDevExtTermin 228
PhysDevExtTermin 229
PhysDevExtTermin 230
PhysDevExtTermin 231
PhysDevExtTermin 232
PhysDevExtTermin 233
PhysDevExtTermin 234
PhysDevExtTermin 235
PhysDevExtTermin 236
PhysDevExtTermin 237
PhysDevExtTermin 238
PhysDevExtTermin 239
PhysDevExtTermin 240
PhysDevExtTermin 241
PhysDevExtTermin 242
PhysDevExtTermin 243
PhysDevExtTermin 244
PhysDevExtTermin 245
PhysDevExtTermin 246
PhysDevExtTermin 247
PhysDevExtTermin 248
PhysDevExtTermin 249
DevExtTramp 0
DevExtTramp 1
DevExtTramp 2
DevExtTramp 3
DevExtTramp 4
DevExtTramp 5
DevExtTramp 6
DevExtTramp 7
DevExtTramp 8
DevExtTramp 9
DevExtTramp 10
DevExtTramp 11
DevExtTramp 12
DevExtTramp 13
DevExtTramp 14
DevExtTramp 15
DevExtTramp 16
DevExtTramp 17
DevExtTramp 18
DevExtTramp 19
DevExtTramp 20
DevExtTramp 21
DevExtTramp 22
DevExtTramp 23
DevExtTramp 24
DevExtTramp 25
DevExtTramp 26
DevExtTramp 27
DevExtTramp 28
DevExtTramp 29
DevExtTramp 30
DevExtTramp 31
DevExtTramp 32
DevExtTramp 33
DevExtTramp 34
DevExtTramp 35
DevExtTramp 36
DevExtTramp 37
DevExtTramp 38
DevExtTramp 39
DevExtTramp 40
DevExtTramp 41
DevExtTramp 42
DevExtTramp 43
DevExtTramp 44
DevExtTramp 45
DevExtTramp 46
DevExtTramp 47
DevExtTramp 48
DevExtTramp 49
DevExtTramp 50
DevExtTramp 51
DevExtTramp 52
DevExtTramp 53
DevExtTramp 54
DevExtTramp 55
DevExtTramp 56
DevExtTramp 57
DevExtTramp 58
DevExtTramp 59
DevExtTramp 60
DevExtTramp 61
DevExtTramp 62
DevExtTramp 63
DevExtTramp 64
DevExtTramp 65
DevExtTramp 66
DevExtTramp 67
DevExtTramp 68
DevExtTramp 69
DevExtTramp 70
DevExtTramp 71
DevExtTramp 72
DevExtTramp 73
DevExtTramp 74
DevExtTramp 75
DevExtTramp 76
DevExtTramp 77
DevExtTramp 78
DevExtTramp 79
DevExtTramp 80
DevExtTramp 81
DevExtTramp 82
DevExtTramp 83
DevExtTramp 84
DevExtTramp 85
DevExtTramp 86
DevExtTramp 87
DevExtTramp 88
DevExtTramp 89
DevExtTramp 90
DevExtTramp 91
DevExtTramp 92
DevExtTramp 93
DevExtTramp 94
DevExtTramp 95
DevExtTramp 96
DevExtTramp 97
DevExtTramp 98
DevExtTramp 99
DevExtTramp 100
DevExtTramp 101
DevExtTramp 102
DevExtTramp 103
DevExtTramp 104
DevExtTramp 105
DevExtTramp 106
DevExtTramp 107
DevExtTramp 108
DevExtTramp 109
DevExtTramp 110
DevExtTramp 111
DevExtTramp 112
DevExtTramp 113
DevExtTramp 114
DevExtTramp 115
DevExtTramp 116
DevExtTramp 117
DevExtTramp 118
DevExtTramp 119
DevExtTramp 120
DevExtTramp 121
DevExtTramp 122
DevExtTramp 123
DevExtTramp 124
DevExtTramp 125
DevExtTramp 126
DevExtTramp 127
DevExtTramp 128
DevExtTramp 129
DevExtTramp 130
DevExtTramp 131
DevExtTramp 132
DevExtTramp 133
DevExtTramp 134
DevExtTramp 135
DevExtTramp 136
DevExtTramp 137
DevExtTramp 138
DevExtTramp 139
DevExtTramp 140
DevExtTramp 141
DevExtTramp 142
DevExtTramp 143
DevExtTramp 144
DevExtTramp 145
DevExtTramp 146
DevExtTramp 147
DevExtTramp 148
DevExtTramp 149
DevExtTramp 150
DevExtTramp 151
DevExtTramp 152
DevExtTramp 153
DevExtTramp 154
DevExtTramp 155
DevExtTramp 156
DevExtTramp 157
DevExtTramp 158
DevExtTramp 159
DevExtTramp 160
DevExtTramp 161
DevExtTramp 162
DevExtTramp 163
DevExtTramp 164
DevExtTramp 165
DevExtTramp 166
DevExtTramp 167
DevExtTramp 168
DevExtTramp 169
DevExtTramp 170
DevExtTramp 171
DevExtTramp 172
DevExtTramp 173
DevExtTramp 174
DevExtTramp 175
DevExtTramp 176
DevExtTramp 177
DevExtTramp 178
DevExtTramp 179
DevExtTramp 180
DevExtTramp 181
DevExtTramp 182
DevExtTramp 183
DevExtTramp 184
DevExtTramp 185
DevExtTramp 186
DevExtTramp 187
DevExtTramp 188
DevExtTramp 189
DevExtTramp 190
DevExtTramp 191
DevExtTramp 192
DevExtTramp 193
DevExtTramp 194
DevExtTramp 195
DevExtTramp 196
DevExtTramp 197
DevExtTramp 198
DevExtTramp 199
DevExtTramp 200
DevExtTramp 201
DevExtTramp 202
DevExtTramp 203
DevExtTramp 204
DevExtTramp 205
DevExtTramp 206
DevExtTramp 207
DevExtTramp 208
DevExtTramp 209
DevExtTramp 210
DevExtTramp 211
DevExtTramp 212
DevExtTramp 213
DevExtTramp 214
DevExtTramp 215
DevExtTramp 216
DevExtTramp 217
DevExtTramp 218
DevExtTramp 219
DevExtTramp 220
DevExtTramp 221
DevExtTramp 222
DevExtTramp 223
DevExtTramp 224
DevExtTramp 225
DevExtTramp 226
DevExtTramp 227
DevExtTramp 228
DevExtTramp 229
DevExtTramp 230
DevExtTramp 231
DevExtTramp 232
DevExtTramp 233
DevExtTramp 234
DevExtTramp 235
DevExtTramp 236
DevExtTramp 237
DevExtTramp 238
DevExtTramp 239
DevExtTramp 240
DevExtTramp 241
DevExtTramp 242
DevExtTramp 243
DevExtTramp 244
DevExtTramp 245
DevExtTramp 246
DevExtTramp 247
DevExtTramp 248
DevExtTramp 249

View File

@ -0,0 +1,883 @@
;
; Copyright (c) 2017 The Khronos Group Inc.
; Copyright (c) 2017 Valve Corporation
; Copyright (c) 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: Lenny Komow <lenny@lunarg.com>
;
; This code is used to pass on device (including physical device) extensions through the call chain. It must do this without
; creating a stack frame, because the actual parameters of the call are not known. Since the first parameter is known to be a
; VkPhysicalDevice or a dispatchable object it can unwrap the object, possibly overwriting the wrapped physical device, and then
; jump to the next function in the call chain
; Codegen defines a number of values, chiefly offsets of members within structs and sizes of data types within gen_defines.asm.
; Struct member offsets are defined in the format "XX_OFFSET_YY" where XX indicates the member within the struct and YY indicates
; the struct type that it is a member of. Data type sizes are defined in the format "XX_SIZE" where XX indicates the data type.
INCLUDE gen_defines.asm
; 64-bit values and macro
IFDEF rax
PhysDevExtTramp macro num:req
public vkPhysDevExtTramp&num&
vkPhysDevExtTramp&num&:
mov rax, qword ptr [rcx] ; Dereference the wrapped VkPhysicalDevice to get the dispatch table in rax
mov rcx, qword ptr [rcx + PHYS_DEV_OFFSET_PHYS_DEV_TRAMP] ; Load the unwrapped VkPhysicalDevice into rcx
jmp qword ptr [rax + (PHYS_DEV_OFFSET_INST_DISPATCH + (PTR_SIZE * num))] ; Jump to the next function in the chain, preserving the args in other registers
endm
PhysDevExtTermin macro num
public vkPhysDevExtTermin&num&
vkPhysDevExtTermin&num&:
mov rax, qword ptr [rcx + ICD_TERM_OFFSET_PHYS_DEV_TERM] ; Store the loader_icd_term* in rax
cmp qword ptr [rax + (DISPATCH_OFFSET_ICD_TERM + (PTR_SIZE * num))], 0 ; Check if the next function in the chain is NULL
je terminError&num& ; Go to the error section if it is NULL
mov rcx, qword ptr [rcx + PHYS_DEV_OFFSET_PHYS_DEV_TERM] ; Load the unwrapped VkPhysicalDevice into the first arg
jmp qword ptr [rax + (DISPATCH_OFFSET_ICD_TERM + (PTR_SIZE * num))] ; Jump to the next function in the chain
terminError&num&:
sub rsp, 56 ; Create the stack frame
mov rcx, qword ptr [rax + INSTANCE_OFFSET_ICD_TERM] ; Load the loader_instance into rcx (first arg)
mov rax, qword ptr [rcx + (HASH_OFFSET_INSTANCE + (HASH_SIZE * num) + FUNC_NAME_OFFSET_HASH)] ; Load the func name into rax
lea r9, termin_error_string ; Load the error string into r9 (fourth arg)
xor r8d, r8d ; Set r8 to zero (third arg)
mov qword ptr [rsp + 32], rax ; Move the func name onto the stack (fifth arg)
lea edx, [r8 + VK_DEBUG_REPORT_ERROR_BIT_EXT] ; Write the error logging bit to rdx (second arg)
call loader_log ; Log the error message before we crash
add rsp, 56 ; Clean up the stack frame
mov rax, 0
jmp rax ; Crash intentionally by jumping to address zero
endm
DevExtTramp macro num
public vkdev_ext&num&
vkdev_ext&num&:
mov rax, qword ptr [rcx] ; Dereference the handle to get the dispatch table
jmp qword ptr [rax + (EXT_OFFSET_DEVICE_DISPATCH + (PTR_SIZE * num))] ; Jump to the appropriate call chain
endm
; 32-bit values and macro
ELSE
PhysDevExtTramp macro num
public _vkPhysDevExtTramp&num&@4
_vkPhysDevExtTramp&num&@4:
mov eax, dword ptr [esp + 4] ; Load the wrapped VkPhysicalDevice into eax
mov ecx, [eax + PHYS_DEV_OFFSET_PHYS_DEV_TRAMP] ; Load the unwrapped VkPhysicalDevice into ecx
mov [esp + 4], ecx ; Overwrite the wrapped VkPhysicalDevice with the unwrapped one (on the stack)
mov eax, [eax] ; Dereference the wrapped VkPhysicalDevice to get the dispatch table in eax
jmp dword ptr [eax + (PHYS_DEV_OFFSET_INST_DISPATCH + (PTR_SIZE * num))] ; Jump to the next function in the chain, preserving the args on the stack
endm
PhysDevExtTermin macro num
public _vkPhysDevExtTermin&num&@4
_vkPhysDevExtTermin&num&@4:
mov ecx, dword ptr [esp + 4] ; Move the wrapped VkPhysicalDevice into ecx
mov eax, dword ptr [ecx + ICD_TERM_OFFSET_PHYS_DEV_TERM] ; Store the loader_icd_term* in eax
cmp dword ptr [eax + (DISPATCH_OFFSET_ICD_TERM + (PTR_SIZE * num))], 0 ; Check if the next function in the chain is NULL
je terminError&num& ; Go to the error section if it is NULL
mov ecx, dword ptr [ecx + PHYS_DEV_OFFSET_PHYS_DEV_TERM] ; Unwrap the VkPhysicalDevice in ecx
mov dword ptr [esp + 4], ecx ; Copy the unwrapped VkPhysicalDevice into the first arg
jmp dword ptr [eax + (DISPATCH_OFFSET_ICD_TERM + (PTR_SIZE * num))] ; Jump to the next function in the chain
terminError&num&:
mov eax, dword ptr [eax + INSTANCE_OFFSET_ICD_TERM] ; Load the loader_instance into eax
push dword ptr [eax + (HASH_OFFSET_INSTANCE + (HASH_SIZE * num) + FUNC_NAME_OFFSET_HASH)] ; Push the func name (fifth arg)
push offset termin_error_string ; Push the error string (fourth arg)
push 0 ; Push zero (third arg)
push VK_DEBUG_REPORT_ERROR_BIT_EXT ; Push the error logging bit (second arg)
push eax ; Push the loader_instance (first arg)
call _loader_log ; Log the error message before we crash
add esp, 20 ; Clean up the args
mov eax, 0
jmp eax ; Crash intentionally by jumping to address zero
endm
DevExtTramp macro num
public _vkdev_ext&num&@4
_vkdev_ext&num&@4:
mov eax, dword ptr [esp + 4] ; Dereference the handle to get the dispatch table
jmp dword ptr [eax + (EXT_OFFSET_DEVICE_DISPATCH + (PTR_SIZE * num))] ; Jump to the appropriate call chain
endm
; This is also needed for 32-bit only
.model flat
ENDIF
.const
termin_error_string db 'Extension %s not supported for this physical device', 0
.code
IFDEF rax
extrn loader_log:near
ELSE
extrn _loader_log:near
ENDIF
PhysDevExtTramp 0
PhysDevExtTramp 1
PhysDevExtTramp 2
PhysDevExtTramp 3
PhysDevExtTramp 4
PhysDevExtTramp 5
PhysDevExtTramp 6
PhysDevExtTramp 7
PhysDevExtTramp 8
PhysDevExtTramp 9
PhysDevExtTramp 10
PhysDevExtTramp 11
PhysDevExtTramp 12
PhysDevExtTramp 13
PhysDevExtTramp 14
PhysDevExtTramp 15
PhysDevExtTramp 16
PhysDevExtTramp 17
PhysDevExtTramp 18
PhysDevExtTramp 19
PhysDevExtTramp 20
PhysDevExtTramp 21
PhysDevExtTramp 22
PhysDevExtTramp 23
PhysDevExtTramp 24
PhysDevExtTramp 25
PhysDevExtTramp 26
PhysDevExtTramp 27
PhysDevExtTramp 28
PhysDevExtTramp 29
PhysDevExtTramp 30
PhysDevExtTramp 31
PhysDevExtTramp 32
PhysDevExtTramp 33
PhysDevExtTramp 34
PhysDevExtTramp 35
PhysDevExtTramp 36
PhysDevExtTramp 37
PhysDevExtTramp 38
PhysDevExtTramp 39
PhysDevExtTramp 40
PhysDevExtTramp 41
PhysDevExtTramp 42
PhysDevExtTramp 43
PhysDevExtTramp 44
PhysDevExtTramp 45
PhysDevExtTramp 46
PhysDevExtTramp 47
PhysDevExtTramp 48
PhysDevExtTramp 49
PhysDevExtTramp 50
PhysDevExtTramp 51
PhysDevExtTramp 52
PhysDevExtTramp 53
PhysDevExtTramp 54
PhysDevExtTramp 55
PhysDevExtTramp 56
PhysDevExtTramp 57
PhysDevExtTramp 58
PhysDevExtTramp 59
PhysDevExtTramp 60
PhysDevExtTramp 61
PhysDevExtTramp 62
PhysDevExtTramp 63
PhysDevExtTramp 64
PhysDevExtTramp 65
PhysDevExtTramp 66
PhysDevExtTramp 67
PhysDevExtTramp 68
PhysDevExtTramp 69
PhysDevExtTramp 70
PhysDevExtTramp 71
PhysDevExtTramp 72
PhysDevExtTramp 73
PhysDevExtTramp 74
PhysDevExtTramp 75
PhysDevExtTramp 76
PhysDevExtTramp 77
PhysDevExtTramp 78
PhysDevExtTramp 79
PhysDevExtTramp 80
PhysDevExtTramp 81
PhysDevExtTramp 82
PhysDevExtTramp 83
PhysDevExtTramp 84
PhysDevExtTramp 85
PhysDevExtTramp 86
PhysDevExtTramp 87
PhysDevExtTramp 88
PhysDevExtTramp 89
PhysDevExtTramp 90
PhysDevExtTramp 91
PhysDevExtTramp 92
PhysDevExtTramp 93
PhysDevExtTramp 94
PhysDevExtTramp 95
PhysDevExtTramp 96
PhysDevExtTramp 97
PhysDevExtTramp 98
PhysDevExtTramp 99
PhysDevExtTramp 100
PhysDevExtTramp 101
PhysDevExtTramp 102
PhysDevExtTramp 103
PhysDevExtTramp 104
PhysDevExtTramp 105
PhysDevExtTramp 106
PhysDevExtTramp 107
PhysDevExtTramp 108
PhysDevExtTramp 109
PhysDevExtTramp 110
PhysDevExtTramp 111
PhysDevExtTramp 112
PhysDevExtTramp 113
PhysDevExtTramp 114
PhysDevExtTramp 115
PhysDevExtTramp 116
PhysDevExtTramp 117
PhysDevExtTramp 118
PhysDevExtTramp 119
PhysDevExtTramp 120
PhysDevExtTramp 121
PhysDevExtTramp 122
PhysDevExtTramp 123
PhysDevExtTramp 124
PhysDevExtTramp 125
PhysDevExtTramp 126
PhysDevExtTramp 127
PhysDevExtTramp 128
PhysDevExtTramp 129
PhysDevExtTramp 130
PhysDevExtTramp 131
PhysDevExtTramp 132
PhysDevExtTramp 133
PhysDevExtTramp 134
PhysDevExtTramp 135
PhysDevExtTramp 136
PhysDevExtTramp 137
PhysDevExtTramp 138
PhysDevExtTramp 139
PhysDevExtTramp 140
PhysDevExtTramp 141
PhysDevExtTramp 142
PhysDevExtTramp 143
PhysDevExtTramp 144
PhysDevExtTramp 145
PhysDevExtTramp 146
PhysDevExtTramp 147
PhysDevExtTramp 148
PhysDevExtTramp 149
PhysDevExtTramp 150
PhysDevExtTramp 151
PhysDevExtTramp 152
PhysDevExtTramp 153
PhysDevExtTramp 154
PhysDevExtTramp 155
PhysDevExtTramp 156
PhysDevExtTramp 157
PhysDevExtTramp 158
PhysDevExtTramp 159
PhysDevExtTramp 160
PhysDevExtTramp 161
PhysDevExtTramp 162
PhysDevExtTramp 163
PhysDevExtTramp 164
PhysDevExtTramp 165
PhysDevExtTramp 166
PhysDevExtTramp 167
PhysDevExtTramp 168
PhysDevExtTramp 169
PhysDevExtTramp 170
PhysDevExtTramp 171
PhysDevExtTramp 172
PhysDevExtTramp 173
PhysDevExtTramp 174
PhysDevExtTramp 175
PhysDevExtTramp 176
PhysDevExtTramp 177
PhysDevExtTramp 178
PhysDevExtTramp 179
PhysDevExtTramp 180
PhysDevExtTramp 181
PhysDevExtTramp 182
PhysDevExtTramp 183
PhysDevExtTramp 184
PhysDevExtTramp 185
PhysDevExtTramp 186
PhysDevExtTramp 187
PhysDevExtTramp 188
PhysDevExtTramp 189
PhysDevExtTramp 190
PhysDevExtTramp 191
PhysDevExtTramp 192
PhysDevExtTramp 193
PhysDevExtTramp 194
PhysDevExtTramp 195
PhysDevExtTramp 196
PhysDevExtTramp 197
PhysDevExtTramp 198
PhysDevExtTramp 199
PhysDevExtTramp 200
PhysDevExtTramp 201
PhysDevExtTramp 202
PhysDevExtTramp 203
PhysDevExtTramp 204
PhysDevExtTramp 205
PhysDevExtTramp 206
PhysDevExtTramp 207
PhysDevExtTramp 208
PhysDevExtTramp 209
PhysDevExtTramp 210
PhysDevExtTramp 211
PhysDevExtTramp 212
PhysDevExtTramp 213
PhysDevExtTramp 214
PhysDevExtTramp 215
PhysDevExtTramp 216
PhysDevExtTramp 217
PhysDevExtTramp 218
PhysDevExtTramp 219
PhysDevExtTramp 220
PhysDevExtTramp 221
PhysDevExtTramp 222
PhysDevExtTramp 223
PhysDevExtTramp 224
PhysDevExtTramp 225
PhysDevExtTramp 226
PhysDevExtTramp 227
PhysDevExtTramp 228
PhysDevExtTramp 229
PhysDevExtTramp 230
PhysDevExtTramp 231
PhysDevExtTramp 232
PhysDevExtTramp 233
PhysDevExtTramp 234
PhysDevExtTramp 235
PhysDevExtTramp 236
PhysDevExtTramp 237
PhysDevExtTramp 238
PhysDevExtTramp 239
PhysDevExtTramp 240
PhysDevExtTramp 241
PhysDevExtTramp 242
PhysDevExtTramp 243
PhysDevExtTramp 244
PhysDevExtTramp 245
PhysDevExtTramp 246
PhysDevExtTramp 247
PhysDevExtTramp 248
PhysDevExtTramp 249
PhysDevExtTermin 0
PhysDevExtTermin 1
PhysDevExtTermin 2
PhysDevExtTermin 3
PhysDevExtTermin 4
PhysDevExtTermin 5
PhysDevExtTermin 6
PhysDevExtTermin 7
PhysDevExtTermin 8
PhysDevExtTermin 9
PhysDevExtTermin 10
PhysDevExtTermin 11
PhysDevExtTermin 12
PhysDevExtTermin 13
PhysDevExtTermin 14
PhysDevExtTermin 15
PhysDevExtTermin 16
PhysDevExtTermin 17
PhysDevExtTermin 18
PhysDevExtTermin 19
PhysDevExtTermin 20
PhysDevExtTermin 21
PhysDevExtTermin 22
PhysDevExtTermin 23
PhysDevExtTermin 24
PhysDevExtTermin 25
PhysDevExtTermin 26
PhysDevExtTermin 27
PhysDevExtTermin 28
PhysDevExtTermin 29
PhysDevExtTermin 30
PhysDevExtTermin 31
PhysDevExtTermin 32
PhysDevExtTermin 33
PhysDevExtTermin 34
PhysDevExtTermin 35
PhysDevExtTermin 36
PhysDevExtTermin 37
PhysDevExtTermin 38
PhysDevExtTermin 39
PhysDevExtTermin 40
PhysDevExtTermin 41
PhysDevExtTermin 42
PhysDevExtTermin 43
PhysDevExtTermin 44
PhysDevExtTermin 45
PhysDevExtTermin 46
PhysDevExtTermin 47
PhysDevExtTermin 48
PhysDevExtTermin 49
PhysDevExtTermin 50
PhysDevExtTermin 51
PhysDevExtTermin 52
PhysDevExtTermin 53
PhysDevExtTermin 54
PhysDevExtTermin 55
PhysDevExtTermin 56
PhysDevExtTermin 57
PhysDevExtTermin 58
PhysDevExtTermin 59
PhysDevExtTermin 60
PhysDevExtTermin 61
PhysDevExtTermin 62
PhysDevExtTermin 63
PhysDevExtTermin 64
PhysDevExtTermin 65
PhysDevExtTermin 66
PhysDevExtTermin 67
PhysDevExtTermin 68
PhysDevExtTermin 69
PhysDevExtTermin 70
PhysDevExtTermin 71
PhysDevExtTermin 72
PhysDevExtTermin 73
PhysDevExtTermin 74
PhysDevExtTermin 75
PhysDevExtTermin 76
PhysDevExtTermin 77
PhysDevExtTermin 78
PhysDevExtTermin 79
PhysDevExtTermin 80
PhysDevExtTermin 81
PhysDevExtTermin 82
PhysDevExtTermin 83
PhysDevExtTermin 84
PhysDevExtTermin 85
PhysDevExtTermin 86
PhysDevExtTermin 87
PhysDevExtTermin 88
PhysDevExtTermin 89
PhysDevExtTermin 90
PhysDevExtTermin 91
PhysDevExtTermin 92
PhysDevExtTermin 93
PhysDevExtTermin 94
PhysDevExtTermin 95
PhysDevExtTermin 96
PhysDevExtTermin 97
PhysDevExtTermin 98
PhysDevExtTermin 99
PhysDevExtTermin 100
PhysDevExtTermin 101
PhysDevExtTermin 102
PhysDevExtTermin 103
PhysDevExtTermin 104
PhysDevExtTermin 105
PhysDevExtTermin 106
PhysDevExtTermin 107
PhysDevExtTermin 108
PhysDevExtTermin 109
PhysDevExtTermin 110
PhysDevExtTermin 111
PhysDevExtTermin 112
PhysDevExtTermin 113
PhysDevExtTermin 114
PhysDevExtTermin 115
PhysDevExtTermin 116
PhysDevExtTermin 117
PhysDevExtTermin 118
PhysDevExtTermin 119
PhysDevExtTermin 120
PhysDevExtTermin 121
PhysDevExtTermin 122
PhysDevExtTermin 123
PhysDevExtTermin 124
PhysDevExtTermin 125
PhysDevExtTermin 126
PhysDevExtTermin 127
PhysDevExtTermin 128
PhysDevExtTermin 129
PhysDevExtTermin 130
PhysDevExtTermin 131
PhysDevExtTermin 132
PhysDevExtTermin 133
PhysDevExtTermin 134
PhysDevExtTermin 135
PhysDevExtTermin 136
PhysDevExtTermin 137
PhysDevExtTermin 138
PhysDevExtTermin 139
PhysDevExtTermin 140
PhysDevExtTermin 141
PhysDevExtTermin 142
PhysDevExtTermin 143
PhysDevExtTermin 144
PhysDevExtTermin 145
PhysDevExtTermin 146
PhysDevExtTermin 147
PhysDevExtTermin 148
PhysDevExtTermin 149
PhysDevExtTermin 150
PhysDevExtTermin 151
PhysDevExtTermin 152
PhysDevExtTermin 153
PhysDevExtTermin 154
PhysDevExtTermin 155
PhysDevExtTermin 156
PhysDevExtTermin 157
PhysDevExtTermin 158
PhysDevExtTermin 159
PhysDevExtTermin 160
PhysDevExtTermin 161
PhysDevExtTermin 162
PhysDevExtTermin 163
PhysDevExtTermin 164
PhysDevExtTermin 165
PhysDevExtTermin 166
PhysDevExtTermin 167
PhysDevExtTermin 168
PhysDevExtTermin 169
PhysDevExtTermin 170
PhysDevExtTermin 171
PhysDevExtTermin 172
PhysDevExtTermin 173
PhysDevExtTermin 174
PhysDevExtTermin 175
PhysDevExtTermin 176
PhysDevExtTermin 177
PhysDevExtTermin 178
PhysDevExtTermin 179
PhysDevExtTermin 180
PhysDevExtTermin 181
PhysDevExtTermin 182
PhysDevExtTermin 183
PhysDevExtTermin 184
PhysDevExtTermin 185
PhysDevExtTermin 186
PhysDevExtTermin 187
PhysDevExtTermin 188
PhysDevExtTermin 189
PhysDevExtTermin 190
PhysDevExtTermin 191
PhysDevExtTermin 192
PhysDevExtTermin 193
PhysDevExtTermin 194
PhysDevExtTermin 195
PhysDevExtTermin 196
PhysDevExtTermin 197
PhysDevExtTermin 198
PhysDevExtTermin 199
PhysDevExtTermin 200
PhysDevExtTermin 201
PhysDevExtTermin 202
PhysDevExtTermin 203
PhysDevExtTermin 204
PhysDevExtTermin 205
PhysDevExtTermin 206
PhysDevExtTermin 207
PhysDevExtTermin 208
PhysDevExtTermin 209
PhysDevExtTermin 210
PhysDevExtTermin 211
PhysDevExtTermin 212
PhysDevExtTermin 213
PhysDevExtTermin 214
PhysDevExtTermin 215
PhysDevExtTermin 216
PhysDevExtTermin 217
PhysDevExtTermin 218
PhysDevExtTermin 219
PhysDevExtTermin 220
PhysDevExtTermin 221
PhysDevExtTermin 222
PhysDevExtTermin 223
PhysDevExtTermin 224
PhysDevExtTermin 225
PhysDevExtTermin 226
PhysDevExtTermin 227
PhysDevExtTermin 228
PhysDevExtTermin 229
PhysDevExtTermin 230
PhysDevExtTermin 231
PhysDevExtTermin 232
PhysDevExtTermin 233
PhysDevExtTermin 234
PhysDevExtTermin 235
PhysDevExtTermin 236
PhysDevExtTermin 237
PhysDevExtTermin 238
PhysDevExtTermin 239
PhysDevExtTermin 240
PhysDevExtTermin 241
PhysDevExtTermin 242
PhysDevExtTermin 243
PhysDevExtTermin 244
PhysDevExtTermin 245
PhysDevExtTermin 246
PhysDevExtTermin 247
PhysDevExtTermin 248
PhysDevExtTermin 249
DevExtTramp 0
DevExtTramp 1
DevExtTramp 2
DevExtTramp 3
DevExtTramp 4
DevExtTramp 5
DevExtTramp 6
DevExtTramp 7
DevExtTramp 8
DevExtTramp 9
DevExtTramp 10
DevExtTramp 11
DevExtTramp 12
DevExtTramp 13
DevExtTramp 14
DevExtTramp 15
DevExtTramp 16
DevExtTramp 17
DevExtTramp 18
DevExtTramp 19
DevExtTramp 20
DevExtTramp 21
DevExtTramp 22
DevExtTramp 23
DevExtTramp 24
DevExtTramp 25
DevExtTramp 26
DevExtTramp 27
DevExtTramp 28
DevExtTramp 29
DevExtTramp 30
DevExtTramp 31
DevExtTramp 32
DevExtTramp 33
DevExtTramp 34
DevExtTramp 35
DevExtTramp 36
DevExtTramp 37
DevExtTramp 38
DevExtTramp 39
DevExtTramp 40
DevExtTramp 41
DevExtTramp 42
DevExtTramp 43
DevExtTramp 44
DevExtTramp 45
DevExtTramp 46
DevExtTramp 47
DevExtTramp 48
DevExtTramp 49
DevExtTramp 50
DevExtTramp 51
DevExtTramp 52
DevExtTramp 53
DevExtTramp 54
DevExtTramp 55
DevExtTramp 56
DevExtTramp 57
DevExtTramp 58
DevExtTramp 59
DevExtTramp 60
DevExtTramp 61
DevExtTramp 62
DevExtTramp 63
DevExtTramp 64
DevExtTramp 65
DevExtTramp 66
DevExtTramp 67
DevExtTramp 68
DevExtTramp 69
DevExtTramp 70
DevExtTramp 71
DevExtTramp 72
DevExtTramp 73
DevExtTramp 74
DevExtTramp 75
DevExtTramp 76
DevExtTramp 77
DevExtTramp 78
DevExtTramp 79
DevExtTramp 80
DevExtTramp 81
DevExtTramp 82
DevExtTramp 83
DevExtTramp 84
DevExtTramp 85
DevExtTramp 86
DevExtTramp 87
DevExtTramp 88
DevExtTramp 89
DevExtTramp 90
DevExtTramp 91
DevExtTramp 92
DevExtTramp 93
DevExtTramp 94
DevExtTramp 95
DevExtTramp 96
DevExtTramp 97
DevExtTramp 98
DevExtTramp 99
DevExtTramp 100
DevExtTramp 101
DevExtTramp 102
DevExtTramp 103
DevExtTramp 104
DevExtTramp 105
DevExtTramp 106
DevExtTramp 107
DevExtTramp 108
DevExtTramp 109
DevExtTramp 110
DevExtTramp 111
DevExtTramp 112
DevExtTramp 113
DevExtTramp 114
DevExtTramp 115
DevExtTramp 116
DevExtTramp 117
DevExtTramp 118
DevExtTramp 119
DevExtTramp 120
DevExtTramp 121
DevExtTramp 122
DevExtTramp 123
DevExtTramp 124
DevExtTramp 125
DevExtTramp 126
DevExtTramp 127
DevExtTramp 128
DevExtTramp 129
DevExtTramp 130
DevExtTramp 131
DevExtTramp 132
DevExtTramp 133
DevExtTramp 134
DevExtTramp 135
DevExtTramp 136
DevExtTramp 137
DevExtTramp 138
DevExtTramp 139
DevExtTramp 140
DevExtTramp 141
DevExtTramp 142
DevExtTramp 143
DevExtTramp 144
DevExtTramp 145
DevExtTramp 146
DevExtTramp 147
DevExtTramp 148
DevExtTramp 149
DevExtTramp 150
DevExtTramp 151
DevExtTramp 152
DevExtTramp 153
DevExtTramp 154
DevExtTramp 155
DevExtTramp 156
DevExtTramp 157
DevExtTramp 158
DevExtTramp 159
DevExtTramp 160
DevExtTramp 161
DevExtTramp 162
DevExtTramp 163
DevExtTramp 164
DevExtTramp 165
DevExtTramp 166
DevExtTramp 167
DevExtTramp 168
DevExtTramp 169
DevExtTramp 170
DevExtTramp 171
DevExtTramp 172
DevExtTramp 173
DevExtTramp 174
DevExtTramp 175
DevExtTramp 176
DevExtTramp 177
DevExtTramp 178
DevExtTramp 179
DevExtTramp 180
DevExtTramp 181
DevExtTramp 182
DevExtTramp 183
DevExtTramp 184
DevExtTramp 185
DevExtTramp 186
DevExtTramp 187
DevExtTramp 188
DevExtTramp 189
DevExtTramp 190
DevExtTramp 191
DevExtTramp 192
DevExtTramp 193
DevExtTramp 194
DevExtTramp 195
DevExtTramp 196
DevExtTramp 197
DevExtTramp 198
DevExtTramp 199
DevExtTramp 200
DevExtTramp 201
DevExtTramp 202
DevExtTramp 203
DevExtTramp 204
DevExtTramp 205
DevExtTramp 206
DevExtTramp 207
DevExtTramp 208
DevExtTramp 209
DevExtTramp 210
DevExtTramp 211
DevExtTramp 212
DevExtTramp 213
DevExtTramp 214
DevExtTramp 215
DevExtTramp 216
DevExtTramp 217
DevExtTramp 218
DevExtTramp 219
DevExtTramp 220
DevExtTramp 221
DevExtTramp 222
DevExtTramp 223
DevExtTramp 224
DevExtTramp 225
DevExtTramp 226
DevExtTramp 227
DevExtTramp 228
DevExtTramp 229
DevExtTramp 230
DevExtTramp 231
DevExtTramp 232
DevExtTramp 233
DevExtTramp 234
DevExtTramp 235
DevExtTramp 236
DevExtTramp 237
DevExtTramp 238
DevExtTramp 239
DevExtTramp 240
DevExtTramp 241
DevExtTramp 242
DevExtTramp 243
DevExtTramp 244
DevExtTramp 245
DevExtTramp 246
DevExtTramp 247
DevExtTramp 248
DevExtTramp 249
end

View File

@ -0,0 +1,740 @@
#pragma once
// *** THIS FILE IS GENERATED - DO NOT EDIT ***
// See dispatch_helper_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: Courtney Goeltzenleuchter <courtney@LunarG.com>
* Author: Jon Ashburn <jon@lunarg.com>
* Author: Mark Lobodzinski <mark@lunarg.com>
*/
#include <vulkan/vulkan.h>
#include <vulkan/vk_layer.h>
#include <string.h>
#include "vk_layer_dispatch_table.h"
static VKAPI_ATTR VkResult VKAPI_CALL StubCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchain) { return VK_SUCCESS; };
static VKAPI_ATTR void VKAPI_CALL StubDestroySwapchainKHR(VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks* pAllocator) { };
static VKAPI_ATTR VkResult VKAPI_CALL StubGetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain, uint32_t* pSwapchainImageCount, VkImage* pSwapchainImages) { return VK_SUCCESS; };
static VKAPI_ATTR VkResult VKAPI_CALL StubAcquireNextImageKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t* pImageIndex) { return VK_SUCCESS; };
static VKAPI_ATTR VkResult VKAPI_CALL StubQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR* pPresentInfo) { return VK_SUCCESS; };
static VKAPI_ATTR VkResult VKAPI_CALL StubGetDeviceGroupPresentCapabilitiesKHR(VkDevice device, VkDeviceGroupPresentCapabilitiesKHR* pDeviceGroupPresentCapabilities) { return VK_SUCCESS; };
static VKAPI_ATTR VkResult VKAPI_CALL StubGetDeviceGroupSurfacePresentModesKHR(VkDevice device, VkSurfaceKHR surface, VkDeviceGroupPresentModeFlagsKHR* pModes) { return VK_SUCCESS; };
static VKAPI_ATTR VkResult VKAPI_CALL StubAcquireNextImage2KHR(VkDevice device, const VkAcquireNextImageInfoKHR* pAcquireInfo, uint32_t* pImageIndex) { return VK_SUCCESS; };
static VKAPI_ATTR VkResult VKAPI_CALL StubCreateSharedSwapchainsKHR(VkDevice device, uint32_t swapchainCount, const VkSwapchainCreateInfoKHR* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchains) { return VK_SUCCESS; };
static VKAPI_ATTR void VKAPI_CALL StubGetDeviceGroupPeerMemoryFeaturesKHR(VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, VkPeerMemoryFeatureFlags* pPeerMemoryFeatures) { };
static VKAPI_ATTR void VKAPI_CALL StubCmdSetDeviceMaskKHR(VkCommandBuffer commandBuffer, uint32_t deviceMask) { };
static VKAPI_ATTR void VKAPI_CALL StubCmdDispatchBaseKHR(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ) { };
static VKAPI_ATTR void VKAPI_CALL StubTrimCommandPoolKHR(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags) { };
#ifdef VK_USE_PLATFORM_WIN32_KHR
static VKAPI_ATTR VkResult VKAPI_CALL StubGetMemoryWin32HandleKHR(VkDevice device, const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle) { return VK_SUCCESS; };
#endif // VK_USE_PLATFORM_WIN32_KHR
#ifdef VK_USE_PLATFORM_WIN32_KHR
static VKAPI_ATTR VkResult VKAPI_CALL StubGetMemoryWin32HandlePropertiesKHR(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE handle, VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties) { return VK_SUCCESS; };
#endif // VK_USE_PLATFORM_WIN32_KHR
static VKAPI_ATTR VkResult VKAPI_CALL StubGetMemoryFdKHR(VkDevice device, const VkMemoryGetFdInfoKHR* pGetFdInfo, int* pFd) { return VK_SUCCESS; };
static VKAPI_ATTR VkResult VKAPI_CALL StubGetMemoryFdPropertiesKHR(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, int fd, VkMemoryFdPropertiesKHR* pMemoryFdProperties) { return VK_SUCCESS; };
#ifdef VK_USE_PLATFORM_WIN32_KHR
static VKAPI_ATTR VkResult VKAPI_CALL StubImportSemaphoreWin32HandleKHR(VkDevice device, const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo) { return VK_SUCCESS; };
#endif // VK_USE_PLATFORM_WIN32_KHR
#ifdef VK_USE_PLATFORM_WIN32_KHR
static VKAPI_ATTR VkResult VKAPI_CALL StubGetSemaphoreWin32HandleKHR(VkDevice device, const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle) { return VK_SUCCESS; };
#endif // VK_USE_PLATFORM_WIN32_KHR
static VKAPI_ATTR VkResult VKAPI_CALL StubImportSemaphoreFdKHR(VkDevice device, const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo) { return VK_SUCCESS; };
static VKAPI_ATTR VkResult VKAPI_CALL StubGetSemaphoreFdKHR(VkDevice device, const VkSemaphoreGetFdInfoKHR* pGetFdInfo, int* pFd) { return VK_SUCCESS; };
static VKAPI_ATTR void VKAPI_CALL StubCmdPushDescriptorSetKHR(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites) { };
static VKAPI_ATTR void VKAPI_CALL StubCmdPushDescriptorSetWithTemplateKHR(VkCommandBuffer commandBuffer, VkDescriptorUpdateTemplate descriptorUpdateTemplate, VkPipelineLayout layout, uint32_t set, const void* pData) { };
static VKAPI_ATTR VkResult VKAPI_CALL StubCreateDescriptorUpdateTemplateKHR(VkDevice device, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate) { return VK_SUCCESS; };
static VKAPI_ATTR void VKAPI_CALL StubDestroyDescriptorUpdateTemplateKHR(VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const VkAllocationCallbacks* pAllocator) { };
static VKAPI_ATTR void VKAPI_CALL StubUpdateDescriptorSetWithTemplateKHR(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData) { };
static VKAPI_ATTR VkResult VKAPI_CALL StubCreateRenderPass2KHR(VkDevice device, const VkRenderPassCreateInfo2KHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass) { return VK_SUCCESS; };
static VKAPI_ATTR void VKAPI_CALL StubCmdBeginRenderPass2KHR(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, const VkSubpassBeginInfoKHR* pSubpassBeginInfo) { };
static VKAPI_ATTR void VKAPI_CALL StubCmdNextSubpass2KHR(VkCommandBuffer commandBuffer, const VkSubpassBeginInfoKHR* pSubpassBeginInfo, const VkSubpassEndInfoKHR* pSubpassEndInfo) { };
static VKAPI_ATTR void VKAPI_CALL StubCmdEndRenderPass2KHR(VkCommandBuffer commandBuffer, const VkSubpassEndInfoKHR* pSubpassEndInfo) { };
static VKAPI_ATTR VkResult VKAPI_CALL StubGetSwapchainStatusKHR(VkDevice device, VkSwapchainKHR swapchain) { return VK_SUCCESS; };
#ifdef VK_USE_PLATFORM_WIN32_KHR
static VKAPI_ATTR VkResult VKAPI_CALL StubImportFenceWin32HandleKHR(VkDevice device, const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo) { return VK_SUCCESS; };
#endif // VK_USE_PLATFORM_WIN32_KHR
#ifdef VK_USE_PLATFORM_WIN32_KHR
static VKAPI_ATTR VkResult VKAPI_CALL StubGetFenceWin32HandleKHR(VkDevice device, const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle) { return VK_SUCCESS; };
#endif // VK_USE_PLATFORM_WIN32_KHR
static VKAPI_ATTR VkResult VKAPI_CALL StubImportFenceFdKHR(VkDevice device, const VkImportFenceFdInfoKHR* pImportFenceFdInfo) { return VK_SUCCESS; };
static VKAPI_ATTR VkResult VKAPI_CALL StubGetFenceFdKHR(VkDevice device, const VkFenceGetFdInfoKHR* pGetFdInfo, int* pFd) { return VK_SUCCESS; };
static VKAPI_ATTR void VKAPI_CALL StubGetImageMemoryRequirements2KHR(VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements) { };
static VKAPI_ATTR void VKAPI_CALL StubGetBufferMemoryRequirements2KHR(VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements) { };
static VKAPI_ATTR void VKAPI_CALL StubGetImageSparseMemoryRequirements2KHR(VkDevice device, const VkImageSparseMemoryRequirementsInfo2* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) { };
static VKAPI_ATTR VkResult VKAPI_CALL StubCreateSamplerYcbcrConversionKHR(VkDevice device, const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSamplerYcbcrConversion* pYcbcrConversion) { return VK_SUCCESS; };
static VKAPI_ATTR void VKAPI_CALL StubDestroySamplerYcbcrConversionKHR(VkDevice device, VkSamplerYcbcrConversion ycbcrConversion, const VkAllocationCallbacks* pAllocator) { };
static VKAPI_ATTR VkResult VKAPI_CALL StubBindBufferMemory2KHR(VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo* pBindInfos) { return VK_SUCCESS; };
static VKAPI_ATTR VkResult VKAPI_CALL StubBindImageMemory2KHR(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo* pBindInfos) { return VK_SUCCESS; };
static VKAPI_ATTR void VKAPI_CALL StubGetDescriptorSetLayoutSupportKHR(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayoutSupport* pSupport) { };
static VKAPI_ATTR void VKAPI_CALL StubCmdDrawIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) { };
static VKAPI_ATTR void VKAPI_CALL StubCmdDrawIndexedIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) { };
static VKAPI_ATTR VkResult VKAPI_CALL StubDebugMarkerSetObjectTagEXT(VkDevice device, const VkDebugMarkerObjectTagInfoEXT* pTagInfo) { return VK_SUCCESS; };
static VKAPI_ATTR VkResult VKAPI_CALL StubDebugMarkerSetObjectNameEXT(VkDevice device, const VkDebugMarkerObjectNameInfoEXT* pNameInfo) { return VK_SUCCESS; };
static VKAPI_ATTR void VKAPI_CALL StubCmdDebugMarkerBeginEXT(VkCommandBuffer commandBuffer, const VkDebugMarkerMarkerInfoEXT* pMarkerInfo) { };
static VKAPI_ATTR void VKAPI_CALL StubCmdDebugMarkerEndEXT(VkCommandBuffer commandBuffer) { };
static VKAPI_ATTR void VKAPI_CALL StubCmdDebugMarkerInsertEXT(VkCommandBuffer commandBuffer, const VkDebugMarkerMarkerInfoEXT* pMarkerInfo) { };
static VKAPI_ATTR void VKAPI_CALL StubCmdBindTransformFeedbackBuffersEXT(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets, const VkDeviceSize* pSizes) { };
static VKAPI_ATTR void VKAPI_CALL StubCmdBeginTransformFeedbackEXT(VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer, uint32_t counterBufferCount, const VkBuffer* pCounterBuffers, const VkDeviceSize* pCounterBufferOffsets) { };
static VKAPI_ATTR void VKAPI_CALL StubCmdEndTransformFeedbackEXT(VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer, uint32_t counterBufferCount, const VkBuffer* pCounterBuffers, const VkDeviceSize* pCounterBufferOffsets) { };
static VKAPI_ATTR void VKAPI_CALL StubCmdBeginQueryIndexedEXT(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags, uint32_t index) { };
static VKAPI_ATTR void VKAPI_CALL StubCmdEndQueryIndexedEXT(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, uint32_t index) { };
static VKAPI_ATTR void VKAPI_CALL StubCmdDrawIndirectByteCountEXT(VkCommandBuffer commandBuffer, uint32_t instanceCount, uint32_t firstInstance, VkBuffer counterBuffer, VkDeviceSize counterBufferOffset, uint32_t counterOffset, uint32_t vertexStride) { };
static VKAPI_ATTR void VKAPI_CALL StubGetImageViewHandleNVX(VkDevice device, const VkImageViewHandleInfoNVX* pInfo) { };
static VKAPI_ATTR void VKAPI_CALL StubCmdDrawIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) { };
static VKAPI_ATTR void VKAPI_CALL StubCmdDrawIndexedIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) { };
static VKAPI_ATTR VkResult VKAPI_CALL StubGetShaderInfoAMD(VkDevice device, VkPipeline pipeline, VkShaderStageFlagBits shaderStage, VkShaderInfoTypeAMD infoType, size_t* pInfoSize, void* pInfo) { return VK_SUCCESS; };
#ifdef VK_USE_PLATFORM_WIN32_KHR
static VKAPI_ATTR VkResult VKAPI_CALL StubGetMemoryWin32HandleNV(VkDevice device, VkDeviceMemory memory, VkExternalMemoryHandleTypeFlagsNV handleType, HANDLE* pHandle) { return VK_SUCCESS; };
#endif // VK_USE_PLATFORM_WIN32_KHR
static VKAPI_ATTR void VKAPI_CALL StubCmdBeginConditionalRenderingEXT(VkCommandBuffer commandBuffer, const VkConditionalRenderingBeginInfoEXT* pConditionalRenderingBegin) { };
static VKAPI_ATTR void VKAPI_CALL StubCmdEndConditionalRenderingEXT(VkCommandBuffer commandBuffer) { };
static VKAPI_ATTR void VKAPI_CALL StubCmdProcessCommandsNVX(VkCommandBuffer commandBuffer, const VkCmdProcessCommandsInfoNVX* pProcessCommandsInfo) { };
static VKAPI_ATTR void VKAPI_CALL StubCmdReserveSpaceForCommandsNVX(VkCommandBuffer commandBuffer, const VkCmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo) { };
static VKAPI_ATTR VkResult VKAPI_CALL StubCreateIndirectCommandsLayoutNVX(VkDevice device, const VkIndirectCommandsLayoutCreateInfoNVX* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkIndirectCommandsLayoutNVX* pIndirectCommandsLayout) { return VK_SUCCESS; };
static VKAPI_ATTR void VKAPI_CALL StubDestroyIndirectCommandsLayoutNVX(VkDevice device, VkIndirectCommandsLayoutNVX indirectCommandsLayout, const VkAllocationCallbacks* pAllocator) { };
static VKAPI_ATTR VkResult VKAPI_CALL StubCreateObjectTableNVX(VkDevice device, const VkObjectTableCreateInfoNVX* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkObjectTableNVX* pObjectTable) { return VK_SUCCESS; };
static VKAPI_ATTR void VKAPI_CALL StubDestroyObjectTableNVX(VkDevice device, VkObjectTableNVX objectTable, const VkAllocationCallbacks* pAllocator) { };
static VKAPI_ATTR VkResult VKAPI_CALL StubRegisterObjectsNVX(VkDevice device, VkObjectTableNVX objectTable, uint32_t objectCount, const VkObjectTableEntryNVX* const* ppObjectTableEntries, const uint32_t* pObjectIndices) { return VK_SUCCESS; };
static VKAPI_ATTR VkResult VKAPI_CALL StubUnregisterObjectsNVX(VkDevice device, VkObjectTableNVX objectTable, uint32_t objectCount, const VkObjectEntryTypeNVX* pObjectEntryTypes, const uint32_t* pObjectIndices) { return VK_SUCCESS; };
static VKAPI_ATTR void VKAPI_CALL StubCmdSetViewportWScalingNV(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewportWScalingNV* pViewportWScalings) { };
static VKAPI_ATTR VkResult VKAPI_CALL StubDisplayPowerControlEXT(VkDevice device, VkDisplayKHR display, const VkDisplayPowerInfoEXT* pDisplayPowerInfo) { return VK_SUCCESS; };
static VKAPI_ATTR VkResult VKAPI_CALL StubRegisterDeviceEventEXT(VkDevice device, const VkDeviceEventInfoEXT* pDeviceEventInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence) { return VK_SUCCESS; };
static VKAPI_ATTR VkResult VKAPI_CALL StubRegisterDisplayEventEXT(VkDevice device, VkDisplayKHR display, const VkDisplayEventInfoEXT* pDisplayEventInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence) { return VK_SUCCESS; };
static VKAPI_ATTR VkResult VKAPI_CALL StubGetSwapchainCounterEXT(VkDevice device, VkSwapchainKHR swapchain, VkSurfaceCounterFlagBitsEXT counter, uint64_t* pCounterValue) { return VK_SUCCESS; };
static VKAPI_ATTR VkResult VKAPI_CALL StubGetRefreshCycleDurationGOOGLE(VkDevice device, VkSwapchainKHR swapchain, VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties) { return VK_SUCCESS; };
static VKAPI_ATTR VkResult VKAPI_CALL StubGetPastPresentationTimingGOOGLE(VkDevice device, VkSwapchainKHR swapchain, uint32_t* pPresentationTimingCount, VkPastPresentationTimingGOOGLE* pPresentationTimings) { return VK_SUCCESS; };
static VKAPI_ATTR void VKAPI_CALL StubCmdSetDiscardRectangleEXT(VkCommandBuffer commandBuffer, uint32_t firstDiscardRectangle, uint32_t discardRectangleCount, const VkRect2D* pDiscardRectangles) { };
static VKAPI_ATTR void VKAPI_CALL StubSetHdrMetadataEXT(VkDevice device, uint32_t swapchainCount, const VkSwapchainKHR* pSwapchains, const VkHdrMetadataEXT* pMetadata) { };
#ifdef VK_USE_PLATFORM_ANDROID_KHR
static VKAPI_ATTR VkResult VKAPI_CALL StubGetAndroidHardwareBufferPropertiesANDROID(VkDevice device, const struct AHardwareBuffer* buffer, VkAndroidHardwareBufferPropertiesANDROID* pProperties) { return VK_SUCCESS; };
#endif // VK_USE_PLATFORM_ANDROID_KHR
#ifdef VK_USE_PLATFORM_ANDROID_KHR
static VKAPI_ATTR VkResult VKAPI_CALL StubGetMemoryAndroidHardwareBufferANDROID(VkDevice device, const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, struct AHardwareBuffer** pBuffer) { return VK_SUCCESS; };
#endif // VK_USE_PLATFORM_ANDROID_KHR
static VKAPI_ATTR void VKAPI_CALL StubCmdSetSampleLocationsEXT(VkCommandBuffer commandBuffer, const VkSampleLocationsInfoEXT* pSampleLocationsInfo) { };
static VKAPI_ATTR VkResult VKAPI_CALL StubGetImageDrmFormatModifierPropertiesEXT(VkDevice device, VkImage image, VkImageDrmFormatModifierPropertiesEXT* pProperties) { return VK_SUCCESS; };
static VKAPI_ATTR VkResult VKAPI_CALL StubCreateValidationCacheEXT(VkDevice device, const VkValidationCacheCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkValidationCacheEXT* pValidationCache) { return VK_SUCCESS; };
static VKAPI_ATTR void VKAPI_CALL StubDestroyValidationCacheEXT(VkDevice device, VkValidationCacheEXT validationCache, const VkAllocationCallbacks* pAllocator) { };
static VKAPI_ATTR VkResult VKAPI_CALL StubMergeValidationCachesEXT(VkDevice device, VkValidationCacheEXT dstCache, uint32_t srcCacheCount, const VkValidationCacheEXT* pSrcCaches) { return VK_SUCCESS; };
static VKAPI_ATTR VkResult VKAPI_CALL StubGetValidationCacheDataEXT(VkDevice device, VkValidationCacheEXT validationCache, size_t* pDataSize, void* pData) { return VK_SUCCESS; };
static VKAPI_ATTR void VKAPI_CALL StubCmdBindShadingRateImageNV(VkCommandBuffer commandBuffer, VkImageView imageView, VkImageLayout imageLayout) { };
static VKAPI_ATTR void VKAPI_CALL StubCmdSetViewportShadingRatePaletteNV(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkShadingRatePaletteNV* pShadingRatePalettes) { };
static VKAPI_ATTR void VKAPI_CALL StubCmdSetCoarseSampleOrderNV(VkCommandBuffer commandBuffer, VkCoarseSampleOrderTypeNV sampleOrderType, uint32_t customSampleOrderCount, const VkCoarseSampleOrderCustomNV* pCustomSampleOrders) { };
static VKAPI_ATTR VkResult VKAPI_CALL StubCreateAccelerationStructureNV(VkDevice device, const VkAccelerationStructureCreateInfoNV* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkAccelerationStructureNV* pAccelerationStructure) { return VK_SUCCESS; };
static VKAPI_ATTR void VKAPI_CALL StubDestroyAccelerationStructureNV(VkDevice device, VkAccelerationStructureNV accelerationStructure, const VkAllocationCallbacks* pAllocator) { };
static VKAPI_ATTR void VKAPI_CALL StubGetAccelerationStructureMemoryRequirementsNV(VkDevice device, const VkAccelerationStructureMemoryRequirementsInfoNV* pInfo, VkMemoryRequirements2KHR* pMemoryRequirements) { };
static VKAPI_ATTR VkResult VKAPI_CALL StubBindAccelerationStructureMemoryNV(VkDevice device, uint32_t bindInfoCount, const VkBindAccelerationStructureMemoryInfoNV* pBindInfos) { return VK_SUCCESS; };
static VKAPI_ATTR void VKAPI_CALL StubCmdBuildAccelerationStructureNV(VkCommandBuffer commandBuffer, const VkAccelerationStructureInfoNV* pInfo, VkBuffer instanceData, VkDeviceSize instanceOffset, VkBool32 update, VkAccelerationStructureNV dst, VkAccelerationStructureNV src, VkBuffer scratch, VkDeviceSize scratchOffset) { };
static VKAPI_ATTR void VKAPI_CALL StubCmdCopyAccelerationStructureNV(VkCommandBuffer commandBuffer, VkAccelerationStructureNV dst, VkAccelerationStructureNV src, VkCopyAccelerationStructureModeNV mode) { };
static VKAPI_ATTR void VKAPI_CALL StubCmdTraceRaysNV(VkCommandBuffer commandBuffer, VkBuffer raygenShaderBindingTableBuffer, VkDeviceSize raygenShaderBindingOffset, VkBuffer missShaderBindingTableBuffer, VkDeviceSize missShaderBindingOffset, VkDeviceSize missShaderBindingStride, VkBuffer hitShaderBindingTableBuffer, VkDeviceSize hitShaderBindingOffset, VkDeviceSize hitShaderBindingStride, VkBuffer callableShaderBindingTableBuffer, VkDeviceSize callableShaderBindingOffset, VkDeviceSize callableShaderBindingStride, uint32_t width, uint32_t height, uint32_t depth) { };
static VKAPI_ATTR VkResult VKAPI_CALL StubCreateRayTracingPipelinesNV(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkRayTracingPipelineCreateInfoNV* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines) { return VK_SUCCESS; };
static VKAPI_ATTR VkResult VKAPI_CALL StubGetRayTracingShaderGroupHandlesNV(VkDevice device, VkPipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, void* pData) { return VK_SUCCESS; };
static VKAPI_ATTR VkResult VKAPI_CALL StubGetAccelerationStructureHandleNV(VkDevice device, VkAccelerationStructureNV accelerationStructure, size_t dataSize, void* pData) { return VK_SUCCESS; };
static VKAPI_ATTR void VKAPI_CALL StubCmdWriteAccelerationStructuresPropertiesNV(VkCommandBuffer commandBuffer, uint32_t accelerationStructureCount, const VkAccelerationStructureNV* pAccelerationStructures, VkQueryType queryType, VkQueryPool queryPool, uint32_t firstQuery) { };
static VKAPI_ATTR VkResult VKAPI_CALL StubCompileDeferredNV(VkDevice device, VkPipeline pipeline, uint32_t shader) { return VK_SUCCESS; };
static VKAPI_ATTR VkResult VKAPI_CALL StubGetMemoryHostPointerPropertiesEXT(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, const void* pHostPointer, VkMemoryHostPointerPropertiesEXT* pMemoryHostPointerProperties) { return VK_SUCCESS; };
static VKAPI_ATTR void VKAPI_CALL StubCmdWriteBufferMarkerAMD(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkBuffer dstBuffer, VkDeviceSize dstOffset, uint32_t marker) { };
static VKAPI_ATTR VkResult VKAPI_CALL StubGetCalibratedTimestampsEXT(VkDevice device, uint32_t timestampCount, const VkCalibratedTimestampInfoEXT* pTimestampInfos, uint64_t* pTimestamps, uint64_t* pMaxDeviation) { return VK_SUCCESS; };
static VKAPI_ATTR void VKAPI_CALL StubCmdDrawMeshTasksNV(VkCommandBuffer commandBuffer, uint32_t taskCount, uint32_t firstTask) { };
static VKAPI_ATTR void VKAPI_CALL StubCmdDrawMeshTasksIndirectNV(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride) { };
static VKAPI_ATTR void VKAPI_CALL StubCmdDrawMeshTasksIndirectCountNV(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) { };
static VKAPI_ATTR void VKAPI_CALL StubCmdSetExclusiveScissorNV(VkCommandBuffer commandBuffer, uint32_t firstExclusiveScissor, uint32_t exclusiveScissorCount, const VkRect2D* pExclusiveScissors) { };
static VKAPI_ATTR void VKAPI_CALL StubCmdSetCheckpointNV(VkCommandBuffer commandBuffer, const void* pCheckpointMarker) { };
static VKAPI_ATTR void VKAPI_CALL StubGetQueueCheckpointDataNV(VkQueue queue, uint32_t* pCheckpointDataCount, VkCheckpointDataNV* pCheckpointData) { };
static VKAPI_ATTR VkResult VKAPI_CALL StubInitializePerformanceApiINTEL(VkDevice device, const VkInitializePerformanceApiInfoINTEL* pInitializeInfo) { return VK_SUCCESS; };
static VKAPI_ATTR void VKAPI_CALL StubUninitializePerformanceApiINTEL(VkDevice device) { };
static VKAPI_ATTR VkResult VKAPI_CALL StubCmdSetPerformanceMarkerINTEL(VkCommandBuffer commandBuffer, const VkPerformanceMarkerInfoINTEL* pMarkerInfo) { return VK_SUCCESS; };
static VKAPI_ATTR VkResult VKAPI_CALL StubCmdSetPerformanceStreamMarkerINTEL(VkCommandBuffer commandBuffer, const VkPerformanceStreamMarkerInfoINTEL* pMarkerInfo) { return VK_SUCCESS; };
static VKAPI_ATTR VkResult VKAPI_CALL StubCmdSetPerformanceOverrideINTEL(VkCommandBuffer commandBuffer, const VkPerformanceOverrideInfoINTEL* pOverrideInfo) { return VK_SUCCESS; };
static VKAPI_ATTR VkResult VKAPI_CALL StubAcquirePerformanceConfigurationINTEL(VkDevice device, const VkPerformanceConfigurationAcquireInfoINTEL* pAcquireInfo, VkPerformanceConfigurationINTEL* pConfiguration) { return VK_SUCCESS; };
static VKAPI_ATTR VkResult VKAPI_CALL StubReleasePerformanceConfigurationINTEL(VkDevice device, VkPerformanceConfigurationINTEL configuration) { return VK_SUCCESS; };
static VKAPI_ATTR VkResult VKAPI_CALL StubQueueSetPerformanceConfigurationINTEL(VkQueue queue, VkPerformanceConfigurationINTEL configuration) { return VK_SUCCESS; };
static VKAPI_ATTR VkResult VKAPI_CALL StubGetPerformanceParameterINTEL(VkDevice device, VkPerformanceParameterTypeINTEL parameter, VkPerformanceValueINTEL* pValue) { return VK_SUCCESS; };
static VKAPI_ATTR void VKAPI_CALL StubSetLocalDimmingAMD(VkDevice device, VkSwapchainKHR swapChain, VkBool32 localDimmingEnable) { };
static VKAPI_ATTR void VKAPI_CALL StubGetBufferDeviceAddressEXT(VkDevice device, const VkBufferDeviceAddressInfoEXT* pInfo) { };
#ifdef VK_USE_PLATFORM_WIN32_KHR
static VKAPI_ATTR VkResult VKAPI_CALL StubAcquireFullScreenExclusiveModeEXT(VkDevice device, VkSwapchainKHR swapchain) { return VK_SUCCESS; };
#endif // VK_USE_PLATFORM_WIN32_KHR
#ifdef VK_USE_PLATFORM_WIN32_KHR
static VKAPI_ATTR VkResult VKAPI_CALL StubReleaseFullScreenExclusiveModeEXT(VkDevice device, VkSwapchainKHR swapchain) { return VK_SUCCESS; };
#endif // VK_USE_PLATFORM_WIN32_KHR
#ifdef VK_USE_PLATFORM_WIN32_KHR
static VKAPI_ATTR VkResult VKAPI_CALL StubGetDeviceGroupSurfacePresentModes2EXT(VkDevice device, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, VkDeviceGroupPresentModeFlagsKHR* pModes) { return VK_SUCCESS; };
#endif // VK_USE_PLATFORM_WIN32_KHR
static VKAPI_ATTR void VKAPI_CALL StubResetQueryPoolEXT(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount) { };
static inline void layer_init_device_dispatch_table(VkDevice device, VkLayerDispatchTable *table, PFN_vkGetDeviceProcAddr gpa) {
memset(table, 0, sizeof(*table));
// Device function pointers
table->GetDeviceProcAddr = gpa;
table->DestroyDevice = (PFN_vkDestroyDevice) gpa(device, "vkDestroyDevice");
table->GetDeviceQueue = (PFN_vkGetDeviceQueue) gpa(device, "vkGetDeviceQueue");
table->QueueSubmit = (PFN_vkQueueSubmit) gpa(device, "vkQueueSubmit");
table->QueueWaitIdle = (PFN_vkQueueWaitIdle) gpa(device, "vkQueueWaitIdle");
table->DeviceWaitIdle = (PFN_vkDeviceWaitIdle) gpa(device, "vkDeviceWaitIdle");
table->AllocateMemory = (PFN_vkAllocateMemory) gpa(device, "vkAllocateMemory");
table->FreeMemory = (PFN_vkFreeMemory) gpa(device, "vkFreeMemory");
table->MapMemory = (PFN_vkMapMemory) gpa(device, "vkMapMemory");
table->UnmapMemory = (PFN_vkUnmapMemory) gpa(device, "vkUnmapMemory");
table->FlushMappedMemoryRanges = (PFN_vkFlushMappedMemoryRanges) gpa(device, "vkFlushMappedMemoryRanges");
table->InvalidateMappedMemoryRanges = (PFN_vkInvalidateMappedMemoryRanges) gpa(device, "vkInvalidateMappedMemoryRanges");
table->GetDeviceMemoryCommitment = (PFN_vkGetDeviceMemoryCommitment) gpa(device, "vkGetDeviceMemoryCommitment");
table->BindBufferMemory = (PFN_vkBindBufferMemory) gpa(device, "vkBindBufferMemory");
table->BindImageMemory = (PFN_vkBindImageMemory) gpa(device, "vkBindImageMemory");
table->GetBufferMemoryRequirements = (PFN_vkGetBufferMemoryRequirements) gpa(device, "vkGetBufferMemoryRequirements");
table->GetImageMemoryRequirements = (PFN_vkGetImageMemoryRequirements) gpa(device, "vkGetImageMemoryRequirements");
table->GetImageSparseMemoryRequirements = (PFN_vkGetImageSparseMemoryRequirements) gpa(device, "vkGetImageSparseMemoryRequirements");
table->QueueBindSparse = (PFN_vkQueueBindSparse) gpa(device, "vkQueueBindSparse");
table->CreateFence = (PFN_vkCreateFence) gpa(device, "vkCreateFence");
table->DestroyFence = (PFN_vkDestroyFence) gpa(device, "vkDestroyFence");
table->ResetFences = (PFN_vkResetFences) gpa(device, "vkResetFences");
table->GetFenceStatus = (PFN_vkGetFenceStatus) gpa(device, "vkGetFenceStatus");
table->WaitForFences = (PFN_vkWaitForFences) gpa(device, "vkWaitForFences");
table->CreateSemaphore = (PFN_vkCreateSemaphore) gpa(device, "vkCreateSemaphore");
table->DestroySemaphore = (PFN_vkDestroySemaphore) gpa(device, "vkDestroySemaphore");
table->CreateEvent = (PFN_vkCreateEvent) gpa(device, "vkCreateEvent");
table->DestroyEvent = (PFN_vkDestroyEvent) gpa(device, "vkDestroyEvent");
table->GetEventStatus = (PFN_vkGetEventStatus) gpa(device, "vkGetEventStatus");
table->SetEvent = (PFN_vkSetEvent) gpa(device, "vkSetEvent");
table->ResetEvent = (PFN_vkResetEvent) gpa(device, "vkResetEvent");
table->CreateQueryPool = (PFN_vkCreateQueryPool) gpa(device, "vkCreateQueryPool");
table->DestroyQueryPool = (PFN_vkDestroyQueryPool) gpa(device, "vkDestroyQueryPool");
table->GetQueryPoolResults = (PFN_vkGetQueryPoolResults) gpa(device, "vkGetQueryPoolResults");
table->CreateBuffer = (PFN_vkCreateBuffer) gpa(device, "vkCreateBuffer");
table->DestroyBuffer = (PFN_vkDestroyBuffer) gpa(device, "vkDestroyBuffer");
table->CreateBufferView = (PFN_vkCreateBufferView) gpa(device, "vkCreateBufferView");
table->DestroyBufferView = (PFN_vkDestroyBufferView) gpa(device, "vkDestroyBufferView");
table->CreateImage = (PFN_vkCreateImage) gpa(device, "vkCreateImage");
table->DestroyImage = (PFN_vkDestroyImage) gpa(device, "vkDestroyImage");
table->GetImageSubresourceLayout = (PFN_vkGetImageSubresourceLayout) gpa(device, "vkGetImageSubresourceLayout");
table->CreateImageView = (PFN_vkCreateImageView) gpa(device, "vkCreateImageView");
table->DestroyImageView = (PFN_vkDestroyImageView) gpa(device, "vkDestroyImageView");
table->CreateShaderModule = (PFN_vkCreateShaderModule) gpa(device, "vkCreateShaderModule");
table->DestroyShaderModule = (PFN_vkDestroyShaderModule) gpa(device, "vkDestroyShaderModule");
table->CreatePipelineCache = (PFN_vkCreatePipelineCache) gpa(device, "vkCreatePipelineCache");
table->DestroyPipelineCache = (PFN_vkDestroyPipelineCache) gpa(device, "vkDestroyPipelineCache");
table->GetPipelineCacheData = (PFN_vkGetPipelineCacheData) gpa(device, "vkGetPipelineCacheData");
table->MergePipelineCaches = (PFN_vkMergePipelineCaches) gpa(device, "vkMergePipelineCaches");
table->CreateGraphicsPipelines = (PFN_vkCreateGraphicsPipelines) gpa(device, "vkCreateGraphicsPipelines");
table->CreateComputePipelines = (PFN_vkCreateComputePipelines) gpa(device, "vkCreateComputePipelines");
table->DestroyPipeline = (PFN_vkDestroyPipeline) gpa(device, "vkDestroyPipeline");
table->CreatePipelineLayout = (PFN_vkCreatePipelineLayout) gpa(device, "vkCreatePipelineLayout");
table->DestroyPipelineLayout = (PFN_vkDestroyPipelineLayout) gpa(device, "vkDestroyPipelineLayout");
table->CreateSampler = (PFN_vkCreateSampler) gpa(device, "vkCreateSampler");
table->DestroySampler = (PFN_vkDestroySampler) gpa(device, "vkDestroySampler");
table->CreateDescriptorSetLayout = (PFN_vkCreateDescriptorSetLayout) gpa(device, "vkCreateDescriptorSetLayout");
table->DestroyDescriptorSetLayout = (PFN_vkDestroyDescriptorSetLayout) gpa(device, "vkDestroyDescriptorSetLayout");
table->CreateDescriptorPool = (PFN_vkCreateDescriptorPool) gpa(device, "vkCreateDescriptorPool");
table->DestroyDescriptorPool = (PFN_vkDestroyDescriptorPool) gpa(device, "vkDestroyDescriptorPool");
table->ResetDescriptorPool = (PFN_vkResetDescriptorPool) gpa(device, "vkResetDescriptorPool");
table->AllocateDescriptorSets = (PFN_vkAllocateDescriptorSets) gpa(device, "vkAllocateDescriptorSets");
table->FreeDescriptorSets = (PFN_vkFreeDescriptorSets) gpa(device, "vkFreeDescriptorSets");
table->UpdateDescriptorSets = (PFN_vkUpdateDescriptorSets) gpa(device, "vkUpdateDescriptorSets");
table->CreateFramebuffer = (PFN_vkCreateFramebuffer) gpa(device, "vkCreateFramebuffer");
table->DestroyFramebuffer = (PFN_vkDestroyFramebuffer) gpa(device, "vkDestroyFramebuffer");
table->CreateRenderPass = (PFN_vkCreateRenderPass) gpa(device, "vkCreateRenderPass");
table->DestroyRenderPass = (PFN_vkDestroyRenderPass) gpa(device, "vkDestroyRenderPass");
table->GetRenderAreaGranularity = (PFN_vkGetRenderAreaGranularity) gpa(device, "vkGetRenderAreaGranularity");
table->CreateCommandPool = (PFN_vkCreateCommandPool) gpa(device, "vkCreateCommandPool");
table->DestroyCommandPool = (PFN_vkDestroyCommandPool) gpa(device, "vkDestroyCommandPool");
table->ResetCommandPool = (PFN_vkResetCommandPool) gpa(device, "vkResetCommandPool");
table->AllocateCommandBuffers = (PFN_vkAllocateCommandBuffers) gpa(device, "vkAllocateCommandBuffers");
table->FreeCommandBuffers = (PFN_vkFreeCommandBuffers) gpa(device, "vkFreeCommandBuffers");
table->BeginCommandBuffer = (PFN_vkBeginCommandBuffer) gpa(device, "vkBeginCommandBuffer");
table->EndCommandBuffer = (PFN_vkEndCommandBuffer) gpa(device, "vkEndCommandBuffer");
table->ResetCommandBuffer = (PFN_vkResetCommandBuffer) gpa(device, "vkResetCommandBuffer");
table->CmdBindPipeline = (PFN_vkCmdBindPipeline) gpa(device, "vkCmdBindPipeline");
table->CmdSetViewport = (PFN_vkCmdSetViewport) gpa(device, "vkCmdSetViewport");
table->CmdSetScissor = (PFN_vkCmdSetScissor) gpa(device, "vkCmdSetScissor");
table->CmdSetLineWidth = (PFN_vkCmdSetLineWidth) gpa(device, "vkCmdSetLineWidth");
table->CmdSetDepthBias = (PFN_vkCmdSetDepthBias) gpa(device, "vkCmdSetDepthBias");
table->CmdSetBlendConstants = (PFN_vkCmdSetBlendConstants) gpa(device, "vkCmdSetBlendConstants");
table->CmdSetDepthBounds = (PFN_vkCmdSetDepthBounds) gpa(device, "vkCmdSetDepthBounds");
table->CmdSetStencilCompareMask = (PFN_vkCmdSetStencilCompareMask) gpa(device, "vkCmdSetStencilCompareMask");
table->CmdSetStencilWriteMask = (PFN_vkCmdSetStencilWriteMask) gpa(device, "vkCmdSetStencilWriteMask");
table->CmdSetStencilReference = (PFN_vkCmdSetStencilReference) gpa(device, "vkCmdSetStencilReference");
table->CmdBindDescriptorSets = (PFN_vkCmdBindDescriptorSets) gpa(device, "vkCmdBindDescriptorSets");
table->CmdBindIndexBuffer = (PFN_vkCmdBindIndexBuffer) gpa(device, "vkCmdBindIndexBuffer");
table->CmdBindVertexBuffers = (PFN_vkCmdBindVertexBuffers) gpa(device, "vkCmdBindVertexBuffers");
table->CmdDraw = (PFN_vkCmdDraw) gpa(device, "vkCmdDraw");
table->CmdDrawIndexed = (PFN_vkCmdDrawIndexed) gpa(device, "vkCmdDrawIndexed");
table->CmdDrawIndirect = (PFN_vkCmdDrawIndirect) gpa(device, "vkCmdDrawIndirect");
table->CmdDrawIndexedIndirect = (PFN_vkCmdDrawIndexedIndirect) gpa(device, "vkCmdDrawIndexedIndirect");
table->CmdDispatch = (PFN_vkCmdDispatch) gpa(device, "vkCmdDispatch");
table->CmdDispatchIndirect = (PFN_vkCmdDispatchIndirect) gpa(device, "vkCmdDispatchIndirect");
table->CmdCopyBuffer = (PFN_vkCmdCopyBuffer) gpa(device, "vkCmdCopyBuffer");
table->CmdCopyImage = (PFN_vkCmdCopyImage) gpa(device, "vkCmdCopyImage");
table->CmdBlitImage = (PFN_vkCmdBlitImage) gpa(device, "vkCmdBlitImage");
table->CmdCopyBufferToImage = (PFN_vkCmdCopyBufferToImage) gpa(device, "vkCmdCopyBufferToImage");
table->CmdCopyImageToBuffer = (PFN_vkCmdCopyImageToBuffer) gpa(device, "vkCmdCopyImageToBuffer");
table->CmdUpdateBuffer = (PFN_vkCmdUpdateBuffer) gpa(device, "vkCmdUpdateBuffer");
table->CmdFillBuffer = (PFN_vkCmdFillBuffer) gpa(device, "vkCmdFillBuffer");
table->CmdClearColorImage = (PFN_vkCmdClearColorImage) gpa(device, "vkCmdClearColorImage");
table->CmdClearDepthStencilImage = (PFN_vkCmdClearDepthStencilImage) gpa(device, "vkCmdClearDepthStencilImage");
table->CmdClearAttachments = (PFN_vkCmdClearAttachments) gpa(device, "vkCmdClearAttachments");
table->CmdResolveImage = (PFN_vkCmdResolveImage) gpa(device, "vkCmdResolveImage");
table->CmdSetEvent = (PFN_vkCmdSetEvent) gpa(device, "vkCmdSetEvent");
table->CmdResetEvent = (PFN_vkCmdResetEvent) gpa(device, "vkCmdResetEvent");
table->CmdWaitEvents = (PFN_vkCmdWaitEvents) gpa(device, "vkCmdWaitEvents");
table->CmdPipelineBarrier = (PFN_vkCmdPipelineBarrier) gpa(device, "vkCmdPipelineBarrier");
table->CmdBeginQuery = (PFN_vkCmdBeginQuery) gpa(device, "vkCmdBeginQuery");
table->CmdEndQuery = (PFN_vkCmdEndQuery) gpa(device, "vkCmdEndQuery");
table->CmdResetQueryPool = (PFN_vkCmdResetQueryPool) gpa(device, "vkCmdResetQueryPool");
table->CmdWriteTimestamp = (PFN_vkCmdWriteTimestamp) gpa(device, "vkCmdWriteTimestamp");
table->CmdCopyQueryPoolResults = (PFN_vkCmdCopyQueryPoolResults) gpa(device, "vkCmdCopyQueryPoolResults");
table->CmdPushConstants = (PFN_vkCmdPushConstants) gpa(device, "vkCmdPushConstants");
table->CmdBeginRenderPass = (PFN_vkCmdBeginRenderPass) gpa(device, "vkCmdBeginRenderPass");
table->CmdNextSubpass = (PFN_vkCmdNextSubpass) gpa(device, "vkCmdNextSubpass");
table->CmdEndRenderPass = (PFN_vkCmdEndRenderPass) gpa(device, "vkCmdEndRenderPass");
table->CmdExecuteCommands = (PFN_vkCmdExecuteCommands) gpa(device, "vkCmdExecuteCommands");
table->BindBufferMemory2 = (PFN_vkBindBufferMemory2) gpa(device, "vkBindBufferMemory2");
table->BindImageMemory2 = (PFN_vkBindImageMemory2) gpa(device, "vkBindImageMemory2");
table->GetDeviceGroupPeerMemoryFeatures = (PFN_vkGetDeviceGroupPeerMemoryFeatures) gpa(device, "vkGetDeviceGroupPeerMemoryFeatures");
table->CmdSetDeviceMask = (PFN_vkCmdSetDeviceMask) gpa(device, "vkCmdSetDeviceMask");
table->CmdDispatchBase = (PFN_vkCmdDispatchBase) gpa(device, "vkCmdDispatchBase");
table->GetImageMemoryRequirements2 = (PFN_vkGetImageMemoryRequirements2) gpa(device, "vkGetImageMemoryRequirements2");
table->GetBufferMemoryRequirements2 = (PFN_vkGetBufferMemoryRequirements2) gpa(device, "vkGetBufferMemoryRequirements2");
table->GetImageSparseMemoryRequirements2 = (PFN_vkGetImageSparseMemoryRequirements2) gpa(device, "vkGetImageSparseMemoryRequirements2");
table->TrimCommandPool = (PFN_vkTrimCommandPool) gpa(device, "vkTrimCommandPool");
table->GetDeviceQueue2 = (PFN_vkGetDeviceQueue2) gpa(device, "vkGetDeviceQueue2");
table->CreateSamplerYcbcrConversion = (PFN_vkCreateSamplerYcbcrConversion) gpa(device, "vkCreateSamplerYcbcrConversion");
table->DestroySamplerYcbcrConversion = (PFN_vkDestroySamplerYcbcrConversion) gpa(device, "vkDestroySamplerYcbcrConversion");
table->CreateDescriptorUpdateTemplate = (PFN_vkCreateDescriptorUpdateTemplate) gpa(device, "vkCreateDescriptorUpdateTemplate");
table->DestroyDescriptorUpdateTemplate = (PFN_vkDestroyDescriptorUpdateTemplate) gpa(device, "vkDestroyDescriptorUpdateTemplate");
table->UpdateDescriptorSetWithTemplate = (PFN_vkUpdateDescriptorSetWithTemplate) gpa(device, "vkUpdateDescriptorSetWithTemplate");
table->GetDescriptorSetLayoutSupport = (PFN_vkGetDescriptorSetLayoutSupport) gpa(device, "vkGetDescriptorSetLayoutSupport");
table->CreateSwapchainKHR = (PFN_vkCreateSwapchainKHR) gpa(device, "vkCreateSwapchainKHR");
if (table->CreateSwapchainKHR == nullptr) { table->CreateSwapchainKHR = (PFN_vkCreateSwapchainKHR)StubCreateSwapchainKHR; }
table->DestroySwapchainKHR = (PFN_vkDestroySwapchainKHR) gpa(device, "vkDestroySwapchainKHR");
if (table->DestroySwapchainKHR == nullptr) { table->DestroySwapchainKHR = (PFN_vkDestroySwapchainKHR)StubDestroySwapchainKHR; }
table->GetSwapchainImagesKHR = (PFN_vkGetSwapchainImagesKHR) gpa(device, "vkGetSwapchainImagesKHR");
if (table->GetSwapchainImagesKHR == nullptr) { table->GetSwapchainImagesKHR = (PFN_vkGetSwapchainImagesKHR)StubGetSwapchainImagesKHR; }
table->AcquireNextImageKHR = (PFN_vkAcquireNextImageKHR) gpa(device, "vkAcquireNextImageKHR");
if (table->AcquireNextImageKHR == nullptr) { table->AcquireNextImageKHR = (PFN_vkAcquireNextImageKHR)StubAcquireNextImageKHR; }
table->QueuePresentKHR = (PFN_vkQueuePresentKHR) gpa(device, "vkQueuePresentKHR");
if (table->QueuePresentKHR == nullptr) { table->QueuePresentKHR = (PFN_vkQueuePresentKHR)StubQueuePresentKHR; }
table->GetDeviceGroupPresentCapabilitiesKHR = (PFN_vkGetDeviceGroupPresentCapabilitiesKHR) gpa(device, "vkGetDeviceGroupPresentCapabilitiesKHR");
if (table->GetDeviceGroupPresentCapabilitiesKHR == nullptr) { table->GetDeviceGroupPresentCapabilitiesKHR = (PFN_vkGetDeviceGroupPresentCapabilitiesKHR)StubGetDeviceGroupPresentCapabilitiesKHR; }
table->GetDeviceGroupSurfacePresentModesKHR = (PFN_vkGetDeviceGroupSurfacePresentModesKHR) gpa(device, "vkGetDeviceGroupSurfacePresentModesKHR");
if (table->GetDeviceGroupSurfacePresentModesKHR == nullptr) { table->GetDeviceGroupSurfacePresentModesKHR = (PFN_vkGetDeviceGroupSurfacePresentModesKHR)StubGetDeviceGroupSurfacePresentModesKHR; }
table->AcquireNextImage2KHR = (PFN_vkAcquireNextImage2KHR) gpa(device, "vkAcquireNextImage2KHR");
if (table->AcquireNextImage2KHR == nullptr) { table->AcquireNextImage2KHR = (PFN_vkAcquireNextImage2KHR)StubAcquireNextImage2KHR; }
table->CreateSharedSwapchainsKHR = (PFN_vkCreateSharedSwapchainsKHR) gpa(device, "vkCreateSharedSwapchainsKHR");
if (table->CreateSharedSwapchainsKHR == nullptr) { table->CreateSharedSwapchainsKHR = (PFN_vkCreateSharedSwapchainsKHR)StubCreateSharedSwapchainsKHR; }
table->GetDeviceGroupPeerMemoryFeaturesKHR = (PFN_vkGetDeviceGroupPeerMemoryFeaturesKHR) gpa(device, "vkGetDeviceGroupPeerMemoryFeaturesKHR");
if (table->GetDeviceGroupPeerMemoryFeaturesKHR == nullptr) { table->GetDeviceGroupPeerMemoryFeaturesKHR = (PFN_vkGetDeviceGroupPeerMemoryFeaturesKHR)StubGetDeviceGroupPeerMemoryFeaturesKHR; }
table->CmdSetDeviceMaskKHR = (PFN_vkCmdSetDeviceMaskKHR) gpa(device, "vkCmdSetDeviceMaskKHR");
if (table->CmdSetDeviceMaskKHR == nullptr) { table->CmdSetDeviceMaskKHR = (PFN_vkCmdSetDeviceMaskKHR)StubCmdSetDeviceMaskKHR; }
table->CmdDispatchBaseKHR = (PFN_vkCmdDispatchBaseKHR) gpa(device, "vkCmdDispatchBaseKHR");
if (table->CmdDispatchBaseKHR == nullptr) { table->CmdDispatchBaseKHR = (PFN_vkCmdDispatchBaseKHR)StubCmdDispatchBaseKHR; }
table->TrimCommandPoolKHR = (PFN_vkTrimCommandPoolKHR) gpa(device, "vkTrimCommandPoolKHR");
if (table->TrimCommandPoolKHR == nullptr) { table->TrimCommandPoolKHR = (PFN_vkTrimCommandPoolKHR)StubTrimCommandPoolKHR; }
#ifdef VK_USE_PLATFORM_WIN32_KHR
table->GetMemoryWin32HandleKHR = (PFN_vkGetMemoryWin32HandleKHR) gpa(device, "vkGetMemoryWin32HandleKHR");
if (table->GetMemoryWin32HandleKHR == nullptr) { table->GetMemoryWin32HandleKHR = (PFN_vkGetMemoryWin32HandleKHR)StubGetMemoryWin32HandleKHR; }
#endif // VK_USE_PLATFORM_WIN32_KHR
#ifdef VK_USE_PLATFORM_WIN32_KHR
table->GetMemoryWin32HandlePropertiesKHR = (PFN_vkGetMemoryWin32HandlePropertiesKHR) gpa(device, "vkGetMemoryWin32HandlePropertiesKHR");
if (table->GetMemoryWin32HandlePropertiesKHR == nullptr) { table->GetMemoryWin32HandlePropertiesKHR = (PFN_vkGetMemoryWin32HandlePropertiesKHR)StubGetMemoryWin32HandlePropertiesKHR; }
#endif // VK_USE_PLATFORM_WIN32_KHR
table->GetMemoryFdKHR = (PFN_vkGetMemoryFdKHR) gpa(device, "vkGetMemoryFdKHR");
if (table->GetMemoryFdKHR == nullptr) { table->GetMemoryFdKHR = (PFN_vkGetMemoryFdKHR)StubGetMemoryFdKHR; }
table->GetMemoryFdPropertiesKHR = (PFN_vkGetMemoryFdPropertiesKHR) gpa(device, "vkGetMemoryFdPropertiesKHR");
if (table->GetMemoryFdPropertiesKHR == nullptr) { table->GetMemoryFdPropertiesKHR = (PFN_vkGetMemoryFdPropertiesKHR)StubGetMemoryFdPropertiesKHR; }
#ifdef VK_USE_PLATFORM_WIN32_KHR
table->ImportSemaphoreWin32HandleKHR = (PFN_vkImportSemaphoreWin32HandleKHR) gpa(device, "vkImportSemaphoreWin32HandleKHR");
if (table->ImportSemaphoreWin32HandleKHR == nullptr) { table->ImportSemaphoreWin32HandleKHR = (PFN_vkImportSemaphoreWin32HandleKHR)StubImportSemaphoreWin32HandleKHR; }
#endif // VK_USE_PLATFORM_WIN32_KHR
#ifdef VK_USE_PLATFORM_WIN32_KHR
table->GetSemaphoreWin32HandleKHR = (PFN_vkGetSemaphoreWin32HandleKHR) gpa(device, "vkGetSemaphoreWin32HandleKHR");
if (table->GetSemaphoreWin32HandleKHR == nullptr) { table->GetSemaphoreWin32HandleKHR = (PFN_vkGetSemaphoreWin32HandleKHR)StubGetSemaphoreWin32HandleKHR; }
#endif // VK_USE_PLATFORM_WIN32_KHR
table->ImportSemaphoreFdKHR = (PFN_vkImportSemaphoreFdKHR) gpa(device, "vkImportSemaphoreFdKHR");
if (table->ImportSemaphoreFdKHR == nullptr) { table->ImportSemaphoreFdKHR = (PFN_vkImportSemaphoreFdKHR)StubImportSemaphoreFdKHR; }
table->GetSemaphoreFdKHR = (PFN_vkGetSemaphoreFdKHR) gpa(device, "vkGetSemaphoreFdKHR");
if (table->GetSemaphoreFdKHR == nullptr) { table->GetSemaphoreFdKHR = (PFN_vkGetSemaphoreFdKHR)StubGetSemaphoreFdKHR; }
table->CmdPushDescriptorSetKHR = (PFN_vkCmdPushDescriptorSetKHR) gpa(device, "vkCmdPushDescriptorSetKHR");
if (table->CmdPushDescriptorSetKHR == nullptr) { table->CmdPushDescriptorSetKHR = (PFN_vkCmdPushDescriptorSetKHR)StubCmdPushDescriptorSetKHR; }
table->CmdPushDescriptorSetWithTemplateKHR = (PFN_vkCmdPushDescriptorSetWithTemplateKHR) gpa(device, "vkCmdPushDescriptorSetWithTemplateKHR");
if (table->CmdPushDescriptorSetWithTemplateKHR == nullptr) { table->CmdPushDescriptorSetWithTemplateKHR = (PFN_vkCmdPushDescriptorSetWithTemplateKHR)StubCmdPushDescriptorSetWithTemplateKHR; }
table->CreateDescriptorUpdateTemplateKHR = (PFN_vkCreateDescriptorUpdateTemplateKHR) gpa(device, "vkCreateDescriptorUpdateTemplateKHR");
if (table->CreateDescriptorUpdateTemplateKHR == nullptr) { table->CreateDescriptorUpdateTemplateKHR = (PFN_vkCreateDescriptorUpdateTemplateKHR)StubCreateDescriptorUpdateTemplateKHR; }
table->DestroyDescriptorUpdateTemplateKHR = (PFN_vkDestroyDescriptorUpdateTemplateKHR) gpa(device, "vkDestroyDescriptorUpdateTemplateKHR");
if (table->DestroyDescriptorUpdateTemplateKHR == nullptr) { table->DestroyDescriptorUpdateTemplateKHR = (PFN_vkDestroyDescriptorUpdateTemplateKHR)StubDestroyDescriptorUpdateTemplateKHR; }
table->UpdateDescriptorSetWithTemplateKHR = (PFN_vkUpdateDescriptorSetWithTemplateKHR) gpa(device, "vkUpdateDescriptorSetWithTemplateKHR");
if (table->UpdateDescriptorSetWithTemplateKHR == nullptr) { table->UpdateDescriptorSetWithTemplateKHR = (PFN_vkUpdateDescriptorSetWithTemplateKHR)StubUpdateDescriptorSetWithTemplateKHR; }
table->CreateRenderPass2KHR = (PFN_vkCreateRenderPass2KHR) gpa(device, "vkCreateRenderPass2KHR");
if (table->CreateRenderPass2KHR == nullptr) { table->CreateRenderPass2KHR = (PFN_vkCreateRenderPass2KHR)StubCreateRenderPass2KHR; }
table->CmdBeginRenderPass2KHR = (PFN_vkCmdBeginRenderPass2KHR) gpa(device, "vkCmdBeginRenderPass2KHR");
if (table->CmdBeginRenderPass2KHR == nullptr) { table->CmdBeginRenderPass2KHR = (PFN_vkCmdBeginRenderPass2KHR)StubCmdBeginRenderPass2KHR; }
table->CmdNextSubpass2KHR = (PFN_vkCmdNextSubpass2KHR) gpa(device, "vkCmdNextSubpass2KHR");
if (table->CmdNextSubpass2KHR == nullptr) { table->CmdNextSubpass2KHR = (PFN_vkCmdNextSubpass2KHR)StubCmdNextSubpass2KHR; }
table->CmdEndRenderPass2KHR = (PFN_vkCmdEndRenderPass2KHR) gpa(device, "vkCmdEndRenderPass2KHR");
if (table->CmdEndRenderPass2KHR == nullptr) { table->CmdEndRenderPass2KHR = (PFN_vkCmdEndRenderPass2KHR)StubCmdEndRenderPass2KHR; }
table->GetSwapchainStatusKHR = (PFN_vkGetSwapchainStatusKHR) gpa(device, "vkGetSwapchainStatusKHR");
if (table->GetSwapchainStatusKHR == nullptr) { table->GetSwapchainStatusKHR = (PFN_vkGetSwapchainStatusKHR)StubGetSwapchainStatusKHR; }
#ifdef VK_USE_PLATFORM_WIN32_KHR
table->ImportFenceWin32HandleKHR = (PFN_vkImportFenceWin32HandleKHR) gpa(device, "vkImportFenceWin32HandleKHR");
if (table->ImportFenceWin32HandleKHR == nullptr) { table->ImportFenceWin32HandleKHR = (PFN_vkImportFenceWin32HandleKHR)StubImportFenceWin32HandleKHR; }
#endif // VK_USE_PLATFORM_WIN32_KHR
#ifdef VK_USE_PLATFORM_WIN32_KHR
table->GetFenceWin32HandleKHR = (PFN_vkGetFenceWin32HandleKHR) gpa(device, "vkGetFenceWin32HandleKHR");
if (table->GetFenceWin32HandleKHR == nullptr) { table->GetFenceWin32HandleKHR = (PFN_vkGetFenceWin32HandleKHR)StubGetFenceWin32HandleKHR; }
#endif // VK_USE_PLATFORM_WIN32_KHR
table->ImportFenceFdKHR = (PFN_vkImportFenceFdKHR) gpa(device, "vkImportFenceFdKHR");
if (table->ImportFenceFdKHR == nullptr) { table->ImportFenceFdKHR = (PFN_vkImportFenceFdKHR)StubImportFenceFdKHR; }
table->GetFenceFdKHR = (PFN_vkGetFenceFdKHR) gpa(device, "vkGetFenceFdKHR");
if (table->GetFenceFdKHR == nullptr) { table->GetFenceFdKHR = (PFN_vkGetFenceFdKHR)StubGetFenceFdKHR; }
table->GetImageMemoryRequirements2KHR = (PFN_vkGetImageMemoryRequirements2KHR) gpa(device, "vkGetImageMemoryRequirements2KHR");
if (table->GetImageMemoryRequirements2KHR == nullptr) { table->GetImageMemoryRequirements2KHR = (PFN_vkGetImageMemoryRequirements2KHR)StubGetImageMemoryRequirements2KHR; }
table->GetBufferMemoryRequirements2KHR = (PFN_vkGetBufferMemoryRequirements2KHR) gpa(device, "vkGetBufferMemoryRequirements2KHR");
if (table->GetBufferMemoryRequirements2KHR == nullptr) { table->GetBufferMemoryRequirements2KHR = (PFN_vkGetBufferMemoryRequirements2KHR)StubGetBufferMemoryRequirements2KHR; }
table->GetImageSparseMemoryRequirements2KHR = (PFN_vkGetImageSparseMemoryRequirements2KHR) gpa(device, "vkGetImageSparseMemoryRequirements2KHR");
if (table->GetImageSparseMemoryRequirements2KHR == nullptr) { table->GetImageSparseMemoryRequirements2KHR = (PFN_vkGetImageSparseMemoryRequirements2KHR)StubGetImageSparseMemoryRequirements2KHR; }
table->CreateSamplerYcbcrConversionKHR = (PFN_vkCreateSamplerYcbcrConversionKHR) gpa(device, "vkCreateSamplerYcbcrConversionKHR");
if (table->CreateSamplerYcbcrConversionKHR == nullptr) { table->CreateSamplerYcbcrConversionKHR = (PFN_vkCreateSamplerYcbcrConversionKHR)StubCreateSamplerYcbcrConversionKHR; }
table->DestroySamplerYcbcrConversionKHR = (PFN_vkDestroySamplerYcbcrConversionKHR) gpa(device, "vkDestroySamplerYcbcrConversionKHR");
if (table->DestroySamplerYcbcrConversionKHR == nullptr) { table->DestroySamplerYcbcrConversionKHR = (PFN_vkDestroySamplerYcbcrConversionKHR)StubDestroySamplerYcbcrConversionKHR; }
table->BindBufferMemory2KHR = (PFN_vkBindBufferMemory2KHR) gpa(device, "vkBindBufferMemory2KHR");
if (table->BindBufferMemory2KHR == nullptr) { table->BindBufferMemory2KHR = (PFN_vkBindBufferMemory2KHR)StubBindBufferMemory2KHR; }
table->BindImageMemory2KHR = (PFN_vkBindImageMemory2KHR) gpa(device, "vkBindImageMemory2KHR");
if (table->BindImageMemory2KHR == nullptr) { table->BindImageMemory2KHR = (PFN_vkBindImageMemory2KHR)StubBindImageMemory2KHR; }
table->GetDescriptorSetLayoutSupportKHR = (PFN_vkGetDescriptorSetLayoutSupportKHR) gpa(device, "vkGetDescriptorSetLayoutSupportKHR");
if (table->GetDescriptorSetLayoutSupportKHR == nullptr) { table->GetDescriptorSetLayoutSupportKHR = (PFN_vkGetDescriptorSetLayoutSupportKHR)StubGetDescriptorSetLayoutSupportKHR; }
table->CmdDrawIndirectCountKHR = (PFN_vkCmdDrawIndirectCountKHR) gpa(device, "vkCmdDrawIndirectCountKHR");
if (table->CmdDrawIndirectCountKHR == nullptr) { table->CmdDrawIndirectCountKHR = (PFN_vkCmdDrawIndirectCountKHR)StubCmdDrawIndirectCountKHR; }
table->CmdDrawIndexedIndirectCountKHR = (PFN_vkCmdDrawIndexedIndirectCountKHR) gpa(device, "vkCmdDrawIndexedIndirectCountKHR");
if (table->CmdDrawIndexedIndirectCountKHR == nullptr) { table->CmdDrawIndexedIndirectCountKHR = (PFN_vkCmdDrawIndexedIndirectCountKHR)StubCmdDrawIndexedIndirectCountKHR; }
table->DebugMarkerSetObjectTagEXT = (PFN_vkDebugMarkerSetObjectTagEXT) gpa(device, "vkDebugMarkerSetObjectTagEXT");
if (table->DebugMarkerSetObjectTagEXT == nullptr) { table->DebugMarkerSetObjectTagEXT = (PFN_vkDebugMarkerSetObjectTagEXT)StubDebugMarkerSetObjectTagEXT; }
table->DebugMarkerSetObjectNameEXT = (PFN_vkDebugMarkerSetObjectNameEXT) gpa(device, "vkDebugMarkerSetObjectNameEXT");
if (table->DebugMarkerSetObjectNameEXT == nullptr) { table->DebugMarkerSetObjectNameEXT = (PFN_vkDebugMarkerSetObjectNameEXT)StubDebugMarkerSetObjectNameEXT; }
table->CmdDebugMarkerBeginEXT = (PFN_vkCmdDebugMarkerBeginEXT) gpa(device, "vkCmdDebugMarkerBeginEXT");
if (table->CmdDebugMarkerBeginEXT == nullptr) { table->CmdDebugMarkerBeginEXT = (PFN_vkCmdDebugMarkerBeginEXT)StubCmdDebugMarkerBeginEXT; }
table->CmdDebugMarkerEndEXT = (PFN_vkCmdDebugMarkerEndEXT) gpa(device, "vkCmdDebugMarkerEndEXT");
if (table->CmdDebugMarkerEndEXT == nullptr) { table->CmdDebugMarkerEndEXT = (PFN_vkCmdDebugMarkerEndEXT)StubCmdDebugMarkerEndEXT; }
table->CmdDebugMarkerInsertEXT = (PFN_vkCmdDebugMarkerInsertEXT) gpa(device, "vkCmdDebugMarkerInsertEXT");
if (table->CmdDebugMarkerInsertEXT == nullptr) { table->CmdDebugMarkerInsertEXT = (PFN_vkCmdDebugMarkerInsertEXT)StubCmdDebugMarkerInsertEXT; }
table->CmdBindTransformFeedbackBuffersEXT = (PFN_vkCmdBindTransformFeedbackBuffersEXT) gpa(device, "vkCmdBindTransformFeedbackBuffersEXT");
if (table->CmdBindTransformFeedbackBuffersEXT == nullptr) { table->CmdBindTransformFeedbackBuffersEXT = (PFN_vkCmdBindTransformFeedbackBuffersEXT)StubCmdBindTransformFeedbackBuffersEXT; }
table->CmdBeginTransformFeedbackEXT = (PFN_vkCmdBeginTransformFeedbackEXT) gpa(device, "vkCmdBeginTransformFeedbackEXT");
if (table->CmdBeginTransformFeedbackEXT == nullptr) { table->CmdBeginTransformFeedbackEXT = (PFN_vkCmdBeginTransformFeedbackEXT)StubCmdBeginTransformFeedbackEXT; }
table->CmdEndTransformFeedbackEXT = (PFN_vkCmdEndTransformFeedbackEXT) gpa(device, "vkCmdEndTransformFeedbackEXT");
if (table->CmdEndTransformFeedbackEXT == nullptr) { table->CmdEndTransformFeedbackEXT = (PFN_vkCmdEndTransformFeedbackEXT)StubCmdEndTransformFeedbackEXT; }
table->CmdBeginQueryIndexedEXT = (PFN_vkCmdBeginQueryIndexedEXT) gpa(device, "vkCmdBeginQueryIndexedEXT");
if (table->CmdBeginQueryIndexedEXT == nullptr) { table->CmdBeginQueryIndexedEXT = (PFN_vkCmdBeginQueryIndexedEXT)StubCmdBeginQueryIndexedEXT; }
table->CmdEndQueryIndexedEXT = (PFN_vkCmdEndQueryIndexedEXT) gpa(device, "vkCmdEndQueryIndexedEXT");
if (table->CmdEndQueryIndexedEXT == nullptr) { table->CmdEndQueryIndexedEXT = (PFN_vkCmdEndQueryIndexedEXT)StubCmdEndQueryIndexedEXT; }
table->CmdDrawIndirectByteCountEXT = (PFN_vkCmdDrawIndirectByteCountEXT) gpa(device, "vkCmdDrawIndirectByteCountEXT");
if (table->CmdDrawIndirectByteCountEXT == nullptr) { table->CmdDrawIndirectByteCountEXT = (PFN_vkCmdDrawIndirectByteCountEXT)StubCmdDrawIndirectByteCountEXT; }
table->GetImageViewHandleNVX = (PFN_vkGetImageViewHandleNVX) gpa(device, "vkGetImageViewHandleNVX");
if (table->GetImageViewHandleNVX == nullptr) { table->GetImageViewHandleNVX = (PFN_vkGetImageViewHandleNVX)StubGetImageViewHandleNVX; }
table->CmdDrawIndirectCountAMD = (PFN_vkCmdDrawIndirectCountAMD) gpa(device, "vkCmdDrawIndirectCountAMD");
if (table->CmdDrawIndirectCountAMD == nullptr) { table->CmdDrawIndirectCountAMD = (PFN_vkCmdDrawIndirectCountAMD)StubCmdDrawIndirectCountAMD; }
table->CmdDrawIndexedIndirectCountAMD = (PFN_vkCmdDrawIndexedIndirectCountAMD) gpa(device, "vkCmdDrawIndexedIndirectCountAMD");
if (table->CmdDrawIndexedIndirectCountAMD == nullptr) { table->CmdDrawIndexedIndirectCountAMD = (PFN_vkCmdDrawIndexedIndirectCountAMD)StubCmdDrawIndexedIndirectCountAMD; }
table->GetShaderInfoAMD = (PFN_vkGetShaderInfoAMD) gpa(device, "vkGetShaderInfoAMD");
if (table->GetShaderInfoAMD == nullptr) { table->GetShaderInfoAMD = (PFN_vkGetShaderInfoAMD)StubGetShaderInfoAMD; }
#ifdef VK_USE_PLATFORM_WIN32_KHR
table->GetMemoryWin32HandleNV = (PFN_vkGetMemoryWin32HandleNV) gpa(device, "vkGetMemoryWin32HandleNV");
if (table->GetMemoryWin32HandleNV == nullptr) { table->GetMemoryWin32HandleNV = (PFN_vkGetMemoryWin32HandleNV)StubGetMemoryWin32HandleNV; }
#endif // VK_USE_PLATFORM_WIN32_KHR
table->CmdBeginConditionalRenderingEXT = (PFN_vkCmdBeginConditionalRenderingEXT) gpa(device, "vkCmdBeginConditionalRenderingEXT");
if (table->CmdBeginConditionalRenderingEXT == nullptr) { table->CmdBeginConditionalRenderingEXT = (PFN_vkCmdBeginConditionalRenderingEXT)StubCmdBeginConditionalRenderingEXT; }
table->CmdEndConditionalRenderingEXT = (PFN_vkCmdEndConditionalRenderingEXT) gpa(device, "vkCmdEndConditionalRenderingEXT");
if (table->CmdEndConditionalRenderingEXT == nullptr) { table->CmdEndConditionalRenderingEXT = (PFN_vkCmdEndConditionalRenderingEXT)StubCmdEndConditionalRenderingEXT; }
table->CmdProcessCommandsNVX = (PFN_vkCmdProcessCommandsNVX) gpa(device, "vkCmdProcessCommandsNVX");
if (table->CmdProcessCommandsNVX == nullptr) { table->CmdProcessCommandsNVX = (PFN_vkCmdProcessCommandsNVX)StubCmdProcessCommandsNVX; }
table->CmdReserveSpaceForCommandsNVX = (PFN_vkCmdReserveSpaceForCommandsNVX) gpa(device, "vkCmdReserveSpaceForCommandsNVX");
if (table->CmdReserveSpaceForCommandsNVX == nullptr) { table->CmdReserveSpaceForCommandsNVX = (PFN_vkCmdReserveSpaceForCommandsNVX)StubCmdReserveSpaceForCommandsNVX; }
table->CreateIndirectCommandsLayoutNVX = (PFN_vkCreateIndirectCommandsLayoutNVX) gpa(device, "vkCreateIndirectCommandsLayoutNVX");
if (table->CreateIndirectCommandsLayoutNVX == nullptr) { table->CreateIndirectCommandsLayoutNVX = (PFN_vkCreateIndirectCommandsLayoutNVX)StubCreateIndirectCommandsLayoutNVX; }
table->DestroyIndirectCommandsLayoutNVX = (PFN_vkDestroyIndirectCommandsLayoutNVX) gpa(device, "vkDestroyIndirectCommandsLayoutNVX");
if (table->DestroyIndirectCommandsLayoutNVX == nullptr) { table->DestroyIndirectCommandsLayoutNVX = (PFN_vkDestroyIndirectCommandsLayoutNVX)StubDestroyIndirectCommandsLayoutNVX; }
table->CreateObjectTableNVX = (PFN_vkCreateObjectTableNVX) gpa(device, "vkCreateObjectTableNVX");
if (table->CreateObjectTableNVX == nullptr) { table->CreateObjectTableNVX = (PFN_vkCreateObjectTableNVX)StubCreateObjectTableNVX; }
table->DestroyObjectTableNVX = (PFN_vkDestroyObjectTableNVX) gpa(device, "vkDestroyObjectTableNVX");
if (table->DestroyObjectTableNVX == nullptr) { table->DestroyObjectTableNVX = (PFN_vkDestroyObjectTableNVX)StubDestroyObjectTableNVX; }
table->RegisterObjectsNVX = (PFN_vkRegisterObjectsNVX) gpa(device, "vkRegisterObjectsNVX");
if (table->RegisterObjectsNVX == nullptr) { table->RegisterObjectsNVX = (PFN_vkRegisterObjectsNVX)StubRegisterObjectsNVX; }
table->UnregisterObjectsNVX = (PFN_vkUnregisterObjectsNVX) gpa(device, "vkUnregisterObjectsNVX");
if (table->UnregisterObjectsNVX == nullptr) { table->UnregisterObjectsNVX = (PFN_vkUnregisterObjectsNVX)StubUnregisterObjectsNVX; }
table->CmdSetViewportWScalingNV = (PFN_vkCmdSetViewportWScalingNV) gpa(device, "vkCmdSetViewportWScalingNV");
if (table->CmdSetViewportWScalingNV == nullptr) { table->CmdSetViewportWScalingNV = (PFN_vkCmdSetViewportWScalingNV)StubCmdSetViewportWScalingNV; }
table->DisplayPowerControlEXT = (PFN_vkDisplayPowerControlEXT) gpa(device, "vkDisplayPowerControlEXT");
if (table->DisplayPowerControlEXT == nullptr) { table->DisplayPowerControlEXT = (PFN_vkDisplayPowerControlEXT)StubDisplayPowerControlEXT; }
table->RegisterDeviceEventEXT = (PFN_vkRegisterDeviceEventEXT) gpa(device, "vkRegisterDeviceEventEXT");
if (table->RegisterDeviceEventEXT == nullptr) { table->RegisterDeviceEventEXT = (PFN_vkRegisterDeviceEventEXT)StubRegisterDeviceEventEXT; }
table->RegisterDisplayEventEXT = (PFN_vkRegisterDisplayEventEXT) gpa(device, "vkRegisterDisplayEventEXT");
if (table->RegisterDisplayEventEXT == nullptr) { table->RegisterDisplayEventEXT = (PFN_vkRegisterDisplayEventEXT)StubRegisterDisplayEventEXT; }
table->GetSwapchainCounterEXT = (PFN_vkGetSwapchainCounterEXT) gpa(device, "vkGetSwapchainCounterEXT");
if (table->GetSwapchainCounterEXT == nullptr) { table->GetSwapchainCounterEXT = (PFN_vkGetSwapchainCounterEXT)StubGetSwapchainCounterEXT; }
table->GetRefreshCycleDurationGOOGLE = (PFN_vkGetRefreshCycleDurationGOOGLE) gpa(device, "vkGetRefreshCycleDurationGOOGLE");
if (table->GetRefreshCycleDurationGOOGLE == nullptr) { table->GetRefreshCycleDurationGOOGLE = (PFN_vkGetRefreshCycleDurationGOOGLE)StubGetRefreshCycleDurationGOOGLE; }
table->GetPastPresentationTimingGOOGLE = (PFN_vkGetPastPresentationTimingGOOGLE) gpa(device, "vkGetPastPresentationTimingGOOGLE");
if (table->GetPastPresentationTimingGOOGLE == nullptr) { table->GetPastPresentationTimingGOOGLE = (PFN_vkGetPastPresentationTimingGOOGLE)StubGetPastPresentationTimingGOOGLE; }
table->CmdSetDiscardRectangleEXT = (PFN_vkCmdSetDiscardRectangleEXT) gpa(device, "vkCmdSetDiscardRectangleEXT");
if (table->CmdSetDiscardRectangleEXT == nullptr) { table->CmdSetDiscardRectangleEXT = (PFN_vkCmdSetDiscardRectangleEXT)StubCmdSetDiscardRectangleEXT; }
table->SetHdrMetadataEXT = (PFN_vkSetHdrMetadataEXT) gpa(device, "vkSetHdrMetadataEXT");
if (table->SetHdrMetadataEXT == nullptr) { table->SetHdrMetadataEXT = (PFN_vkSetHdrMetadataEXT)StubSetHdrMetadataEXT; }
table->SetDebugUtilsObjectNameEXT = (PFN_vkSetDebugUtilsObjectNameEXT) gpa(device, "vkSetDebugUtilsObjectNameEXT");
table->SetDebugUtilsObjectTagEXT = (PFN_vkSetDebugUtilsObjectTagEXT) gpa(device, "vkSetDebugUtilsObjectTagEXT");
table->QueueBeginDebugUtilsLabelEXT = (PFN_vkQueueBeginDebugUtilsLabelEXT) gpa(device, "vkQueueBeginDebugUtilsLabelEXT");
table->QueueEndDebugUtilsLabelEXT = (PFN_vkQueueEndDebugUtilsLabelEXT) gpa(device, "vkQueueEndDebugUtilsLabelEXT");
table->QueueInsertDebugUtilsLabelEXT = (PFN_vkQueueInsertDebugUtilsLabelEXT) gpa(device, "vkQueueInsertDebugUtilsLabelEXT");
table->CmdBeginDebugUtilsLabelEXT = (PFN_vkCmdBeginDebugUtilsLabelEXT) gpa(device, "vkCmdBeginDebugUtilsLabelEXT");
table->CmdEndDebugUtilsLabelEXT = (PFN_vkCmdEndDebugUtilsLabelEXT) gpa(device, "vkCmdEndDebugUtilsLabelEXT");
table->CmdInsertDebugUtilsLabelEXT = (PFN_vkCmdInsertDebugUtilsLabelEXT) gpa(device, "vkCmdInsertDebugUtilsLabelEXT");
#ifdef VK_USE_PLATFORM_ANDROID_KHR
table->GetAndroidHardwareBufferPropertiesANDROID = (PFN_vkGetAndroidHardwareBufferPropertiesANDROID) gpa(device, "vkGetAndroidHardwareBufferPropertiesANDROID");
if (table->GetAndroidHardwareBufferPropertiesANDROID == nullptr) { table->GetAndroidHardwareBufferPropertiesANDROID = (PFN_vkGetAndroidHardwareBufferPropertiesANDROID)StubGetAndroidHardwareBufferPropertiesANDROID; }
#endif // VK_USE_PLATFORM_ANDROID_KHR
#ifdef VK_USE_PLATFORM_ANDROID_KHR
table->GetMemoryAndroidHardwareBufferANDROID = (PFN_vkGetMemoryAndroidHardwareBufferANDROID) gpa(device, "vkGetMemoryAndroidHardwareBufferANDROID");
if (table->GetMemoryAndroidHardwareBufferANDROID == nullptr) { table->GetMemoryAndroidHardwareBufferANDROID = (PFN_vkGetMemoryAndroidHardwareBufferANDROID)StubGetMemoryAndroidHardwareBufferANDROID; }
#endif // VK_USE_PLATFORM_ANDROID_KHR
table->CmdSetSampleLocationsEXT = (PFN_vkCmdSetSampleLocationsEXT) gpa(device, "vkCmdSetSampleLocationsEXT");
if (table->CmdSetSampleLocationsEXT == nullptr) { table->CmdSetSampleLocationsEXT = (PFN_vkCmdSetSampleLocationsEXT)StubCmdSetSampleLocationsEXT; }
table->GetImageDrmFormatModifierPropertiesEXT = (PFN_vkGetImageDrmFormatModifierPropertiesEXT) gpa(device, "vkGetImageDrmFormatModifierPropertiesEXT");
if (table->GetImageDrmFormatModifierPropertiesEXT == nullptr) { table->GetImageDrmFormatModifierPropertiesEXT = (PFN_vkGetImageDrmFormatModifierPropertiesEXT)StubGetImageDrmFormatModifierPropertiesEXT; }
table->CreateValidationCacheEXT = (PFN_vkCreateValidationCacheEXT) gpa(device, "vkCreateValidationCacheEXT");
if (table->CreateValidationCacheEXT == nullptr) { table->CreateValidationCacheEXT = (PFN_vkCreateValidationCacheEXT)StubCreateValidationCacheEXT; }
table->DestroyValidationCacheEXT = (PFN_vkDestroyValidationCacheEXT) gpa(device, "vkDestroyValidationCacheEXT");
if (table->DestroyValidationCacheEXT == nullptr) { table->DestroyValidationCacheEXT = (PFN_vkDestroyValidationCacheEXT)StubDestroyValidationCacheEXT; }
table->MergeValidationCachesEXT = (PFN_vkMergeValidationCachesEXT) gpa(device, "vkMergeValidationCachesEXT");
if (table->MergeValidationCachesEXT == nullptr) { table->MergeValidationCachesEXT = (PFN_vkMergeValidationCachesEXT)StubMergeValidationCachesEXT; }
table->GetValidationCacheDataEXT = (PFN_vkGetValidationCacheDataEXT) gpa(device, "vkGetValidationCacheDataEXT");
if (table->GetValidationCacheDataEXT == nullptr) { table->GetValidationCacheDataEXT = (PFN_vkGetValidationCacheDataEXT)StubGetValidationCacheDataEXT; }
table->CmdBindShadingRateImageNV = (PFN_vkCmdBindShadingRateImageNV) gpa(device, "vkCmdBindShadingRateImageNV");
if (table->CmdBindShadingRateImageNV == nullptr) { table->CmdBindShadingRateImageNV = (PFN_vkCmdBindShadingRateImageNV)StubCmdBindShadingRateImageNV; }
table->CmdSetViewportShadingRatePaletteNV = (PFN_vkCmdSetViewportShadingRatePaletteNV) gpa(device, "vkCmdSetViewportShadingRatePaletteNV");
if (table->CmdSetViewportShadingRatePaletteNV == nullptr) { table->CmdSetViewportShadingRatePaletteNV = (PFN_vkCmdSetViewportShadingRatePaletteNV)StubCmdSetViewportShadingRatePaletteNV; }
table->CmdSetCoarseSampleOrderNV = (PFN_vkCmdSetCoarseSampleOrderNV) gpa(device, "vkCmdSetCoarseSampleOrderNV");
if (table->CmdSetCoarseSampleOrderNV == nullptr) { table->CmdSetCoarseSampleOrderNV = (PFN_vkCmdSetCoarseSampleOrderNV)StubCmdSetCoarseSampleOrderNV; }
table->CreateAccelerationStructureNV = (PFN_vkCreateAccelerationStructureNV) gpa(device, "vkCreateAccelerationStructureNV");
if (table->CreateAccelerationStructureNV == nullptr) { table->CreateAccelerationStructureNV = (PFN_vkCreateAccelerationStructureNV)StubCreateAccelerationStructureNV; }
table->DestroyAccelerationStructureNV = (PFN_vkDestroyAccelerationStructureNV) gpa(device, "vkDestroyAccelerationStructureNV");
if (table->DestroyAccelerationStructureNV == nullptr) { table->DestroyAccelerationStructureNV = (PFN_vkDestroyAccelerationStructureNV)StubDestroyAccelerationStructureNV; }
table->GetAccelerationStructureMemoryRequirementsNV = (PFN_vkGetAccelerationStructureMemoryRequirementsNV) gpa(device, "vkGetAccelerationStructureMemoryRequirementsNV");
if (table->GetAccelerationStructureMemoryRequirementsNV == nullptr) { table->GetAccelerationStructureMemoryRequirementsNV = (PFN_vkGetAccelerationStructureMemoryRequirementsNV)StubGetAccelerationStructureMemoryRequirementsNV; }
table->BindAccelerationStructureMemoryNV = (PFN_vkBindAccelerationStructureMemoryNV) gpa(device, "vkBindAccelerationStructureMemoryNV");
if (table->BindAccelerationStructureMemoryNV == nullptr) { table->BindAccelerationStructureMemoryNV = (PFN_vkBindAccelerationStructureMemoryNV)StubBindAccelerationStructureMemoryNV; }
table->CmdBuildAccelerationStructureNV = (PFN_vkCmdBuildAccelerationStructureNV) gpa(device, "vkCmdBuildAccelerationStructureNV");
if (table->CmdBuildAccelerationStructureNV == nullptr) { table->CmdBuildAccelerationStructureNV = (PFN_vkCmdBuildAccelerationStructureNV)StubCmdBuildAccelerationStructureNV; }
table->CmdCopyAccelerationStructureNV = (PFN_vkCmdCopyAccelerationStructureNV) gpa(device, "vkCmdCopyAccelerationStructureNV");
if (table->CmdCopyAccelerationStructureNV == nullptr) { table->CmdCopyAccelerationStructureNV = (PFN_vkCmdCopyAccelerationStructureNV)StubCmdCopyAccelerationStructureNV; }
table->CmdTraceRaysNV = (PFN_vkCmdTraceRaysNV) gpa(device, "vkCmdTraceRaysNV");
if (table->CmdTraceRaysNV == nullptr) { table->CmdTraceRaysNV = (PFN_vkCmdTraceRaysNV)StubCmdTraceRaysNV; }
table->CreateRayTracingPipelinesNV = (PFN_vkCreateRayTracingPipelinesNV) gpa(device, "vkCreateRayTracingPipelinesNV");
if (table->CreateRayTracingPipelinesNV == nullptr) { table->CreateRayTracingPipelinesNV = (PFN_vkCreateRayTracingPipelinesNV)StubCreateRayTracingPipelinesNV; }
table->GetRayTracingShaderGroupHandlesNV = (PFN_vkGetRayTracingShaderGroupHandlesNV) gpa(device, "vkGetRayTracingShaderGroupHandlesNV");
if (table->GetRayTracingShaderGroupHandlesNV == nullptr) { table->GetRayTracingShaderGroupHandlesNV = (PFN_vkGetRayTracingShaderGroupHandlesNV)StubGetRayTracingShaderGroupHandlesNV; }
table->GetAccelerationStructureHandleNV = (PFN_vkGetAccelerationStructureHandleNV) gpa(device, "vkGetAccelerationStructureHandleNV");
if (table->GetAccelerationStructureHandleNV == nullptr) { table->GetAccelerationStructureHandleNV = (PFN_vkGetAccelerationStructureHandleNV)StubGetAccelerationStructureHandleNV; }
table->CmdWriteAccelerationStructuresPropertiesNV = (PFN_vkCmdWriteAccelerationStructuresPropertiesNV) gpa(device, "vkCmdWriteAccelerationStructuresPropertiesNV");
if (table->CmdWriteAccelerationStructuresPropertiesNV == nullptr) { table->CmdWriteAccelerationStructuresPropertiesNV = (PFN_vkCmdWriteAccelerationStructuresPropertiesNV)StubCmdWriteAccelerationStructuresPropertiesNV; }
table->CompileDeferredNV = (PFN_vkCompileDeferredNV) gpa(device, "vkCompileDeferredNV");
if (table->CompileDeferredNV == nullptr) { table->CompileDeferredNV = (PFN_vkCompileDeferredNV)StubCompileDeferredNV; }
table->GetMemoryHostPointerPropertiesEXT = (PFN_vkGetMemoryHostPointerPropertiesEXT) gpa(device, "vkGetMemoryHostPointerPropertiesEXT");
if (table->GetMemoryHostPointerPropertiesEXT == nullptr) { table->GetMemoryHostPointerPropertiesEXT = (PFN_vkGetMemoryHostPointerPropertiesEXT)StubGetMemoryHostPointerPropertiesEXT; }
table->CmdWriteBufferMarkerAMD = (PFN_vkCmdWriteBufferMarkerAMD) gpa(device, "vkCmdWriteBufferMarkerAMD");
if (table->CmdWriteBufferMarkerAMD == nullptr) { table->CmdWriteBufferMarkerAMD = (PFN_vkCmdWriteBufferMarkerAMD)StubCmdWriteBufferMarkerAMD; }
table->GetCalibratedTimestampsEXT = (PFN_vkGetCalibratedTimestampsEXT) gpa(device, "vkGetCalibratedTimestampsEXT");
if (table->GetCalibratedTimestampsEXT == nullptr) { table->GetCalibratedTimestampsEXT = (PFN_vkGetCalibratedTimestampsEXT)StubGetCalibratedTimestampsEXT; }
table->CmdDrawMeshTasksNV = (PFN_vkCmdDrawMeshTasksNV) gpa(device, "vkCmdDrawMeshTasksNV");
if (table->CmdDrawMeshTasksNV == nullptr) { table->CmdDrawMeshTasksNV = (PFN_vkCmdDrawMeshTasksNV)StubCmdDrawMeshTasksNV; }
table->CmdDrawMeshTasksIndirectNV = (PFN_vkCmdDrawMeshTasksIndirectNV) gpa(device, "vkCmdDrawMeshTasksIndirectNV");
if (table->CmdDrawMeshTasksIndirectNV == nullptr) { table->CmdDrawMeshTasksIndirectNV = (PFN_vkCmdDrawMeshTasksIndirectNV)StubCmdDrawMeshTasksIndirectNV; }
table->CmdDrawMeshTasksIndirectCountNV = (PFN_vkCmdDrawMeshTasksIndirectCountNV) gpa(device, "vkCmdDrawMeshTasksIndirectCountNV");
if (table->CmdDrawMeshTasksIndirectCountNV == nullptr) { table->CmdDrawMeshTasksIndirectCountNV = (PFN_vkCmdDrawMeshTasksIndirectCountNV)StubCmdDrawMeshTasksIndirectCountNV; }
table->CmdSetExclusiveScissorNV = (PFN_vkCmdSetExclusiveScissorNV) gpa(device, "vkCmdSetExclusiveScissorNV");
if (table->CmdSetExclusiveScissorNV == nullptr) { table->CmdSetExclusiveScissorNV = (PFN_vkCmdSetExclusiveScissorNV)StubCmdSetExclusiveScissorNV; }
table->CmdSetCheckpointNV = (PFN_vkCmdSetCheckpointNV) gpa(device, "vkCmdSetCheckpointNV");
if (table->CmdSetCheckpointNV == nullptr) { table->CmdSetCheckpointNV = (PFN_vkCmdSetCheckpointNV)StubCmdSetCheckpointNV; }
table->GetQueueCheckpointDataNV = (PFN_vkGetQueueCheckpointDataNV) gpa(device, "vkGetQueueCheckpointDataNV");
if (table->GetQueueCheckpointDataNV == nullptr) { table->GetQueueCheckpointDataNV = (PFN_vkGetQueueCheckpointDataNV)StubGetQueueCheckpointDataNV; }
table->InitializePerformanceApiINTEL = (PFN_vkInitializePerformanceApiINTEL) gpa(device, "vkInitializePerformanceApiINTEL");
if (table->InitializePerformanceApiINTEL == nullptr) { table->InitializePerformanceApiINTEL = (PFN_vkInitializePerformanceApiINTEL)StubInitializePerformanceApiINTEL; }
table->UninitializePerformanceApiINTEL = (PFN_vkUninitializePerformanceApiINTEL) gpa(device, "vkUninitializePerformanceApiINTEL");
if (table->UninitializePerformanceApiINTEL == nullptr) { table->UninitializePerformanceApiINTEL = (PFN_vkUninitializePerformanceApiINTEL)StubUninitializePerformanceApiINTEL; }
table->CmdSetPerformanceMarkerINTEL = (PFN_vkCmdSetPerformanceMarkerINTEL) gpa(device, "vkCmdSetPerformanceMarkerINTEL");
if (table->CmdSetPerformanceMarkerINTEL == nullptr) { table->CmdSetPerformanceMarkerINTEL = (PFN_vkCmdSetPerformanceMarkerINTEL)StubCmdSetPerformanceMarkerINTEL; }
table->CmdSetPerformanceStreamMarkerINTEL = (PFN_vkCmdSetPerformanceStreamMarkerINTEL) gpa(device, "vkCmdSetPerformanceStreamMarkerINTEL");
if (table->CmdSetPerformanceStreamMarkerINTEL == nullptr) { table->CmdSetPerformanceStreamMarkerINTEL = (PFN_vkCmdSetPerformanceStreamMarkerINTEL)StubCmdSetPerformanceStreamMarkerINTEL; }
table->CmdSetPerformanceOverrideINTEL = (PFN_vkCmdSetPerformanceOverrideINTEL) gpa(device, "vkCmdSetPerformanceOverrideINTEL");
if (table->CmdSetPerformanceOverrideINTEL == nullptr) { table->CmdSetPerformanceOverrideINTEL = (PFN_vkCmdSetPerformanceOverrideINTEL)StubCmdSetPerformanceOverrideINTEL; }
table->AcquirePerformanceConfigurationINTEL = (PFN_vkAcquirePerformanceConfigurationINTEL) gpa(device, "vkAcquirePerformanceConfigurationINTEL");
if (table->AcquirePerformanceConfigurationINTEL == nullptr) { table->AcquirePerformanceConfigurationINTEL = (PFN_vkAcquirePerformanceConfigurationINTEL)StubAcquirePerformanceConfigurationINTEL; }
table->ReleasePerformanceConfigurationINTEL = (PFN_vkReleasePerformanceConfigurationINTEL) gpa(device, "vkReleasePerformanceConfigurationINTEL");
if (table->ReleasePerformanceConfigurationINTEL == nullptr) { table->ReleasePerformanceConfigurationINTEL = (PFN_vkReleasePerformanceConfigurationINTEL)StubReleasePerformanceConfigurationINTEL; }
table->QueueSetPerformanceConfigurationINTEL = (PFN_vkQueueSetPerformanceConfigurationINTEL) gpa(device, "vkQueueSetPerformanceConfigurationINTEL");
if (table->QueueSetPerformanceConfigurationINTEL == nullptr) { table->QueueSetPerformanceConfigurationINTEL = (PFN_vkQueueSetPerformanceConfigurationINTEL)StubQueueSetPerformanceConfigurationINTEL; }
table->GetPerformanceParameterINTEL = (PFN_vkGetPerformanceParameterINTEL) gpa(device, "vkGetPerformanceParameterINTEL");
if (table->GetPerformanceParameterINTEL == nullptr) { table->GetPerformanceParameterINTEL = (PFN_vkGetPerformanceParameterINTEL)StubGetPerformanceParameterINTEL; }
table->SetLocalDimmingAMD = (PFN_vkSetLocalDimmingAMD) gpa(device, "vkSetLocalDimmingAMD");
if (table->SetLocalDimmingAMD == nullptr) { table->SetLocalDimmingAMD = (PFN_vkSetLocalDimmingAMD)StubSetLocalDimmingAMD; }
table->GetBufferDeviceAddressEXT = (PFN_vkGetBufferDeviceAddressEXT) gpa(device, "vkGetBufferDeviceAddressEXT");
if (table->GetBufferDeviceAddressEXT == nullptr) { table->GetBufferDeviceAddressEXT = (PFN_vkGetBufferDeviceAddressEXT)StubGetBufferDeviceAddressEXT; }
#ifdef VK_USE_PLATFORM_WIN32_KHR
table->AcquireFullScreenExclusiveModeEXT = (PFN_vkAcquireFullScreenExclusiveModeEXT) gpa(device, "vkAcquireFullScreenExclusiveModeEXT");
if (table->AcquireFullScreenExclusiveModeEXT == nullptr) { table->AcquireFullScreenExclusiveModeEXT = (PFN_vkAcquireFullScreenExclusiveModeEXT)StubAcquireFullScreenExclusiveModeEXT; }
#endif // VK_USE_PLATFORM_WIN32_KHR
#ifdef VK_USE_PLATFORM_WIN32_KHR
table->ReleaseFullScreenExclusiveModeEXT = (PFN_vkReleaseFullScreenExclusiveModeEXT) gpa(device, "vkReleaseFullScreenExclusiveModeEXT");
if (table->ReleaseFullScreenExclusiveModeEXT == nullptr) { table->ReleaseFullScreenExclusiveModeEXT = (PFN_vkReleaseFullScreenExclusiveModeEXT)StubReleaseFullScreenExclusiveModeEXT; }
#endif // VK_USE_PLATFORM_WIN32_KHR
#ifdef VK_USE_PLATFORM_WIN32_KHR
table->GetDeviceGroupSurfacePresentModes2EXT = (PFN_vkGetDeviceGroupSurfacePresentModes2EXT) gpa(device, "vkGetDeviceGroupSurfacePresentModes2EXT");
if (table->GetDeviceGroupSurfacePresentModes2EXT == nullptr) { table->GetDeviceGroupSurfacePresentModes2EXT = (PFN_vkGetDeviceGroupSurfacePresentModes2EXT)StubGetDeviceGroupSurfacePresentModes2EXT; }
#endif // VK_USE_PLATFORM_WIN32_KHR
table->ResetQueryPoolEXT = (PFN_vkResetQueryPoolEXT) gpa(device, "vkResetQueryPoolEXT");
if (table->ResetQueryPoolEXT == nullptr) { table->ResetQueryPoolEXT = (PFN_vkResetQueryPoolEXT)StubResetQueryPoolEXT; }
}
static inline void layer_init_instance_dispatch_table(VkInstance instance, VkLayerInstanceDispatchTable *table, PFN_vkGetInstanceProcAddr gpa) {
memset(table, 0, sizeof(*table));
// Instance function pointers
table->DestroyInstance = (PFN_vkDestroyInstance) gpa(instance, "vkDestroyInstance");
table->EnumeratePhysicalDevices = (PFN_vkEnumeratePhysicalDevices) gpa(instance, "vkEnumeratePhysicalDevices");
table->GetPhysicalDeviceFeatures = (PFN_vkGetPhysicalDeviceFeatures) gpa(instance, "vkGetPhysicalDeviceFeatures");
table->GetPhysicalDeviceFormatProperties = (PFN_vkGetPhysicalDeviceFormatProperties) gpa(instance, "vkGetPhysicalDeviceFormatProperties");
table->GetPhysicalDeviceImageFormatProperties = (PFN_vkGetPhysicalDeviceImageFormatProperties) gpa(instance, "vkGetPhysicalDeviceImageFormatProperties");
table->GetPhysicalDeviceProperties = (PFN_vkGetPhysicalDeviceProperties) gpa(instance, "vkGetPhysicalDeviceProperties");
table->GetPhysicalDeviceQueueFamilyProperties = (PFN_vkGetPhysicalDeviceQueueFamilyProperties) gpa(instance, "vkGetPhysicalDeviceQueueFamilyProperties");
table->GetPhysicalDeviceMemoryProperties = (PFN_vkGetPhysicalDeviceMemoryProperties) gpa(instance, "vkGetPhysicalDeviceMemoryProperties");
table->GetInstanceProcAddr = gpa;
table->EnumerateDeviceExtensionProperties = (PFN_vkEnumerateDeviceExtensionProperties) gpa(instance, "vkEnumerateDeviceExtensionProperties");
table->EnumerateDeviceLayerProperties = (PFN_vkEnumerateDeviceLayerProperties) gpa(instance, "vkEnumerateDeviceLayerProperties");
table->GetPhysicalDeviceSparseImageFormatProperties = (PFN_vkGetPhysicalDeviceSparseImageFormatProperties) gpa(instance, "vkGetPhysicalDeviceSparseImageFormatProperties");
table->EnumeratePhysicalDeviceGroups = (PFN_vkEnumeratePhysicalDeviceGroups) gpa(instance, "vkEnumeratePhysicalDeviceGroups");
table->GetPhysicalDeviceFeatures2 = (PFN_vkGetPhysicalDeviceFeatures2) gpa(instance, "vkGetPhysicalDeviceFeatures2");
table->GetPhysicalDeviceProperties2 = (PFN_vkGetPhysicalDeviceProperties2) gpa(instance, "vkGetPhysicalDeviceProperties2");
table->GetPhysicalDeviceFormatProperties2 = (PFN_vkGetPhysicalDeviceFormatProperties2) gpa(instance, "vkGetPhysicalDeviceFormatProperties2");
table->GetPhysicalDeviceImageFormatProperties2 = (PFN_vkGetPhysicalDeviceImageFormatProperties2) gpa(instance, "vkGetPhysicalDeviceImageFormatProperties2");
table->GetPhysicalDeviceQueueFamilyProperties2 = (PFN_vkGetPhysicalDeviceQueueFamilyProperties2) gpa(instance, "vkGetPhysicalDeviceQueueFamilyProperties2");
table->GetPhysicalDeviceMemoryProperties2 = (PFN_vkGetPhysicalDeviceMemoryProperties2) gpa(instance, "vkGetPhysicalDeviceMemoryProperties2");
table->GetPhysicalDeviceSparseImageFormatProperties2 = (PFN_vkGetPhysicalDeviceSparseImageFormatProperties2) gpa(instance, "vkGetPhysicalDeviceSparseImageFormatProperties2");
table->GetPhysicalDeviceExternalBufferProperties = (PFN_vkGetPhysicalDeviceExternalBufferProperties) gpa(instance, "vkGetPhysicalDeviceExternalBufferProperties");
table->GetPhysicalDeviceExternalFenceProperties = (PFN_vkGetPhysicalDeviceExternalFenceProperties) gpa(instance, "vkGetPhysicalDeviceExternalFenceProperties");
table->GetPhysicalDeviceExternalSemaphoreProperties = (PFN_vkGetPhysicalDeviceExternalSemaphoreProperties) gpa(instance, "vkGetPhysicalDeviceExternalSemaphoreProperties");
table->DestroySurfaceKHR = (PFN_vkDestroySurfaceKHR) gpa(instance, "vkDestroySurfaceKHR");
table->GetPhysicalDeviceSurfaceSupportKHR = (PFN_vkGetPhysicalDeviceSurfaceSupportKHR) gpa(instance, "vkGetPhysicalDeviceSurfaceSupportKHR");
table->GetPhysicalDeviceSurfaceCapabilitiesKHR = (PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR) gpa(instance, "vkGetPhysicalDeviceSurfaceCapabilitiesKHR");
table->GetPhysicalDeviceSurfaceFormatsKHR = (PFN_vkGetPhysicalDeviceSurfaceFormatsKHR) gpa(instance, "vkGetPhysicalDeviceSurfaceFormatsKHR");
table->GetPhysicalDeviceSurfacePresentModesKHR = (PFN_vkGetPhysicalDeviceSurfacePresentModesKHR) gpa(instance, "vkGetPhysicalDeviceSurfacePresentModesKHR");
table->GetPhysicalDevicePresentRectanglesKHR = (PFN_vkGetPhysicalDevicePresentRectanglesKHR) gpa(instance, "vkGetPhysicalDevicePresentRectanglesKHR");
table->GetPhysicalDeviceDisplayPropertiesKHR = (PFN_vkGetPhysicalDeviceDisplayPropertiesKHR) gpa(instance, "vkGetPhysicalDeviceDisplayPropertiesKHR");
table->GetPhysicalDeviceDisplayPlanePropertiesKHR = (PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR) gpa(instance, "vkGetPhysicalDeviceDisplayPlanePropertiesKHR");
table->GetDisplayPlaneSupportedDisplaysKHR = (PFN_vkGetDisplayPlaneSupportedDisplaysKHR) gpa(instance, "vkGetDisplayPlaneSupportedDisplaysKHR");
table->GetDisplayModePropertiesKHR = (PFN_vkGetDisplayModePropertiesKHR) gpa(instance, "vkGetDisplayModePropertiesKHR");
table->CreateDisplayModeKHR = (PFN_vkCreateDisplayModeKHR) gpa(instance, "vkCreateDisplayModeKHR");
table->GetDisplayPlaneCapabilitiesKHR = (PFN_vkGetDisplayPlaneCapabilitiesKHR) gpa(instance, "vkGetDisplayPlaneCapabilitiesKHR");
table->CreateDisplayPlaneSurfaceKHR = (PFN_vkCreateDisplayPlaneSurfaceKHR) gpa(instance, "vkCreateDisplayPlaneSurfaceKHR");
#ifdef VK_USE_PLATFORM_XLIB_KHR
table->CreateXlibSurfaceKHR = (PFN_vkCreateXlibSurfaceKHR) gpa(instance, "vkCreateXlibSurfaceKHR");
#endif // VK_USE_PLATFORM_XLIB_KHR
#ifdef VK_USE_PLATFORM_XLIB_KHR
table->GetPhysicalDeviceXlibPresentationSupportKHR = (PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR) gpa(instance, "vkGetPhysicalDeviceXlibPresentationSupportKHR");
#endif // VK_USE_PLATFORM_XLIB_KHR
#ifdef VK_USE_PLATFORM_XCB_KHR
table->CreateXcbSurfaceKHR = (PFN_vkCreateXcbSurfaceKHR) gpa(instance, "vkCreateXcbSurfaceKHR");
#endif // VK_USE_PLATFORM_XCB_KHR
#ifdef VK_USE_PLATFORM_XCB_KHR
table->GetPhysicalDeviceXcbPresentationSupportKHR = (PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR) gpa(instance, "vkGetPhysicalDeviceXcbPresentationSupportKHR");
#endif // VK_USE_PLATFORM_XCB_KHR
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
table->CreateWaylandSurfaceKHR = (PFN_vkCreateWaylandSurfaceKHR) gpa(instance, "vkCreateWaylandSurfaceKHR");
#endif // VK_USE_PLATFORM_WAYLAND_KHR
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
table->GetPhysicalDeviceWaylandPresentationSupportKHR = (PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR) gpa(instance, "vkGetPhysicalDeviceWaylandPresentationSupportKHR");
#endif // VK_USE_PLATFORM_WAYLAND_KHR
#ifdef VK_USE_PLATFORM_ANDROID_KHR
table->CreateAndroidSurfaceKHR = (PFN_vkCreateAndroidSurfaceKHR) gpa(instance, "vkCreateAndroidSurfaceKHR");
#endif // VK_USE_PLATFORM_ANDROID_KHR
#ifdef VK_USE_PLATFORM_WIN32_KHR
table->CreateWin32SurfaceKHR = (PFN_vkCreateWin32SurfaceKHR) gpa(instance, "vkCreateWin32SurfaceKHR");
#endif // VK_USE_PLATFORM_WIN32_KHR
#ifdef VK_USE_PLATFORM_WIN32_KHR
table->GetPhysicalDeviceWin32PresentationSupportKHR = (PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR) gpa(instance, "vkGetPhysicalDeviceWin32PresentationSupportKHR");
#endif // VK_USE_PLATFORM_WIN32_KHR
table->GetPhysicalDeviceFeatures2KHR = (PFN_vkGetPhysicalDeviceFeatures2KHR) gpa(instance, "vkGetPhysicalDeviceFeatures2KHR");
table->GetPhysicalDeviceProperties2KHR = (PFN_vkGetPhysicalDeviceProperties2KHR) gpa(instance, "vkGetPhysicalDeviceProperties2KHR");
table->GetPhysicalDeviceFormatProperties2KHR = (PFN_vkGetPhysicalDeviceFormatProperties2KHR) gpa(instance, "vkGetPhysicalDeviceFormatProperties2KHR");
table->GetPhysicalDeviceImageFormatProperties2KHR = (PFN_vkGetPhysicalDeviceImageFormatProperties2KHR) gpa(instance, "vkGetPhysicalDeviceImageFormatProperties2KHR");
table->GetPhysicalDeviceQueueFamilyProperties2KHR = (PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR) gpa(instance, "vkGetPhysicalDeviceQueueFamilyProperties2KHR");
table->GetPhysicalDeviceMemoryProperties2KHR = (PFN_vkGetPhysicalDeviceMemoryProperties2KHR) gpa(instance, "vkGetPhysicalDeviceMemoryProperties2KHR");
table->GetPhysicalDeviceSparseImageFormatProperties2KHR = (PFN_vkGetPhysicalDeviceSparseImageFormatProperties2KHR) gpa(instance, "vkGetPhysicalDeviceSparseImageFormatProperties2KHR");
table->EnumeratePhysicalDeviceGroupsKHR = (PFN_vkEnumeratePhysicalDeviceGroupsKHR) gpa(instance, "vkEnumeratePhysicalDeviceGroupsKHR");
table->GetPhysicalDeviceExternalBufferPropertiesKHR = (PFN_vkGetPhysicalDeviceExternalBufferPropertiesKHR) gpa(instance, "vkGetPhysicalDeviceExternalBufferPropertiesKHR");
table->GetPhysicalDeviceExternalSemaphorePropertiesKHR = (PFN_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR) gpa(instance, "vkGetPhysicalDeviceExternalSemaphorePropertiesKHR");
table->GetPhysicalDeviceExternalFencePropertiesKHR = (PFN_vkGetPhysicalDeviceExternalFencePropertiesKHR) gpa(instance, "vkGetPhysicalDeviceExternalFencePropertiesKHR");
table->GetPhysicalDeviceSurfaceCapabilities2KHR = (PFN_vkGetPhysicalDeviceSurfaceCapabilities2KHR) gpa(instance, "vkGetPhysicalDeviceSurfaceCapabilities2KHR");
table->GetPhysicalDeviceSurfaceFormats2KHR = (PFN_vkGetPhysicalDeviceSurfaceFormats2KHR) gpa(instance, "vkGetPhysicalDeviceSurfaceFormats2KHR");
table->GetPhysicalDeviceDisplayProperties2KHR = (PFN_vkGetPhysicalDeviceDisplayProperties2KHR) gpa(instance, "vkGetPhysicalDeviceDisplayProperties2KHR");
table->GetPhysicalDeviceDisplayPlaneProperties2KHR = (PFN_vkGetPhysicalDeviceDisplayPlaneProperties2KHR) gpa(instance, "vkGetPhysicalDeviceDisplayPlaneProperties2KHR");
table->GetDisplayModeProperties2KHR = (PFN_vkGetDisplayModeProperties2KHR) gpa(instance, "vkGetDisplayModeProperties2KHR");
table->GetDisplayPlaneCapabilities2KHR = (PFN_vkGetDisplayPlaneCapabilities2KHR) gpa(instance, "vkGetDisplayPlaneCapabilities2KHR");
table->CreateDebugReportCallbackEXT = (PFN_vkCreateDebugReportCallbackEXT) gpa(instance, "vkCreateDebugReportCallbackEXT");
table->DestroyDebugReportCallbackEXT = (PFN_vkDestroyDebugReportCallbackEXT) gpa(instance, "vkDestroyDebugReportCallbackEXT");
table->DebugReportMessageEXT = (PFN_vkDebugReportMessageEXT) gpa(instance, "vkDebugReportMessageEXT");
#ifdef VK_USE_PLATFORM_GGP
table->CreateStreamDescriptorSurfaceGGP = (PFN_vkCreateStreamDescriptorSurfaceGGP) gpa(instance, "vkCreateStreamDescriptorSurfaceGGP");
#endif // VK_USE_PLATFORM_GGP
table->GetPhysicalDeviceExternalImageFormatPropertiesNV = (PFN_vkGetPhysicalDeviceExternalImageFormatPropertiesNV) gpa(instance, "vkGetPhysicalDeviceExternalImageFormatPropertiesNV");
#ifdef VK_USE_PLATFORM_VI_NN
table->CreateViSurfaceNN = (PFN_vkCreateViSurfaceNN) gpa(instance, "vkCreateViSurfaceNN");
#endif // VK_USE_PLATFORM_VI_NN
table->GetPhysicalDeviceGeneratedCommandsPropertiesNVX = (PFN_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX) gpa(instance, "vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX");
table->ReleaseDisplayEXT = (PFN_vkReleaseDisplayEXT) gpa(instance, "vkReleaseDisplayEXT");
#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT
table->AcquireXlibDisplayEXT = (PFN_vkAcquireXlibDisplayEXT) gpa(instance, "vkAcquireXlibDisplayEXT");
#endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT
#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT
table->GetRandROutputDisplayEXT = (PFN_vkGetRandROutputDisplayEXT) gpa(instance, "vkGetRandROutputDisplayEXT");
#endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT
table->GetPhysicalDeviceSurfaceCapabilities2EXT = (PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT) gpa(instance, "vkGetPhysicalDeviceSurfaceCapabilities2EXT");
#ifdef VK_USE_PLATFORM_IOS_MVK
table->CreateIOSSurfaceMVK = (PFN_vkCreateIOSSurfaceMVK) gpa(instance, "vkCreateIOSSurfaceMVK");
#endif // VK_USE_PLATFORM_IOS_MVK
#ifdef VK_USE_PLATFORM_MACOS_MVK
table->CreateMacOSSurfaceMVK = (PFN_vkCreateMacOSSurfaceMVK) gpa(instance, "vkCreateMacOSSurfaceMVK");
#endif // VK_USE_PLATFORM_MACOS_MVK
table->CreateDebugUtilsMessengerEXT = (PFN_vkCreateDebugUtilsMessengerEXT) gpa(instance, "vkCreateDebugUtilsMessengerEXT");
table->DestroyDebugUtilsMessengerEXT = (PFN_vkDestroyDebugUtilsMessengerEXT) gpa(instance, "vkDestroyDebugUtilsMessengerEXT");
table->SubmitDebugUtilsMessageEXT = (PFN_vkSubmitDebugUtilsMessageEXT) gpa(instance, "vkSubmitDebugUtilsMessageEXT");
table->GetPhysicalDeviceMultisamplePropertiesEXT = (PFN_vkGetPhysicalDeviceMultisamplePropertiesEXT) gpa(instance, "vkGetPhysicalDeviceMultisamplePropertiesEXT");
table->GetPhysicalDeviceCalibrateableTimeDomainsEXT = (PFN_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT) gpa(instance, "vkGetPhysicalDeviceCalibrateableTimeDomainsEXT");
#ifdef VK_USE_PLATFORM_FUCHSIA
table->CreateImagePipeSurfaceFUCHSIA = (PFN_vkCreateImagePipeSurfaceFUCHSIA) gpa(instance, "vkCreateImagePipeSurfaceFUCHSIA");
#endif // VK_USE_PLATFORM_FUCHSIA
#ifdef VK_USE_PLATFORM_METAL_EXT
table->CreateMetalSurfaceEXT = (PFN_vkCreateMetalSurfaceEXT) gpa(instance, "vkCreateMetalSurfaceEXT");
#endif // VK_USE_PLATFORM_METAL_EXT
table->GetPhysicalDeviceCooperativeMatrixPropertiesNV = (PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV) gpa(instance, "vkGetPhysicalDeviceCooperativeMatrixPropertiesNV");
table->GetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV = (PFN_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV) gpa(instance, "vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV");
#ifdef VK_USE_PLATFORM_WIN32_KHR
table->GetPhysicalDeviceSurfacePresentModes2EXT = (PFN_vkGetPhysicalDeviceSurfacePresentModes2EXT) gpa(instance, "vkGetPhysicalDeviceSurfacePresentModes2EXT");
#endif // VK_USE_PLATFORM_WIN32_KHR
table->CreateHeadlessSurfaceEXT = (PFN_vkCreateHeadlessSurfaceEXT) gpa(instance, "vkCreateHeadlessSurfaceEXT");
}

View File

@ -0,0 +1,638 @@
// *** 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
typedef PFN_vkVoidFunction (VKAPI_PTR *PFN_GetPhysicalDeviceProcAddr)(VkInstance instance, const char* pName);
// Instance function pointer dispatch table
typedef struct VkLayerInstanceDispatchTable_ {
// Manually add in GetPhysicalDeviceProcAddr entry
PFN_GetPhysicalDeviceProcAddr GetPhysicalDeviceProcAddr;
// ---- 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_vkGetInstanceProcAddr GetInstanceProcAddr;
PFN_vkCreateDevice CreateDevice;
PFN_vkEnumerateInstanceExtensionProperties EnumerateInstanceExtensionProperties;
PFN_vkEnumerateDeviceExtensionProperties EnumerateDeviceExtensionProperties;
PFN_vkEnumerateInstanceLayerProperties EnumerateInstanceLayerProperties;
PFN_vkEnumerateDeviceLayerProperties EnumerateDeviceLayerProperties;
PFN_vkGetPhysicalDeviceSparseImageFormatProperties GetPhysicalDeviceSparseImageFormatProperties;
// ---- Core 1_1 commands
PFN_vkEnumerateInstanceVersion EnumerateInstanceVersion;
PFN_vkEnumeratePhysicalDeviceGroups EnumeratePhysicalDeviceGroups;
PFN_vkGetPhysicalDeviceFeatures2 GetPhysicalDeviceFeatures2;
PFN_vkGetPhysicalDeviceProperties2 GetPhysicalDeviceProperties2;
PFN_vkGetPhysicalDeviceFormatProperties2 GetPhysicalDeviceFormatProperties2;
PFN_vkGetPhysicalDeviceImageFormatProperties2 GetPhysicalDeviceImageFormatProperties2;
PFN_vkGetPhysicalDeviceQueueFamilyProperties2 GetPhysicalDeviceQueueFamilyProperties2;
PFN_vkGetPhysicalDeviceMemoryProperties2 GetPhysicalDeviceMemoryProperties2;
PFN_vkGetPhysicalDeviceSparseImageFormatProperties2 GetPhysicalDeviceSparseImageFormatProperties2;
PFN_vkGetPhysicalDeviceExternalBufferProperties GetPhysicalDeviceExternalBufferProperties;
PFN_vkGetPhysicalDeviceExternalFenceProperties GetPhysicalDeviceExternalFenceProperties;
PFN_vkGetPhysicalDeviceExternalSemaphoreProperties GetPhysicalDeviceExternalSemaphoreProperties;
// ---- 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_vkGetPhysicalDevicePresentRectanglesKHR GetPhysicalDevicePresentRectanglesKHR;
// ---- 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_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_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_device_group_creation extension commands
PFN_vkEnumeratePhysicalDeviceGroupsKHR EnumeratePhysicalDeviceGroupsKHR;
// ---- 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_KHR_get_display_properties2 extension commands
PFN_vkGetPhysicalDeviceDisplayProperties2KHR GetPhysicalDeviceDisplayProperties2KHR;
PFN_vkGetPhysicalDeviceDisplayPlaneProperties2KHR GetPhysicalDeviceDisplayPlaneProperties2KHR;
PFN_vkGetDisplayModeProperties2KHR GetDisplayModeProperties2KHR;
PFN_vkGetDisplayPlaneCapabilities2KHR GetDisplayPlaneCapabilities2KHR;
// ---- VK_EXT_debug_report extension commands
PFN_vkCreateDebugReportCallbackEXT CreateDebugReportCallbackEXT;
PFN_vkDestroyDebugReportCallbackEXT DestroyDebugReportCallbackEXT;
PFN_vkDebugReportMessageEXT DebugReportMessageEXT;
// ---- VK_GGP_stream_descriptor_surface extension commands
#ifdef VK_USE_PLATFORM_GGP
PFN_vkCreateStreamDescriptorSurfaceGGP CreateStreamDescriptorSurfaceGGP;
#endif // VK_USE_PLATFORM_GGP
// ---- VK_NV_external_memory_capabilities extension commands
PFN_vkGetPhysicalDeviceExternalImageFormatPropertiesNV GetPhysicalDeviceExternalImageFormatPropertiesNV;
// ---- VK_NN_vi_surface extension commands
#ifdef VK_USE_PLATFORM_VI_NN
PFN_vkCreateViSurfaceNN CreateViSurfaceNN;
#endif // VK_USE_PLATFORM_VI_NN
// ---- 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_debug_utils extension commands
PFN_vkCreateDebugUtilsMessengerEXT CreateDebugUtilsMessengerEXT;
PFN_vkDestroyDebugUtilsMessengerEXT DestroyDebugUtilsMessengerEXT;
PFN_vkSubmitDebugUtilsMessageEXT SubmitDebugUtilsMessageEXT;
// ---- VK_EXT_sample_locations extension commands
PFN_vkGetPhysicalDeviceMultisamplePropertiesEXT GetPhysicalDeviceMultisamplePropertiesEXT;
// ---- VK_EXT_calibrated_timestamps extension commands
PFN_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT GetPhysicalDeviceCalibrateableTimeDomainsEXT;
// ---- VK_FUCHSIA_imagepipe_surface extension commands
#ifdef VK_USE_PLATFORM_FUCHSIA
PFN_vkCreateImagePipeSurfaceFUCHSIA CreateImagePipeSurfaceFUCHSIA;
#endif // VK_USE_PLATFORM_FUCHSIA
// ---- VK_EXT_metal_surface extension commands
#ifdef VK_USE_PLATFORM_METAL_EXT
PFN_vkCreateMetalSurfaceEXT CreateMetalSurfaceEXT;
#endif // VK_USE_PLATFORM_METAL_EXT
// ---- VK_NV_cooperative_matrix extension commands
PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV GetPhysicalDeviceCooperativeMatrixPropertiesNV;
// ---- VK_NV_coverage_reduction_mode extension commands
PFN_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV GetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV;
// ---- VK_EXT_full_screen_exclusive extension commands
#ifdef VK_USE_PLATFORM_WIN32_KHR
PFN_vkGetPhysicalDeviceSurfacePresentModes2EXT GetPhysicalDeviceSurfacePresentModes2EXT;
#endif // VK_USE_PLATFORM_WIN32_KHR
// ---- VK_EXT_headless_surface extension commands
PFN_vkCreateHeadlessSurfaceEXT CreateHeadlessSurfaceEXT;
} VkLayerInstanceDispatchTable;
// Device function pointer dispatch table
typedef struct VkLayerDispatchTable_ {
// ---- Core 1_0 commands
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_vkBindBufferMemory BindBufferMemory;
PFN_vkBindImageMemory BindImageMemory;
PFN_vkGetBufferMemoryRequirements GetBufferMemoryRequirements;
PFN_vkGetImageMemoryRequirements GetImageMemoryRequirements;
PFN_vkGetImageSparseMemoryRequirements GetImageSparseMemoryRequirements;
PFN_vkQueueBindSparse QueueBindSparse;
PFN_vkCreateFence CreateFence;
PFN_vkDestroyFence DestroyFence;
PFN_vkResetFences ResetFences;
PFN_vkGetFenceStatus GetFenceStatus;
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_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_vkCmdBindDescriptorSets CmdBindDescriptorSets;
PFN_vkCmdBindIndexBuffer CmdBindIndexBuffer;
PFN_vkCmdBindVertexBuffers CmdBindVertexBuffers;
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;
// ---- Core 1_1 commands
PFN_vkBindBufferMemory2 BindBufferMemory2;
PFN_vkBindImageMemory2 BindImageMemory2;
PFN_vkGetDeviceGroupPeerMemoryFeatures GetDeviceGroupPeerMemoryFeatures;
PFN_vkCmdSetDeviceMask CmdSetDeviceMask;
PFN_vkCmdDispatchBase CmdDispatchBase;
PFN_vkGetImageMemoryRequirements2 GetImageMemoryRequirements2;
PFN_vkGetBufferMemoryRequirements2 GetBufferMemoryRequirements2;
PFN_vkGetImageSparseMemoryRequirements2 GetImageSparseMemoryRequirements2;
PFN_vkTrimCommandPool TrimCommandPool;
PFN_vkGetDeviceQueue2 GetDeviceQueue2;
PFN_vkCreateSamplerYcbcrConversion CreateSamplerYcbcrConversion;
PFN_vkDestroySamplerYcbcrConversion DestroySamplerYcbcrConversion;
PFN_vkCreateDescriptorUpdateTemplate CreateDescriptorUpdateTemplate;
PFN_vkDestroyDescriptorUpdateTemplate DestroyDescriptorUpdateTemplate;
PFN_vkUpdateDescriptorSetWithTemplate UpdateDescriptorSetWithTemplate;
PFN_vkGetDescriptorSetLayoutSupport GetDescriptorSetLayoutSupport;
// ---- VK_KHR_swapchain extension commands
PFN_vkCreateSwapchainKHR CreateSwapchainKHR;
PFN_vkDestroySwapchainKHR DestroySwapchainKHR;
PFN_vkGetSwapchainImagesKHR GetSwapchainImagesKHR;
PFN_vkAcquireNextImageKHR AcquireNextImageKHR;
PFN_vkQueuePresentKHR QueuePresentKHR;
PFN_vkGetDeviceGroupPresentCapabilitiesKHR GetDeviceGroupPresentCapabilitiesKHR;
PFN_vkGetDeviceGroupSurfacePresentModesKHR GetDeviceGroupSurfacePresentModesKHR;
PFN_vkAcquireNextImage2KHR AcquireNextImage2KHR;
// ---- VK_KHR_display_swapchain extension commands
PFN_vkCreateSharedSwapchainsKHR CreateSharedSwapchainsKHR;
// ---- VK_KHR_device_group extension commands
PFN_vkGetDeviceGroupPeerMemoryFeaturesKHR GetDeviceGroupPeerMemoryFeaturesKHR;
PFN_vkCmdSetDeviceMaskKHR CmdSetDeviceMaskKHR;
PFN_vkCmdDispatchBaseKHR CmdDispatchBaseKHR;
// ---- VK_KHR_maintenance1 extension commands
PFN_vkTrimCommandPoolKHR TrimCommandPoolKHR;
// ---- VK_KHR_external_memory_win32 extension commands
#ifdef VK_USE_PLATFORM_WIN32_KHR
PFN_vkGetMemoryWin32HandleKHR GetMemoryWin32HandleKHR;
#endif // VK_USE_PLATFORM_WIN32_KHR
#ifdef VK_USE_PLATFORM_WIN32_KHR
PFN_vkGetMemoryWin32HandlePropertiesKHR GetMemoryWin32HandlePropertiesKHR;
#endif // VK_USE_PLATFORM_WIN32_KHR
// ---- VK_KHR_external_memory_fd extension commands
PFN_vkGetMemoryFdKHR GetMemoryFdKHR;
PFN_vkGetMemoryFdPropertiesKHR GetMemoryFdPropertiesKHR;
// ---- VK_KHR_external_semaphore_win32 extension commands
#ifdef VK_USE_PLATFORM_WIN32_KHR
PFN_vkImportSemaphoreWin32HandleKHR ImportSemaphoreWin32HandleKHR;
#endif // VK_USE_PLATFORM_WIN32_KHR
#ifdef VK_USE_PLATFORM_WIN32_KHR
PFN_vkGetSemaphoreWin32HandleKHR GetSemaphoreWin32HandleKHR;
#endif // VK_USE_PLATFORM_WIN32_KHR
// ---- VK_KHR_external_semaphore_fd extension commands
PFN_vkImportSemaphoreFdKHR ImportSemaphoreFdKHR;
PFN_vkGetSemaphoreFdKHR GetSemaphoreFdKHR;
// ---- VK_KHR_push_descriptor extension commands
PFN_vkCmdPushDescriptorSetKHR CmdPushDescriptorSetKHR;
PFN_vkCmdPushDescriptorSetWithTemplateKHR CmdPushDescriptorSetWithTemplateKHR;
// ---- VK_KHR_descriptor_update_template extension commands
PFN_vkCreateDescriptorUpdateTemplateKHR CreateDescriptorUpdateTemplateKHR;
PFN_vkDestroyDescriptorUpdateTemplateKHR DestroyDescriptorUpdateTemplateKHR;
PFN_vkUpdateDescriptorSetWithTemplateKHR UpdateDescriptorSetWithTemplateKHR;
// ---- VK_KHR_create_renderpass2 extension commands
PFN_vkCreateRenderPass2KHR CreateRenderPass2KHR;
PFN_vkCmdBeginRenderPass2KHR CmdBeginRenderPass2KHR;
PFN_vkCmdNextSubpass2KHR CmdNextSubpass2KHR;
PFN_vkCmdEndRenderPass2KHR CmdEndRenderPass2KHR;
// ---- VK_KHR_shared_presentable_image extension commands
PFN_vkGetSwapchainStatusKHR GetSwapchainStatusKHR;
// ---- VK_KHR_external_fence_win32 extension commands
#ifdef VK_USE_PLATFORM_WIN32_KHR
PFN_vkImportFenceWin32HandleKHR ImportFenceWin32HandleKHR;
#endif // VK_USE_PLATFORM_WIN32_KHR
#ifdef VK_USE_PLATFORM_WIN32_KHR
PFN_vkGetFenceWin32HandleKHR GetFenceWin32HandleKHR;
#endif // VK_USE_PLATFORM_WIN32_KHR
// ---- VK_KHR_external_fence_fd extension commands
PFN_vkImportFenceFdKHR ImportFenceFdKHR;
PFN_vkGetFenceFdKHR GetFenceFdKHR;
// ---- VK_KHR_get_memory_requirements2 extension commands
PFN_vkGetImageMemoryRequirements2KHR GetImageMemoryRequirements2KHR;
PFN_vkGetBufferMemoryRequirements2KHR GetBufferMemoryRequirements2KHR;
PFN_vkGetImageSparseMemoryRequirements2KHR GetImageSparseMemoryRequirements2KHR;
// ---- VK_KHR_sampler_ycbcr_conversion extension commands
PFN_vkCreateSamplerYcbcrConversionKHR CreateSamplerYcbcrConversionKHR;
PFN_vkDestroySamplerYcbcrConversionKHR DestroySamplerYcbcrConversionKHR;
// ---- VK_KHR_bind_memory2 extension commands
PFN_vkBindBufferMemory2KHR BindBufferMemory2KHR;
PFN_vkBindImageMemory2KHR BindImageMemory2KHR;
// ---- VK_KHR_maintenance3 extension commands
PFN_vkGetDescriptorSetLayoutSupportKHR GetDescriptorSetLayoutSupportKHR;
// ---- VK_KHR_draw_indirect_count extension commands
PFN_vkCmdDrawIndirectCountKHR CmdDrawIndirectCountKHR;
PFN_vkCmdDrawIndexedIndirectCountKHR CmdDrawIndexedIndirectCountKHR;
// ---- VK_EXT_debug_marker extension commands
PFN_vkDebugMarkerSetObjectTagEXT DebugMarkerSetObjectTagEXT;
PFN_vkDebugMarkerSetObjectNameEXT DebugMarkerSetObjectNameEXT;
PFN_vkCmdDebugMarkerBeginEXT CmdDebugMarkerBeginEXT;
PFN_vkCmdDebugMarkerEndEXT CmdDebugMarkerEndEXT;
PFN_vkCmdDebugMarkerInsertEXT CmdDebugMarkerInsertEXT;
// ---- VK_EXT_transform_feedback extension commands
PFN_vkCmdBindTransformFeedbackBuffersEXT CmdBindTransformFeedbackBuffersEXT;
PFN_vkCmdBeginTransformFeedbackEXT CmdBeginTransformFeedbackEXT;
PFN_vkCmdEndTransformFeedbackEXT CmdEndTransformFeedbackEXT;
PFN_vkCmdBeginQueryIndexedEXT CmdBeginQueryIndexedEXT;
PFN_vkCmdEndQueryIndexedEXT CmdEndQueryIndexedEXT;
PFN_vkCmdDrawIndirectByteCountEXT CmdDrawIndirectByteCountEXT;
// ---- VK_NVX_image_view_handle extension commands
PFN_vkGetImageViewHandleNVX GetImageViewHandleNVX;
// ---- VK_AMD_draw_indirect_count extension commands
PFN_vkCmdDrawIndirectCountAMD CmdDrawIndirectCountAMD;
PFN_vkCmdDrawIndexedIndirectCountAMD CmdDrawIndexedIndirectCountAMD;
// ---- VK_AMD_shader_info extension commands
PFN_vkGetShaderInfoAMD GetShaderInfoAMD;
// ---- VK_NV_external_memory_win32 extension commands
#ifdef VK_USE_PLATFORM_WIN32_KHR
PFN_vkGetMemoryWin32HandleNV GetMemoryWin32HandleNV;
#endif // VK_USE_PLATFORM_WIN32_KHR
// ---- VK_EXT_conditional_rendering extension commands
PFN_vkCmdBeginConditionalRenderingEXT CmdBeginConditionalRenderingEXT;
PFN_vkCmdEndConditionalRenderingEXT CmdEndConditionalRenderingEXT;
// ---- VK_NVX_device_generated_commands extension 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;
// ---- VK_NV_clip_space_w_scaling extension commands
PFN_vkCmdSetViewportWScalingNV CmdSetViewportWScalingNV;
// ---- VK_EXT_display_control extension commands
PFN_vkDisplayPowerControlEXT DisplayPowerControlEXT;
PFN_vkRegisterDeviceEventEXT RegisterDeviceEventEXT;
PFN_vkRegisterDisplayEventEXT RegisterDisplayEventEXT;
PFN_vkGetSwapchainCounterEXT GetSwapchainCounterEXT;
// ---- VK_GOOGLE_display_timing extension commands
PFN_vkGetRefreshCycleDurationGOOGLE GetRefreshCycleDurationGOOGLE;
PFN_vkGetPastPresentationTimingGOOGLE GetPastPresentationTimingGOOGLE;
// ---- VK_EXT_discard_rectangles extension commands
PFN_vkCmdSetDiscardRectangleEXT CmdSetDiscardRectangleEXT;
// ---- VK_EXT_hdr_metadata extension commands
PFN_vkSetHdrMetadataEXT SetHdrMetadataEXT;
// ---- VK_EXT_debug_utils extension commands
PFN_vkSetDebugUtilsObjectNameEXT SetDebugUtilsObjectNameEXT;
PFN_vkSetDebugUtilsObjectTagEXT SetDebugUtilsObjectTagEXT;
PFN_vkQueueBeginDebugUtilsLabelEXT QueueBeginDebugUtilsLabelEXT;
PFN_vkQueueEndDebugUtilsLabelEXT QueueEndDebugUtilsLabelEXT;
PFN_vkQueueInsertDebugUtilsLabelEXT QueueInsertDebugUtilsLabelEXT;
PFN_vkCmdBeginDebugUtilsLabelEXT CmdBeginDebugUtilsLabelEXT;
PFN_vkCmdEndDebugUtilsLabelEXT CmdEndDebugUtilsLabelEXT;
PFN_vkCmdInsertDebugUtilsLabelEXT CmdInsertDebugUtilsLabelEXT;
// ---- VK_ANDROID_external_memory_android_hardware_buffer extension commands
#ifdef VK_USE_PLATFORM_ANDROID_KHR
PFN_vkGetAndroidHardwareBufferPropertiesANDROID GetAndroidHardwareBufferPropertiesANDROID;
#endif // VK_USE_PLATFORM_ANDROID_KHR
#ifdef VK_USE_PLATFORM_ANDROID_KHR
PFN_vkGetMemoryAndroidHardwareBufferANDROID GetMemoryAndroidHardwareBufferANDROID;
#endif // VK_USE_PLATFORM_ANDROID_KHR
// ---- VK_EXT_sample_locations extension commands
PFN_vkCmdSetSampleLocationsEXT CmdSetSampleLocationsEXT;
// ---- VK_EXT_image_drm_format_modifier extension commands
PFN_vkGetImageDrmFormatModifierPropertiesEXT GetImageDrmFormatModifierPropertiesEXT;
// ---- VK_EXT_validation_cache extension commands
PFN_vkCreateValidationCacheEXT CreateValidationCacheEXT;
PFN_vkDestroyValidationCacheEXT DestroyValidationCacheEXT;
PFN_vkMergeValidationCachesEXT MergeValidationCachesEXT;
PFN_vkGetValidationCacheDataEXT GetValidationCacheDataEXT;
// ---- VK_NV_shading_rate_image extension commands
PFN_vkCmdBindShadingRateImageNV CmdBindShadingRateImageNV;
PFN_vkCmdSetViewportShadingRatePaletteNV CmdSetViewportShadingRatePaletteNV;
PFN_vkCmdSetCoarseSampleOrderNV CmdSetCoarseSampleOrderNV;
// ---- VK_NV_ray_tracing extension commands
PFN_vkCreateAccelerationStructureNV CreateAccelerationStructureNV;
PFN_vkDestroyAccelerationStructureNV DestroyAccelerationStructureNV;
PFN_vkGetAccelerationStructureMemoryRequirementsNV GetAccelerationStructureMemoryRequirementsNV;
PFN_vkBindAccelerationStructureMemoryNV BindAccelerationStructureMemoryNV;
PFN_vkCmdBuildAccelerationStructureNV CmdBuildAccelerationStructureNV;
PFN_vkCmdCopyAccelerationStructureNV CmdCopyAccelerationStructureNV;
PFN_vkCmdTraceRaysNV CmdTraceRaysNV;
PFN_vkCreateRayTracingPipelinesNV CreateRayTracingPipelinesNV;
PFN_vkGetRayTracingShaderGroupHandlesNV GetRayTracingShaderGroupHandlesNV;
PFN_vkGetAccelerationStructureHandleNV GetAccelerationStructureHandleNV;
PFN_vkCmdWriteAccelerationStructuresPropertiesNV CmdWriteAccelerationStructuresPropertiesNV;
PFN_vkCompileDeferredNV CompileDeferredNV;
// ---- VK_EXT_external_memory_host extension commands
PFN_vkGetMemoryHostPointerPropertiesEXT GetMemoryHostPointerPropertiesEXT;
// ---- VK_AMD_buffer_marker extension commands
PFN_vkCmdWriteBufferMarkerAMD CmdWriteBufferMarkerAMD;
// ---- VK_EXT_calibrated_timestamps extension commands
PFN_vkGetCalibratedTimestampsEXT GetCalibratedTimestampsEXT;
// ---- VK_NV_mesh_shader extension commands
PFN_vkCmdDrawMeshTasksNV CmdDrawMeshTasksNV;
PFN_vkCmdDrawMeshTasksIndirectNV CmdDrawMeshTasksIndirectNV;
PFN_vkCmdDrawMeshTasksIndirectCountNV CmdDrawMeshTasksIndirectCountNV;
// ---- VK_NV_scissor_exclusive extension commands
PFN_vkCmdSetExclusiveScissorNV CmdSetExclusiveScissorNV;
// ---- VK_NV_device_diagnostic_checkpoints extension commands
PFN_vkCmdSetCheckpointNV CmdSetCheckpointNV;
PFN_vkGetQueueCheckpointDataNV GetQueueCheckpointDataNV;
// ---- VK_INTEL_performance_query extension commands
PFN_vkInitializePerformanceApiINTEL InitializePerformanceApiINTEL;
PFN_vkUninitializePerformanceApiINTEL UninitializePerformanceApiINTEL;
PFN_vkCmdSetPerformanceMarkerINTEL CmdSetPerformanceMarkerINTEL;
PFN_vkCmdSetPerformanceStreamMarkerINTEL CmdSetPerformanceStreamMarkerINTEL;
PFN_vkCmdSetPerformanceOverrideINTEL CmdSetPerformanceOverrideINTEL;
PFN_vkAcquirePerformanceConfigurationINTEL AcquirePerformanceConfigurationINTEL;
PFN_vkReleasePerformanceConfigurationINTEL ReleasePerformanceConfigurationINTEL;
PFN_vkQueueSetPerformanceConfigurationINTEL QueueSetPerformanceConfigurationINTEL;
PFN_vkGetPerformanceParameterINTEL GetPerformanceParameterINTEL;
// ---- VK_AMD_display_native_hdr extension commands
PFN_vkSetLocalDimmingAMD SetLocalDimmingAMD;
// ---- VK_EXT_buffer_device_address extension commands
PFN_vkGetBufferDeviceAddressEXT GetBufferDeviceAddressEXT;
// ---- VK_EXT_full_screen_exclusive extension commands
#ifdef VK_USE_PLATFORM_WIN32_KHR
PFN_vkAcquireFullScreenExclusiveModeEXT AcquireFullScreenExclusiveModeEXT;
#endif // VK_USE_PLATFORM_WIN32_KHR
#ifdef VK_USE_PLATFORM_WIN32_KHR
PFN_vkReleaseFullScreenExclusiveModeEXT ReleaseFullScreenExclusiveModeEXT;
#endif // VK_USE_PLATFORM_WIN32_KHR
#ifdef VK_USE_PLATFORM_WIN32_KHR
PFN_vkGetDeviceGroupSurfacePresentModes2EXT GetDeviceGroupSurfacePresentModes2EXT;
#endif // VK_USE_PLATFORM_WIN32_KHR
// ---- VK_EXT_host_query_reset extension commands
PFN_vkResetQueryPoolEXT ResetQueryPoolEXT;
} VkLayerDispatchTable;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,445 @@
// *** 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_device;
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(struct loader_device *dev, 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_vkGetInstanceProcAddr gipa,
PFN_vkGetDeviceProcAddr gdpa,
VkInstance inst,
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);
VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumerateInstanceVersion(
const VkEnumerateInstanceVersionChain* chain,
uint32_t* pApiVersion);
VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumeratePhysicalDeviceGroups(
VkInstance instance,
uint32_t* pPhysicalDeviceGroupCount,
VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties);
VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceFeatures2(
VkPhysicalDevice physicalDevice,
VkPhysicalDeviceFeatures2* pFeatures);
VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceProperties2(
VkPhysicalDevice physicalDevice,
VkPhysicalDeviceProperties2* pProperties);
VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceFormatProperties2(
VkPhysicalDevice physicalDevice,
VkFormat format,
VkFormatProperties2* pFormatProperties);
VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceImageFormatProperties2(
VkPhysicalDevice physicalDevice,
const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo,
VkImageFormatProperties2* pImageFormatProperties);
VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceQueueFamilyProperties2(
VkPhysicalDevice physicalDevice,
uint32_t* pQueueFamilyPropertyCount,
VkQueueFamilyProperties2* pQueueFamilyProperties);
VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceMemoryProperties2(
VkPhysicalDevice physicalDevice,
VkPhysicalDeviceMemoryProperties2* pMemoryProperties);
VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceSparseImageFormatProperties2(
VkPhysicalDevice physicalDevice,
const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo,
uint32_t* pPropertyCount,
VkSparseImageFormatProperties2* pProperties);
VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceExternalBufferProperties(
VkPhysicalDevice physicalDevice,
const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo,
VkExternalBufferProperties* pExternalBufferProperties);
VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceExternalFenceProperties(
VkPhysicalDevice physicalDevice,
const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo,
VkExternalFenceProperties* pExternalFenceProperties);
VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceExternalSemaphoreProperties(
VkPhysicalDevice physicalDevice,
const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo,
VkExternalSemaphoreProperties* pExternalSemaphoreProperties);
// 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;
// ---- Core 1_1 commands
PFN_vkEnumerateInstanceVersion EnumerateInstanceVersion;
PFN_vkEnumeratePhysicalDeviceGroups EnumeratePhysicalDeviceGroups;
PFN_vkGetPhysicalDeviceFeatures2 GetPhysicalDeviceFeatures2;
PFN_vkGetPhysicalDeviceProperties2 GetPhysicalDeviceProperties2;
PFN_vkGetPhysicalDeviceFormatProperties2 GetPhysicalDeviceFormatProperties2;
PFN_vkGetPhysicalDeviceImageFormatProperties2 GetPhysicalDeviceImageFormatProperties2;
PFN_vkGetPhysicalDeviceQueueFamilyProperties2 GetPhysicalDeviceQueueFamilyProperties2;
PFN_vkGetPhysicalDeviceMemoryProperties2 GetPhysicalDeviceMemoryProperties2;
PFN_vkGetPhysicalDeviceSparseImageFormatProperties2 GetPhysicalDeviceSparseImageFormatProperties2;
PFN_vkGetPhysicalDeviceExternalBufferProperties GetPhysicalDeviceExternalBufferProperties;
PFN_vkGetPhysicalDeviceExternalFenceProperties GetPhysicalDeviceExternalFenceProperties;
PFN_vkGetPhysicalDeviceExternalSemaphoreProperties GetPhysicalDeviceExternalSemaphoreProperties;
// ---- 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;
PFN_vkGetDeviceGroupSurfacePresentModesKHR GetDeviceGroupSurfacePresentModesKHR;
PFN_vkGetPhysicalDevicePresentRectanglesKHR GetPhysicalDevicePresentRectanglesKHR;
// ---- 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_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_device_group_creation extension commands
PFN_vkEnumeratePhysicalDeviceGroupsKHR EnumeratePhysicalDeviceGroupsKHR;
// ---- 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_KHR_get_display_properties2 extension commands
PFN_vkGetPhysicalDeviceDisplayProperties2KHR GetPhysicalDeviceDisplayProperties2KHR;
PFN_vkGetPhysicalDeviceDisplayPlaneProperties2KHR GetPhysicalDeviceDisplayPlaneProperties2KHR;
PFN_vkGetDisplayModeProperties2KHR GetDisplayModeProperties2KHR;
PFN_vkGetDisplayPlaneCapabilities2KHR GetDisplayPlaneCapabilities2KHR;
// ---- 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_GGP_stream_descriptor_surface extension commands
#ifdef VK_USE_PLATFORM_GGP
PFN_vkCreateStreamDescriptorSurfaceGGP CreateStreamDescriptorSurfaceGGP;
#endif // VK_USE_PLATFORM_GGP
// ---- VK_NV_external_memory_capabilities extension commands
PFN_vkGetPhysicalDeviceExternalImageFormatPropertiesNV GetPhysicalDeviceExternalImageFormatPropertiesNV;
// ---- VK_NN_vi_surface extension commands
#ifdef VK_USE_PLATFORM_VI_NN
PFN_vkCreateViSurfaceNN CreateViSurfaceNN;
#endif // VK_USE_PLATFORM_VI_NN
// ---- 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_debug_utils extension commands
PFN_vkSetDebugUtilsObjectNameEXT SetDebugUtilsObjectNameEXT;
PFN_vkSetDebugUtilsObjectTagEXT SetDebugUtilsObjectTagEXT;
PFN_vkCreateDebugUtilsMessengerEXT CreateDebugUtilsMessengerEXT;
PFN_vkDestroyDebugUtilsMessengerEXT DestroyDebugUtilsMessengerEXT;
PFN_vkSubmitDebugUtilsMessageEXT SubmitDebugUtilsMessageEXT;
// ---- VK_EXT_sample_locations extension commands
PFN_vkGetPhysicalDeviceMultisamplePropertiesEXT GetPhysicalDeviceMultisamplePropertiesEXT;
// ---- VK_EXT_calibrated_timestamps extension commands
PFN_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT GetPhysicalDeviceCalibrateableTimeDomainsEXT;
// ---- VK_FUCHSIA_imagepipe_surface extension commands
#ifdef VK_USE_PLATFORM_FUCHSIA
PFN_vkCreateImagePipeSurfaceFUCHSIA CreateImagePipeSurfaceFUCHSIA;
#endif // VK_USE_PLATFORM_FUCHSIA
// ---- VK_EXT_metal_surface extension commands
#ifdef VK_USE_PLATFORM_METAL_EXT
PFN_vkCreateMetalSurfaceEXT CreateMetalSurfaceEXT;
#endif // VK_USE_PLATFORM_METAL_EXT
// ---- VK_NV_cooperative_matrix extension commands
PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV GetPhysicalDeviceCooperativeMatrixPropertiesNV;
// ---- VK_NV_coverage_reduction_mode extension commands
PFN_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV GetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV;
// ---- VK_EXT_full_screen_exclusive extension commands
#ifdef VK_USE_PLATFORM_WIN32_KHR
PFN_vkGetPhysicalDeviceSurfacePresentModes2EXT GetPhysicalDeviceSurfacePresentModes2EXT;
#endif // VK_USE_PLATFORM_WIN32_KHR
#ifdef VK_USE_PLATFORM_WIN32_KHR
PFN_vkGetDeviceGroupSurfacePresentModes2EXT GetDeviceGroupSurfacePresentModes2EXT;
#endif // VK_USE_PLATFORM_WIN32_KHR
// ---- VK_EXT_headless_surface extension commands
PFN_vkCreateHeadlessSurfaceEXT CreateHeadlessSurfaceEXT;
};
union loader_instance_extension_enables {
struct {
uint8_t khr_get_physical_device_properties2 : 1;
uint8_t khr_device_group_creation : 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 ggp_stream_descriptor_surface : 1;
uint8_t nv_external_memory_capabilities : 1;
uint8_t nn_vi_surface : 1;
uint8_t ext_direct_mode_display : 1;
uint8_t ext_acquire_xlib_display : 1;
uint8_t ext_display_surface_counter : 1;
uint8_t ext_debug_utils : 1;
uint8_t fuchsia_imagepipe_surface : 1;
uint8_t ext_metal_surface : 1;
};
uint64_t padding[4];
};

46
thirdparty/vulkan/loader/vk_loader_layer.h vendored Executable file
View File

@ -0,0 +1,46 @@
/*
*
* Copyright (c) 2016 The Khronos Group Inc.
* Copyright (c) 2016 Valve Corporation
* Copyright (c) 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>
*
*/
#pragma once
// Linked list node for tree of debug callbacks
typedef struct VkDebugReportContent {
VkDebugReportCallbackEXT msgCallback;
PFN_vkDebugReportCallbackEXT pfnMsgCallback;
VkFlags msgFlags;
} VkDebugReportContent;
typedef struct VkDebugUtilsMessengerContent {
VkDebugUtilsMessengerEXT messenger;
VkDebugUtilsMessageSeverityFlagsEXT messageSeverity;
VkDebugUtilsMessageTypeFlagsEXT messageType;
PFN_vkDebugUtilsMessengerCallbackEXT pfnUserCallback;
} VkDebugUtilsMessengerContent;
typedef struct VkLayerDbgFunctionNode_ {
bool is_messenger;
union {
VkDebugReportContent report;
VkDebugUtilsMessengerContent messenger;
};
void *pUserData;
struct VkLayerDbgFunctionNode_ *pNext;
} VkLayerDbgFunctionNode;

Some files were not shown because too many files have changed in this diff Show More