platform/upstream/Vulkan-Loader.git
13 months agoUpgrade version to 1.3.250 1.3.250
Xuelian Bai [Fri, 1 Sep 2023 06:25:10 +0000 (14:25 +0800)]
Upgrade version to 1.3.250

Change-Id: Id1d95430af27e11bf76c83e3933475bf8eb6886d

14 months agoFix crash on pixel phone
Xuelian Bai [Thu, 3 Aug 2023 06:36:49 +0000 (14:36 +0800)]
Fix crash on pixel phone

Change-Id: I89320faf4c1063b9404cfca1d528edef4cfa8fb3
Signed-off-by: Xuelian Bai <xuelian.bai@samsung.com>
14 months agoUpgrade to v1.3.240
Xuelian Bai [Fri, 23 Sep 2022 06:09:21 +0000 (14:09 +0800)]
Upgrade to v1.3.240

Change-Id: Ibcdb636a32951e23bd0871a93dd7ffa88a7cc2c6

14 months agoRemove unnecessary usages of prefix in pc
Joonbum Ko [Tue, 23 Aug 2022 06:37:40 +0000 (15:37 +0900)]
Remove unnecessary usages of prefix in pc

Change-Id: If03b32419c4c094b5645009a008549b5f8510315
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
14 months agoremove double slash in vulkan.pc
jinbong, Lee [Wed, 10 Aug 2022 04:15:16 +0000 (13:15 +0900)]
remove double slash in vulkan.pc

Change-Id: I891e70bd36594aa31fc6f405006e233c58ad35d1

14 months agoFix double free issue
Xuelian Bai [Mon, 23 May 2022 05:44:12 +0000 (13:44 +0800)]
Fix double free issue

dEQP-VK.api.object_management.alloc_callback_fail.device is crashed on
RPI4, it's caused by double free in icd_term->logical_device_list.
This patch intend to avoid duplicated item in
icd_term->logical_device_list.

Change-Id: Icfd35f8fad70a06a5697d9dc0c0a330f83e08fc6
Signed-off-by: Xuelian Bai <xuelian.bai@samsung.com>
14 months agoUpgrade to 1.3.208
Xuelian Bai [Mon, 21 Mar 2022 06:09:39 +0000 (14:09 +0800)]
Upgrade to 1.3.208

1. Change version number
2. Add default path for mesa icd

Change-Id: Iea5a2636cb8215c82cb901fed3bf4dc058e86c62
Signed-off-by: Xuelian Bai <xuelian.bai@samsung.com>
14 months agoadd spec file
SooChan Lim [Thu, 29 Nov 2018 12:29:50 +0000 (21:29 +0900)]
add spec file

17 months agodocs: Update README.md
juan-lunarg [Thu, 4 May 2023 19:12:47 +0000 (13:12 -0600)]
docs: Update README.md

17 months agobuild: Update to header 1.3.250
Mike Schuchardt [Thu, 4 May 2023 17:24:21 +0000 (10:24 -0700)]
build: Update to header 1.3.250

- Update known-good
- Generate source

17 months agobuild: Update to header 1.3.249
Mike Schuchardt [Thu, 27 Apr 2023 16:05:54 +0000 (09:05 -0700)]
build: Update to header 1.3.249

- Update known-good
- Generate source

17 months agobuild: Update to header 1.3.248
Mike Schuchardt [Thu, 20 Apr 2023 16:11:36 +0000 (09:11 -0700)]
build: Update to header 1.3.248

- Update known-good
- Generate source

17 months agoLog ERROR when layers in VK_INSTANCE_LAYERS are missing
Charles Giessen [Tue, 18 Apr 2023 19:40:33 +0000 (13:40 -0600)]
Log ERROR when layers in VK_INSTANCE_LAYERS are missing

It is unhelpful to have zero diagnostics emitted when the layers listed in
VK_INSTANCE_LAYERS are not found.

17 months agobuild: Update to header 1.3.247
Mike Schuchardt [Thu, 13 Apr 2023 16:30:51 +0000 (09:30 -0700)]
build: Update to header 1.3.247

- Update known-good
- Generate source

17 months agoUse Ubuntu 22 in github actions
Charles Giessen [Thu, 6 Apr 2023 19:10:48 +0000 (13:10 -0600)]
Use Ubuntu 22 in github actions

Remove the unneded pkg-config-i686-linux-gnu package since its gone in 22.

17 months agoFix ordering regression for VK_INSTANCE_LAYERS
Charles Giessen [Fri, 31 Mar 2023 23:26:07 +0000 (17:26 -0600)]
Fix ordering regression for VK_INSTANCE_LAYERS

