Commit Graph

1511 Commits

Author SHA1 Message Date
Charles Giessen 643ca68d77 Rename GIPA, GPDPA, & GDPA terminators
Use more correct terminology for the various terminators of the
get proc addr functions. This makes it more obvious when each function
is being called, as well as removing the unecessary
loader_gpdpa_instance_internal.
2022-09-01 12:23:17 -06:00
Mike Schuchardt 47b2c57d6a build: Update to header 1.3.226
- Update known-good
- Generate source
2022-09-01 09:24:25 -07:00
Brad Smith 2d04b71e5c loader: Add stub function for OpenBSD executable path 2022-08-31 14:11:59 -06:00
Charles Giessen 52ba0949c8 Dont pass portability bit to ICDs that dont expect it
There was a small issue with the initial version of the portability
enumeration extension where the portability enumeration flag bit would
be passed down to ICDs which did not expect flags to contain anything
other than zero.

While an argument could be made for those drivers to ignore flags they
do not recognize, just like extensions and other 'unknown' things, it
is best to play nice as this is the first instance creation flag bit
added.
2022-08-31 11:49:56 -06:00
Brad Smith 643e51844c loader: Add OpenBSD support 2022-08-31 10:02:13 -06:00
Mike Schuchardt 85615a2e8c build: Update to header 1.3.225
- Update known-good
- Generate source
2022-08-18 13:03:19 -07:00
Charles Giessen 20a7763ead Separate Major.minor version checks from Full version checks
loader_make_Version previously would decode the major, minor, and patch info out of version data. This results in
erroneous version checks that took into account patch version when they shouldn't of. The loader_make_full_version
function is introduced for code that wishes to get the full major.minor.patch version and uses of
loader_make_version that need the full version have been replaced.
2022-08-15 09:27:43 -06:00
Mike Schuchardt c23adb37bc build: Update to header 1.3.224
- Update known-good
- Generate source
2022-08-04 13:32:11 -07:00
Charles Giessen daafcbc324 Use memmove for copying pApplicationInfo
Replace memcpy with memmove in terminator_CreateInstance to prevent possible issues
with the same memory being the source of the copy and the dest, as there is a for
loop which makes it possible for that to happen.
2022-07-29 16:09:29 -06:00
Mike Schuchardt a9aab18bea build: Update to header 1.3.223
- Update known-good
- Generate source
2022-07-28 10:59:12 -07:00
Mike Schuchardt 7fbff92bff build: Update to header 1.3.222
- Update known-good
- Generate source
2022-07-21 10:05:41 -07:00
Mike Schuchardt 7be768e5cc build: Update to header 1.3.221
- Update known-good
- Generate source
2022-07-14 09:20:23 -07:00
Mike Schuchardt 9021a6f1fa loader: Dynamically load Win8+ functions
Allow loader to run on Windows 7 by dynamically loading function
pointers for Windows 8 and above APIs.
2022-07-11 13:38:35 -06:00
Charles Giessen 1ba0884ecf Disable VulkanOn12/Dozen in Windows 7
Chromium still supports building for Win7, as such the newly added support for
VulkanOn12/Dozen needs to be excluded from said build. This is achieved by using
the SDK version macros defined in <sdkddkver>
2022-07-08 13:32:14 -06:00
Charles Giessen 8c34a62d0b Fix corrupted pNext chain in vkCreateDevice
When creating a device, the loader looks for the VkDeviceGroupCreateInfo
structure and replaces it with its own. This allows the loader to edit the
struct. However, to do this required editing the pNext chain. Because the
edited chain contained pointers to structures whose lifetimes end when the
vkCreateDevice function returns, the pNext chain is now corrupted.

This commit fixes that by storing a pointer to the user's
VkDeviceGroupCreateInfo and fixing up the pNext chain to use that instead.
2022-07-07 18:17:34 -06:00
Charles Giessen 1763b0ae2a Initialize properly when statically linked
Previously, the loader supported static linking. This capability was restricted
to MacOS only, however the necessary functionality was never implemented. This
commit adds the required code to properly initialize the loader when statically
linked with MacOS

