platform/upstream/Vulkan-Loader.git
2 years agoRemove unnecessary usages of prefix in pc 68/280068/2 accepted/tizen_7.0_unified accepted/tizen_7.0_unified_hotfix tizen_7.0 tizen_7.0_hotfix accepted/tizen/7.0/unified/20221110.061043 accepted/tizen/7.0/unified/hotfix/20221116.110556 accepted/tizen/unified/20220824.042343 submit/tizen/20220823.072343 tizen_7.0_m2_release
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>
2 years agoremove double slash in vulkan.pc 71/279471/1 accepted/tizen/unified/20220811.135910 submit/tizen/20220810.124903
jinbong, Lee [Wed, 10 Aug 2022 04:15:16 +0000 (13:15 +0900)]
remove double slash in vulkan.pc

Change-Id: I891e70bd36594aa31fc6f405006e233c58ad35d1

2 years agoFix double free issue 51/275351/1
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>
2 years agoUpgrade to 1.3.208 79/272579/2 accepted/tizen/unified/20220610.134801 submit/tizen/20220506.015933 submit/tizen/20220509.032328 submit/tizen/20220607.045230 submit/tizen/20220609.070600 submit/tizen/20220609.091423 submit/tizen/20220613.104856
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>
2 years agoadd spec file
SooChan Lim [Thu, 29 Nov 2018 12:29:50 +0000 (21:29 +0900)]
add spec file

2 years agobuild: Update to header 1.3.208 upstream/1.3.208
Mike Schuchardt [Tue, 15 Mar 2022 15:58:42 +0000 (08:58 -0700)]
build: Update to header 1.3.208

- Update known-good
- Generate source

2 years agoTests close layer handles when necessary
Charles Giessen [Tue, 15 Mar 2022 05:19:13 +0000 (23:19 -0600)]
Tests close layer handles when necessary

The fs::FolderManager can't close objects that are in use, thus if the tests
keep open a binary then the destructor will fail to delete the file. This
commit manually cleans out the FrameworkEnvironment's loaded layers to prevent
this from happening.

2 years agoTest framework now shims registry functions
Charles Giessen [Tue, 15 Mar 2022 03:57:55 +0000 (21:57 -0600)]
Test framework now shims registry functions

Previously the way the test framework worked was to fake the registry using a
special windows API call. However this led to brittle tests and was incompatible
with googletest's death test capabilities.

These death tests highlighted that the current set of them didn't use the built in
matcher to verify a correct crash/abort. This commit also amends all uses of
ASSERT_DEATH to provide the relevant death message.

If a driver reports an interface version greater than 0 but doesn't export
vk_icdGetInstanceProcAddr, the loader will now skip the driver.

2 years agoRemove hasing of unknown functions
Charles Giessen [Thu, 10 Mar 2022 23:48:14 +0000 (16:48 -0700)]
Remove hasing of unknown functions

Use a simple linear search instead. This greatly simplifies the logic and
reduces the places for the logic to go awry.

2 years agoMove unknown function logic into dedicated file
Charles Giessen [Wed, 9 Mar 2022 23:28:04 +0000 (16:28 -0700)]
Move unknown function logic into dedicated file

unknown_function_handling.c now holds all of the unknown function handling
logic.

2 years agoRevamp unknown function tests
Charles Giessen [Tue, 8 Mar 2022 23:38:30 +0000 (16:38 -0700)]
Revamp unknown function tests

Make use of multiple different functions that are used so that its more
obvious when a test is actually calling the right function.

2 years agoUse no-chromium-code in GN build.
Jamie Madill [Mon, 14 Mar 2022 15:12:49 +0000 (11:12 -0400)]
Use no-chromium-code in GN build.

Aligns the configs so that new warnings turned on in Chromium
Clang don't show up in the loader project.

Fixes #878

2 years agoModify loader VK_ADD_DRIVER_FILES behavior
Mark Young [Wed, 9 Mar 2022 21:25:32 +0000 (14:25 -0700)]
Modify loader VK_ADD_DRIVER_FILES behavior

Modify the loader to only use VK_ADD_DRIVER_FILES if
VK_DRIVER_FILES or VK_ICD_FILENAMES is not used.
This could have caused weird issues with systems where VK_DRIVER_FILES
was used to force drivers in a specific order/location for testing.