The commit to add VK_LOADER_LAYERS_ENABLE/DISABLE inadvertently broke the
ordering guarantees of VK_INSTANCE_LAYERS. This commit restores that order.
If both VK_INSTANCE_LAYERS and VK_LOADER_LAYERS_ENABLE add layers, the order
will be VK_INSTANCE_LAYERS enabled layers, in the order specified by the
env-var, followed by any layers enabled by VK_LOADER_LAYERS_ENABLED enabled in
the order they are found on the system.

In addition to this, the test framework receieved two changes:
* Make env-var folders report their contents in a deterministic order (aka the
order the items were added to the framework). This mirrors existing behavior
for redirected folders.
* Make platform shim resilient to shutdown ordering issues. Namely, set a flag
during shutdown so that any interception functions go straight to the real
version of the functoin. This works around an issue during the destruction of
the FolderManagers for the environment variables, where the readdir shim
function was trying to use the FolderManager's data but Address Sanitizer
declared that such a use was 'heap use after free'.
* Rename set_path to set_fake_path to better indicate its purpose

17 months agoMake correct layer be used when duplicates are present
Charles Giessen [Wed, 29 Mar 2023 20:05:44 +0000 (14:05 -0600)]
Make correct layer be used when duplicates are present

When there are multiple versions of the same layer found through environment variables
or from implicit layer locations, the loader would use the *last* one that appeared rather
than the first, causing surprising behavior. This commit fixes that by checking to make
sure that layers do not already exist in the list of layers to be enabled before adding a
layer to the list, preventing duplicates from appearing in the list.

This commit adds a check in vkEnumerateInstanceLayerProperties to skip over layers that do
wish to intercept the function. The missing check would only cause a spurious log message
which said that the loader was unable to load a symbol names "" (as in an empty string)
from the layer.

This commit also amends the test framework with the following fixes:
* Create Layer JSON manifests that contain multiple layers
* Only add layers to the registry if they are generic (meant to simulate installed layers)
* Allow layers to print messages during vkCreateInstance - a mechanism to double check that
only the correct layer(s) are loaded
* Fixes env-var added layers not using full paths
* Only have 1 XDG env-var set, making all other XDG env-var have an empty string
* Set the XDG env-vars even on macOS (github actions seems to have them set)

17 months agobuild: Update to header 1.3.246
Mike Schuchardt [Fri, 31 Mar 2023 14:56:04 +0000 (08:56 -0600)]
build: Update to header 1.3.246

- Update known-good
- Generate source

17 months agoAdd 4th component to version in loader.rc
Charles Giessen [Wed, 29 Mar 2023 20:10:04 +0000 (14:10 -0600)]
Add 4th component to version in loader.rc

FILVERSION is supposed to be a 4 component field. The previous commit to make loader.rc
be generated did not account for that and so requires this fix to make sure it has four
components. Thankfully, this issue is not present in SDK released loaders thanks to the
SDK specifying its own version string that has 4 components.

17 months agobuild: Update to header 1.3.245
Mike Schuchardt [Fri, 24 Mar 2023 17:18:22 +0000 (10:18 -0700)]
build: Update to header 1.3.245

- Update known-good
- Generate source

17 months agobuild: Update to header 1.3.244
Mike Schuchardt [Mon, 20 Mar 2023 04:59:15 +0000 (21:59 -0700)]
build: Update to header 1.3.244

- Update known-good
- Generate source

19 months agoAdd missing backtick in LoaderInterfaceArchitecture.md
Charles Giessen [Thu, 16 Mar 2023 19:39:02 +0000 (13:39 -0600)]
Add missing backtick in LoaderInterfaceArchitecture.md

19 months agoDocs: Add missing ".md"
MeeSong [Tue, 14 Mar 2023 07:50:59 +0000 (15:50 +0800)]
Docs: Add missing ".md"

19 months agobuild: Update to header 1.3.243
Mike Schuchardt [Mon, 13 Mar 2023 17:43:05 +0000 (10:43 -0700)]
build: Update to header 1.3.243

- Update known-good
- Generate source
- Add new return code to test_util.h

19 months agoMake check_code_format.sh not care about includes
Charles Giessen [Thu, 9 Mar 2023 19:27:25 +0000 (12:27 -0700)]
Make check_code_format.sh not care about includes

The code being removed here was a fix for travis CI which is no longer in
use. The git diff ignores files in the gitignore, so this workaround is no
longer necessary.

19 months agoAdd clang-format-diff.py
Charles Giessen [Thu, 9 Mar 2023 19:25:55 +0000 (12:25 -0700)]
Add clang-format-diff.py