Since the test framework was designed to dynamically load everything, it would
require significant rearchitecting to support it. As such, a simple verification
executable was added to the live_verification folder, instead of full support
in the test framework.
2022-07-07 14:41:01 -06:00
Charles Giessen cd85dc6c3f Refactor vk_loader_platform.h
Move includes of vulkan headers into loader_common.h, delete dead code
and unnecessary macro defines, and generally clean up the header.
2022-07-07 14:41:01 -06:00
Mike Schuchardt ebaf827719 build: Update to header 1.3.220
- Update known-good
- Generate source
2022-07-07 11:26:05 -06:00
Jesse Natalie 62efb88939 Enable the Vulkan loader to load VulkanOn12/Dozen out of the D3DMappingLayers app package 2022-07-05 14:34:53 -06:00
Mike Schuchardt 5815ceb5ee build: Update to header 1.3.219
- Update known-good
- Generate source
2022-06-30 12:28:09 -06:00
Marcin Kańtoch 1c84e3b5c2 loader: device array dealloc fix 2022-06-24 14:08:04 -06:00
Andrew Naumov 697f1801c5 loader: Add unicode support 2022-06-24 13:14:10 -06:00
Charles Giessen 0dbe5db838 Add 32 & 64 bit field to json manifests
Allows drivers and layers to specify if they are 32 bit or 64 bit in the
manifest file. This makes the loader able to prune manifests without
loading the library and finding that it failed to load.
2022-06-22 10:28:18 -06:00
Charles Giessen 90dbb56eec Fix use-after-free in loader_add_layer_properties
Occurs after file_vers is freed and when the layer manifest has a layers field
but has a version of 1.0.0.
2022-06-22 10:18:15 -06:00
Brad Grantham 018afe955d only descend into layer GPDPA from trampoline 2022-06-21 18:43:19 -06:00
Graeme Leese 0418a8e719 Prevent loader config from overriding project config
The loader options dummy targets were being linked into the public
interface of the loader, meaning that they were also set in projects the
include the loader as a sub-project. These override the containing
projects settings and can break things. There don't seem to be any
interface requirements in these settings, so include them as PRIVATE, so
that they stay local to the loader.
2022-06-20 13:30:56 -06:00
Mike Schuchardt 637329a14e build: Update to header 1.3.218
- Update known-good
- Generate source
- Add missing enums to test framework
2022-06-16 13:35:17 -07:00
Mike Schuchardt df428678d8 build: Update to header 1.3.217
- Update known-good
- Generate source
2022-06-13 12:54:07 -07:00
Charles Giessen 565ff9668a Only check first GPDPA in the layer chain.
When checking for unknown physical device functions, check the first layer that supports
vk_layerGetPhysicalDeviceProcAddr in the chain starting with the layer closest to the
application. This prevents unecessary work being done, and if any layer wraps VkInstance
will properly call through the wrapping layer first without calling into any other layer.
2022-06-06 21:34:36 -06:00
Mike Schuchardt bb5cf75fbf build: Update to header 1.3.216
- Update known-good
- Generate source
2022-06-02 12:52:22 -07:00
Charles Giessen a63c37176d Revert "fix #948 Only calls the first GPDPA in layer chain"
This reverts commit 3c680eef40.
2022-06-01 19:26:13 -06:00
Charles Giessen ceb70497bd Revert "Comment tweak to reflect new behaviour."
This reverts commit 36c42e1574.
2022-06-01 19:26:13 -06:00
Andrew Cox 36c42e1574 Comment tweak to reflect new behaviour. 2022-06-01 12:48:01 -06:00
Andrew Cox 3c680eef40 fix #948 Only calls the first GPDPA in layer chain 2022-06-01 12:48:01 -06:00
Charles Giessen c129609717 Fix crashes from OOM in vkDestroyInstance
Various situations could cause an OOM to turn into a hard crash due to double freeing
of memory that was improperly cleaned up. Also fixed memory leaks when layers would
report OOM.
2022-05-27 17:25:52 -06:00
Charles Giessen 4f6ccc2f2f Keep allocated debug callbacks until destroy instance
Previously the loader would destroy any debug callbacks created during instance creation
to later create new ones during instance destruction. This required a memory allocation
to occur inside vkDestroyInstance, which can cause leaks if an OOM occurs during
instance destruction.

