Commit Graph

3839 Commits

Author SHA1 Message Date
Charles Giessen
192efa48a7 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
c745281f0f loader: Add OpenBSD support 2022-08-31 10:02:13 -06:00
Mike Schuchardt
40faec799c build: Update to header 1.3.225
- Update known-good
- Generate source
2022-08-18 13:03:19 -07:00
Charles Giessen
16d5d8f254 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
a0ab2f162e build: Update to header 1.3.224
- Update known-good
- Generate source
2022-08-04 13:32:11 -07:00
Charles Giessen
d4801c93c5 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
0bcddf345f build: Update to header 1.3.223
- Update known-good
- Generate source
2022-07-28 10:59:12 -07:00
Mike Schuchardt
fe3ea8d5f7 build: Update to header 1.3.222
- Update known-good
- Generate source
2022-07-21 10:05:41 -07:00
Pan
a13608020f Fix typo in setting linux environment variables
Replace `;` with `:` in setting linux environment variables.
2022-07-15 10:49:09 -06:00
Mike Schuchardt
30cb46bf7e build: Update to header 1.3.221
- Update known-good
- Generate source
2022-07-14 09:20:23 -07:00
Mike Schuchardt
4de4f256ab 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
9a45e5a4ab 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
57d5dd568b 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
0c7685be41 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
d8af0ae227 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
9ce0cf688b build: Update to header 1.3.220
- Update known-good
- Generate source
2022-07-07 11:26:05 -06:00
Jesse Natalie
26921924d6 Enable the Vulkan loader to load VulkanOn12/Dozen out of the D3DMappingLayers app package 2022-07-05 14:34:53 -06:00
Charles Giessen
0ad591fa3c 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
68e5bdc58f build: Update to header 1.3.219
- Update known-good
- Generate source
2022-06-30 12:28:09 -06:00
Yuly Novikov
c8399c9130 Fix BUILD.gn
Add newly added file stack_allocation.h

Fixes #846
2022-06-30 12:24:44 -06:00
Marcin Kańtoch
e91cfe1cf9 loader: device array dealloc fix 2022-06-24 14:08:04 -06:00
Andrew Naumov
5249c8f869 loader: Add unicode support 2022-06-24 13:14:10 -06:00
Charles Giessen
865626abba 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
8d3d6d4e16 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
1f92bbb656 only descend into layer GPDPA from trampoline 2022-06-21 18:43:19 -06:00
Graeme Leese
477fb9e188 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
e26be655eb 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
0ace24470b 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
71e43122c9 build: Update to header 1.3.217
- Update known-good
- Generate source
2022-06-13 12:54:07 -07:00
Charles Giessen
c3601d4d91 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
d3db2f78d9 build: Update to header 1.3.216
- Update known-good
- Generate source
2022-06-02 12:52:22 -07:00
Charles Giessen
bcecf87328 Revert "fix #948 Only calls the first GPDPA in layer chain"
This reverts commit a8c17d6a36.
2022-06-01 19:26:13 -06:00
Charles Giessen
aace830a23 Revert "Comment tweak to reflect new behaviour."
This reverts commit d86dc61e76.
2022-06-01 19:26:13 -06:00
Andrew Cox
d86dc61e76 Comment tweak to reflect new behaviour. 2022-06-01 12:48:01 -06:00
Andrew Cox
a8c17d6a36 fix #948 Only calls the first GPDPA in layer chain 2022-06-01 12:48:01 -06:00
Charles Giessen
5437a0854f 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
8289053993 fix typo
resulsts -> results
2022-05-31 13:39:58 -06:00
Charles Giessen
9308d2f8f1 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
e52b98e356 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
b1478c3e73 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
37c7953443 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
4676775702 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
fc48c8640b 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
c2897084d2 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
2d15653773 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
9b355f1948 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
0a2395df92 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
e65a8bcaeb 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
2e5d77b6ef build: Update to header 1.3.215
- Update known-good
- Generate source
2022-05-24 11:41:56 -06:00
Rutwik Choughule
3772b036e0 docs: Fix typo in MoltenVK url 2022-05-20 20:05:21 -06:00