Turns out this script was never checked in, causing the check_code_format.sh script to
never run. This is due to python *not* returning an error when it fails to find the
python script, which results in the shell script passing while never actually checking
the formatting.

19 months agoSet github actions to only have read only permissions
Charles Giessen [Thu, 9 Mar 2023 17:39:04 +0000 (10:39 -0700)]
Set github actions to only have read only permissions

Because the loader only uses github actions to perform CI runs, it is good to set
the 'read-all' only, helping harden the github actions runners from potentially
compromised access.

For more context
https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions

Fixes #1148

19 months agoAllow the loader to enable ASAN outside of testing
Charles Giessen [Tue, 7 Mar 2023 22:14:43 +0000 (15:14 -0700)]
Allow the loader to enable ASAN outside of testing

This commit promotes the build option TEST_USE_ADDRESS_SANITIZER and
TEST_USE_THREAD_SANITIZER to not be behind BUILD_TESTS. This allows users
of the loader to enable ASAN & TSAN support on the loader without enabling
the loader's tests.

The new options are called LOADER_ENABLE_ADDRESS_SANITIZER and
LOADER_ENABLE_THREAD_SANITIZER.

There is also a new build option: `LOADER_DISABLE_DYNAMIC_LIBRARY_UNLOADING`.
This is to allow layers & drivers that use Address Sanitizer to get useful
stack traces when running their code. Because vkDestroyInstance unloads all
layer and driver dynamic libraries, leak sanitizer cannot create complete
stack traces, making debugging the leaks much more difficult than necessary.
This option is only available when LOADER_ENABLE_ADDRESS_SANITIZER is also
enabled, due to that being the only reason to prevent the unloading of
libraries.

19 months agoCall DestroyInstance on each driver in error path
Charles Giessen [Sat, 25 Feb 2023 01:09:47 +0000 (18:09 -0700)]
Call DestroyInstance on each driver in error path

If CreateInstance successfully calls terminator_CreateInstance but subsequently fails on the way
back up the chain, the loader should call DestroyInstance on each driver to give them a chance to
clean up. This path is possible during CTS OOM tests which cause VVL to fail which then causes
leaks to occur.

Additionally, the layer name allocations needed to be cleaned up in this error
path as well, since there is no chance for vkDestroyInstance to run.

19 months agobuild: Update to header 1.3.242
Mike Schuchardt [Mon, 27 Feb 2023 18:47:21 +0000 (10:47 -0800)]
build: Update to header 1.3.242

- Update known-good
- Generate source

19 months agobuild: Update to header 1.3.241
Mike Schuchardt [Thu, 16 Feb 2023 16:10:20 +0000 (08:10 -0800)]
build: Update to header 1.3.241

- Update known-good
- Use new 'depends' attribute for extension dependencies
- Generate source

20 months agoFix documentation to use the correct function name
Charles Giessen [Fri, 17 Feb 2023 21:25:12 +0000 (14:25 -0700)]
Fix documentation to use the correct function name

`vk_icdNegotiateLoaderICDInterfaceVersion` was intended but due to a copy paste error `vk_icdGetInstanceProcAddr`
was used instead.

20 months agoOnly allocate layers if initialization succeed
Christophe [Mon, 13 Feb 2023 15:37:59 +0000 (16:37 +0100)]
Only allocate layers if initialization succeed

20 months agoA bit more safe string copy
Christophe [Mon, 13 Feb 2023 14:47:55 +0000 (15:47 +0100)]
A bit more safe string copy

20 months agoUse calloc instead of alloc
Christophe [Mon, 13 Feb 2023 14:34:50 +0000 (15:34 +0100)]
Use calloc instead of alloc

20 months agogni
Christophe [Wed, 1 Feb 2023 17:40:42 +0000 (18:40 +0100)]
gni

20 months agoTesting C.I. memory leak hypothesis
Christophe [Wed, 1 Feb 2023 17:34:17 +0000 (18:34 +0100)]
Testing C.I. memory leak hypothesis

20 months agoWarn user when using device layers field #1086
Christophe [Tue, 3 Jan 2023 15:37:15 +0000 (16:37 +0100)]
Warn user when using device layers field #1086

The device layer fields in VkDeviceCreateInfo are deprecated and have
been for years. Users should not be adding anything to them (and if
they do, it should match the layers added in VkInstanceCreateInfo).

This would be a warning that 'device layers are deprecated, they do
nothing' in case a user is trying to enable validation layers using
them. Charles has seen multiple users not knowing that they are
deprecated and get burned by the API due to not having validation
layers enabled.

Since there may be applications in the wild which currently do provide
a list of layers to device create info, this warning should only be
issued if the list differs from instance creation. That way no spurious
warnings are created.