This commit simplifies the logic by keeping around the allocations made during instance
creation by moving them into their own debug node chain. Then during instance destruction
moves them back.

Also renames several functions to better describe their intended purpose.
2022-05-27 17:14:25 -06:00
Charles Giessen a3d18efea0 Use calloc to allocate memory for the search path
This prevents bugs where uninitialized memory is treated as a real path. It
should fix an issue where sometimes CI would fail due to what appears to be a
spurious path with junk characters.
2022-05-27 11:12:46 -06:00
Charles Giessen 33f0d2f61c Fix a NULL inst crashing during loader_icd_scan
When checking for the portability driver field of driver manifests,
the loader did not check if inst was NULL first. Since this function
is called in pre-instance functions, this crashes the loader.
2022-05-25 13:14:04 -06:00
Charles Giessen 01b3ae769f Use calloc instead of alloc+memset
Replace naked uses of malloc & free with loader_alloc & loader_free.
2022-05-24 14:18:26 -06:00
Charles Giessen e87a34cc6e Use VkAllocationCallback in cJSON
Make cJSON pass the VkAllocationCallbacks instead of the loader_instance.
This removes and unecessary dependency between cJSON and the loader headers.
It also somewhat simplifies the interface by not requiring the inst parameter
everywhere, just in the creation of cJSON pointers and freeing.
2022-05-24 14:18:26 -06:00
Charles Giessen 40e0ee3792 Use VkAllocationCallbacks in windows dirent
Pass the allocation callbacks directly to dirent_on_windows.
This removes a unecessary dependency between the loader headers and
dirent_on_windows.
2022-05-24 14:18:26 -06:00
Charles Giessen c947827900 Refactor loader allocation functionality
Created wrapper functions loader_alloc, loader_calloc, loader_free,
and loader_realloc. Made the existing loader allocation functions use
them. Replaced manual usage of VkAllocatorCallbacks with the new
wrapper functions.
2022-05-24 14:18:26 -06:00
Mike Schuchardt 523a4b0e3d build: Update to header 1.3.215
- Update known-good
- Generate source
2022-05-24 11:41:56 -06:00
Mike Schuchardt 456f3f9c4b build: Update to header 1.3.214
- Update known-good
- Generate source
2022-05-17 08:43:02 -07:00
Mike Schuchardt a43773fae1 build: Update to header 1.3.213
- Update known-good
- Generate source
2022-05-11 10:31:02 -07:00
Charles Giessen 711031a24a Revert "Implement unknown function intercept in layers"
This reverts commit fc845625ed.
2022-05-11 08:57:30 -06:00
Mark Young c00ad5835c Output message if override app_keys mismatch on app name
Output a layer message if the override layer is present and the
app name is not in the app_keys list.
Fixes issue #917.
2022-05-05 16:46:41 -06:00
Charles Giessen 1dbe2ea63f Make portability drivers not load by default
Unless the portability enumeration extension is enabled and the create instance flags
contain VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR, do not enumerate drivers that
contain `is_portability_driver` in their JSON Manifest. This is phase 2 of the release
for the VK_KHR_portability_enumeration extension.

An error message will be printed when no drivers were reported but there was a
portability driver which was skipped over.
2022-05-04 15:40:27 -06:00
Charles Giessen 57e6b0cd0b Fix CMake code for getting Git Version information
The ${CMAKE_SOURCE_DIR} uses the wrong directory when the loader is included as a
subproject. By using ${CMAKE_CURRENT_LIST_DIR}, the CMake code to find the git
commit and branch name will use the correct directory.

Additionally, the logic was ammended to curtail this issue in the future. Quotes are
included in the string to allow it to be used as a string literal, instead of
needing a const char[] variable and macros. Also, the CMake code was restructured
to always define GIT_BRANCH_NAME and GIT_TAG_INFO.
2022-05-04 14:46:53 -06:00
Charles Giessen fc845625ed Implement unknown function intercept in layers
Make it possible for layers to declare that they support unknown functions
and set up the layer dispatch table appropriately. A very niche use case
but helpful when developing validation for functions not yet out in the
public headers.
2022-05-03 17:38:09 -06:00