Commit Graph

3916 Commits

Author SHA1 Message Date
Charles Giessen
6c64537135 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().
2022-10-06 17:00:40 -06:00
Charles Giessen
cd9b4afed4 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.
2022-10-04 13:28:00 -06:00
Juan Ramos
925eb27e51 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
2022-10-03 17:30:15 -06:00
Mike Schuchardt
c71f94d8a8 build: Update to header 1.3.230
- Update known-good
- Generate source
2022-09-29 11:29:08 -07:00
PaperChalice
9c40a28e3e loader: fix log message 2022-09-26 11:56:43 -06:00
Mike Schuchardt
f755a87bf8 ci: Do apt update before install to fix 404 errors 2022-09-22 10:58:15 -07:00
Mike Schuchardt
1bfe4ad2b5 build: Update to header 1.3.229
- Update known-good
- Generate source
2022-09-22 10:58:15 -07:00
Mike Schuchardt
3090fc12bd build: Update to header 1.3.228
- Update known-good
- Generate source
2022-09-15 09:07:36 -07:00
Charles Giessen
55b1b3d07a 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.
2022-09-15 10:03:20 -06:00
Charles Giessen
2f87e2b3a5 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.
2022-09-08 13:48:46 -06:00
Mike Schuchardt
23043a5c87 build: Update to header 1.3.227
- Update known-good
- Generate source
2022-09-08 10:03:21 -07:00
Brad Smith
0a783b5d3e build: Also include XCB header path 2022-09-06 16:53:34 -06:00
Steve Lhomme
a73cf14417 fix typo in CMakeLists 2022-09-06 11:31:17 -06:00
Steve Lhomme
688ad64341 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.
2022-09-06 11:31:17 -06:00
Steve Lhomme
b57feee285 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
2022-09-06 11:31:17 -06:00
Brad Smith
fdfdef6d1b 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.
2022-09-02 17:52:37 -06:00
Brad Smith
efe6aa4f3f loader: Fix CMake detection of OpenBSD/FreeBSD / amd64 2022-09-01 15:26:14 -06:00
Charles Giessen
823078c862 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.
2022-09-01 13:13:14 -06:00
Charles Giessen
1bede3d1a0 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.
2022-09-01 13:13:14 -06:00
Charles Giessen
ad5c8f5305 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.
2022-09-01 13:13:14 -06:00
xantares
b437061de1 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
2022-09-01 12:28:13 -06:00
Charles Giessen
4f79db3afe Refactor unknown function tests
Allow multiple layers to intercept an unknown function and then create a single test
which tests many common combinations.
2022-09-01 12:23:17 -06:00
Charles Giessen
1f2f222f60 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.
2022-09-01 12:23:17 -06:00
Charles Giessen
e19518e31f 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
efa8903d73 tests: Further fixes to be able to build on OpenBSD 2022-09-01 12:21:19 -06:00
Mike Schuchardt
87429ffc5d build: Update to header 1.3.226
- Update known-good
- Generate source
2022-09-01 09:24:25 -07:00
Brad Smith
095a7bf60b loader: Add stub function for OpenBSD executable path 2022-08-31 14:11:59 -06:00
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