Resolves issue #871

2 years agoRemove VK_NO_PROTOTYPES from test_util.h
Charles Giessen [Wed, 9 Mar 2022 22:52:04 +0000 (15:52 -0700)]
Remove VK_NO_PROTOTYPES from test_util.h

2 years agomake secure_getenv discovery project wide
Charles Giessen [Wed, 9 Mar 2022 21:54:58 +0000 (14:54 -0700)]
make secure_getenv discovery project wide

Since the tests need to know if secure_getenv exists or not, the detection and
setup logic is now in the top level CMakeLists.txt.

2 years agoSet VK_NO_PROTOTYPES on test targets
Charles Giessen [Wed, 9 Mar 2022 21:48:50 +0000 (14:48 -0700)]
Set VK_NO_PROTOTYPES on test targets

Moves the definition of VK_NO_PROTOTYPES out of a header and into cmake so that
so that libraries and executables can set or not set it if they so desire. This
allows binaries to link directly to the loader if need be.

2 years agoFix tests compiler warnings from bool conversions
Charles Giessen [Sat, 19 Feb 2022 20:47:32 +0000 (13:47 -0700)]
Fix tests compiler warnings from bool conversions

While set_env_var did return a boolean, this caused odd performance warnings
on old compilers and wasn't being used by the tests.

2 years agoUse target_link_options if available in CMake
Charles Giessen [Sat, 19 Feb 2022 20:36:58 +0000 (13:36 -0700)]
Use target_link_options if available in CMake

2 years agoRefactor CMake to user correct C/C++ Standard
Charles Giessen [Fri, 18 Feb 2022 23:45:04 +0000 (16:45 -0700)]
Refactor CMake to user correct C/C++ Standard

Make sure the correct C++ version but also refactor the tests CMake code
to clean it up.

2 years agoFix macOS CMake errors
Charles Giessen [Thu, 17 Feb 2022 22:25:49 +0000 (15:25 -0700)]
Fix macOS CMake errors

Used incorrect syntax for CONFIGURE_DEPENDS.

2 years agoSet CMake C & C++ standard per target
Charles Giessen [Thu, 17 Feb 2022 05:01:44 +0000 (22:01 -0700)]
Set CMake C & C++ standard per target

2 years agoMake _GNU_SOURCE a common target property
Charles Giessen [Thu, 17 Feb 2022 23:15:05 +0000 (16:15 -0700)]
Make _GNU_SOURCE a common target property

Rather than set it per target that needs it, make it available on the
loader_specific_options target for consistency.

2 years agoSpecify wrap_objects.cpp in CMake code
Charles Giessen [Thu, 17 Feb 2022 04:57:01 +0000 (21:57 -0700)]
Specify wrap_objects.cpp in CMake code

While CMake will append appropriate file extensions when the full name isn't
given, such as "wrap_objects", it is best to specify the file with its
extension for explicitness.

2 years agoUse targets CMake logic instead of directories
Charles Giessen [Thu, 17 Feb 2022 04:44:09 +0000 (21:44 -0700)]
Use targets CMake logic instead of directories

Replace the last usages of CMake logic that applied compiler definitions and
options to the folder with usage of a target.

2 years agoCleanup MSVC CMake code
Charles Giessen [Wed, 16 Feb 2022 20:24:26 +0000 (13:24 -0700)]
Cleanup MSVC CMake code

* Googletest has been updated to 1.11 which means the TR1 deprecation notice is
unecessary.

* The `/permissive-` flag has been moved to loader_common_options so it doesn't
have to be repeated over and over.

* Since we do not support VS 2013 and early, use /guard:cf everywhere

* Remove MSVC_LOADER_COMPILE_OPTIONS in favor of loader_common_options

* Remove reduntant compile options and include directories

2 years agoFix compiler warnings in tests on MSVC
Charles Giessen [Wed, 16 Feb 2022 19:59:10 +0000 (12:59 -0700)]
Fix compiler warnings in tests on MSVC

