Merge pull request #29993 from bruvzg/vulkan
Initial Vulkan support for macOS (MoltenVK) and Windows
This commit is contained in:
commit
6289e7d147
70
.travis.yml
70
.travis.yml
|
@ -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
|
||||
|
|
119
COPYRIGHT.txt
119
COPYRIGHT.txt
|
@ -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
|
||||
----------------------------
|
||||
|
|
|
@ -111,6 +111,7 @@ 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(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 +155,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))
|
||||
|
|
|
@ -106,6 +106,7 @@ public:
|
|||
enum VideoDriver {
|
||||
VIDEO_DRIVER_GLES3,
|
||||
VIDEO_DRIVER_GLES2,
|
||||
VIDEO_DRIVER_VULKAN,
|
||||
};
|
||||
|
||||
enum PowerState {
|
||||
|
|
|
@ -691,9 +691,9 @@ const char *OS::get_video_driver_name(int p_driver) const {
|
|||
switch (p_driver) {
|
||||
case VIDEO_DRIVER_GLES2:
|
||||
return "GLES2";
|
||||
case VIDEO_DRIVER_GLES3:
|
||||
case VIDEO_DRIVER_VULKAN:
|
||||
default:
|
||||
return "GLES3";
|
||||
return "Vulkan";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -181,7 +181,7 @@ public:
|
|||
virtual void get_fullscreen_mode_list(List<VideoMode> *p_list, int p_screen = 0) const = 0;
|
||||
|
||||
enum VideoDriver {
|
||||
VIDEO_DRIVER_GLES3,
|
||||
VIDEO_DRIVER_VULKAN,
|
||||
VIDEO_DRIVER_GLES2,
|
||||
VIDEO_DRIVER_MAX,
|
||||
};
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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"
|
||||
|
@ -4875,7 +4905,9 @@ RenderingDevice::DrawListID RenderingDeviceVulkan::draw_list_begin_for_screen(in
|
|||
VkCommandBuffer command_buffer = frames[frame].draw_command_buffer;
|
||||
draw_list = memnew(DrawList);
|
||||
draw_list->command_buffer = command_buffer;
|
||||
#ifdef DEBUG_ENABLED
|
||||
draw_list->validation.framebuffer_format = screen_get_framebuffer_format();
|
||||
#endif
|
||||
draw_list_count = 0;
|
||||
draw_list_split = false;
|
||||
|
||||
|
@ -5071,7 +5103,9 @@ RenderingDevice::DrawListID RenderingDeviceVulkan::draw_list_begin(RID p_framebu
|
|||
|
||||
draw_list = memnew(DrawList);
|
||||
draw_list->command_buffer = command_buffer;
|
||||
#ifdef DEBUG_ENABLED
|
||||
draw_list->validation.framebuffer_format = framebuffer->format_id;
|
||||
#endif
|
||||
draw_list_count = 0;
|
||||
draw_list_split = false;
|
||||
|
||||
|
@ -5216,7 +5250,9 @@ Error RenderingDeviceVulkan::draw_list_begin_split(RID p_framebuffer, uint32_t p
|
|||
}
|
||||
|
||||
draw_list[i].command_buffer = command_buffer;
|
||||
#ifdef DEBUG_ENABLED
|
||||
draw_list[i].validation.framebuffer_format = framebuffer->format_id;
|
||||
#endif
|
||||
|
||||
VkViewport viewport;
|
||||
viewport.x = viewport_offset.x;
|
||||
|
@ -5400,9 +5436,9 @@ void RenderingDeviceVulkan::draw_list_bind_vertex_array(DrawListID p_list, RID p
|
|||
|
||||
#ifdef DEBUG_ENABLED
|
||||
dl->validation.vertex_format = vertex_array->description;
|
||||
dl->validation.vertex_array_size = vertex_array->vertex_count;
|
||||
dl->validation.vertex_max_instances_allowed = vertex_array->max_instances_allowed;
|
||||
#endif
|
||||
dl->validation.vertex_array_size = vertex_array->vertex_count;
|
||||
vkCmdBindVertexBuffers(dl->command_buffer, 0, vertex_array->buffers.size(), vertex_array->buffers.ptr(), vertex_array->offsets.ptr());
|
||||
}
|
||||
void RenderingDeviceVulkan::draw_list_bind_index_array(DrawListID p_list, RID p_index_array) {
|
||||
|
@ -5422,10 +5458,11 @@ void RenderingDeviceVulkan::draw_list_bind_index_array(DrawListID p_list, RID p_
|
|||
|
||||
dl->state.index_array = p_index_array;
|
||||
#ifdef DEBUG_ENABLED
|
||||
dl->validation.index_array_size = index_array->indices;
|
||||
dl->validation.index_array_max_index = index_array->max_index;
|
||||
dl->validation.index_array_offset = index_array->offset;
|
||||
#endif
|
||||
dl->validation.index_array_size = index_array->indices;
|
||||
dl->validation.index_array_offset = index_array->offset;
|
||||
|
||||
vkCmdBindIndexBuffer(dl->command_buffer, index_array->buffer, index_array->offset, index_array->index_type);
|
||||
}
|
||||
|
||||
|
@ -5433,7 +5470,9 @@ void RenderingDeviceVulkan::draw_list_set_line_width(DrawListID p_list, float p_
|
|||
|
||||
DrawList *dl = _get_draw_list_ptr(p_list);
|
||||
ERR_FAIL_COND(!dl);
|
||||
#ifdef DEBUG_ENABLED
|
||||
ERR_FAIL_COND_MSG(!dl->validation.active, "Submitted Draw Lists can no longer be modified.");
|
||||
#endif
|
||||
|
||||
vkCmdSetLineWidth(dl->command_buffer, p_width);
|
||||
}
|
||||
|
@ -5451,7 +5490,9 @@ void RenderingDeviceVulkan::draw_list_set_push_constant(DrawListID p_list, void
|
|||
"This render pipeline requires (" + itos(dl->validation.pipeline_push_constant_size) + ") bytes of push constant data, supplied: (" + itos(p_data_size) + ")");
|
||||
#endif
|
||||
vkCmdPushConstants(dl->command_buffer, dl->state.pipeline_layout, dl->state.pipeline_push_constant_stages, 0, p_data_size, p_data);
|
||||
#ifdef DEBUG_ENABLED
|
||||
dl->validation.pipeline_push_constant_suppplied = true;
|
||||
#endif
|
||||
}
|
||||
|
||||
void RenderingDeviceVulkan::draw_list_draw(DrawListID p_list, bool p_use_indices, uint32_t p_instances) {
|
||||
|
|
|
@ -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
|
||||
|
||||
|
@ -737,6 +767,17 @@ class RenderingDeviceVulkan : public RenderingDevice {
|
|||
pipeline_push_constant_suppplied = false;
|
||||
}
|
||||
} validation;
|
||||
#else
|
||||
struct Validation {
|
||||
uint32_t vertex_array_size; //0 if not set
|
||||
uint32_t index_array_size; //0 if index buffer not set
|
||||
uint32_t index_array_offset;
|
||||
|
||||
Validation() {
|
||||
vertex_array_size = 0;
|
||||
index_array_size = 0; //not sent
|
||||
}
|
||||
} validation;
|
||||
|
||||
#endif
|
||||
};
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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 = ®ion,
|
||||
/*sType*/ VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR,
|
||||
/*pNext*/ present.pNext,
|
||||
/*swapchainCount*/ present.swapchainCount,
|
||||
/*pRegions*/ ®ion,
|
||||
};
|
||||
present.pNext = ®ions;
|
||||
}
|
||||
|
@ -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() {
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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])
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -990,8 +990,8 @@ 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"));
|
||||
GLOBAL_DEF("rendering/quality/driver/driver_name", "Vulkan");
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("rendering/quality/driver/driver_name", PropertyInfo(Variant::STRING, "rendering/quality/driver/driver_name", PROPERTY_HINT_ENUM, "Vulkan,GLES2"));
|
||||
if (video_driver == "") {
|
||||
video_driver = GLOBAL_GET("rendering/quality/driver/driver_name");
|
||||
}
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"file_format_version" : "1.0.0",
|
||||
"ICD": {
|
||||
"library_path": "../../../Frameworks/libMoltenVK.dylib",
|
||||
"api_version" : "1.0.0"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"file_format_version" : "1.0.0",
|
||||
"ICD": {
|
||||
"library_path": "../../../Frameworks/libMoltenVK.dylib",
|
||||
"api_version" : "1.0.0"
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
|
|
|
@ -9,52 +9,52 @@ 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"):
|
||||
thirdparty_sources.append("glslang/OSDependent/Windows/ossource.cpp")
|
||||
thirdparty_sources.append("glslang/OSDependent/Windows/ossource.cpp")
|
||||
else:
|
||||
thirdparty_sources.append("glslang/OSDependent/Unix/ossource.cpp")
|
||||
thirdparty_sources.append("glslang/OSDependent/Unix/ossource.cpp")
|
||||
|
||||
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
|
||||
|
||||
|
@ -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])
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -13,6 +13,8 @@ files = [
|
|||
'dir_access_osx.mm',
|
||||
'joypad_osx.cpp',
|
||||
'power_osx.cpp',
|
||||
'vulkan_context_osx.mm',
|
||||
'context_gl_osx.mm'
|
||||
]
|
||||
|
||||
prog = env.add_program('#bin/godot', files)
|
||||
|
|
|
@ -0,0 +1,79 @@
|
|||
/*************************************************************************/
|
||||
/* context_gl_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 CONTEXT_GL_OSX_H
|
||||
#define CONTEXT_GL_OSX_H
|
||||
|
||||
#if defined(OPENGL_ENABLED) || defined(GLES_ENABLED)
|
||||
|
||||
#include "core/error_list.h"
|
||||
#include "core/os/os.h"
|
||||
|
||||
#include <AppKit/AppKit.h>
|
||||
#include <ApplicationServices/ApplicationServices.h>
|
||||
#include <CoreVideo/CoreVideo.h>
|
||||
|
||||
class ContextGL_OSX {
|
||||
|
||||
bool opengl_3_context;
|
||||
bool use_vsync;
|
||||
|
||||
void *framework;
|
||||
id window_view;
|
||||
NSOpenGLPixelFormat *pixelFormat;
|
||||
NSOpenGLContext *context;
|
||||
|
||||
public:
|
||||
bool waiting_for_vsync;
|
||||
NSCondition *vsync_condition;
|
||||
CVDisplayLinkRef displayLink;
|
||||
|
||||
void release_current();
|
||||
|
||||
void make_current();
|
||||
void update();
|
||||
|
||||
void set_opacity(GLint p_opacity);
|
||||
|
||||
int get_window_width();
|
||||
int get_window_height();
|
||||
void swap_buffers();
|
||||
|
||||
Error initialize();
|
||||
|
||||
void set_use_vsync(bool p_use);
|
||||
bool is_using_vsync() const;
|
||||
|
||||
ContextGL_OSX(id p_view, bool p_opengl_3_context);
|
||||
~ContextGL_OSX();
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
|
@ -0,0 +1,216 @@
|
|||
/*************************************************************************/
|
||||
/* context_gl_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 "context_gl_osx.h"
|
||||
|
||||
#if defined(OPENGL_ENABLED) || defined(GLES_ENABLED)
|
||||
|
||||
// DisplayLinkCallback is called from our DisplayLink OS thread informing us right before
|
||||
// a screen update is required. We can use it to work around the broken vsync.
|
||||
static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeStamp *now, const CVTimeStamp *outputTime, CVOptionFlags flagsIn, CVOptionFlags *flagsOut, void *displayLinkContext) {
|
||||
ContextGL_OSX *gl_ctx = (ContextGL_OSX *)displayLinkContext;
|
||||
|
||||
// Set flag so we know we can output our next frame and signal our conditional lock
|
||||
// if we're not doing vsync this will be ignored
|
||||
[gl_ctx->vsync_condition lock];
|
||||
gl_ctx->waiting_for_vsync = false;
|
||||
[gl_ctx->vsync_condition signal];
|
||||
[gl_ctx->vsync_condition unlock];
|
||||
|
||||
return kCVReturnSuccess;
|
||||
}
|
||||
|
||||
void ContextGL_OSX::release_current() {
|
||||
|
||||
[NSOpenGLContext clearCurrentContext];
|
||||
}
|
||||
|
||||
void ContextGL_OSX::make_current() {
|
||||
|
||||
[context makeCurrentContext];
|
||||
}
|
||||
|
||||
void ContextGL_OSX::update() {
|
||||
|
||||
[context update];
|
||||
}
|
||||
|
||||
void ContextGL_OSX::set_opacity(GLint p_opacity) {
|
||||
|
||||
[context setValues:&p_opacity forParameter:NSOpenGLCPSurfaceOpacity];
|
||||
}
|
||||
|
||||
int ContextGL_OSX::get_window_width() {
|
||||
|
||||
return OS::get_singleton()->get_video_mode().width;
|
||||
}
|
||||
|
||||
int ContextGL_OSX::get_window_height() {
|
||||
|
||||
return OS::get_singleton()->get_video_mode().height;
|
||||
}
|
||||
|
||||
void ContextGL_OSX::swap_buffers() {
|
||||
|
||||
if (use_vsync) {
|
||||
// Wait until our DisplayLink callback unsets our flag...
|
||||
[vsync_condition lock];
|
||||
while (waiting_for_vsync)
|
||||
[vsync_condition wait];
|
||||
|
||||
// Make sure we wait again next frame around
|
||||
waiting_for_vsync = true;
|
||||
|
||||
[vsync_condition unlock];
|
||||
}
|
||||
|
||||
[context flushBuffer];
|
||||
}
|
||||
|
||||
void ContextGL_OSX::set_use_vsync(bool p_use) {
|
||||
// CGLCPSwapInterval broke in OSX 10.14 and it seems Apple is not interested in fixing
|
||||
// it as OpenGL is now deprecated and Metal solves this differently.
|
||||
// Following SDLs example we're working around this using DisplayLink
|
||||
// When vsync is enabled we set a flag "waiting_for_vsync" to true.
|
||||
// This flag is set to false when DisplayLink informs us our display is about to refresh.
|
||||
|
||||
///TODO Maybe pause/unpause display link?
|
||||
use_vsync = p_use;
|
||||
waiting_for_vsync = p_use;
|
||||
}
|
||||
|
||||
bool ContextGL_OSX::is_using_vsync() const {
|
||||
|
||||
return use_vsync;
|
||||
}
|
||||
|
||||
Error ContextGL_OSX::initialize() {
|
||||
|
||||
framework = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.opengl"));
|
||||
ERR_FAIL_COND_V(!framework, ERR_CANT_CREATE);
|
||||
|
||||
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) \
|
||||
{ \
|
||||
ADD_ATTR(x); \
|
||||
ADD_ATTR(y); \
|
||||
}
|
||||
|
||||
// Arbitrary array size here
|
||||
NSOpenGLPixelFormatAttribute attributes[40];
|
||||
|
||||
ADD_ATTR(NSOpenGLPFADoubleBuffer);
|
||||
ADD_ATTR(NSOpenGLPFAClosestPolicy);
|
||||
|
||||
if (!opengl_3_context) {
|
||||
ADD_ATTR2(NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersionLegacy);
|
||||
} else {
|
||||
//we now need OpenGL 3 or better, maybe even change this to 3_3Core ?
|
||||
ADD_ATTR2(NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core);
|
||||
}
|
||||
|
||||
ADD_ATTR2(NSOpenGLPFAColorSize, colorBits);
|
||||
|
||||
/*
|
||||
if (fbconfig->alphaBits > 0)
|
||||
ADD_ATTR2(NSOpenGLPFAAlphaSize, fbconfig->alphaBits);
|
||||
*/
|
||||
|
||||
ADD_ATTR2(NSOpenGLPFADepthSize, 24);
|
||||
|
||||
ADD_ATTR2(NSOpenGLPFAStencilSize, 8);
|
||||
|
||||
/*
|
||||
if (fbconfig->stereo)
|
||||
ADD_ATTR(NSOpenGLPFAStereo);
|
||||
*/
|
||||
|
||||
/*
|
||||
if (fbconfig->samples > 0) {
|
||||
ADD_ATTR2(NSOpenGLPFASampleBuffers, 1);
|
||||
ADD_ATTR2(NSOpenGLPFASamples, fbconfig->samples);
|
||||
}
|
||||
*/
|
||||
|
||||
// NOTE: All NSOpenGLPixelFormats on the relevant cards support sRGB
|
||||
// framebuffer, so there's no need (and no way) to request it
|
||||
|
||||
ADD_ATTR(0);
|
||||
|
||||
#undef ADD_ATTR
|
||||
#undef ADD_ATTR2
|
||||
|
||||
pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:attributes];
|
||||
ERR_FAIL_COND_V(pixelFormat == nil, ERR_CANT_CREATE);
|
||||
|
||||
context = [[NSOpenGLContext alloc] initWithFormat:pixelFormat shareContext:nil];
|
||||
|
||||
ERR_FAIL_COND_V(context == nil, ERR_CANT_CREATE);
|
||||
|
||||
[context setView:window_view];
|
||||
|
||||
[context makeCurrentContext];
|
||||
|
||||
// setup our display link, this will inform us when a refresh is needed
|
||||
CVDisplayLinkCreateWithActiveCGDisplays(&displayLink);
|
||||
CVDisplayLinkSetOutputCallback(displayLink, &DisplayLinkCallback, this);
|
||||
CVDisplayLinkSetCurrentCGDisplayFromOpenGLContext(displayLink, context.CGLContextObj, pixelFormat.CGLPixelFormatObj);
|
||||
CVDisplayLinkStart(displayLink);
|
||||
|
||||
// initialise a conditional lock object
|
||||
vsync_condition = [[NSCondition alloc] init];
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
ContextGL_OSX::ContextGL_OSX(id p_view, bool p_opengl_3_context) {
|
||||
|
||||
opengl_3_context = p_opengl_3_context;
|
||||
window_view = p_view;
|
||||
use_vsync = false;
|
||||
}
|
||||
|
||||
ContextGL_OSX::~ContextGL_OSX() {
|
||||
|
||||
if (displayLink) {
|
||||
CVDisplayLinkRelease(displayLink);
|
||||
}
|
||||
[vsync_condition release];
|
||||
}
|
||||
|
||||
#endif
|
|
@ -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,20 @@ 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'])
|
||||
|
||||
env.Append(CCFLAGS=['-mmacosx-version-min=10.9'])
|
||||
env.Append(LINKFLAGS=['-mmacosx-version-min=10.9'])
|
||||
env.Prepend(CPPPATH=['#thirdparty/vulkan/include/', "#thirdparty/vulkan/registry/"])
|
||||
env.Append(CPPDEFINES=['VULKAN_ENABLED'])
|
||||
|
||||
#env.Append(CPPDEFINES=['GLES_ENABLED', 'OPENGL_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'])
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -46,6 +46,15 @@
|
|||
#include "servers/visual/visual_server_wrap_mt.h"
|
||||
#include "servers/visual_server.h"
|
||||
|
||||
#if defined(OPENGL_ENABLED)
|
||||
#include "context_gl_osx.h"
|
||||
#endif
|
||||
|
||||
#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 +102,6 @@ public:
|
|||
void process_events();
|
||||
void process_key_events();
|
||||
|
||||
void *framework;
|
||||
// pthread_key_t current;
|
||||
bool mouse_grab;
|
||||
Point2 mouse_pos;
|
||||
|
@ -104,8 +112,15 @@ public:
|
|||
id window_view;
|
||||
id autoreleasePool;
|
||||
id cursor;
|
||||
NSOpenGLPixelFormat *pixelFormat;
|
||||
NSOpenGLContext *context;
|
||||
|
||||
#if defined(OPENGL_ENABLED)
|
||||
ContextGL_OSX *context_gles2;
|
||||
#endif
|
||||
|
||||
#if defined(VULKAN_ENABLED)
|
||||
VulkanContextOSX *context_vulkan;
|
||||
RenderingDeviceVulkan *rendering_device_vulkan;
|
||||
#endif
|
||||
|
||||
bool layered_window;
|
||||
|
||||
|
|
|
@ -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_rd/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>
|
||||
|
@ -260,29 +271,6 @@ static NSCursor *cursorFromSelector(SEL selector, SEL fallback = nil) {
|
|||
return NSTerminateCancel;
|
||||
}
|
||||
|
||||
- (void)applicationDidHide:(NSNotification *)notification {
|
||||
/*
|
||||
_Godotwindow* window;
|
||||
for (window = _Godot.windowListHead; window; window = window->next)
|
||||
_GodotInputWindowVisibility(window, GL_FALSE);
|
||||
*/
|
||||
}
|
||||
|
||||
- (void)applicationDidUnhide:(NSNotification *)notification {
|
||||
/*
|
||||
_Godotwindow* window;
|
||||
|
||||
for (window = _Godot.windowListHead; window; window = window->next) {
|
||||
if ([window_object isVisible])
|
||||
_GodotInputWindowVisibility(window, GL_TRUE);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
- (void)applicationDidChangeScreenParameters:(NSNotification *)notification {
|
||||
//_GodotInputMonitorChange();
|
||||
}
|
||||
|
||||
- (void)showAbout:(id)sender {
|
||||
if (OS_OSX::singleton->get_main_loop())
|
||||
OS_OSX::singleton->get_main_loop()->notification(MainLoop::NOTIFICATION_WM_ABOUT);
|
||||
|
@ -336,11 +324,16 @@ 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 (OS_OSX::singleton->is_hidpi_allowed()) {
|
||||
[OS_OSX::singleton->window_view setWantsBestResolutionOpenGLSurface:YES];
|
||||
} else {
|
||||
[OS_OSX::singleton->window_view setWantsBestResolutionOpenGLSurface:NO];
|
||||
|
||||
#if defined(OPENGL_ENABLED)
|
||||
if (OS_OSX::singleton->video_driver_index == OS::VIDEO_DRIVER_GLES2) {
|
||||
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,8 +354,12 @@ static NSCursor *cursorFromSelector(SEL selector, SEL fallback = nil) {
|
|||
}
|
||||
|
||||
- (void)windowDidResize:(NSNotification *)notification {
|
||||
[OS_OSX::singleton->context update];
|
||||
|
||||
#if defined(OPENGL_ENABLED)
|
||||
if (OS_OSX::singleton->video_driver_index == OS::VIDEO_DRIVER_GLES2) {
|
||||
OS_OSX::singleton->context_gles2->update();
|
||||
}
|
||||
#endif
|
||||
const NSRect contentRect = [OS_OSX::singleton->window_view frame];
|
||||
const NSRect fbRect = contentRect;
|
||||
|
||||
|
@ -370,6 +367,14 @@ 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)
|
||||
if (OS_OSX::singleton->video_driver_index == OS::VIDEO_DRIVER_VULKAN) {
|
||||
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.
|
||||
|
@ -377,15 +382,6 @@ static NSCursor *cursorFromSelector(SEL selector, SEL fallback = nil) {
|
|||
Main::iteration();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
_GodotInputFramebufferSize(window, fbRect.size.width, fbRect.size.height);
|
||||
_GodotInputWindowSize(window, contentRect.size.width, contentRect.size.height);
|
||||
_GodotInputWindowDamage(window);
|
||||
|
||||
if (window->cursorMode == Godot_CURSOR_DISABLED)
|
||||
centerCursor(window);
|
||||
*/
|
||||
}
|
||||
|
||||
- (void)windowDidMove:(NSNotification *)notification {
|
||||
|
@ -393,17 +389,6 @@ static NSCursor *cursorFromSelector(SEL selector, SEL fallback = nil) {
|
|||
if (OS_OSX::singleton->get_main_loop()) {
|
||||
OS_OSX::singleton->input->release_pressed_events();
|
||||
}
|
||||
|
||||
/*
|
||||
[window->nsgl.context update];
|
||||
|
||||
int x, y;
|
||||
_GodotPlatformGetWindowPos(window, &x, &y);
|
||||
_GodotInputWindowPos(window, x, y);
|
||||
|
||||
if (window->cursorMode == Godot_CURSOR_DISABLED)
|
||||
centerCursor(window);
|
||||
*/
|
||||
}
|
||||
|
||||
- (void)windowDidBecomeKey:(NSNotification *)notification {
|
||||
|
@ -450,8 +435,12 @@ static NSCursor *cursorFromSelector(SEL selector, SEL fallback = nil) {
|
|||
bool imeInputEventInProgress;
|
||||
}
|
||||
- (void)cancelComposition;
|
||||
|
||||
- (CALayer*)makeBackingLayer;
|
||||
|
||||
- (BOOL)wantsUpdateLayer;
|
||||
- (void)updateLayer;
|
||||
|
||||
@end
|
||||
|
||||
@implementation GodotContentView
|
||||
|
@ -462,12 +451,32 @@ static NSCursor *cursorFromSelector(SEL selector, SEL fallback = nil) {
|
|||
}
|
||||
}
|
||||
|
||||
- (BOOL)wantsUpdateLayer {
|
||||
return YES;
|
||||
- (CALayer*)makeBackingLayer {
|
||||
#if defined(VULKAN_ENABLED)
|
||||
if (OS_OSX::singleton->video_driver_index == OS::VIDEO_DRIVER_VULKAN) {
|
||||
CALayer* layer = [[CAMetalLayer class] layer];
|
||||
layer.contentsScale = OS_OSX::singleton->_display_scale();
|
||||
return layer;
|
||||
}
|
||||
#endif
|
||||
return [super makeBackingLayer];
|
||||
}
|
||||
|
||||
- (void)updateLayer {
|
||||
[OS_OSX::singleton->context update];
|
||||
#if defined(VULKAN_ENABLED)
|
||||
if (OS_OSX::singleton->video_driver_index == OS::VIDEO_DRIVER_VULKAN) {
|
||||
[super updateLayer];
|
||||
}
|
||||
#endif
|
||||
#if defined(OPENGL_ENABLED)
|
||||
if (OS_OSX::singleton->video_driver_index == OS::VIDEO_DRIVER_GLES2) {
|
||||
OS_OSX::singleton->context_gles2->update();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
- (BOOL)wantsUpdateLayer {
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (id)init {
|
||||
|
@ -1458,6 +1467,14 @@ Error OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
|
|||
// Register to be notified on displays arrangement changes
|
||||
CGDisplayRegisterReconfigurationCallback(displays_arrangement_changed, NULL);
|
||||
|
||||
//!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
//TODO - do Vulkan and GLES2 support checks, driver selection and fallback
|
||||
video_driver_index = p_video_driver;
|
||||
print_verbose("Driver: " + String(get_video_driver_name(video_driver_index)) + " [" + itos(video_driver_index) + "]");
|
||||
//!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
//Create window
|
||||
|
||||
window_delegate = [[GodotWindowDelegate alloc] init];
|
||||
|
||||
// Don't use accumulation buffer support; it's not accelerated
|
||||
|
@ -1498,14 +1515,16 @@ 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) {
|
||||
[window_view setWantsBestResolutionOpenGLSurface:YES];
|
||||
//if (current_videomode.resizable)
|
||||
#if defined(OPENGL_ENABLED)
|
||||
if (video_driver_index == VIDEO_DRIVER_GLES2) {
|
||||
[window_view setWantsBestResolutionOpenGLSurface:YES];
|
||||
}
|
||||
#endif
|
||||
[window_object setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
|
||||
} else {
|
||||
[window_view setWantsBestResolutionOpenGLSurface:NO];
|
||||
}
|
||||
|
||||
//[window_object setTitle:[NSString stringWithUTF8String:"GodotEnginies"]];
|
||||
[window_object setContentView:window_view];
|
||||
[window_object setDelegate:window_delegate];
|
||||
[window_object setAcceptsMouseMovedEvents:YES];
|
||||
|
@ -1513,77 +1532,51 @@ Error OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
|
|||
|
||||
[window_object setRestorable:NO];
|
||||
|
||||
unsigned int attributeCount = 0;
|
||||
// Init context and rendering device
|
||||
#if defined(OPENGL_ENABLED)
|
||||
if (video_driver_index == VIDEO_DRIVER_GLES2) {
|
||||
|
||||
// OS X needs non-zero color size, so set reasonable values
|
||||
int colorBits = 32;
|
||||
context_gles2 = memnew(ContextGL_OSX(window_view, false));
|
||||
|
||||
// Fail if a robustness strategy was requested
|
||||
if (context_gles2->initialize() != OK) {
|
||||
memdelete(context_gles2);
|
||||
context_gles2 = NULL;
|
||||
ERR_FAIL_V(ERR_UNAVAILABLE);
|
||||
}
|
||||
|
||||
#define ADD_ATTR(x) \
|
||||
{ attributes[attributeCount++] = x; }
|
||||
#define ADD_ATTR2(x, y) \
|
||||
{ \
|
||||
ADD_ATTR(x); \
|
||||
ADD_ATTR(y); \
|
||||
context_gles2->set_use_vsync(p_desired.use_vsync);
|
||||
|
||||
if (RasterizerGLES2::is_viable() == OK) {
|
||||
RasterizerGLES2::register_config();
|
||||
RasterizerGLES2::make_current();
|
||||
} else {
|
||||
memdelete(context_gles2);
|
||||
context_gles2 = NULL;
|
||||
ERR_FAIL_V(ERR_UNAVAILABLE);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if defined(VULKAN_ENABLED)
|
||||
if (video_driver_index == VIDEO_DRIVER_VULKAN) {
|
||||
|
||||
// Arbitrary array size here
|
||||
NSOpenGLPixelFormatAttribute attributes[40];
|
||||
context_vulkan = memnew(VulkanContextOSX);
|
||||
if (context_vulkan->initialize() != OK) {
|
||||
memdelete(context_vulkan);
|
||||
context_vulkan = NULL;
|
||||
ERR_FAIL_V(ERR_UNAVAILABLE);
|
||||
}
|
||||
if (context_vulkan->window_create(window_view, get_video_mode().width, get_video_mode().height) == -1) {
|
||||
memdelete(context_vulkan);
|
||||
context_vulkan = NULL;
|
||||
ERR_FAIL_V(ERR_UNAVAILABLE);
|
||||
}
|
||||
|
||||
ADD_ATTR(NSOpenGLPFADoubleBuffer);
|
||||
ADD_ATTR(NSOpenGLPFAClosestPolicy);
|
||||
rendering_device_vulkan = memnew(RenderingDeviceVulkan);
|
||||
rendering_device_vulkan->initialize(context_vulkan);
|
||||
|
||||
if (p_video_driver == VIDEO_DRIVER_GLES2) {
|
||||
ADD_ATTR2(NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersionLegacy);
|
||||
} else {
|
||||
//we now need OpenGL 3 or better, maybe even change this to 3_3Core ?
|
||||
ADD_ATTR2(NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core);
|
||||
RasterizerRD::make_current();
|
||||
}
|
||||
|
||||
ADD_ATTR2(NSOpenGLPFAColorSize, colorBits);
|
||||
|
||||
/*
|
||||
if (fbconfig->alphaBits > 0)
|
||||
ADD_ATTR2(NSOpenGLPFAAlphaSize, fbconfig->alphaBits);
|
||||
*/
|
||||
|
||||
ADD_ATTR2(NSOpenGLPFADepthSize, 24);
|
||||
|
||||
ADD_ATTR2(NSOpenGLPFAStencilSize, 8);
|
||||
|
||||
/*
|
||||
if (fbconfig->stereo)
|
||||
ADD_ATTR(NSOpenGLPFAStereo);
|
||||
*/
|
||||
|
||||
/*
|
||||
if (fbconfig->samples > 0) {
|
||||
ADD_ATTR2(NSOpenGLPFASampleBuffers, 1);
|
||||
ADD_ATTR2(NSOpenGLPFASamples, fbconfig->samples);
|
||||
}
|
||||
*/
|
||||
|
||||
// NOTE: All NSOpenGLPixelFormats on the relevant cards support sRGB
|
||||
// framebuffer, so there's no need (and no way) to request it
|
||||
|
||||
ADD_ATTR(0);
|
||||
|
||||
#undef ADD_ATTR
|
||||
#undef ADD_ATTR2
|
||||
|
||||
pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:attributes];
|
||||
ERR_FAIL_COND_V(pixelFormat == nil, ERR_UNAVAILABLE);
|
||||
|
||||
context = [[NSOpenGLContext alloc] initWithFormat:pixelFormat shareContext:nil];
|
||||
|
||||
ERR_FAIL_COND_V(context == nil, ERR_UNAVAILABLE);
|
||||
|
||||
[context setView:window_view];
|
||||
|
||||
[context makeCurrentContext];
|
||||
|
||||
set_use_vsync(p_desired.use_vsync);
|
||||
#endif
|
||||
|
||||
[NSApp activateIgnoringOtherApps:YES];
|
||||
|
||||
|
@ -1594,53 +1587,6 @@ Error OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
|
|||
if (p_desired.fullscreen)
|
||||
zoomed = true;
|
||||
|
||||
/*** END OSX INITIALIZATION ***/
|
||||
|
||||
bool gles3 = true;
|
||||
if (p_video_driver == VIDEO_DRIVER_GLES2) {
|
||||
gles3 = false;
|
||||
}
|
||||
|
||||
bool editor = Engine::get_singleton()->is_editor_hint();
|
||||
bool gl_initialization_error = false;
|
||||
|
||||
while (true) {
|
||||
if (gles3) {
|
||||
if (RasterizerGLES3::is_viable() == OK) {
|
||||
RasterizerGLES3::register_config();
|
||||
RasterizerGLES3::make_current();
|
||||
break;
|
||||
} else {
|
||||
if (GLOBAL_GET("rendering/quality/driver/fallback_to_gles2") || editor) {
|
||||
p_video_driver = VIDEO_DRIVER_GLES2;
|
||||
gles3 = false;
|
||||
continue;
|
||||
} else {
|
||||
gl_initialization_error = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (RasterizerGLES2::is_viable() == OK) {
|
||||
RasterizerGLES2::register_config();
|
||||
RasterizerGLES2::make_current();
|
||||
break;
|
||||
} else {
|
||||
gl_initialization_error = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (gl_initialization_error) {
|
||||
OS::get_singleton()->alert("Your video card driver does not support any of the supported OpenGL versions.\n"
|
||||
"Please update your drivers or if you have a very old or integrated GPU upgrade it.",
|
||||
"Unable to initialize Video driver");
|
||||
return ERR_UNAVAILABLE;
|
||||
}
|
||||
|
||||
video_driver_index = p_video_driver;
|
||||
|
||||
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));
|
||||
|
@ -1673,6 +1619,27 @@ void OS_OSX::finalize() {
|
|||
midi_driver.close();
|
||||
#endif
|
||||
|
||||
#if defined(OPENGL_ENABLED)
|
||||
if (video_driver_index == VIDEO_DRIVER_GLES2) {
|
||||
|
||||
if (context_gles2)
|
||||
memdelete(context_gles2);
|
||||
}
|
||||
#endif
|
||||
#if defined(VULKAN_ENABLED)
|
||||
if (video_driver_index == VIDEO_DRIVER_VULKAN) {
|
||||
|
||||
if (rendering_device_vulkan) {
|
||||
rendering_device_vulkan->finalize();
|
||||
memdelete(rendering_device_vulkan);
|
||||
}
|
||||
|
||||
if (context_vulkan)
|
||||
memdelete(context_vulkan);
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
CFNotificationCenterRemoveObserver(CFNotificationCenterGetDistributedCenter(), NULL, kTISNotifySelectedKeyboardInputSourceChanged, NULL);
|
||||
CGDisplayRemoveReconfigurationCallback(displays_arrangement_changed, NULL);
|
||||
|
||||
|
@ -1684,7 +1651,6 @@ void OS_OSX::finalize() {
|
|||
cursors_cache.clear();
|
||||
visual_server->finish();
|
||||
memdelete(visual_server);
|
||||
//memdelete(rasterizer);
|
||||
}
|
||||
|
||||
void OS_OSX::set_main_loop(MainLoop *p_main_loop) {
|
||||
|
@ -1916,7 +1882,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 +1936,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 +2194,19 @@ String OS_OSX::get_clipboard() const {
|
|||
}
|
||||
|
||||
void OS_OSX::release_rendering_thread() {
|
||||
|
||||
[NSOpenGLContext clearCurrentContext];
|
||||
#if defined(OPENGL_ENABLED)
|
||||
if (video_driver_index == VIDEO_DRIVER_GLES2) {
|
||||
context_gles2->release_current();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void OS_OSX::make_rendering_thread() {
|
||||
|
||||
[context makeCurrentContext];
|
||||
#if defined(OPENGL_ENABLED)
|
||||
if (video_driver_index == VIDEO_DRIVER_GLES2) {
|
||||
context_gles2->make_current();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Error OS_OSX::shell_open(String p_uri) {
|
||||
|
@ -2249,7 +2221,16 @@ String OS_OSX::get_locale() const {
|
|||
}
|
||||
|
||||
void OS_OSX::swap_buffers() {
|
||||
[context flushBuffer];
|
||||
#if defined(OPENGL_ENABLED)
|
||||
if (video_driver_index == VIDEO_DRIVER_GLES2) {
|
||||
context_gles2->swap_buffers();
|
||||
}
|
||||
#endif
|
||||
#if defined(VULKAN_ENABLED)
|
||||
if (video_driver_index == VIDEO_DRIVER_VULKAN) {
|
||||
context_vulkan->swap_buffers();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void OS_OSX::wm_minimized(bool p_minimized) {
|
||||
|
@ -2659,21 +2640,31 @@ 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];
|
||||
[context setValues:&opacity forParameter:NSOpenGLCPSurfaceOpacity];
|
||||
#if defined(OPENGL_ENABLED)
|
||||
if (video_driver_index == VIDEO_DRIVER_GLES2) {
|
||||
context_gles2->set_opacity(0);
|
||||
}
|
||||
#endif
|
||||
layered_window = true;
|
||||
} else {
|
||||
GLint opacity = 1;
|
||||
[window_object setBackgroundColor:[NSColor colorWithCalibratedWhite:1 alpha:1]];
|
||||
[window_object setOpaque:YES];
|
||||
[window_object setHasShadow:YES];
|
||||
[context setValues:&opacity forParameter:NSOpenGLCPSurfaceOpacity];
|
||||
#if defined(OPENGL_ENABLED)
|
||||
if (video_driver_index == VIDEO_DRIVER_GLES2) {
|
||||
context_gles2->set_opacity(1);
|
||||
}
|
||||
#endif
|
||||
layered_window = false;
|
||||
}
|
||||
[context update];
|
||||
#if defined(OPENGL_ENABLED)
|
||||
if (video_driver_index == VIDEO_DRIVER_GLES2) {
|
||||
context_gles2->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];
|
||||
|
@ -2992,11 +2983,20 @@ Error OS_OSX::move_to_trash(const String &p_path) {
|
|||
}
|
||||
|
||||
void OS_OSX::_set_use_vsync(bool p_enable) {
|
||||
// FIXME: Commented out during rebase of vulkan branch on master.
|
||||
/*
|
||||
CGLContextObj ctx = CGLGetCurrentContext();
|
||||
if (ctx) {
|
||||
GLint swapInterval = p_enable ? 1 : 0;
|
||||
CGLSetParameter(ctx, kCGLCPSwapInterval, &swapInterval);
|
||||
}
|
||||
*/
|
||||
#if defined(OPENGL_ENABLED)
|
||||
if (video_driver_index == VIDEO_DRIVER_GLES2) {
|
||||
if (context_gles2)
|
||||
context_gles2->set_use_vsync(p_enable);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
OS_OSX *OS_OSX::singleton = NULL;
|
||||
|
@ -3018,16 +3018,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];
|
||||
|
||||
|
|
|
@ -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
|
|
@ -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() {
|
||||
}
|
|
@ -8,13 +8,14 @@ import platform_windows_builders
|
|||
|
||||
common_win = [
|
||||
"godot_windows.cpp",
|
||||
"context_gl_windows.cpp",
|
||||
"crash_handler_windows.cpp",
|
||||
"os_windows.cpp",
|
||||
"key_mapping_windows.cpp",
|
||||
"joypad_windows.cpp",
|
||||
"power_windows.cpp",
|
||||
"windows_terminal_logger.cpp"
|
||||
"windows_terminal_logger.cpp",
|
||||
"vulkan_context_win.cpp",
|
||||
"context_gl_windows.cpp"
|
||||
]
|
||||
|
||||
res_file = 'godot_res.rc'
|
||||
|
|
|
@ -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,21 @@ 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']
|
||||
|
||||
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']
|
||||
|
||||
#env.AppendUnique(CPPDEFINES = ['OPENGL_ENABLED'])
|
||||
LIBS += ['opengl32']
|
||||
|
||||
env.Append(LINKFLAGS=[p + env["LIBSUFFIX"] for p in LIBS])
|
||||
|
||||
if manual_msvc_config:
|
||||
|
@ -345,9 +356,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'])
|
||||
|
||||
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'])
|
||||
|
||||
## TODO !!! Reenable when OpenGLES Rendering Device is implemented !!!
|
||||
#env.Append(CPPDEFINES=['OPENGL_ENABLED'])
|
||||
env.Append(LIBS=['opengl32'])
|
||||
|
||||
env.Append(CPPDEFINES=['MINGW_ENABLED', ('MINGW_HAS_SECURE_API', 1)])
|
||||
|
||||
|
|
|
@ -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_rd/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,11 @@ 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)
|
||||
if (video_driver_index == VIDEO_DRIVER_VULKAN) {
|
||||
context_vulkan->window_resize(0, video_mode.width, video_mode.height);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (wParam == SIZE_MAXIMIZED) {
|
||||
|
@ -1416,78 +1428,59 @@ Error OS_Windows::initialize(const VideoMode &p_desired, int p_video_driver, int
|
|||
SetWindowPos(hWnd, video_mode.always_on_top ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
|
||||
}
|
||||
|
||||
#if defined(OPENGL_ENABLED)
|
||||
|
||||
bool gles3_context = true;
|
||||
if (p_video_driver == VIDEO_DRIVER_GLES2) {
|
||||
gles3_context = false;
|
||||
}
|
||||
|
||||
bool editor = Engine::get_singleton()->is_editor_hint();
|
||||
bool gl_initialization_error = false;
|
||||
|
||||
gl_context = NULL;
|
||||
while (!gl_context) {
|
||||
gl_context = memnew(ContextGL_Windows(hWnd, gles3_context));
|
||||
|
||||
if (gl_context->initialize() != OK) {
|
||||
memdelete(gl_context);
|
||||
gl_context = NULL;
|
||||
|
||||
if (GLOBAL_GET("rendering/quality/driver/fallback_to_gles2") || editor) {
|
||||
if (p_video_driver == VIDEO_DRIVER_GLES2) {
|
||||
gl_initialization_error = true;
|
||||
break;
|
||||
}
|
||||
|
||||
p_video_driver = VIDEO_DRIVER_GLES2;
|
||||
gles3_context = false;
|
||||
} else {
|
||||
gl_initialization_error = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
while (true) {
|
||||
if (gles3_context) {
|
||||
if (RasterizerGLES3::is_viable() == OK) {
|
||||
RasterizerGLES3::register_config();
|
||||
RasterizerGLES3::make_current();
|
||||
break;
|
||||
} else {
|
||||
if (GLOBAL_GET("rendering/quality/driver/fallback_to_gles2") || editor) {
|
||||
p_video_driver = VIDEO_DRIVER_GLES2;
|
||||
gles3_context = false;
|
||||
continue;
|
||||
} else {
|
||||
gl_initialization_error = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (RasterizerGLES2::is_viable() == OK) {
|
||||
RasterizerGLES2::register_config();
|
||||
RasterizerGLES2::make_current();
|
||||
break;
|
||||
} else {
|
||||
gl_initialization_error = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (gl_initialization_error) {
|
||||
OS::get_singleton()->alert("Your video card driver does not support any of the supported OpenGL versions.\n"
|
||||
"Please update your drivers or if you have a very old or integrated GPU upgrade it.",
|
||||
"Unable to initialize Video driver");
|
||||
return ERR_UNAVAILABLE;
|
||||
}
|
||||
|
||||
//!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
//TODO - do Vulkan and GLES2 support checks, driver selection and fallback
|
||||
video_driver_index = p_video_driver;
|
||||
print_verbose("Driver: " + String(get_video_driver_name(video_driver_index)) + " [" + itos(video_driver_index) + "]");
|
||||
//!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
gl_context->set_use_vsync(video_mode.use_vsync);
|
||||
set_vsync_via_compositor(video_mode.vsync_via_compositor);
|
||||
// Init context and rendering device
|
||||
#if defined(OPENGL_ENABLED)
|
||||
if (video_driver_index == VIDEO_DRIVER_GLES2) {
|
||||
|
||||
context_gles2 = memnew(ContextGL_Windows(hWnd, false));
|
||||
|
||||
if (context_gles2->initialize() != OK) {
|
||||
memdelete(context_gles2);
|
||||
context_gles2 = NULL;
|
||||
ERR_FAIL_V(ERR_UNAVAILABLE);
|
||||
}
|
||||
|
||||
context_gles2->set_use_vsync(video_mode.use_vsync);
|
||||
set_vsync_via_compositor(video_mode.vsync_via_compositor);
|
||||
|
||||
if (RasterizerGLES2::is_viable() == OK) {
|
||||
RasterizerGLES2::register_config();
|
||||
RasterizerGLES2::make_current();
|
||||
} else {
|
||||
memdelete(context_gles2);
|
||||
context_gles2 = NULL;
|
||||
ERR_FAIL_V(ERR_UNAVAILABLE);
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
#if defined(VULKAN_ENABLED)
|
||||
if (video_driver_index == VIDEO_DRIVER_VULKAN) {
|
||||
|
||||
context_vulkan = memnew(VulkanContextWindows);
|
||||
if (context_vulkan->initialize() != OK) {
|
||||
memdelete(context_vulkan);
|
||||
context_vulkan = NULL;
|
||||
ERR_FAIL_V(ERR_UNAVAILABLE);
|
||||
}
|
||||
if (context_vulkan->window_create(hWnd, hInstance, get_video_mode().width, get_video_mode().height) == -1) {
|
||||
memdelete(context_vulkan);
|
||||
context_vulkan = NULL;
|
||||
ERR_FAIL_V(ERR_UNAVAILABLE);
|
||||
}
|
||||
|
||||
//temporary
|
||||
rendering_device_vulkan = memnew(RenderingDeviceVulkan);
|
||||
rendering_device_vulkan->initialize(context_vulkan);
|
||||
|
||||
RasterizerRD::make_current();
|
||||
}
|
||||
#endif
|
||||
|
||||
visual_server = memnew(VisualServerRaster);
|
||||
|
@ -1660,9 +1653,26 @@ void OS_Windows::finalize() {
|
|||
cursors_cache.clear();
|
||||
visual_server->finish();
|
||||
memdelete(visual_server);
|
||||
#ifdef OPENGL_ENABLED
|
||||
if (gl_context)
|
||||
memdelete(gl_context);
|
||||
|
||||
#if defined(OPENGL_ENABLED)
|
||||
if (video_driver_index == VIDEO_DRIVER_GLES2) {
|
||||
|
||||
if (context_gles2)
|
||||
memdelete(context_gles2);
|
||||
|
||||
}
|
||||
#endif
|
||||
#if defined(VULKAN_ENABLED)
|
||||
if (video_driver_index == VIDEO_DRIVER_VULKAN) {
|
||||
|
||||
if (rendering_device_vulkan) {
|
||||
rendering_device_vulkan->finalize();
|
||||
memdelete(rendering_device_vulkan);
|
||||
}
|
||||
|
||||
if (context_vulkan)
|
||||
memdelete(context_vulkan);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (user_proc) {
|
||||
|
@ -1964,6 +1974,11 @@ void OS_Windows::set_window_size(const Size2 p_size) {
|
|||
|
||||
video_mode.width = w;
|
||||
video_mode.height = h;
|
||||
#if defined(VULKAN_ENABLED)
|
||||
if (video_driver_index == VIDEO_DRIVER_VULKAN) {
|
||||
context_vulkan->window_resize(0, video_mode.width, video_mode.height);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (video_mode.fullscreen) {
|
||||
return;
|
||||
|
@ -3121,18 +3136,32 @@ OS::LatinKeyboardVariant OS_Windows::get_latin_keyboard_variant() const {
|
|||
}
|
||||
|
||||
void OS_Windows::release_rendering_thread() {
|
||||
|
||||
gl_context->release_current();
|
||||
#if defined(OPENGL_ENABLED)
|
||||
if (video_driver_index == VIDEO_DRIVER_GLES2) {
|
||||
context_gles2->release_current();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void OS_Windows::make_rendering_thread() {
|
||||
|
||||
gl_context->make_current();
|
||||
#if defined(OPENGL_ENABLED)
|
||||
if (video_driver_index == VIDEO_DRIVER_GLES2) {
|
||||
context_gles2->make_current();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void OS_Windows::swap_buffers() {
|
||||
|
||||
gl_context->swap_buffers();
|
||||
#if defined(OPENGL_ENABLED)
|
||||
if (video_driver_index == VIDEO_DRIVER_GLES2) {
|
||||
context_gles2->swap_buffers();
|
||||
}
|
||||
#endif
|
||||
#if defined(VULKAN_ENABLED)
|
||||
if (video_driver_index == VIDEO_DRIVER_VULKAN) {
|
||||
context_vulkan->swap_buffers();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void OS_Windows::force_process_input() {
|
||||
|
@ -3299,18 +3328,13 @@ String OS_Windows::get_joy_guid(int p_device) const {
|
|||
}
|
||||
|
||||
void OS_Windows::_set_use_vsync(bool p_enable) {
|
||||
|
||||
if (gl_context)
|
||||
gl_context->set_use_vsync(p_enable);
|
||||
#if defined(OPENGL_ENABLED)
|
||||
if (video_driver_index == VIDEO_DRIVER_GLES2) {
|
||||
if (context_gles2)
|
||||
context_gles2->set_use_vsync(p_enable);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
/*
|
||||
bool OS_Windows::is_vsync_enabled() const {
|
||||
|
||||
if (gl_context)
|
||||
return gl_context->is_using_vsync();
|
||||
|
||||
return true;
|
||||
}*/
|
||||
|
||||
OS::PowerState OS_Windows::get_power_state() {
|
||||
return power_manager->get_power_state();
|
||||
|
|
|
@ -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>
|
||||
|
@ -170,9 +178,16 @@ class OS_Windows : public OS {
|
|||
bool outside;
|
||||
int old_x, old_y;
|
||||
Point2i center;
|
||||
|
||||
#if defined(OPENGL_ENABLED)
|
||||
ContextGL_Windows *gl_context;
|
||||
ContextGL_Windows *context_gles2;
|
||||
#endif
|
||||
|
||||
#if defined(VULKAN_ENABLED)
|
||||
VulkanContextWindows *context_vulkan;
|
||||
RenderingDeviceVulkan *rendering_device_vulkan;
|
||||
#endif
|
||||
|
||||
VisualServer *visual_server;
|
||||
int pressrc;
|
||||
HINSTANCE hInstance; // Holds The Instance Of The Application
|
||||
|
|
|
@ -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() {
|
||||
}
|
|
@ -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
|
|
@ -6,7 +6,7 @@ from platform_methods import run_in_subprocess
|
|||
import platform_x11_builders
|
||||
|
||||
common_x11 = [
|
||||
#"context_gl_x11.cpp",
|
||||
"context_gl_x11.cpp",
|
||||
"vulkan_context_x11.cpp",
|
||||
"crash_handler_x11.cpp",
|
||||
"os_x11.cpp",
|
||||
|
|
|
@ -319,9 +319,16 @@ def configure(env):
|
|||
|
||||
env.Prepend(CPPPATH=['#platform/x11'])
|
||||
env.Append(CPPDEFINES=['X11_ENABLED', 'UNIX_ENABLED'])
|
||||
|
||||
env.Prepend(CPPPATH=['#thirdparty/vulkan/include/', "#thirdparty/vulkan/registry/"])
|
||||
env.Append(CPPDEFINES=['VULKAN_ENABLED'])
|
||||
env.Append(LIBS=['vulkan'])
|
||||
env.Append(LIBS=['GL', 'pthread'])
|
||||
if not env["builtin_vulkan_loader"]:
|
||||
env.Append(LIBS=['vulkan'])
|
||||
|
||||
#env.Append(CPPDEFINES=['OPENGL_ENABLED'])
|
||||
env.Append(LIBS=['GL'])
|
||||
|
||||
env.Append(LIBS=['pthread'])
|
||||
|
||||
if (platform.system() == "Linux"):
|
||||
env.Append(LIBS=['dl'])
|
||||
|
|
|
@ -33,11 +33,17 @@
|
|||
|
||||
#include "core/os/dir_access.h"
|
||||
#include "core/print_string.h"
|
||||
//#include "drivers/gles2/rasterizer_gles2.h"
|
||||
//#include "drivers/gles3/rasterizer_gles3.h"
|
||||
#include "errno.h"
|
||||
#include "key_mapping_x11.h"
|
||||
|
||||
#if defined(OPENGL_ENABLED)
|
||||
#include "drivers/gles2/rasterizer_gles2.h"
|
||||
#endif
|
||||
|
||||
#if defined(VULKAN_ENABLED)
|
||||
#include "servers/visual/rasterizer_rd/rasterizer_rd.h"
|
||||
#endif
|
||||
|
||||
#include "servers/visual/visual_server_raster.h"
|
||||
#include "servers/visual/visual_server_wrap_mt.h"
|
||||
|
||||
|
@ -103,15 +109,7 @@ void OS_X11::initialize_core() {
|
|||
int OS_X11::get_current_video_driver() const {
|
||||
return video_driver_index;
|
||||
}
|
||||
#if 0
|
||||
static RID test_index_array;
|
||||
static RID test_vertex_array;
|
||||
static RID test_uniform_set;
|
||||
static RID test_pipeline;
|
||||
static RID test_framebuffer_pipeline;
|
||||
static RID test_framebuffer_uniform_set;
|
||||
static RID test_framebuffer;
|
||||
#endif
|
||||
|
||||
Error OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver) {
|
||||
|
||||
long im_event_mask = 0;
|
||||
|
@ -239,138 +237,14 @@ Error OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
|
|||
XFree(imvalret);
|
||||
}
|
||||
|
||||
/*
|
||||
char* windowid = getenv("GODOT_WINDOWID");
|
||||
if (windowid) {
|
||||
|
||||
//freopen("/home/punto/stdout", "w", stdout);
|
||||
//reopen("/home/punto/stderr", "w", stderr);
|
||||
x11_window = atol(windowid);
|
||||
|
||||
XWindowAttributes xwa;
|
||||
XGetWindowAttributes(x11_display,x11_window,&xwa);
|
||||
|
||||
current_videomode.width = xwa.width;
|
||||
current_videomode.height = xwa.height;
|
||||
};
|
||||
*/
|
||||
|
||||
// maybe contextgl wants to be in charge of creating the window
|
||||
#if defined(OPENGL_ENABLED)
|
||||
if (getenv("DRI_PRIME") == NULL) {
|
||||
int use_prime = -1;
|
||||
|
||||
if (getenv("PRIMUS_DISPLAY") ||
|
||||
getenv("PRIMUS_libGLd") ||
|
||||
getenv("PRIMUS_libGLa") ||
|
||||
getenv("PRIMUS_libGL") ||
|
||||
getenv("PRIMUS_LOAD_GLOBAL") ||
|
||||
getenv("BUMBLEBEE_SOCKET")) {
|
||||
|
||||
print_verbose("Optirun/primusrun detected. Skipping GPU detection");
|
||||
use_prime = 0;
|
||||
}
|
||||
|
||||
if (getenv("LD_LIBRARY_PATH")) {
|
||||
String ld_library_path(getenv("LD_LIBRARY_PATH"));
|
||||
Vector<String> libraries = ld_library_path.split(":");
|
||||
|
||||
for (int i = 0; i < libraries.size(); ++i) {
|
||||
if (FileAccess::exists(libraries[i] + "/libGL.so.1") ||
|
||||
FileAccess::exists(libraries[i] + "/libGL.so")) {
|
||||
|
||||
print_verbose("Custom libGL override detected. Skipping GPU detection");
|
||||
use_prime = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (use_prime == -1) {
|
||||
print_verbose("Detecting GPUs, set DRI_PRIME in the environment to override GPU detection logic.");
|
||||
use_prime = detect_prime();
|
||||
}
|
||||
|
||||
if (use_prime) {
|
||||
print_line("Found discrete GPU, setting DRI_PRIME=1 to use it.");
|
||||
print_line("Note: Set DRI_PRIME=0 in the environment to disable Godot from using the discrete GPU.");
|
||||
setenv("DRI_PRIME", "1", 1);
|
||||
}
|
||||
}
|
||||
|
||||
ContextGL_X11::ContextType opengl_api_type = ContextGL_X11::GLES_3_0_COMPATIBLE;
|
||||
|
||||
if (p_video_driver == VIDEO_DRIVER_GLES2) {
|
||||
opengl_api_type = ContextGL_X11::GLES_2_0_COMPATIBLE;
|
||||
}
|
||||
|
||||
bool editor = Engine::get_singleton()->is_editor_hint();
|
||||
bool gl_initialization_error = false;
|
||||
|
||||
context_gl = NULL;
|
||||
while (!context_gl) {
|
||||
context_gl = memnew(ContextGL_X11(x11_display, x11_window, current_videomode, opengl_api_type));
|
||||
|
||||
if (context_gl->initialize() != OK) {
|
||||
memdelete(context_gl);
|
||||
context_gl = NULL;
|
||||
|
||||
if (GLOBAL_GET("rendering/quality/driver/fallback_to_gles2") || editor) {
|
||||
if (p_video_driver == VIDEO_DRIVER_GLES2) {
|
||||
gl_initialization_error = true;
|
||||
break;
|
||||
}
|
||||
|
||||
p_video_driver = VIDEO_DRIVER_GLES2;
|
||||
opengl_api_type = ContextGL_X11::GLES_2_0_COMPATIBLE;
|
||||
} else {
|
||||
gl_initialization_error = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
while (true) {
|
||||
if (opengl_api_type == ContextGL_X11::GLES_3_0_COMPATIBLE) {
|
||||
if (RasterizerGLES3::is_viable() == OK) {
|
||||
RasterizerGLES3::register_config();
|
||||
RasterizerGLES3::make_current();
|
||||
break;
|
||||
} else {
|
||||
if (GLOBAL_GET("rendering/quality/driver/fallback_to_gles2") || editor) {
|
||||
p_video_driver = VIDEO_DRIVER_GLES2;
|
||||
opengl_api_type = ContextGL_X11::GLES_2_0_COMPATIBLE;
|
||||
continue;
|
||||
} else {
|
||||
gl_initialization_error = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (opengl_api_type == ContextGL_X11::GLES_2_0_COMPATIBLE) {
|
||||
if (RasterizerGLES2::is_viable() == OK) {
|
||||
RasterizerGLES2::register_config();
|
||||
RasterizerGLES2::make_current();
|
||||
break;
|
||||
} else {
|
||||
gl_initialization_error = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (gl_initialization_error) {
|
||||
OS::get_singleton()->alert("Your video card driver does not support any of the supported OpenGL versions.\n"
|
||||
"Please update your drivers or if you have a very old or integrated GPU upgrade it.",
|
||||
"Unable to initialize Video driver");
|
||||
return ERR_UNAVAILABLE;
|
||||
}
|
||||
|
||||
//!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
//TODO - do Vulkan and GLES2 support checks, driver selection and fallback
|
||||
video_driver_index = p_video_driver;
|
||||
print_verbose("Driver: " + String(get_video_driver_name(video_driver_index)) + " [" + itos(video_driver_index) + "]");
|
||||
//!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
context_gl->set_use_vsync(current_videomode.use_vsync);
|
||||
//Create window
|
||||
|
||||
#else
|
||||
long visualMask = VisualScreenMask;
|
||||
int numberOfVisuals;
|
||||
XVisualInfo vInfoTemplate = {};
|
||||
|
@ -384,11 +258,7 @@ Error OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
|
|||
windowAttributes.background_pixel = 0xFFFFFFFF;
|
||||
windowAttributes.border_pixel = 0;
|
||||
windowAttributes.event_mask = KeyPressMask | KeyReleaseMask | StructureNotifyMask | ExposureMask;
|
||||
/*
|
||||
window = XCreateWindow(demo->display, RootWindow(display, vInfoTemplate.screen), 0, 0, demo->width,
|
||||
demo->height, 0, visualInfo->depth, InputOutput, visualInfo->visual,
|
||||
CWBackPixel | CWBorderPixel | CWEventMask | CWColormap, &windowAttributes);
|
||||
*/
|
||||
|
||||
unsigned long valuemask = CWBorderPixel | CWColormap | CWEventMask;
|
||||
x11_window = XCreateWindow(x11_display, RootWindow(x11_display, visualInfo->screen), 0, 0, OS::get_singleton()->get_video_mode().width, OS::get_singleton()->get_video_mode().height, 0, visualInfo->depth, InputOutput, visualInfo->visual, valuemask, &windowAttributes);
|
||||
|
||||
|
@ -401,261 +271,92 @@ Error OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
|
|||
|
||||
XFree(visualInfo);
|
||||
|
||||
context_vulkan = memnew(VulkanContextX11);
|
||||
context_vulkan->initialize();
|
||||
context_vulkan->window_create(x11_window, x11_display, get_video_mode().width, get_video_mode().height);
|
||||
// Init context and rendering device
|
||||
#if defined(OPENGL_ENABLED)
|
||||
if (video_driver_index == VIDEO_DRIVER_GLES2) {
|
||||
if (getenv("DRI_PRIME") == NULL) {
|
||||
int use_prime = -1;
|
||||
|
||||
//temporary
|
||||
rendering_device = memnew(RenderingDeviceVulkan);
|
||||
rendering_device->initialize(context_vulkan);
|
||||
RasterizerRD::make_current();
|
||||
if (getenv("PRIMUS_DISPLAY") ||
|
||||
getenv("PRIMUS_libGLd") ||
|
||||
getenv("PRIMUS_libGLa") ||
|
||||
getenv("PRIMUS_libGL") ||
|
||||
getenv("PRIMUS_LOAD_GLOBAL") ||
|
||||
getenv("BUMBLEBEE_SOCKET")) {
|
||||
|
||||
// test shader
|
||||
#if 0
|
||||
//test code, remains for reference, ask before removing
|
||||
RID shader;
|
||||
{
|
||||
RenderingDevice::ShaderStageSource vert;
|
||||
vert.shader_stage = RenderingDevice::SHADER_STAGE_VERTEX;
|
||||
vert.shader_source = "#version 450\n"
|
||||
"layout(location = 0) in vec4 vertex_pos;\n"
|
||||
"layout(location = 1) in vec2 uv_pos;\n"
|
||||
"layout(location = 0) out vec2 uv_interp;\n"
|
||||
"void main() { gl_Position = vertex_pos; uv_interp=uv_pos;\n }";
|
||||
//"void main() { if (gl_VertexIndex==0) gl_Position=vec4(-0.8,-0.8,0.0,1.0); if (gl_VertexIndex==1) gl_Position=vec4(-0.8,-0.2,0.0,1.0); if (gl_VertexIndex==2) gl_Position=vec4(-0.2,-0.2,0.0,1.0); if (gl_VertexIndex==3) gl_Position=vec4(-0.2,-0.8,0.0,1.0);\n }";
|
||||
print_verbose("Optirun/primusrun detected. Skipping GPU detection");
|
||||
use_prime = 0;
|
||||
}
|
||||
|
||||
RenderingDevice::ShaderStageSource frag;
|
||||
frag.shader_stage = RenderingDevice::SHADER_STAGE_FRAGMENT;
|
||||
frag.shader_source = "#version 450\n"
|
||||
"layout (location = 0) in vec2 uv_interp;\n"
|
||||
"layout (location = 0) out vec4 uFragColor;\n"
|
||||
"layout (binding = 0) uniform sampler2D t;\n"
|
||||
"layout (push_constant, binding=1) uniform ColorMultiplier { vec4 color_mult; } color_multiplier;\n"
|
||||
"void main() { uFragColor=texture(t,uv_interp) * color_multiplier.color_mult; }\n";
|
||||
if (getenv("LD_LIBRARY_PATH")) {
|
||||
String ld_library_path(getenv("LD_LIBRARY_PATH"));
|
||||
Vector<String> libraries = ld_library_path.split(":");
|
||||
|
||||
Vector<RenderingDevice::ShaderStageSource> source;
|
||||
source.push_back(vert);
|
||||
source.push_back(frag);
|
||||
String error;
|
||||
shader = rendering_device->shader_create_from_source(source, &error);
|
||||
if (!shader.is_valid()) {
|
||||
print_line("failed compilation: " + error);
|
||||
for (int i = 0; i < libraries.size(); ++i) {
|
||||
if (FileAccess::exists(libraries[i] + "/libGL.so.1") ||
|
||||
FileAccess::exists(libraries[i] + "/libGL.so")) {
|
||||
|
||||
print_verbose("Custom libGL override detected. Skipping GPU detection");
|
||||
use_prime = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (use_prime == -1) {
|
||||
print_verbose("Detecting GPUs, set DRI_PRIME in the environment to override GPU detection logic.");
|
||||
use_prime = detect_prime();
|
||||
}
|
||||
|
||||
if (use_prime) {
|
||||
print_line("Found discrete GPU, setting DRI_PRIME=1 to use it.");
|
||||
print_line("Note: Set DRI_PRIME=0 in the environment to disable Godot from using the discrete GPU.");
|
||||
setenv("DRI_PRIME", "1", 1);
|
||||
}
|
||||
}
|
||||
|
||||
ContextGL_X11::ContextType opengl_api_type = ContextGL_X11::GLES_2_0_COMPATIBLE;
|
||||
|
||||
context_gles2 = memnew(ContextGL_X11(x11_display, x11_window, current_videomode, opengl_api_type));
|
||||
|
||||
if (context_gles2->initialize() != OK) {
|
||||
memdelete(context_gles2);
|
||||
context_gles2 = NULL;
|
||||
ERR_FAIL_V(ERR_UNAVAILABLE);
|
||||
}
|
||||
|
||||
context_gles2->set_use_vsync(current_videomode.use_vsync);
|
||||
|
||||
if (RasterizerGLES2::is_viable() == OK) {
|
||||
RasterizerGLES2::register_config();
|
||||
RasterizerGLES2::make_current();
|
||||
} else {
|
||||
print_line("compilation success");
|
||||
memdelete(context_gles2);
|
||||
context_gles2 = NULL;
|
||||
ERR_FAIL_V(ERR_UNAVAILABLE);
|
||||
}
|
||||
}
|
||||
|
||||
RenderingDevice::VertexFormatID vertex_desc;
|
||||
{
|
||||
|
||||
PoolVector<uint8_t> pv;
|
||||
pv.resize(24 * 4);
|
||||
{
|
||||
PoolVector<uint8_t>::Write w = pv.write();
|
||||
float *p32 = (float *)w.ptr();
|
||||
p32[0] = -0.8;
|
||||
p32[1] = -0.8;
|
||||
p32[2] = 0.0;
|
||||
p32[3] = 1.0;
|
||||
|
||||
p32[4] = 0.0;
|
||||
p32[5] = 0.0;
|
||||
|
||||
p32[6] = -0.8;
|
||||
p32[7] = -0.2;
|
||||
p32[8] = 0.0;
|
||||
p32[9] = 1.0;
|
||||
|
||||
p32[10] = 0.0;
|
||||
p32[11] = 1.0;
|
||||
|
||||
p32[12] = -0.2;
|
||||
p32[13] = -0.2;
|
||||
p32[14] = 0.0;
|
||||
p32[15] = 1.0;
|
||||
|
||||
p32[16] = 1.0;
|
||||
p32[17] = 1.0;
|
||||
|
||||
p32[18] = -0.2;
|
||||
p32[19] = -0.8;
|
||||
p32[20] = 0.0;
|
||||
p32[21] = 1.0;
|
||||
|
||||
p32[22] = 1.0;
|
||||
p32[23] = 0.0;
|
||||
}
|
||||
|
||||
RID vertex_buffer = rendering_device->vertex_buffer_create(pv.size(), pv);
|
||||
Vector<RenderingDevice::VertexDescription> vdarr;
|
||||
RenderingDevice::VertexDescription vd;
|
||||
vd.format = RenderingDevice::DATA_FORMAT_R32G32B32A32_SFLOAT;
|
||||
vd.stride = 4 * 6; //vertex/uv
|
||||
vd.offset = 0;
|
||||
vd.location = 0;
|
||||
vdarr.push_back(vd);
|
||||
vd.format = RenderingDevice::DATA_FORMAT_R32G32_SFLOAT;
|
||||
vd.stride = 4 * 6; //vertex/uv
|
||||
vd.offset = 4 * 4; //offset to UV
|
||||
vd.location = 1;
|
||||
vdarr.push_back(vd);
|
||||
|
||||
vertex_desc = rendering_device->vertex_format_create(vdarr);
|
||||
|
||||
Vector<RID> buffers;
|
||||
buffers.push_back(vertex_buffer);
|
||||
buffers.push_back(vertex_buffer);
|
||||
|
||||
test_vertex_array = rendering_device->vertex_array_create(4, vertex_desc, buffers);
|
||||
}
|
||||
|
||||
RID test_framebuffer_tex_id;
|
||||
|
||||
{
|
||||
RenderingDevice::TextureFormat tex_format;
|
||||
tex_format.format = RenderingDevice::DATA_FORMAT_R8G8B8A8_UNORM; //RenderingDevice::DATA_FORMAT_A8B8G8R8_UNORM_PACK32;
|
||||
tex_format.width = 256;
|
||||
tex_format.height = 256;
|
||||
tex_format.mipmaps = 1;
|
||||
tex_format.type = RenderingDevice::TEXTURE_TYPE_2D;
|
||||
tex_format.usage_bits = RenderingDevice::TEXTURE_USAGE_SAMPLING_BIT | RenderingDevice::TEXTURE_USAGE_COLOR_ATTACHMENT_BIT;
|
||||
|
||||
test_framebuffer_tex_id = rendering_device->texture_create(tex_format, RenderingDevice::TextureView());
|
||||
|
||||
Vector<RID> ids;
|
||||
ids.push_back(test_framebuffer_tex_id);
|
||||
|
||||
test_framebuffer = rendering_device->framebuffer_create(ids);
|
||||
}
|
||||
|
||||
test_pipeline = rendering_device->render_pipeline_create(shader, rendering_device->framebuffer_get_format(test_framebuffer), vertex_desc, RenderingDevice::RENDER_PRIMITIVE_TRIANGLES, RenderingDevice::PipelineRasterizationState(), RenderingDevice::PipelineMultisampleState(), RenderingDevice::PipelineDepthStencilState(), RenderingDevice::PipelineColorBlendState::create_disabled());
|
||||
|
||||
{
|
||||
|
||||
Ref<Image> img;
|
||||
img.instance();
|
||||
Error terr = img->load("../logo.png");
|
||||
if (terr != OK) {
|
||||
print_line("Cant load logo?");
|
||||
}
|
||||
|
||||
img->convert(Image::FORMAT_RGBA8);
|
||||
|
||||
RenderingDevice::TextureFormat tex_format;
|
||||
tex_format.format = RenderingDevice::DATA_FORMAT_R8G8B8A8_UNORM; //RenderingDevice::DATA_FORMAT_A8B8G8R8_UNORM_PACK32;
|
||||
tex_format.width = img->get_width();
|
||||
tex_format.height = img->get_height();
|
||||
print_line("imgsize: " + Vector2(img->get_width(), img->get_height()));
|
||||
tex_format.mipmaps = 1;
|
||||
tex_format.type = RenderingDevice::TEXTURE_TYPE_2D;
|
||||
tex_format.usage_bits = RenderingDevice::TEXTURE_USAGE_SAMPLING_BIT | RenderingDevice::TEXTURE_USAGE_CAN_UPDATE_BIT;
|
||||
|
||||
Vector<PoolVector<uint8_t> > initial_data;
|
||||
initial_data.push_back(img->get_data());
|
||||
|
||||
RID tex_id = rendering_device->texture_create(tex_format, RenderingDevice::TextureView(), initial_data);
|
||||
RID sampler = rendering_device->sampler_create(RenderingDevice::SamplerState());
|
||||
|
||||
Vector<RenderingDevice::Uniform> uniform_description;
|
||||
|
||||
RenderingDevice::Uniform u;
|
||||
u.type = RenderingDevice::UNIFORM_TYPE_SAMPLER_WITH_TEXTURE;
|
||||
u.binding = 0;
|
||||
u.ids.push_back(sampler);
|
||||
u.ids.push_back(tex_id);
|
||||
|
||||
uniform_description.push_back(u);
|
||||
|
||||
test_uniform_set = rendering_device->uniform_set_create(uniform_description, shader, 0);
|
||||
}
|
||||
|
||||
{
|
||||
PoolVector<uint8_t> pv;
|
||||
pv.resize(6 * 4);
|
||||
{
|
||||
PoolVector<uint8_t>::Write w = pv.write();
|
||||
int *p32 = (int *)w.ptr();
|
||||
p32[0] = 0;
|
||||
p32[1] = 1;
|
||||
p32[2] = 2;
|
||||
p32[3] = 0;
|
||||
p32[4] = 2;
|
||||
p32[5] = 3;
|
||||
}
|
||||
RID index_buffer = rendering_device->index_buffer_create(6, RenderingDevice::INDEX_BUFFER_FORMAT_UINT32, pv);
|
||||
test_index_array = rendering_device->index_array_create(index_buffer, 0, 6);
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
RID sampler = rendering_device->sampler_create(RenderingDevice::SamplerState());
|
||||
|
||||
Vector<RenderingDevice::Uniform> uniform_description;
|
||||
|
||||
RenderingDevice::Uniform u;
|
||||
u.type = RenderingDevice::UNIFORM_TYPE_SAMPLER_WITH_TEXTURE;
|
||||
u.binding = 0;
|
||||
u.ids.push_back(sampler);
|
||||
u.ids.push_back(test_framebuffer_tex_id);
|
||||
|
||||
uniform_description.push_back(u);
|
||||
|
||||
test_framebuffer_uniform_set = rendering_device->uniform_set_create(uniform_description, shader, 0);
|
||||
test_framebuffer_pipeline = rendering_device->render_pipeline_create(shader, rendering_device->screen_get_framebuffer_format(), vertex_desc, RenderingDevice::RENDER_PRIMITIVE_TRIANGLES, RenderingDevice::PipelineRasterizationState(), RenderingDevice::PipelineMultisampleState(), RenderingDevice::PipelineDepthStencilState(), RenderingDevice::PipelineColorBlendState::create_disabled());
|
||||
}
|
||||
|
||||
#endif
|
||||
#if 0
|
||||
//test code, remains for reference, ask before removing
|
||||
Vector<RenderingDevice::ShaderStageSource> source;
|
||||
RenderingDevice::ShaderStageSource frag;
|
||||
frag.shader_stage = RenderingDevice::SHADER_STAGE_FRAGMENT;
|
||||
frag.shader_source = ""
|
||||
"#version 450\n"
|
||||
"#extension GL_ARB_separate_shader_objects : enable\n"
|
||||
"#extension GL_ARB_shading_language_420pack : enable\n"
|
||||
"layout (set =2, binding = 3) uniform sampler2D sampie;\n"
|
||||
"layout (set =2, binding = 4) uniform texture2D texie;\n"
|
||||
"layout (set =2, binding = 5) uniform sampler sampieonly;\n"
|
||||
"layout (set =2, binding = 6) uniform sampler2D sampiearr[2];\n"
|
||||
"layout (set =2, binding = 7) uniform texture2D texiearr[2];\n"
|
||||
"layout (set =2, binding = 8) uniform sampler sampieonlyarr[2];\n"
|
||||
"layout (set =2, binding = 9) uniform samplerBuffer sabufsa;\n"
|
||||
"layout (set =2, binding = 9) uniform textureBuffer texbufsa;\n"
|
||||
"layout (set=3,binding=1,rgba32f) uniform image2D img1;\n"
|
||||
"layout(std140, set=1,binding = 0) uniform buf {\n"
|
||||
" mat4 MVP;\n"
|
||||
" vec4 position[12*3];\n"
|
||||
" vec4 attr[12*3];\n"
|
||||
"} ubuf;\n"
|
||||
"layout(std140, set=1,binding = 1) buffer popis {\n"
|
||||
" int popitos;\n"
|
||||
"} popibuf;\n"
|
||||
"layout (location = 0) out vec4 uFragColor;\n"
|
||||
" \n"
|
||||
"const vec3 lightDir= vec3(0.424, 0.566, 0.707);\n"
|
||||
"\n"
|
||||
"void main() {\n"
|
||||
" uFragColor = texture(sampie, vec2(ubuf.attr[0].x));\n"
|
||||
" uFragColor+= texture(sampler2D(texie,sampieonly), vec2(ubuf.attr[0].x));\n"
|
||||
" uFragColor+= texture(sampiearr[1], vec2(ubuf.attr[0].x));\n"
|
||||
" uFragColor+= texture(sampler2D(texiearr[1],sampieonlyarr[1]), vec2(ubuf.attr[0].x));\n"
|
||||
" uFragColor+= texelFetch(sabufsa,0);\n"
|
||||
" uFragColor+= texelFetch(samplerBuffer(texbufsa,sampieonly),0);\n"
|
||||
" uFragColor+= texelFetch(texbufsa,0);\n"
|
||||
" uFragColor.xy+= imageSize(img1);\n"
|
||||
" uFragColor.x+= float(popibuf.popitos);\n"
|
||||
"}\n";
|
||||
source.push_back(frag);
|
||||
String error;
|
||||
RID shader = rendering_device->shader_create_from_source(source, &error);
|
||||
if (shader == RenderingDevice::INVALID_ID) {
|
||||
print_line("failed compilation: " + error);
|
||||
} else {
|
||||
print_line("compilation success");
|
||||
}
|
||||
#endif
|
||||
#if defined(VULKAN_ENABLED)
|
||||
if (video_driver_index == VIDEO_DRIVER_VULKAN) {
|
||||
|
||||
context_vulkan = memnew(VulkanContextX11);
|
||||
if (context_vulkan->initialize() != OK) {
|
||||
memdelete(context_vulkan);
|
||||
context_vulkan = NULL;
|
||||
ERR_FAIL_V(ERR_UNAVAILABLE);
|
||||
}
|
||||
if (context_vulkan->window_create(x11_window, x11_display, get_video_mode().width, get_video_mode().height) == -1) {
|
||||
memdelete(context_vulkan);
|
||||
context_vulkan = NULL;
|
||||
ERR_FAIL_V(ERR_UNAVAILABLE);
|
||||
}
|
||||
|
||||
//temporary
|
||||
rendering_device_vulkan = memnew(RenderingDeviceVulkan);
|
||||
rendering_device_vulkan->initialize(context_vulkan);
|
||||
|
||||
RasterizerRD::make_current();
|
||||
}
|
||||
#endif
|
||||
|
||||
visual_server = memnew(VisualServerRaster);
|
||||
|
@ -1164,24 +865,35 @@ void OS_X11::finalize() {
|
|||
visual_server->finish();
|
||||
memdelete(visual_server);
|
||||
|
||||
rendering_device->finalize();
|
||||
memdelete(rendering_device);
|
||||
|
||||
memdelete(context_vulkan);
|
||||
|
||||
//memdelete(rasterizer);
|
||||
|
||||
memdelete(power_manager);
|
||||
|
||||
#if defined(OPENGL_ENABLED)
|
||||
if (video_driver_index == VIDEO_DRIVER_GLES2) {
|
||||
|
||||
if (context_gles2)
|
||||
memdelete(context_gles2);
|
||||
|
||||
}
|
||||
#endif
|
||||
#if defined(VULKAN_ENABLED)
|
||||
if (video_driver_index == VIDEO_DRIVER_VULKAN) {
|
||||
|
||||
if (rendering_device_vulkan) {
|
||||
rendering_device_vulkan->finalize();
|
||||
memdelete(rendering_device_vulkan);
|
||||
}
|
||||
|
||||
if (context_vulkan)
|
||||
memdelete(context_vulkan);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (xrandr_handle)
|
||||
dlclose(xrandr_handle);
|
||||
|
||||
XUnmapWindow(x11_display, x11_window);
|
||||
XDestroyWindow(x11_display, x11_window);
|
||||
|
||||
#if defined(OPENGL_ENABLED)
|
||||
memdelete(context_gl);
|
||||
#endif
|
||||
for (int i = 0; i < CURSOR_MAX; i++) {
|
||||
if (cursors[i] != None)
|
||||
XFreeCursor(x11_display, cursors[i]);
|
||||
|
@ -2423,7 +2135,12 @@ void OS_X11::_window_changed(XEvent *event) {
|
|||
|
||||
current_videomode.width = event->xconfigure.width;
|
||||
current_videomode.height = event->xconfigure.height;
|
||||
context_vulkan->window_resize(0, current_videomode.width, current_videomode.height);
|
||||
|
||||
#if defined(VULKAN_ENABLED)
|
||||
if (video_driver_index == VIDEO_DRIVER_VULKAN) {
|
||||
context_vulkan->window_resize(0, current_videomode.width, current_videomode.height);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void OS_X11::process_xevents() {
|
||||
|
@ -3408,48 +3125,32 @@ void OS_X11::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, c
|
|||
}
|
||||
|
||||
void OS_X11::release_rendering_thread() {
|
||||
|
||||
#if defined(OPENGL_ENABLED)
|
||||
context_gl->release_current();
|
||||
if (video_driver_index == VIDEO_DRIVER_GLES2) {
|
||||
context_gles2->release_current();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void OS_X11::make_rendering_thread() {
|
||||
|
||||
#if defined(OPENGL_ENABLED)
|
||||
context_gl->make_current();
|
||||
if (video_driver_index == VIDEO_DRIVER_GLES2) {
|
||||
context_gles2->make_current();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void OS_X11::swap_buffers() {
|
||||
|
||||
#if defined(OPENGL_ENABLED)
|
||||
context_gl->swap_buffers();
|
||||
if (video_driver_index == VIDEO_DRIVER_GLES2) {
|
||||
context_gles2->swap_buffers();
|
||||
}
|
||||
#endif
|
||||
#if 0
|
||||
Vector <Color> clear;
|
||||
float color[4] = { 1, 0, 1, 1 };
|
||||
clear.push_back(Color(0.5, 0.8, 0.2));
|
||||
RenderingDevice::DrawListID cmd_list = rendering_device->draw_list_begin(test_framebuffer, RenderingDevice::INITIAL_ACTION_CLEAR, RenderingDevice::FINAL_ACTION_READ_COLOR_DISCARD_DEPTH, clear);
|
||||
rendering_device->draw_list_bind_render_pipeline(cmd_list, test_pipeline);
|
||||
rendering_device->draw_list_bind_index_array(cmd_list, test_index_array);
|
||||
rendering_device->draw_list_bind_vertex_array(cmd_list, test_vertex_array);
|
||||
rendering_device->draw_list_bind_uniform_set(cmd_list, test_uniform_set, 0);
|
||||
rendering_device->draw_list_set_push_constant(cmd_list, color, 4 * 4);
|
||||
rendering_device->draw_list_draw(cmd_list, true);
|
||||
rendering_device->draw_list_end();
|
||||
|
||||
cmd_list = rendering_device->draw_list_begin_for_screen();
|
||||
rendering_device->draw_list_bind_render_pipeline(cmd_list, test_framebuffer_pipeline);
|
||||
rendering_device->draw_list_bind_index_array(cmd_list, test_index_array);
|
||||
rendering_device->draw_list_bind_vertex_array(cmd_list, test_vertex_array);
|
||||
rendering_device->draw_list_bind_uniform_set(cmd_list, test_framebuffer_uniform_set, 0);
|
||||
rendering_device->draw_list_set_push_constant(cmd_list, color, 4 * 4);
|
||||
rendering_device->draw_list_draw(cmd_list, true);
|
||||
rendering_device->draw_list_end();
|
||||
#if defined(VULKAN_ENABLED)
|
||||
if (video_driver_index == VIDEO_DRIVER_VULKAN) {
|
||||
context_vulkan->swap_buffers();
|
||||
}
|
||||
#endif
|
||||
|
||||
context_vulkan->swap_buffers();
|
||||
}
|
||||
|
||||
void OS_X11::alert(const String &p_alert, const String &p_title) {
|
||||
|
@ -3637,19 +3338,13 @@ String OS_X11::get_joy_guid(int p_device) const {
|
|||
|
||||
void OS_X11::_set_use_vsync(bool p_enable) {
|
||||
#if defined(OPENGL_ENABLED)
|
||||
if (context_gl)
|
||||
context_gl->set_use_vsync(p_enable);
|
||||
if (video_driver_index == VIDEO_DRIVER_GLES2) {
|
||||
if (context_gles2)
|
||||
context_gles2->set_use_vsync(p_enable);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
/*
|
||||
bool OS_X11::is_vsync_enabled() const {
|
||||
|
||||
if (context_gl)
|
||||
return context_gl->is_using_vsync();
|
||||
|
||||
return true;
|
||||
}
|
||||
*/
|
||||
void OS_X11::set_context(int p_context) {
|
||||
|
||||
XClassHint *classHint = XAllocClassHint();
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#ifndef OS_X11_H
|
||||
#define OS_X11_H
|
||||
|
||||
//#include "context_gl_x11.h"
|
||||
#include "core/os/input.h"
|
||||
#include "crash_handler_x11.h"
|
||||
#include "drivers/alsa/audio_driver_alsa.h"
|
||||
|
@ -44,9 +43,15 @@
|
|||
#include "servers/audio_server.h"
|
||||
#include "servers/visual/rasterizer.h"
|
||||
#include "servers/visual_server.h"
|
||||
//#include "servers/visual/visual_server_wrap_mt.h"
|
||||
|
||||
#if defined(OPENGL_ENABLED)
|
||||
#include "context_gl_x11.h"
|
||||
#endif
|
||||
|
||||
#if defined(VULKAN_ENABLED)
|
||||
#include "drivers/vulkan/rendering_device_vulkan.h"
|
||||
#include "platform/x11/vulkan_context_x11.h"
|
||||
#endif
|
||||
|
||||
#include <X11/Xcursor/Xcursor.h>
|
||||
#include <X11/Xlib.h>
|
||||
|
@ -94,11 +99,11 @@ class OS_X11 : public OS_Unix {
|
|||
int xdnd_version;
|
||||
|
||||
#if defined(OPENGL_ENABLED)
|
||||
ContextGL_X11 *context_gl;
|
||||
ContextGL_X11 *context_gles2;
|
||||
#endif
|
||||
#if defined(VULKAN_ENABLED)
|
||||
VulkanContextX11 *context_vulkan;
|
||||
RenderingDeviceVulkan *rendering_device;
|
||||
RenderingDeviceVulkan *rendering_device_vulkan;
|
||||
#endif
|
||||
|
||||
//Rasterizer *rasterizer;
|
||||
|
|
|
@ -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() {
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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"
|
||||
|
@ -1319,7 +1349,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);
|
||||
|
|
|
@ -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
|
||||
|
||||
|
@ -301,11 +331,6 @@ class RasterizerCanvasRD : public RasterizerCanvas {
|
|||
float direction[2];
|
||||
float pad[2];
|
||||
};
|
||||
struct ShadowFixPushConstant {
|
||||
float projection[16];
|
||||
float far;
|
||||
float pad[3];
|
||||
};
|
||||
|
||||
struct OccluderPolygon {
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
@ -54,7 +84,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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -2069,6 +2104,10 @@ EffectsRD *RasterizerStorageRD::get_effects() {
|
|||
|
||||
RasterizerStorageRD::RasterizerStorageRD() {
|
||||
|
||||
for (int i = 0; i < SHADER_TYPE_MAX; i++) {
|
||||
shader_data_request_func[i] = NULL;
|
||||
}
|
||||
|
||||
material_update_list = NULL;
|
||||
{ //create default textures
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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/
|
||||
|
|
|
@ -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.
|
||||
\****************************************************************************/
|
|
@ -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
|
||||
|
|
|
@ -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.
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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_
|
File diff suppressed because it is too large
Load Diff
|
@ -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
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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);
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -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
|
|
@ -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;
|
||||
}
|
|
@ -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);
|
|
@ -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;
|
||||
}
|
|
@ -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.
|
||||
|
||||
*/
|
|
@ -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
|
|
@ -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
|
|
@ -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);
|
|
@ -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;
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -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
|
|
@ -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;
|
||||
}
|
|
@ -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
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -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)
|
|
@ -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
|
|
@ -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
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue