Mike Schuchardt [Thu, 27 Oct 2022 15:25:21 +0000 (08:25 -0700)]
build: Update to header 1.3.232
- Update known-good
- Generate source
Charles Giessen [Wed, 26 Oct 2022 16:11:45 +0000 (10:11 -0600)]
Revert "Remove vkCreateSwapchainKHR from ICD Dispatch table"
This reverts commit
d79e2731d45bf4c81f650f27205e208a023269aa.
Charles Giessen [Wed, 26 Oct 2022 16:11:45 +0000 (10:11 -0600)]
Revert "Document vk_icdGetInstanceProcAddr querying device functions"
This reverts commit
068e83f5f20e38c3ae1687e7f1aeb59bf6ce3e72.
Charles Giessen [Wed, 12 Oct 2022 19:57:22 +0000 (13:57 -0600)]
Document vk_icdGetInstanceProcAddr querying device functions
vk_icdGetInstanceProcAddr has similar semantics to vkGetInstanceProcAddr.
It was created to prevent dynamic linker issues. It stated that it should support
global & instance level function querying. But this differs from the Vulkan spec
which states that vkGetInstanceProcAddr should be able to query all functions.
This creates confusion about what takes precendence, the spec or the loader's docs.
This commit makes it explicit that it should have the same semanics what the spec
says.
Charles Giessen [Wed, 12 Oct 2022 19:51:17 +0000 (13:51 -0600)]
Remove vkCreateSwapchainKHR from ICD Dispatch table
vkCreateSwapchainKHR and vkGetDeviceGroupSurfacePresentModesKHR were added to
the icd dispatch table then loaded with GIPA. While this is possible, for best
performance and consistency, the loader should use the device's dispatch table
for these functions. This required changing the terminators for both functions
so that they checked that the dev pointer isn't null and its dispatch entry for
each function isn't null.
Additionally, various debug marker/util functions checked if an ICD supported
surfaces by checking the ICD's dispatch table for vkCreateSwapchainKHR. These
have been updated to use the device's dispatch table instead.
Charles Giessen [Wed, 19 Oct 2022 21:08:10 +0000 (15:08 -0600)]
Add 32 bit github actions CI
Charles Giessen [Fri, 21 Oct 2022 18:01:45 +0000 (12:01 -0600)]
Fix linux 32 bit unknown function error handling
The issue was that passing a string to loader_log wouldn't work, likely due
to relocation issues. Workaround is to create a bespoke function that contained
the format string embedded in it.
Additionally, CMAKE_SYSTEM_PROCESSOR is incorrect in the case of x86 builds on
x64. Checking for sizeof(void*) == 8 allows distinguishing building for 32 bit
and 64 bit, and so the correct gen_defines.asm is created while cross compiling.
Also rename the error to note that its a function which isn't supported, not
an extension.
Charles Giessen [Tue, 25 Oct 2022 20:41:30 +0000 (14:41 -0600)]
Revert "Don't query vkCreateSwapchainKHR with GIPA"
This reverts commit
af67fccebe59e8d8e30e8c02b7b0069ce4242fc4.
Charles Giessen [Tue, 25 Oct 2022 20:41:30 +0000 (14:41 -0600)]
Revert "Document vk_icdGetInstanceProcAddr querying device functions"
This reverts commit
e5680db8ae5640dde10b58b8ab45e4a6201ae3e9.
Danny Zhu [Tue, 25 Oct 2022 14:37:56 +0000 (22:37 +0800)]
fix: format code
Danny Zhu [Tue, 25 Oct 2022 14:30:29 +0000 (22:30 +0800)]
fix: add null pointer checking
Danny Zhu [Sat, 22 Oct 2022 03:06:31 +0000 (11:06 +0800)]
fix: add dev pointer checking
danny.zhu [Fri, 21 Oct 2022 06:10:16 +0000 (14:10 +0800)]
fix: add dev pointer checking before using
Charles Giessen [Wed, 12 Oct 2022 19:57:22 +0000 (13:57 -0600)]
Document vk_icdGetInstanceProcAddr querying device functions
vk_icdGetInstanceProcAddr has similar semantics to vkGetInstanceProcAddr.
It was created to prevent dynamic linker issues. It stated that it should support
global & instance level function querying. But this differs from the Vulkan spec
which states that vkGetInstanceProcAddr should be able to query all functions.
This creates confusion about what takes precendence, the spec or the loader's docs.
This commit makes it explicit that it should have the same semanics what the spec
says.
Charles Giessen [Wed, 12 Oct 2022 19:51:17 +0000 (13:51 -0600)]
Don't query vkCreateSwapchainKHR with GIPA
Previously, the loader would initialize vkCreateSwapchainKHR and
vkGetDeviceGroupSurfacePresentModeskHR with vkGetInstanceProcAddr, instead
of what should have happened, which is to use vkGetDeviceProcAddr.
Charles Giessen [Fri, 21 Oct 2022 18:01:45 +0000 (12:01 -0600)]
Update BUILD.md
Remove references to VS 2015, as it is no longer supported.
Update the build instructions to include UPDATE_DEPS more prominently.
Move mentions of tests to the very end, and to use `ctest`.
Mention Cross Compilation caveats.
Charles Giessen [Fri, 21 Oct 2022 17:34:00 +0000 (11:34 -0600)]
Restore asm_offset printing code
The cross compiling workaround for asm_offset requires python, but this meant
that all builds required python. This commit re-adds the removed asm_offset
logic and then only requires python during cross compilation.
Charles Giessen [Fri, 21 Oct 2022 20:44:16 +0000 (14:44 -0600)]
Use correct allocator in debug_utils.c
loader_calloc_with_instance_fallback is used in places where a user can
supply their own allocator, but should default to the allocator used with
the instance otherwise. The issue was that loader_free was being used with
objects created with the instance allocator, but loader_free only takes the
user provided one, leading to leaks.
Charles Giessen [Mon, 17 Oct 2022 21:26:47 +0000 (15:26 -0600)]
Only deduplicate driver manifests
Code which was originally meant to deduplicate drivers that moved from the old
registry HKEY_LOCAL_MACHINE/SOFTWARE/Khronos/Vulkan/Drivers to PnP locations
was incorrectly applied to layers as well. The issue is that multiple layers
can share the same json file name but not actually contain the same manifest.
Worse, the first layer found would be assumed to be correct, even the file had
been deleted from the file system.
Charles Giessen [Fri, 9 Sep 2022 23:50:14 +0000 (17:50 -0600)]
Write gen_defines.asm using a python script
This allows cross compilation to enable unkonwn function handling as
gen_defines.asm will be generated without needing to run code meant for the
target platform. Previously, asm_offset.c wrote the gen_defines.asm file
by being run. Now, compilers emit their intermediate assembly output that the
parse_asm_values.py script knows how to find the relevant information from.
Additionally set the test framework `framework_config` build option to always
copy, instead of copy_if_different. This is needed since cmake wouldn't update
this file when changing from/to debug & release mode.
Juan Ramos [Tue, 18 Oct 2022 17:38:15 +0000 (11:38 -0600)]
ci: Use MACOS_DEPLOYMENT_TARGET
- This approach matches what our SDK release process expect
- Since setting CMAKE_MACOS_DEPLOYMENT_TARGET ignores env variable which SDK
release process uses, which could will cause issues in the future, if
the version is changed
- CMAKE_MACOS_DEPLOYMENT_TARGET doesn't propogate to dependencies via
update_deps.py
Mike Schuchardt [Thu, 13 Oct 2022 14:27:58 +0000 (07:27 -0700)]
build: Update to header 1.3.231
- Update known-good
- Generate source
Charles Giessen [Wed, 12 Oct 2022 22:12:58 +0000 (16:12 -0600)]
Correctly handle layers not being loaded in vkCreateDevice
This reverts the previous commit which reverted bad behavior.
Charles Giessen [Wed, 12 Oct 2022 21:45:58 +0000 (15:45 -0600)]
Revert "Don't load layer libraries in vkCreateDevice"
This reverts commit
cd9b4afed4e556ac88a75371eb7283fed94ca3c6.
Charles Giessen [Fri, 20 May 2022 18:18:41 +0000 (12:18 -0600)]
Guard loader.instances access with mutex.
While the adding and removing of data from this global linked list
was guarded, GetInstanceProcAddr & GetDeviceProcAddr did not have
such guards. This results in race conditions that were detected with
thread sanitizer. This commit adds a mutex solely for the
loader.instances global variable.
Charles Giessen [Tue, 11 Oct 2022 18:07:08 +0000 (12:07 -0600)]
Fix issue with MSVC 15 failing to compile test code
Was a basic case of googletest not allowing implicit conversion between
types.
Charles Giessen [Mon, 10 Oct 2022 18:24:58 +0000 (12:24 -0600)]
Don't abort when drivers don't support WSI calls
Instance extensions are aggregated, therefore an application has no way of
knowing whether an ICD supports a WSI function or not. This necessitates
returning instead of aborting from WSI functions, as well as writing 0,
NULL, or returning false as needed for each function. This also needs
additional NULL checks before calling down into the driver.
Charles Giessen [Thu, 6 Oct 2022 21:18:42 +0000 (15:18 -0600)]
Enable cross compile test discovery
gtest_discover_tests() doesn't work in cross compilation environments, so if
that is happening fall back to gtest_add_tests().
Charles Giessen [Tue, 4 Oct 2022 17:24:39 +0000 (11:24 -0600)]
Don't load layer libraries in vkCreateDevice
These libraries will always be loaded in vkCreateInstance, so we don't
need to load them again in vkCreateDevice. This has the added benefit
of not printing 'unloading library X' twice in the log.
Juan Ramos [Mon, 3 Oct 2022 23:12:50 +0000 (17:12 -0600)]
build: Fix CMake warnings
- CMAKE_GENERATOR_PLATFORM is only valid on Visual Studio generators
- Remove FindWayland since it's no longer needed. See this discussion for details: https://github.com/KhronosGroup/Vulkan-Docs/pull/1905
Mike Schuchardt [Thu, 29 Sep 2022 17:26:54 +0000 (10:26 -0700)]
build: Update to header 1.3.230
- Update known-good
- Generate source
PaperChalice [Sat, 24 Sep 2022 06:52:56 +0000 (14:52 +0800)]
loader: fix log message
Mike Schuchardt [Thu, 22 Sep 2022 16:48:57 +0000 (09:48 -0700)]
ci: Do apt update before install to fix 404 errors
Mike Schuchardt [Thu, 22 Sep 2022 16:16:10 +0000 (09:16 -0700)]
build: Update to header 1.3.229
- Update known-good
- Generate source
Mike Schuchardt [Thu, 15 Sep 2022 15:47:25 +0000 (08:47 -0700)]
build: Update to header 1.3.228
- Update known-good
- Generate source
Charles Giessen [Mon, 12 Sep 2022 17:53:34 +0000 (11:53 -0600)]
Make old layer with new app API version warning clearer
The previous message incorrectly labled all layes as Explicit layers
and didn't indicate what the 'warning' was about very well.
Charles Giessen [Thu, 8 Sep 2022 17:50:29 +0000 (11:50 -0600)]
Allow implicit layers for all API versions
This change makes the loader conform to the latests specification
update, 1.3.227, which removes the requirement that implicit layers
API version is at least as high as the application provided API
version.
This change reduces friction for layer developers and API users.
Mike Schuchardt [Thu, 8 Sep 2022 16:07:10 +0000 (09:07 -0700)]
build: Update to header 1.3.227
- Update known-good
- Generate source
Brad Smith [Fri, 2 Sep 2022 23:00:53 +0000 (19:00 -0400)]
build: Also include XCB header path
Steve Lhomme [Tue, 30 Aug 2022 06:08:25 +0000 (08:08 +0200)]
fix typo in CMakeLists
Steve Lhomme [Tue, 30 Aug 2022 06:17:51 +0000 (08:17 +0200)]
Fix the pkg-config import library name with mingw-w64
The common name for import libraries in mingw-w64 ends with .dll.a so we need
to use it so the pkg-config file ends up use -lvulkan-1.dll.
Steve Lhomme [Tue, 30 Aug 2022 05:42:27 +0000 (07:42 +0200)]
Generate the same DLL name with mingw-w64 as with MSVC
It should be the same name so mingw-w64 toolchains can generate/use the same
DLLs as the MSVC toolchains. The DLL and import libraries are compatible both
ways.
Fixes #997
Brad Smith [Fri, 2 Sep 2022 22:55:12 +0000 (18:55 -0400)]
loader: Only use alloca.h if it exists otherwise fallback to stdlib.h
Check for the existence of the alloca.h header and only use it it exists,
otherwise fallback to stdlib.h. Some OS's like macOS and QNX have both
headers and can use either (stdlib.h includes alloca.h), some OS's like
OpenBSD / FreeBSD / NetBSD do not have the alloca.h header and require
the stdlib.h header.
Brad Smith [Thu, 1 Sep 2022 07:05:12 +0000 (03:05 -0400)]
loader: Fix CMake detection of OpenBSD/FreeBSD / amd64
Charles Giessen [Thu, 25 Aug 2022 16:19:06 +0000 (10:19 -0600)]
Remove unneeded exports in test_wrap_layers
Some functions in the wrapping test layer exported functions that are not necessary.
This caused some warnings in builds. Removing them fixes the warnings.
Charles Giessen [Wed, 24 Aug 2022 23:04:38 +0000 (17:04 -0600)]
Refactor loader_icd_scan()
Put all of the parsing for ICD Manifest data into a separate function.
This cleans it up by not requiring manual tracking of allocated resources
while parsing, and allow much saner 'skipping' of incorrect ICD's.
This commit also addresses an issue where OOM during ICD parsing wasn't
immediately ending parsing and returning.
Charles Giessen [Wed, 24 Aug 2022 17:30:00 +0000 (11:30 -0600)]
Remove redundant checks for NULL
Calling free() doesn't require checking for NULL, but many places were
checking for NULL before calling the appropriate freeing function.
xantares [Thu, 1 Sep 2022 15:41:58 +0000 (17:41 +0200)]
appmodel.h is not yet available on mingw stable
https://sourceforge.net/p/mingw-w64/mailman/mingw-w64-public/thread/CALK-3mLynzo8%3D9tOoGjwUUWTCtG_MHb5L1Pzd_GCQ%2B8pR637MQ%40mail.gmail.com/#msg37677890
Charles Giessen [Fri, 22 Jul 2022 16:04:04 +0000 (10:04 -0600)]
Refactor unknown function tests
Allow multiple layers to intercept an unknown function and then create a single test
which tests many common combinations.
Charles Giessen [Wed, 13 Jul 2022 23:04:26 +0000 (17:04 -0600)]
Enable layer interception of unknown functions
Re-add previously reverted behavior that allows layers to setup dispatch chains for unknown physical
device and device functions during vkCreateInstance. Previously, functions not known to the loader could not
be queried by a layer during vkCreateInstance (when dispatch tables should be setup). The change adds support
for unknown functions in the trampolines of vkGetInstanceProcAddr and vkGetPhysicalDeviceProcAddr.
Unknown Device functions not listed in a layers manifest will now be found through vkGetInstanceProcAddr,
which was previously not used.
Charles Giessen [Tue, 12 Jul 2022 23:00:14 +0000 (17:00 -0600)]
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.
Brad Smith [Thu, 1 Sep 2022 05:53:59 +0000 (01:53 -0400)]
tests: Further fixes to be able to build on OpenBSD
Mike Schuchardt [Thu, 1 Sep 2022 15:32:22 +0000 (08:32 -0700)]
build: Update to header 1.3.226
- Update known-good
- Generate source
Brad Smith [Wed, 31 Aug 2022 19:56:19 +0000 (15:56 -0400)]
loader: Add stub function for OpenBSD executable path
Charles Giessen [Thu, 25 Aug 2022 18:16:54 +0000 (12:16 -0600)]
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.
Brad Smith [Wed, 31 Aug 2022 00:14:18 +0000 (20:14 -0400)]
loader: Add OpenBSD support
Mike Schuchardt [Thu, 18 Aug 2022 19:32:49 +0000 (12:32 -0700)]
build: Update to header 1.3.225
- Update known-good
- Generate source
Charles Giessen [Tue, 9 Aug 2022 00:18:02 +0000 (18:18 -0600)]
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.
Mike Schuchardt [Thu, 4 Aug 2022 16:49:24 +0000 (09:49 -0700)]
build: Update to header 1.3.224
- Update known-good
- Generate source
Charles Giessen [Fri, 29 Jul 2022 21:49:56 +0000 (15:49 -0600)]
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.
Mike Schuchardt [Thu, 28 Jul 2022 15:46:56 +0000 (08:46 -0700)]
build: Update to header 1.3.223
- Update known-good
- Generate source
Mike Schuchardt [Thu, 21 Jul 2022 16:28:00 +0000 (09:28 -0700)]
build: Update to header 1.3.222
- Update known-good
- Generate source
Pan [Fri, 15 Jul 2022 06:10:08 +0000 (14:10 +0800)]
Fix typo in setting linux environment variables
Replace `;` with `:` in setting linux environment variables.
Mike Schuchardt [Thu, 14 Jul 2022 16:10:27 +0000 (09:10 -0700)]
build: Update to header 1.3.221
- Update known-good
- Generate source
Mike Schuchardt [Mon, 11 Jul 2022 17:41:03 +0000 (10:41 -0700)]
loader: Dynamically load Win8+ functions
Allow loader to run on Windows 7 by dynamically loading function
pointers for Windows 8 and above APIs.
Charles Giessen [Fri, 8 Jul 2022 18:17:01 +0000 (12:17 -0600)]
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>
Charles Giessen [Thu, 7 Jul 2022 22:58:26 +0000 (16:58 -0600)]
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.
Charles Giessen [Thu, 7 Jul 2022 19:25:22 +0000 (13:25 -0600)]
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.
Charles Giessen [Tue, 21 Jun 2022 15:57:37 +0000 (10:57 -0500)]
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.
Mike Schuchardt [Thu, 7 Jul 2022 17:10:58 +0000 (10:10 -0700)]
build: Update to header 1.3.220
- Update known-good
- Generate source
Jesse Natalie [Thu, 30 Jun 2022 19:55:55 +0000 (12:55 -0700)]
Enable the Vulkan loader to load VulkanOn12/Dozen out of the D3DMappingLayers app package
Charles Giessen [Tue, 28 Jun 2022 23:46:39 +0000 (17:46 -0600)]
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.
Mike Schuchardt [Thu, 30 Jun 2022 18:08:38 +0000 (11:08 -0700)]
build: Update to header 1.3.219
- Update known-good
- Generate source
Yuly Novikov [Thu, 30 Jun 2022 17:43:15 +0000 (17:43 +0000)]
Fix BUILD.gn
Add newly added file stack_allocation.h
Fixes #846
Marcin Kańtoch [Thu, 23 Jun 2022 15:46:34 +0000 (17:46 +0200)]
loader: device array dealloc fix
Andrew Naumov [Mon, 14 Feb 2022 11:21:43 +0000 (14:21 +0300)]
loader: Add unicode support
Charles Giessen [Mon, 20 Jun 2022 20:38:56 +0000 (15:38 -0500)]
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.
Charles Giessen [Mon, 20 Jun 2022 20:53:25 +0000 (15:53 -0500)]
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.
Brad Grantham [Tue, 7 Jun 2022 21:11:54 +0000 (14:11 -0700)]
only descend into layer GPDPA from trampoline
Graeme Leese [Mon, 20 Jun 2022 14:45:25 +0000 (15:45 +0100)]
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.
Mike Schuchardt [Thu, 16 Jun 2022 16:02:49 +0000 (09:02 -0700)]
build: Update to header 1.3.218
- Update known-good
- Generate source
- Add missing enums to test framework
Mike Schuchardt [Thu, 16 Jun 2022 18:58:39 +0000 (11:58 -0700)]
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.
Mike Schuchardt [Mon, 13 Jun 2022 19:02:40 +0000 (12:02 -0700)]
build: Update to header 1.3.217
- Update known-good
- Generate source
Charles Giessen [Mon, 6 Jun 2022 18:05:52 +0000 (12:05 -0600)]
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.
Mike Schuchardt [Thu, 2 Jun 2022 18:41:38 +0000 (11:41 -0700)]
build: Update to header 1.3.216
- Update known-good
- Generate source
Charles Giessen [Thu, 2 Jun 2022 01:14:04 +0000 (19:14 -0600)]
Revert "fix #948 Only calls the first GPDPA in layer chain"
This reverts commit
a8c17d6a367417509aa7b11cf65083eac2b2f4c9.
Charles Giessen [Thu, 2 Jun 2022 01:14:04 +0000 (19:14 -0600)]
Revert "Comment tweak to reflect new behaviour."
This reverts commit
d86dc61e76f66b32b6955e8e7cbfa3edc7ed7b32.
Andrew Cox [Wed, 1 Jun 2022 17:08:36 +0000 (18:08 +0100)]
Comment tweak to reflect new behaviour.
Andrew Cox [Wed, 1 Jun 2022 16:51:29 +0000 (17:51 +0100)]
fix #948 Only calls the first GPDPA in layer chain
Charles Giessen [Tue, 24 May 2022 23:34:38 +0000 (17:34 -0600)]
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.
Tim Gfrerer [Tue, 31 May 2022 09:19:05 +0000 (10:19 +0100)]
fix typo
resulsts -> results
Charles Giessen [Fri, 27 May 2022 22:36:35 +0000 (16:36 -0600)]
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.
Charles Giessen [Tue, 24 May 2022 23:30:23 +0000 (17:30 -0600)]
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.
Charles Giessen [Thu, 26 May 2022 23:25:19 +0000 (17:25 -0600)]
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.
Mark Young [Fri, 27 May 2022 16:28:18 +0000 (10:28 -0600)]
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.
Mark Young [Thu, 26 May 2022 17:40:36 +0000 (11:40 -0600)]
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.
Mark Young [Wed, 25 May 2022 21:38:33 +0000 (15:38 -0600)]
Clarify JSON Manifest "api_version"
Clarify what is indicated by the "api_version" field in both
layer and driver manifest files.
Fixes issue #336.
Charles Giessen [Wed, 25 May 2022 16:47:55 +0000 (10:47 -0600)]
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.
Charles Giessen [Sat, 21 May 2022 01:56:19 +0000 (19:56 -0600)]
Use calloc instead of alloc+memset
Replace naked uses of malloc & free with loader_alloc & loader_free.
Charles Giessen [Sat, 21 May 2022 01:40:53 +0000 (19:40 -0600)]
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.