20 months agocmake: Add VULKAN_LOADER_VERSION
Juan Ramos [Mon, 13 Feb 2023 23:10:35 +0000 (16:10 -0700)]
cmake: Add VULKAN_LOADER_VERSION

20 months agocmake: Remove custom find_package code
Juan Ramos [Mon, 13 Feb 2023 17:49:30 +0000 (10:49 -0700)]
cmake: Remove custom find_package code

20 months agocmake: Use PkgConfig to find XCB, X11, and DirectFB
Juan Ramos [Mon, 13 Feb 2023 17:48:22 +0000 (10:48 -0700)]
cmake: Use PkgConfig to find XCB, X11, and DirectFB

20 months agoci: Test CMake min for Linux builds
Juan Ramos [Wed, 1 Feb 2023 16:28:24 +0000 (09:28 -0700)]
ci: Test CMake min for Linux builds

20 months agocmake: Remove pointless conditionals
Juan Ramos [Wed, 1 Feb 2023 00:27:25 +0000 (17:27 -0700)]
cmake: Remove pointless conditionals

CMake min is now 3.17

20 months agoClarify the VK_LOADER_DRIVERS_SELECT example
Ludovico de Nittis [Tue, 31 Jan 2023 14:58:48 +0000 (15:58 +0100)]
Clarify the VK_LOADER_DRIVERS_SELECT example

In the documentation examples, if we set
`VK_LOADER_DRIVERS_SELECT=nvidia`, we are saying to the loader to select
only the driver whose JSON manifest is called exactly `nvidia`.

This is likely not what we want, because the Nvidia drivers are usually
called something like `nvidia_icd.json`, and not just `nvidia` without a
file extension.

In the "Behavior" column it already states that:
"Since drivers don’t have a name like layers, this glob is used to
compare against the manifest filename."
So, to avoid confusion, we just need to change the example to reflect
how the loader glob works.

This commit also adds an additional automated test to ensure that this
full-name string glob actually works as described in the documentation.

Signed-off-by: Ludovico de Nittis <ludovico.denittis@collabora.com>
20 months agoEnsure VkPhysicalDevice unwrapping in Device functions
Charles Giessen [Tue, 10 Jan 2023 00:59:40 +0000 (17:59 -0700)]
Ensure VkPhysicalDevice unwrapping in Device functions

Certain functions, like vkSetDebugUtilsObjectNameEXT can take a physical device
as a parameter. When this function is queried through vkGetInstanceProcAddr,
the trampoline is returned, whereas when queried through vkGetDeviceProcAddr,
the trampoline wasn't returned, allowing the physical device parameter to not
get unwrapped before calling down the chain, causing a crash.

This commit modifies the codegen to always use the trampoline for these
functions, and adds tests for them. These changes require the the loader check
that the appropriate extensions are enabled during the application's call to
vkGetDeviceProcAddr, since it otherwise always return a non-null function
pointer.

20 months agoImplement VK_LUNARG_direct_driver_loading
Charles Giessen [Wed, 4 Jan 2023 22:05:02 +0000 (15:05 -0700)]
Implement VK_LUNARG_direct_driver_loading

VK_LUNARG_direct_driver_loading is an instance extension which allows
applictations to include drivers directly to the loader, instead of relying
on system installed drivers or environment variables specifying where the
desired driver is located. This allows applications to 'ship' a driver with
themselves and easily provide it to the system loader.

Changes related to direct driver loading:
* Source implementation
* Documentation of new extension, interactions with existing driver discovery
mechanism, and issues with implicit layers
* Extensive tests covering many feature combinations.

Changes also made in this commit:
* Add EnvVarWrapper which more cleanly handles setting, modifying, and
removing Environment Variables. This has the effect of allowing all tests to
run from the test executable without leaking env-vars, which previously
caused spurious test failure. Note - CTest runs each test in a separate
process which hides this issue.
* Adds -Wshadow=local for the gcc compiler (only for gcc 7 and up).
The MSVC compiler already enables this check with W4 so it was added for consistency.
* Add <!-- omit from toc --> to Documenation pages. This prevents the
"Markdown all in one" extension from adding labels to the table of contents.
* Add ManifestDiscoveryType::null_dir, to separate tests that want to write
a manifest file to a place the loader normally does not search and tests which
do not write any manifest file at all.
* Updated copyright to 2023 for changed files

20 months agoRemove newlines in log messages
Charles Giessen [Mon, 30 Jan 2023 19:22:08 +0000 (12:22 -0700)]
Remove newlines in log messages

The loader_log() function adds a new line at the end of every log message.
Having the string contain an extra new line is redundant and makes the output
inconsistent due to having random blank lines.