2 years agoReport secure_getenv missing when not using MSVC
Charles Giessen [Wed, 16 Feb 2022 19:35:17 +0000 (12:35 -0700)]
Report secure_getenv missing when not using MSVC

2 years agoFormat unix fallback paths in CMakeLists.txt
Charles Giessen [Wed, 16 Feb 2022 19:27:13 +0000 (12:27 -0700)]
Format unix fallback paths in CMakeLists.txt

2 years agoRemove BUILD_LOADER build option
Charles Giessen [Wed, 16 Feb 2022 19:26:07 +0000 (12:26 -0700)]
Remove BUILD_LOADER build option

No reason to have this since the tests depend on the loader being built to function.

2 years agoUse CMake provided library names on macOS
Charles Giessen [Wed, 3 Nov 2021 21:09:32 +0000 (15:09 -0600)]
Use CMake provided library names on macOS

The ${CMAKE_DL_LIBS} and Threads::Threads provides generic mechanisms to
use the dynamic linker and threading libraries on the system. In addition,
this commit replaces Vulkan::Headers with loader_specific_commits for the
vulkan-framework target. Note that this commit is in a series of commits and
not intended to work standalone.

2 years agoUse GLOBs to get macOS vulkan framework headers
Charles Giessen [Wed, 3 Nov 2021 21:04:48 +0000 (15:04 -0600)]
Use GLOBs to get macOS vulkan framework headers

This commit recitfies the situation that this list of header files is out of
date with the upstream Vulkan-Headers repo. It uses GLOB_RECURSE to find all
the files and subdirectories in the vulkan headers include directory.
In a perfect world, the list of headers would be removed because users should
be using the Vulkan-Headers for that purpose. But to maintain any existing
users it will be retained.

CMake 3.12 added CONFIGURE_DEPENDS to globs to better support changes in the
list being caught by CMake. Since this repo uses 3.11 as the minimum, it will
not be added unless supported by the currently installed CMake version. While
better, it is not perfect at catching all changing file lists, and thus it
may still be necessary to re-run CMake manually to get an updated list of
headers files.

Note that this commit is a part of a series of commits and not intended to
work standalone.

2 years agoRefactor Windows specific loader CMake code
Charles Giessen [Wed, 3 Nov 2021 20:38:54 +0000 (14:38 -0600)]
Refactor Windows specific loader CMake code

Merged the loader-norm and vulkan libraries and moved the dirent_on_windows.c
into the same block that adds loader_windows.c to the list of sources. This
commit is a part of a series of commits and not intended to work standalone.

2 years agoUse the CMake Threads package
Charles Giessen [Wed, 3 Nov 2021 20:28:03 +0000 (14:28 -0600)]
Use the CMake Threads package

Instead of manually linking to pthreads, use find_package(Threads) to get the
platform specific name for the threading library and link to it. Use the
THREADS_PREFER_PTHREAD_FLAG to ensure we prefer pthreads before anything
else. Note that this commit is a part of a series of commits and not
intended to work by itself.

2 years agoReplace loader_cmake_config.h with definitions
Charles Giessen [Wed, 3 Nov 2021 20:25:29 +0000 (14:25 -0600)]
Replace loader_cmake_config.h with definitions

Use CMakes built in ability to define compiler definitions to targets so that
the loader_cmake_config.h file is made redundant. This simplifies the build
process by removing the configure_file and including it. Note that this
commit is a part of a series of commits and not intended to work by itself.

2 years agoRefactor loader specific CMake options
Charles Giessen [Wed, 3 Nov 2021 20:14:17 +0000 (14:14 -0600)]
Refactor loader specific CMake options

Create a new target loader_specific_options that contains the specific flags
and definitions which apply only to the loader. This target links to the
loader_common_options and is used to store various macro defines which
only are relevant to the loader, like the specific language standard to use.
The target also links to the vulkan headers.
Note that this commit is in a series of commits and is not meant to work
by itself.

2 years agoMove git info in CMake to loader_common_options
Charles Giessen [Wed, 3 Nov 2021 20:09:50 +0000 (14:09 -0600)]
Move git info in CMake to loader_common_options

Make the GIT_BRANCH_NAME and GIT_TAG_INFO apart of the loader_common_options
target so it doesn't apply globally to the C_FLAGS and CXX_FLAGS.
Note that this commit is a part of a series of commits and is not meant to
work by itself.

2 years agoRefactor CMake compiler options
Charles Giessen [Wed, 3 Nov 2021 19:55:29 +0000 (13:55 -0600)]
Refactor CMake compiler options

Create the target loader_common_options which will contain the compiler
commands, options, and definitions that is shared across the code base.
This includes linking to platform_wsi_defines and moving many of the defines
found in the loader/CMakelists.txt up to this location.

Setting the language standard through an interface target is not possible, so
to avoid using the global state modifiers, each target needing to be on a
specific language standard must specify it for themselves.

Note that this commit is in a series and is not intended to work by itself.

2 years agoRefactor CMake WSI platform defines
Charles Giessen [Wed, 3 Nov 2021 19:51:03 +0000 (13:51 -0600)]
Refactor CMake WSI platform defines

Move the WSI macro defines into their own target such that it can be shared
with the loader and test code. Note that this commit is a part of a series
and not intended to work standalone.

2 years agoRemove RELEASE_BUILD cmake option
Charles Giessen [Mon, 1 Nov 2021 21:33:49 +0000 (15:33 -0600)]
Remove RELEASE_BUILD cmake option

Turned out to be not useful and as such should be removed.

2 years agobuild: Update to header 1.3.207 upstream/v1.3.207
Mike Schuchardt [Tue, 8 Mar 2022 17:39:36 +0000 (09:39 -0800)]
build: Update to header 1.3.207

- Update known-good
- Generate source

2 years agoAdd live tests for OS dynamic loader behavior
Charles Giessen [Fri, 4 Mar 2022 17:21:10 +0000 (10:21 -0700)]
Add live tests for OS dynamic loader behavior

Executes various combinations of loading and linking to libraries which
export the same symbols.

2 years agoChanges to additive env var based on code review
Mark Young [Tue, 22 Feb 2022 17:27:18 +0000 (10:27 -0700)]
Changes to additive env var based on code review

2 years agoFix WIndows elevation
Mark Young [Thu, 17 Feb 2022 20:53:04 +0000 (13:53 -0700)]
Fix WIndows elevation

2 years agoAdd "additive" environment variables
Mark Young [Tue, 4 Jan 2022 18:45:18 +0000 (11:45 -0700)]
Add "additive" environment variables

Add "additive" environment variables for adding additional layer
paths or driver JSON files instead of replacing default ones.

Also, rename VK_ICD_FILENAMES to VK_DRIVER_FILES since we're trying
to remove references to ICDs because software driver implementations
of Vulkan aren't ICDs (but continue to support the old name as well).

Added documentation around these changes to reflect the new name and
the new variables.

2 years agoloader: Fix wayland copy paste error
sfricke-samsung [Tue, 1 Mar 2022 05:44:05 +0000 (23:44 -0600)]
loader: Fix wayland copy paste error

2 years agoResolve Angle failure because it breaks with is_high_integrity
Mark Young [Mon, 28 Feb 2022 18:15:46 +0000 (11:15 -0700)]
Resolve Angle failure because it breaks with is_high_integrity

Angle drops the security enforcement of the loader on environment
variables and the additional "is_high_integrity" checks on my
previous loader change caused failures in the Angle run.
Revert the high-integrity checks and update the layer test to
work properly.

2 years agodocs: Fix typo
Matt Turner [Wed, 23 Feb 2022 00:54:26 +0000 (16:54 -0800)]
docs: Fix typo

The behavior change to physical device ordering happened in v1.3.204.

2 years agoFix compiler warnings in regression_tests
Charles Giessen [Mon, 21 Feb 2022 18:31:57 +0000 (11:31 -0700)]
Fix compiler warnings in regression_tests

2 years agoAdd consecutive create instance and device tests
Charles Giessen [Mon, 21 Feb 2022 18:31:27 +0000 (11:31 -0700)]
Add consecutive create instance and device tests

2 years agobuild: Update to header 1.3.206
Mike Schuchardt [Fri, 18 Feb 2022 16:58:37 +0000 (08:58 -0800)]
build: Update to header 1.3.206

- Update known-good
- Generate source

2 years agoFix vk_icdGetPhysicalDeviceProcAddr docs
Mark Young [Thu, 17 Feb 2022 21:25:29 +0000 (14:25 -0700)]
Fix vk_icdGetPhysicalDeviceProcAddr docs

The language was not normative and also made clearer.

2 years agoEnable testing of high-integrity in the loader
Mark Young [Thu, 17 Feb 2022 16:44:49 +0000 (09:44 -0700)]
Enable testing of high-integrity in the loader

Enable testing to check if the loader is running with elevated
privileges.  This is to make sure we're ignoring the appropriate
environment variables in those scenarios to potentially avoid
escalation exploits.

2 years agoUpdate Contributing.md file
Mark Young [Wed, 16 Feb 2022 17:40:28 +0000 (10:40 -0700)]
Update Contributing.md file

Add more detail on running and writing tests.

2 years agoClean up layer test
Mark Young [Wed, 16 Feb 2022 16:09:16 +0000 (09:09 -0700)]
Clean up layer test

My previous commit to enable physical device modifications in a layer
required new compiled layers to do the work.  Since this can more
cleanly be done by setting layer flags (as suggested by @charles-lunarg)
I have gone back and done that.

2 years agoFix Windows build and add proper phys dev group sorting
Mark Young [Tue, 8 Feb 2022 23:58:47 +0000 (16:58 -0700)]
Fix Windows build and add proper phys dev group sorting

2 years agoCode review comment fixes.
Mark Young [Tue, 8 Feb 2022 15:58:14 +0000 (08:58 -0700)]
Code review comment fixes.

Also, cleaned up Linux vs Windows code so that there was less duplication and
complexity.

2 years agoLoader single EnumPhysDev call through layers
Mark Young [Thu, 2 Dec 2021 23:55:13 +0000 (16:55 -0700)]
Loader single EnumPhysDev call through layers

The loader trampoline previously would query all devices every time
vkEnumeratePhysicalDevices was called.
To do this, it would make two calls every time:
  - First, it would ignore the passed in user values
  - Second, it would query the total number of available devices.
  - Third, it would query the values for every available device

This resulted in layers reporting 2 vkEnumeratePhysicalDevices call for
every 1 the application made which could get very polluted in output.
It didn't break any functionality, just made things messy.

This change removes that behavior and adds a bunch of test cases to verify
nothing broke in the move.

2 years agoAdd debug messages for unknown physical device extensions
Mark Young [Tue, 15 Feb 2022 18:37:58 +0000 (11:37 -0700)]
Add debug messages for unknown physical device extensions

Add debug messages to the loader so we can identify when an unknown
physical device extension's entrypoints are queried.

2 years agoUpdate build.md and README.md for the tests
Charles Giessen [Tue, 15 Feb 2022 22:04:15 +0000 (15:04 -0700)]
Update build.md and README.md for the tests

2 years agoGuard building of live_verification tests
Charles Giessen [Tue, 15 Feb 2022 22:03:25 +0000 (15:03 -0700)]
Guard building of live_verification tests

Don't build live verification tests by default. These are meant as manual tests for
developers to run to diagnose issues or verify correctness on a real system.

2 years agoSwitch ASSERT_EQ(false,true) for FAIL() in tests
Mark Young [Tue, 15 Feb 2022 21:47:29 +0000 (14:47 -0700)]
Switch ASSERT_EQ(false,true) for FAIL() in tests

2 years agoAdd explicit layer invalid variant number test
Mark Young [Tue, 15 Feb 2022 20:13:28 +0000 (13:13 -0700)]
Add explicit layer invalid variant number test

2 years agoAdd a few device layer tests
Mark Young [Tue, 15 Feb 2022 20:04:02 +0000 (13:04 -0700)]
Add a few device layer tests

Since device layers are pretty much ignored, make sure that they don't
change any behavior.
Also add a few "load" entrypoint helper routines based on what was already
done elsewhere in the test system.

2 years agoAdd live_verification tests for runnign with real drivers
Charles Giessen [Tue, 15 Feb 2022 20:56:21 +0000 (13:56 -0700)]
Add live_verification tests for runnign with real drivers

