Commit Graph

3843 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
Brad Smith f3cce0e816 tests: Further fixes to be able to build on OpenBSD 2022-09-01 12:21:19 -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
Pan 355ac771e7 Fix typo in setting linux environment variables
Replace `;` with `:` in setting linux environment variables.
2022-07-15 10:49:09 -06: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
Charles Giessen 3abfdb2f2d Make tests get files in a consistent order
Use the order defined the FolderManager's to define the order readdir
uses, rather than leaving it undetermined. This makes tests more consistent
by forcing layers and drivers to always be found in the same order on all
systems.

Note: MacOS doesn't currently have consistent ordering due to a crash with
ASAN. But even if ASAN isn't running, the dirent structure is being filled
out incorrectly, causing further test failures. While not ideal to disable
consistent ordering on MacOS, it is needed for linux and thus the issue
isn't high enough priority to resolve.
2022-07-01 13:36:27 -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
Yuly Novikov 44535f6fbc Fix BUILD.gn
Add newly added file stack_allocation.h

Fixes #846
2022-06-30 12:24:44 -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 05e54d82ee tests: Shuffle devices for sort test
Shuffle the bus IDs for discrete devices pd0, pd3, and pd4. Notably this
puts pd0 from icd0 in between pd4 and pd3 from icd2, making default
sorted order extremely unlikely if not impossible.
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 c9e9ac6a07 Update layer and driver vkGetPhysDevProcAddr docs
Better describe the function's purpose and behavior, moving the
reason for introducing vk_layer|icdGetPhysicalDeviceProcAddr to
a following section for clarity.
2022-05-31 14:51:38 -06:00
Tim Gfrerer c77d2df50d fix typo
resulsts -> results
2022-05-31 13:39:58 -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
Mark Young b2125f6005 Fix typo in env var table
Introduced a typo in my last commit in the table regarding the
disabling of instance extensions.  This is not a Linux only env
var.
2022-05-27 10:39:14 -06:00
Mark Young d4408eb0b8 Clean up environment var docs
Split up into two tables:
  - Active
  - Deprecated

Clean up restrictions into their own column for easier viewing.
Made text slightly smaller to fit more in a smaller space.
2022-05-26 17:37:30 -06:00
Mark Young aa9489cca6 Clarify JSON Manifest "api_version"
Clarify what is indicated by the "api_version" field in both
layer and driver manifest files.

Fixes issue #336.
2022-05-25 15:53:52 -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