20 months agogn: Add ninja to DEPS
Mike Schuchardt [Mon, 30 Jan 2023 18:13:35 +0000 (10:13 -0800)]
gn: Add ninja to DEPS

Instead of relying on the version in depot_tools

20 months agocmake: Remove custom install code
Juan Ramos [Fri, 27 Jan 2023 22:44:47 +0000 (15:44 -0700)]
cmake: Remove custom install code

20 months agocmake: Cleanup BUILD_TESTS code
Juan Ramos [Fri, 27 Jan 2023 22:42:49 +0000 (15:42 -0700)]
cmake: Cleanup BUILD_TESTS code

20 months agocmake: Add scripts/CMakeLists.txt
Juan Ramos [Fri, 27 Jan 2023 22:39:52 +0000 (15:39 -0700)]
cmake: Add scripts/CMakeLists.txt

- Abstracts update_deps code similar to VVL
- Reduce(s) variable polution

20 months agoci: Fix GitHub warnigs about setup-python@v2
Juan Ramos [Fri, 27 Jan 2023 16:34:33 +0000 (09:34 -0700)]
ci: Fix GitHub warnigs about setup-python@v2

20 months agocmake: Update minimum to 3.17.2
Juan Ramos [Fri, 27 Jan 2023 16:48:34 +0000 (09:48 -0700)]
cmake: Update minimum to 3.17.2

Matches what VVL currently uses

20 months agoci: Update GN toolchain
Mike Schuchardt [Fri, 27 Jan 2023 17:38:34 +0000 (09:38 -0800)]
ci: Update GN toolchain

20 months agobuild: Update to header 1.3.240 upstream/1.3.240
Mike Schuchardt [Fri, 27 Jan 2023 17:27:22 +0000 (09:27 -0800)]
build: Update to header 1.3.240

- Update known-good
- Generate source

20 months agoRe-checking loader.rc file
Charles Giessen [Thu, 26 Jan 2023 22:11:25 +0000 (15:11 -0700)]
Re-checking loader.rc file

The loader.rc file is now checked into the source, and is automatically updated
by python whenever the headers are updated so that it contains the version used
to build the loader.

If BUILD_DLL_VERSIONINFO is set in the command line, then the loader will use
that version to configure a new loader.rc and place it in the build directory.
Then it will use that loader.rc rather than the checked in file. This allows
Vulkan Runtimes to be built with an exact version.

The file is checked in to allow builds without modifying the source directory
and allowing GN builds to not need any additional configuration to work.

20 months agoci: Fix CI warnings
Juan Ramos [Thu, 26 Jan 2023 23:47:59 +0000 (16:47 -0700)]
ci: Fix CI warnings

20 months agoFix copyright in windows .rc file
Charles Giessen [Wed, 25 Jan 2023 21:32:41 +0000 (14:32 -0700)]
Fix copyright in windows .rc file

This commit makes the copyright date to be taken from the day of the build
instead of it being hardcoded, which is liable to be out of date.

This commit also makes the loader.rc be generated into the build directory
rather than the source tree. Because this commit modifies the version info to
include the current header version for debug builds, this prevents needing to
update the file whenever the headers update.

20 months agoLog when VK_LAYER_PATH is ignored
Charles Giessen [Tue, 24 Jan 2023 17:52:24 +0000 (10:52 -0700)]
Log when VK_LAYER_PATH is ignored

The current design of the loader make the Override Layer, with its override
paths, take priority over VK_LAYER_PATH. This is fine, but if the override
layer accidentally was left around, it can cause confusion as VK_LAYER_PATH
suddenly stops working for no apparent reason. This commit adds a log message
to indicate that it is being ignored.

20 months agogithub: Use main instead of master
Juan Ramos [Mon, 23 Jan 2023 18:01:28 +0000 (11:01 -0700)]
github: Use main instead of master

closes #1107

21 months agodocs: Notify users about upcoming master to main change
Juan Ramos [Thu, 19 Jan 2023 17:44:08 +0000 (10:44 -0700)]
docs: Notify users about upcoming master to main change

21 months agobuild: Update to header 1.3.239
Mike Schuchardt [Thu, 19 Jan 2023 16:49:15 +0000 (09:49 -0700)]
build: Update to header 1.3.239

- Update known-good
- Generate source

21 months agoAdd Vulkan Loader and Driver Interface Version 7
Charles Giessen [Tue, 17 May 2022 15:51:24 +0000 (09:51 -0600)]
Add Vulkan Loader and Driver Interface Version 7

