Commit Graph

3810 Commits

Author SHA1 Message Date
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
Ludovico de Nittis
db0fb163d7 Update supported versions in the docs
Mention the supported versions that were missing.

Signed-off-by: Ludovico de Nittis <ludovico.denittis@collabora.com>
2022-05-20 20:03:51 -06:00
Mike Schuchardt
ad05e878ee build: Update to header 1.3.214
- Update known-good
- Generate source
2022-05-17 08:43:02 -07:00
Mike Schuchardt
5aa2ee48c9 build: Update to header 1.3.213
- Update known-good
- Generate source
2022-05-11 10:31:02 -07:00
Charles Giessen
8dc9ab5ce8 Revert "Implement unknown function intercept in layers"
This reverts commit 0fd2ff8384.
2022-05-11 08:57:30 -06:00
Mark Young
08cad0c015 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
Mark Young
956139e991 Update layer manifest file
Some fields specific to manifest files were missing.  Also updated
file to clearly indicate where fields are valid and usable.
2022-05-04 16:04:38 -06:00
Charles Giessen
a9543c5ac3 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
461f53cdb5 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
0fd2ff8384 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
Charles Giessen
36a82e0de8 Correctly check for NULL in loader_get_dispatch 2022-05-03 13:39:00 -06:00
Sein Lee
191e261495 Fix typo 2022-05-02 16:29:21 -06:00
Mike Schuchardt
155ca6b868 ci: Remove fbactions/setup-winsdk
The default version 18362 started 404'ing and a new enough version is
present in the base image.
2022-04-21 10:26:19 -07:00
Mike Schuchardt
d16694d362 build: Update to header 1.3.212
- Update known-good
- Generate source
2022-04-21 10:26:19 -07:00
Charles Giessen
71bd6240af Add app_key OverrideMetaLayer tests 2022-04-14 13:18:54 -06:00
Erik Faye-Lund
f503824ff8 Update LoaderDriverInterface.md
Fix link-syntax.
2022-04-13 01:35:14 -06:00
Charles Giessen
5b84b6d09a Refactor FrameworkEnvironment API a bit
Redo some of API's for adding layers and ICD's to the test framework.
2022-04-12 13:00:32 -06:00
Charles Giessen
859fb722c2 Document VK_KHR_portability_enumeration support 2022-04-07 11:49:53 -06:00
Charles Giessen
717697987e Warn if portability_enumeration extension should be enabled
Log an error if an application creates a VkDevice from a physical device which
was enumerated from a driver that is a portability driver but the application
didn't correctly enable the portability enumeration flag & extension.
2022-04-06 18:25:09 -06:00
Charles Giessen
1de26aad69 Increase discovery timeout for Gtest test to 100 seconds 2022-04-06 16:23:51 -06:00
Charles Giessen
e7f0c75354 Revert 32bit linux unknown ext chain change
Fix breaking of builds due to the dropping of GOT addressing mode.
2022-04-06 15:43:25 -06:00
Mike Schuchardt
ae24c6e791 build: Update to header 1.3.211
- Update known-good
- Generate source
2022-04-05 10:27:27 -07:00
Charles Giessen
469aead205 Allow meta layers to have newer component layers
Relax the requirement that all component layers in a meta layer must equal the version of the meta layer.
This allows enabling layers that do not have the same API version as the meta layer.
2022-04-04 19:17:07 -06:00
Charles Giessen
a06dd5484a Clean up version checking logic
Add a few helper functions to simplify checking that a X.Y.Z version is sufficient.
2022-04-04 19:17:07 -06:00
Charles Giessen
aeec557162 Fix 32 bit linux unknown function handling
Building and running the regression tests reveals that the 32 bit unknown function
handling on linux is broken. It required the same fixes as did windows 32 bit, since
the code is almost identical.

wsi.c also would not compile in 32 bit linux due to the warnings-as-errors being enabled,
which has also been fixed.
2022-04-04 19:14:44 -06:00
Charles Giessen
d24a1045fd Fix missed Physical Devices in Windows
The previous logic would cause any non-sorted physical devices to be missed
when aggregating the final list. This caused crashes due to the phys_dev
value not being initialized. The fix is to make sure both sorted and non
sorted physical devices are included in the final output of
setup_loader_term_phys_devs().
2022-04-04 16:38:17 -06:00
Charles Giessen
d921b818b3 Use correct TestICD in tests
Many tests were using the V6 TestICD, which means that it exports the
EnumerateAdapterPhysicalDevices. The loader then only looks for devices
using that functionality and if the test didn't set it up, the driver
won't have its devices found.

Also:
* Cleaned up handle_validation_tests
* Added WSI setup helpers, which put all the setup code for WSI in one place
* Created a to/from_nondispatch_handle function for TestICD, probably should
be in a more general location
2022-04-04 16:38:17 -06:00
Charles Giessen
c70d9c29a8 Add test for different ICD interface versions
Fix Test Framework not skipping Drivers which have a different LUID.
2022-04-04 16:38:17 -06:00
Mike Schuchardt
7f84b1c2fa build: Update to header 1.3.210
- Update known-good
- Generate source
2022-04-01 10:55:08 -07:00
Charles Giessen
f8c97eea2f Dont emit warnings on unknown manifest file versions
Since the loader is meant to be forward compatible, it makes little sense to emit
a warning when an ICD or Layer manifest is found with a version that it doesn't
understand. Thus they now are INFO level.
2022-03-31 11:54:03 -06:00