Some things need to be verified against real drivers. The supporting code in test_util and
test_environment make it easy to write application code which works against real drivers and
layers. This allows quickly verifying loader behavior out in the wild.

2 years agoAdd a test to verify that VK_INSTANCE_LAYERS behaves properly
Mark Young [Tue, 15 Feb 2022 17:42:06 +0000 (10:42 -0700)]
Add a test to verify that VK_INSTANCE_LAYERS behaves properly

2 years agoExpand unknown function handling tests
Charles Giessen [Mon, 14 Feb 2022 23:03:40 +0000 (16:03 -0700)]
Expand unknown function handling tests

Add tests for unknown device functions queried with both vkGetDeviceProcAddr
and vkGetInstanceProcAddr. Also loops enough times to exhaust the available
unknown function supply.

Had to fix the vk_layerGetPhysicalDeviceProcAddr in TestLayer to make the tests
pass.

MacOS currently skips tests which use vkGetInstanceProcAddr. This is due to the
need for unknown functions being lower priority and so do not warrent the time
needed to write the assembly necessary to resolve the issue fully.

2 years agoUpdate tests function loading implementation
Charles Giessen [Sat, 12 Feb 2022 19:35:30 +0000 (12:35 -0700)]
Update tests function loading implementation

Remove the need for macros and use well crafted helper loading functions which
can figure out the type to convert to based on the type being assigned.

2 years agoFix Win32 Unknown Device function handling
Charles Giessen [Sat, 12 Feb 2022 03:49:57 +0000 (20:49 -0700)]
Fix Win32 Unknown Device function handling

The handling of unknown device functions queried with vkGetInstanceProcAddr
required an additional pointer dereference to get the dispatch table.