The changes made by Version 7 are as follows.
If a Driver supports any of the following functions,
they must be exposed by with vk_icdGetInstanceProcAddr:
 * vk_icdNegotiateLoaderICDInterfaceVersion
 * vk_icdGetPhysicalDeviceProcAddr
 * vk_icdEnumerateAdapterPhysicalDevices (Windows only)
This makes it optional for a driver to export these functions. Drivers may still
export them for compatibility with older loaders.

Loader and Driver Interface Version 7 allows for drivers provided through the
VK_LUNARG_direct_driver_loading extension to support the entire Loader and Driver
Interface.

This commit makes many small fixes to the documentation. Main changes are adding
Version 7 of the Loader and Driver Interface, clarifies when the functions
associated with this version must be exported, when they can be optionally exported
and when they must be exposed through vk_icdGetInstanceProcAddr. This also
clarifies LDP_DRIVER_10 to note the exact behavior of drivers that is disallowed.
In the process of these documentation changes, the glossary was amended with
definitions for Exported Functions, Exposed Functions, and Querying Functions.

21 months agobuild: Remove VS2015 support
Juan Ramos [Mon, 16 Jan 2023 21:33:39 +0000 (14:33 -0700)]
build: Remove VS2015 support

21 months agoci: Test CMake minimum
Juan Ramos [Mon, 16 Jan 2023 19:43:24 +0000 (12:43 -0700)]
ci: Test CMake minimum

21 months agoAdd guard for GetPhysDevProcAddr typedef
Charles Giessen [Mon, 16 Jan 2023 05:32:01 +0000 (22:32 -0700)]
Add guard for GetPhysDevProcAddr typedef

vk_layer_dispatch_table.h may be included after vk_icd.h and may cause multiple
definitions. This commit adds a macro guard on whether the type is defined just
in case.

21 months agoTry to catch OOM errors when loading binaries
Charles Giessen [Thu, 8 Dec 2022 00:15:22 +0000 (17:15 -0700)]
Try to catch OOM errors when loading binaries

If there is an error loading a dynamic library, check to see if it is
the result of an OOM condition. Then return the appropriate OOM error
code up the callchain. This commit is the result of an OOM condition
when trying to load the validation layers, which resulted in the return
code VK_ERROR_LAYER_NOT_PRESENT. This is very misleading. If the
loader can catch then report more accurate information, then it should.

21 months agoAdded target condition to vulkan headers
B Marques [Mon, 26 Dec 2022 17:57:02 +0000 (14:57 -0300)]
Added target condition to vulkan headers

21 months agocmake: Fix usage of Vulkan::Registry
Juan Ramos [Tue, 10 Jan 2023 16:57:35 +0000 (09:57 -0700)]
cmake: Fix usage of Vulkan::Registry

Vulkan::Registry was deprecated by Vulkan-Headers

Use 'VULKAN_HEADERS_REGISTRY_DIRECTORY' instead.

closes #1106

21 months agoDocument behavior change in how bundles drivers are used
Charles Giessen [Tue, 6 Dec 2022 21:13:18 +0000 (14:13 -0700)]
Document behavior change in how bundles drivers are used

Document that a bundled driver on macOS will cause the loader to ignore drivers
in system installed locations.

21 months agoAdd macOS bundles support to test framework
Charles Giessen [Tue, 6 Dec 2022 20:45:15 +0000 (13:45 -0700)]
Add macOS bundles support to test framework

Allow basic tests to be written which exercise the bundle discovery and loading logic
in the loader. This allows testing whether drivers found in bundles disables searching
for drivers on the rest of the system.

This commit also inclues fixes for a half dozen non essential spelling mistakes.

21 months agoFix Bundled drivers on MacOS taking precedence
Charles Giessen [Mon, 5 Dec 2022 19:21:59 +0000 (12:21 -0700)]
Fix Bundled drivers on MacOS taking precedence

Previous commits broke the behavior of only using bundled drivers if found,
this commit fixes the condition to make sure the bundled drivers are used while
no other drivers are loaded.

21 months agoAdd Vulkan-Headers version to source
Charles Giessen [Tue, 3 Jan 2023 23:26:23 +0000 (16:26 -0700)]
Add Vulkan-Headers version to source

The version of the Vulkan-Headers used to generate the source code is what should be
used to set the version of the binary, rather than the version of the Vulkan-Headers
that is currently available. This commit checks that version into the repo so that
it is used, and adds the necessary python code to update it.

This behavior was previously in the repo but was broken by the update to use the
version parsing logic from the Vulkan-Headers.

21 months agoFix allocation callback test to start at 0
Charles Giessen [Tue, 3 Jan 2023 23:11:13 +0000 (16:11 -0700)]
Fix allocation callback test to start at 0

While working on the code, it is common to start the allocation tests at a fail_index
greater than zero, usually close to when the issue starts. This was accidentally
checked in, this commit fixes that mistake.

21 months agoRevert asm_offset CMake code to work with 3.10
Charles Giessen [Wed, 28 Dec 2022 01:40:34 +0000 (18:40 -0700)]
Revert asm_offset CMake code to work with 3.10

The revertion of gen_defines.asm generation during cross compilation changed the
form of add_custom_command used, which inadvertently relied on CMake 3.16 support.

From the CMake Docs:
DEPENDS:
...
A target-level dependency is added if any dependency is a byproduct of a target or
any of its build events in the same directory to ensure the byproducts will be
available before this target is built.

21 months agocmake: Use VulkanHeaders_VERSION
Juan Ramos [Tue, 27 Dec 2022 21:37:21 +0000 (14:37 -0700)]
cmake: Use VulkanHeaders_VERSION

Removes need for a bit of python code / parsing.
And it's consistent with VVL's approach.

22 months agobuild: Update to header 1.3.238
Mike Schuchardt [Mon, 19 Dec 2022 15:53:30 +0000 (07:53 -0800)]
build: Update to header 1.3.238

- Update known-good
- Generate source

22 months agoFix for Apple compiler bug
Richard S. Wright Jr [Mon, 12 Dec 2022 18:21:51 +0000 (13:21 -0500)]
Fix for Apple compiler bug

22 months agobuild: Update to header 1.3.237
Mike Schuchardt [Thu, 8 Dec 2022 17:10:30 +0000 (09:10 -0800)]
build: Update to header 1.3.237

- Update known-good
- Generate source

22 months agoDocument interaction of layer env-vars for linux
Charles Giessen [Fri, 2 Dec 2022 21:21:28 +0000 (14:21 -0700)]
Document interaction of layer env-vars for linux

> If `VK_LAYER_PATH` is present, then `VK_ADD_LAYER_PATH` will not be
used by the loader and any values will be ignored.

This was present for the Windows documentation but not for linux and
company.

22 months agoLayers: expand tests to check layer names loaded are expected
phish3y [Wed, 30 Nov 2022 22:28:19 +0000 (14:28 -0800)]
Layers: expand tests to check layer names loaded are expected

22 months agoLayers: update log message and documentation so it is clear that VK_LAYER_PATH does...
phish3y [Wed, 30 Nov 2022 04:24:44 +0000 (20:24 -0800)]
Layers: update log message and documentation so it is clear that VK_LAYER_PATH does not only search directories

22 months agoLayers: modify TestLayerDetails so either files or directories can be set on VK_LAYER...
phish3y [Wed, 30 Nov 2022 04:22:39 +0000 (20:22 -0800)]
Layers: modify TestLayerDetails so either files or directories can be set on VK_LAYER_PATH env var

22 months agoLayers: add tests to verify VK_LAYER_PATH works with full file paths
phish3y [Tue, 29 Nov 2022 03:54:55 +0000 (19:54 -0800)]
Layers: add tests to verify VK_LAYER_PATH works with full file paths

22 months agoLayers: add test to verify VK_LAYER_PATH supports explicit file paths instead of...
phish3y [Tue, 22 Nov 2022 22:55:16 +0000 (14:55 -0800)]
Layers: add test to verify VK_LAYER_PATH supports explicit file paths instead of just directories

22 months agoLayers: update documentation to make it clear the VK_LAYER_PATH supports both explici...
phish3y [Fri, 18 Nov 2022 23:08:46 +0000 (15:08 -0800)]
Layers: update documentation to make it clear the VK_LAYER_PATH supports both explicit directories and files

22 months agoloader: Fix parsing VK_INSTANCE_LAYERS
ziga-lunarg [Fri, 2 Dec 2022 15:08:11 +0000 (16:08 +0100)]
loader: Fix parsing VK_INSTANCE_LAYERS

22 months agobuild: Update to header 1.3.236
Mike Schuchardt [Thu, 1 Dec 2022 17:46:41 +0000 (09:46 -0800)]
build: Update to header 1.3.236

- Update known-good
- Generate source

22 months agoloader: Mark unknown_ext_chain symbols as hidden
John Bauman [Wed, 30 Nov 2022 00:02:50 +0000 (00:02 +0000)]
loader: Mark unknown_ext_chain symbols as hidden

These don't need to be exported from the shared library, as they're just
internal implementation details.

Closes #1079

22 months agoUse integrity_level >= HIGH for is_high_integrity
Charles Giessen [Mon, 21 Nov 2022 22:08:59 +0000 (15:08 -0700)]
Use integrity_level >= HIGH for is_high_integrity