The VkDevice handle is a pointer to the `chain_device` member of
`loader_device`. This member is actually a pointer to `loader_dispatch`, or
put another way, the "start" of `loader_device`. Thus, to get access to the
dispatch table, we need to dereference the VkDevice passed into the function
then dereference the chain_device to get loader_dispatch`.

2 years agoFix NULL check and make a few more consistent
Mark Young [Tue, 15 Feb 2022 15:52:10 +0000 (08:52 -0700)]
Fix NULL check and make a few more consistent

2 years agoTest layer pre-instance functions
Mark Young [Fri, 11 Feb 2022 19:10:17 +0000 (12:10 -0700)]
Test layer pre-instance functions

Add tests to verify that the 3 pre-instance functions are properly
intercepted by the layer when everything is well-defined.

Also include two fixes:
 1) Disable environment variable value of 0 should be treated the same as not present
 2) The vkEnumerateInstanceVersion override path was broken, missing a NULL check

2 years agoUpdate Windows runtime installer copyright
Charles Giessen [Mon, 14 Feb 2022 17:48:49 +0000 (10:48 -0700)]
Update Windows runtime installer copyright

2 years agoClarify behavior of override_paths + VK_LAYER_PATH
Charles Giessen [Fri, 11 Feb 2022 16:52:00 +0000 (09:52 -0700)]
Clarify behavior of override_paths + VK_LAYER_PATH

If a meta layer which contains `override_paths` is active, all of the paths in
VK_LAYER_PATH are ignored when searchign for explicit layers. This may be changed
changed in the future but for now is better tested and documented.

2 years agoMetaLayer version checking had paren in wrong place
Charles Giessen [Fri, 11 Feb 2022 17:36:53 +0000 (10:36 -0700)]
MetaLayer version checking had paren in wrong place

Produced spurious warnings for versions that are correct.

2 years agoTest when there are no devices or device extensions
Charles Giessen [Fri, 10 Sep 2021 19:41:09 +0000 (13:41 -0600)]
Test when there are no devices or device extensions

Adds 2 tests:
* ZeroPhysicalDevices - Return VK_ERROR_INITIALIZATION_FAILED if the driver has zero
physical devices.
* ZeroPhyiscalDeviceExtensions - Return VK_SUCCESS if no physical device extensions are
found.

2 years agoDont return an error for 0 physical device extensions
Charles Giessen [Thu, 10 Feb 2022 18:34:50 +0000 (11:34 -0700)]
Dont return an error for 0 physical device extensions

Previously the logic of loader_add_device_extensions could return an error from
enumerating device extensions. This was because the code would return immediately
if either an error was returned from the driver or the count was zero. Now the
logic will return an error only if the driver returned an error. Zero device
extensions won't be treated as an error and will simply return VK_SUCCESS.

2 years agoAdd debug utils loader testing
Mark Young [Sat, 5 Feb 2022 01:00:11 +0000 (18:00 -0700)]
Add debug utils loader testing

2 years agoFix loader logging of VUIDs
Mark Young [Sat, 5 Feb 2022 00:02:52 +0000 (17:02 -0700)]
Fix loader logging of VUIDs

The loader was logging some VUID failures and it was sending them to the general
message output.  Send the information also to the validation stream to make sure
that if anyone enables validation filtering they will still see those errors

2 years agoUpdate loader VUID messages
Mark Young [Fri, 4 Feb 2022 16:36:43 +0000 (09:36 -0700)]
Update loader VUID messages

Update the loader VUID messages that were added in validating handles
so that thye include the validation flag when going through debug utils
messenger.

2 years agoAdd DebugReport
Mark Young [Fri, 4 Feb 2022 16:00:55 +0000 (09:00 -0700)]
Add DebugReport

2 years agoFix Apple build
Mark Young [Tue, 8 Feb 2022 18:33:23 +0000 (11:33 -0700)]
Fix Apple build

We don't want Apple builds using the Linux sorting algorithm.

2 years agoUpdate Docs table of contents
Charles Giessen [Mon, 7 Feb 2022 22:47:01 +0000 (15:47 -0700)]
Update Docs table of contents

2 years agoRemove Instance and Device extension logging
Charles Giessen [Thu, 13 Jan 2022 22:48:16 +0000 (16:48 -0600)]
Remove Instance and Device extension logging

While the DEBUG level of logging is meant for verbose output, the actual extensions
enumerated rarely are useful for the purposes of debugging the loaders behavior.
With this in mind, the loader will now no longer print all the extensions found.

2 years agobuild: Update to header 1.3.205
Mike Schuchardt [Mon, 7 Feb 2022 17:32:17 +0000 (09:32 -0800)]
build: Update to header 1.3.205

- Update known-good
- Generate source

2 years agoMake vkGetInstanceProcAddr able to get itself
Charles Giessen [Sun, 6 Feb 2022 01:40:14 +0000 (18:40 -0700)]
Make vkGetInstanceProcAddr able to get itself

There was a regression with 1.3 that meant vkGetInstanceProcAddr wouldn't be
able to query itself if instance was set for 1.3. This commit makes it possible
to query for vkGetInstanceProcAddr with itself no matter the value of instance.

2 years agouse the correct instance
Brad Grantham [Sat, 5 Feb 2022 06:01:54 +0000 (22:01 -0800)]
use the correct instance

2 years agoVerify GIPA on device extensions
Mark Young [Thu, 3 Feb 2022 21:43:57 +0000 (14:43 -0700)]
Verify GIPA on device extensions

Verify that using vkGetInstanceProcAddr to get an entrypoint to a device
extension works when the extension is enabled, and crashes when the
extension isn't enabled.

Also, update a copyright notice date for my last commit.

2 years agoAdd tests to verify extension support in physical devices
Mark Young [Thu, 3 Feb 2022 18:08:14 +0000 (11:08 -0700)]
Add tests to verify extension support in physical devices

Add 2 tests to verify that physical devices supporting instance
and device extensions (which are really physical device extensions)
are properly handled.

2 years agoAdd a few tests to verify the vkGet***ProcAddr commands
Mark Young [Wed, 2 Feb 2022 22:19:26 +0000 (15:19 -0700)]
Add a few tests to verify the vkGet***ProcAddr commands

Verify that the loader exported version matches the ones you
receive from vkGet****ProcAddr.

2 years agoFix incorrect indexing of local_phys_dev_groups
Charles Giessen [Wed, 2 Feb 2022 20:38:55 +0000 (13:38 -0700)]
Fix incorrect indexing of local_phys_dev_groups

Seems to have been a copy paste error that meant the group's icd_term was assigned
to the incorrect group.

2 years agoloader: Try to handle ICD failure in vkEnumeratePhysicalDevices
Adam Jackson [Fri, 3 Dec 2021 16:08:54 +0000 (11:08 -0500)]
loader: Try to handle ICD failure in vkEnumeratePhysicalDevices

If any ICD failed to enumerate device groups here, we would fail the call entirely, which means a broken driver for device A could prevent you from using device B. Just skip over the failing ICD instead.

2 years agoAdd tests to validate layer extensions
Mark Young [Mon, 31 Jan 2022 23:27:36 +0000 (16:27 -0700)]
Add tests to validate layer extensions

We had tests that verified that instance and device extensions defined
in a layer had the non-null pointers returned from the corresponding
vkGetXXXProcAddr functions, but we weren't verifying that the functions
actually got called.

2 years agoloader log error if a requested layer not loaded
Mark Young [Thu, 9 Dec 2021 04:16:08 +0000 (21:16 -0700)]
loader log error if a requested layer not loaded

This should throw an error message if a requested layer didn't load.
This could happen if the JSON file is present, but only a library
exists on the system for the wrong target (like 32 vs 64-bit).

If it did fail because of being the wrong bit-type, we report an info
message only, unless it was directly requested by the application.

Modify the improper bit-depth layer loading test so that it is now 4
tests:
 - Verify bad explicit layer generates VK_ERROR_LAYER_NOT_PRESENT error
 - Verify bad implicit layer generates only an info in the loader output
 - Test case with both a bad implicit and explicit layer with INFO logging
   we should see both messages.
 - Test case with both a bad implicit and explicit layer with ERROR logging
   we should see only the explicit failure message.

Report info failure for ICD wrong bit-type as well.

Finally, fixed a small compilation warning for disabled code.

2 years agoFix warning for using wrong variant layers
Charles Giessen [Fri, 28 Jan 2022 23:40:17 +0000 (16:40 -0700)]
Fix warning for using wrong variant layers

Mistakenly used DRIVER instead of LAYER logging level.

2 years agoAdd wrong Variant tests
Charles Giessen [Fri, 28 Jan 2022 19:33:48 +0000 (12:33 -0700)]
Add wrong Variant tests

2 years agoIgnore layers with non zero variant value
Charles Giessen [Fri, 28 Jan 2022 18:28:23 +0000 (11:28 -0700)]
Ignore layers with non zero variant value

Layers which contain an API version where the variant value is non zero are not
designed for the Vulkan-Loader, so it should be ignored.

2 years agoRefactor json and API version parsing code
Charles Giessen [Fri, 28 Jan 2022 18:16:20 +0000 (11:16 -0700)]
Refactor json and API version parsing code

Reuse the loader_api_struct struct and associated parsing functions where
appropriate to reduce code duplication.

2 years agoSkip ICD's with non zero variant value
Charles Giessen [Wed, 26 Jan 2022 22:42:21 +0000 (15:42 -0700)]
Skip ICD's with non zero variant value

If the JSON ICD Manifest contains an api_version that has a non zero variant
value, then the ICD should be skipped since it corresponds to a Vulkan variant.

2 years agoDetect Variant versions in given api versions
Charles Giessen [Wed, 26 Jan 2022 22:40:03 +0000 (15:40 -0700)]
Detect Variant versions in given api versions

Since it is possible that API versions given to the loader have a variant
component, the loader should know how to handle them. It shouldn't use a
variant other than 0, but that is up to the caller to handle.

2 years agoUpdate tests to use correct version macro
Charles Giessen [Wed, 26 Jan 2022 22:14:39 +0000 (15:14 -0700)]
Update tests to use correct version macro

The VK_MAKE_API_VERSION macro and the VK_API_VERSION_1_X macros are better to
use. This commit switches the tests over to the non-deprecated versions of the
macros.

2 years agoWarn when the apiVersion's variant isn't 0
Charles Giessen [Wed, 26 Jan 2022 20:37:04 +0000 (13:37 -0700)]
Warn when the apiVersion's variant isn't 0

The 1.2.175 header release saw the addition of API Variants. For the purposes
of the loader, this should always be set to 0. If this value isn't zero, the
loader should warn about it.