Previously it used integrity_level > MEDIUM, which causes issues since
occasionally windows elevates certain regular user mode processes to
be MEDIUM + 0x100 or similar, causing the `is_high_integrity()` to
return true even though it isn't an admin level process.

22 months agocmake: fix pkgconfig file for absolute install paths
Jan Palus [Mon, 28 Nov 2022 12:29:21 +0000 (13:29 +0100)]
cmake: fix pkgconfig file for absolute install paths

Fixes #1076

22 months agoAdd more OOM handling paths and refactor OOM tests
Charles Giessen [Fri, 18 Nov 2022 00:20:17 +0000 (17:20 -0700)]
Add more OOM handling paths and refactor OOM tests

There were more cases where OOM wasn't being propagated correctly, or
even caught in the first place. This change makes all of those paths
report OOM to the application as is expected. One case was due to linux
sorting erroring out but then leaking memory, which wasn't caught because
the tests didn't create devices that supported PhysDevProps2.

Lastly, since the Allocation tests were taking much longer due to making
many more allocations, the MemoryTracker was rewritten to use
std::unordered_map to speed up insertion and lookup of allocations made.

23 months agobuild: Update to header 1.3.235
Mike Schuchardt [Thu, 17 Nov 2022 17:45:13 +0000 (09:45 -0800)]
build: Update to header 1.3.235

- Update known-good
- Generate source

23 months agoAdd complex json file to allocation tests
Charles Giessen [Wed, 16 Nov 2022 23:29:09 +0000 (16:29 -0700)]
Add complex json file to allocation tests

This helps exercise the cJSON OOM handling code. The json file is
just a copy of the validation layer manifest file.

23 months agoPropagate OOHM error from json parsing
Charles Giessen [Wed, 16 Nov 2022 23:04:59 +0000 (16:04 -0700)]
Propagate OOHM error from json parsing

There was a few places where an out of memory error could be generated
by parsing json but were not passed on upwards, causing CTS tests to fail.

23 months agoFix cases where OOM was handled wrong
Charles Giessen [Wed, 16 Nov 2022 04:16:55 +0000 (21:16 -0700)]
Fix cases where OOM was handled wrong

goto's were replaced by returns erroneously. This caused unfreed memory in
certain OOM scenarios, caught by CTS. The reason the loader tests didn't catch
this was because the fake drivers did not report any extensions, thus no memory
was allocated (which would later be leaked). This commit addressess this
deficiency in the tests as well, which included correctly incrementing the
MemoryTracker's allocation count during realloc.

23 months agoHandle invalid files & symlinks properly
Charles Giessen [Thu, 10 Nov 2022 22:00:04 +0000 (15:00 -0700)]
Handle invalid files & symlinks properly

If loader_get_json fails due to the file missing or the file being a
stale symlink, it returns VK_ERROR_INITIALIZATION_FAILED
which loader_parse_icd_manifest passed upwards. Since the caller of
loader_parse_icd_manifest wasn't expecting that error code, it didn't
skip the ICD, causing an infinite recusion in EnumInstExtProps due
to the call to dlsym("vkEnumerateInstanceExtensionProperties");

This also required changes to callers of loader_get_json which would
propagate VK_ERROR_INITIALIZATION failed during layer searching to
no longer cause vkCreateInstance to abort if any invalid files were
found.

Added tests for symlinks as the origin of this bug is due to 'stale'
symlinks after driver installers

23 months agoRecheck API version in terminator_CreateInstance
Charles Giessen [Thu, 3 Nov 2022 17:37:15 +0000 (11:37 -0600)]
Recheck API version in terminator_CreateInstance

Layers are liable of changing the API version during the call down
vkCreateInstance. Certain layers use the guarantees of 1.1 to allow
using VK_KHR_get_physical_device_properties2 functionality. This
commit checks and assignes a new API version if it was modified.

Add tests for when the application forgets to enable 1.1 and when
a layer enabled 1.1 on behalf of the application.

23 months agoRemove redundant code
Waffl3x [Fri, 11 Nov 2022 06:06:47 +0000 (01:06 -0500)]
Remove redundant code
loader_make_version recently was changed to zero out the patch version, explicitly doing it is no longer necessary.

23 months agocmake: CMake cleanup
Juan Ramos [Thu, 10 Nov 2022 23:46:39 +0000 (16:46 -0700)]
cmake: CMake cleanup

- Use idiom for CMAKE_MODULE_PATH
- find_package(PkgConfig) instead of include(FindPkgConfig)
- Remove CMake 2.X code workaround
- Use CMAKE_CURRENT_BINARY_DIR instead of CMAKE_BINARY_DIR
- CMakeParseArguments is now part of the language