platform/upstream/Vulkan-Loader.git
11 months agobuild: Update to header 1.3.268 upstream upstream/1.3.268
Mike Schuchardt [Fri, 13 Oct 2023 17:34:36 +0000 (10:34 -0700)]
build: Update to header 1.3.268

- Update known-good
- Generate source

11 months agocmake: Fix vulkan.pc regressions
Juan Ramos [Sat, 7 Oct 2023 19:45:18 +0000 (13:45 -0600)]
cmake: Fix vulkan.pc regressions

closes #1318, #1319

11 months agobuild: Update to header 1.3.267
Mike Schuchardt [Fri, 6 Oct 2023 15:29:38 +0000 (08:29 -0700)]
build: Update to header 1.3.267

- Update known-good
- Generate source

11 months agogithub: split mingw-no-asm job
Christopher Degawa [Thu, 5 Oct 2023 00:02:04 +0000 (19:02 -0500)]
github: split mingw-no-asm job

Splits the mingw-no-asm job into an explicit -D USE_MASM=OFF and one
without to test the automatic detection of MASM.

Signed-off-by: Christopher Degawa <ccom@randomderp.com>
11 months agoloader: Add check for working MASM compiler
Christopher Degawa [Wed, 4 Oct 2023 18:42:44 +0000 (13:42 -0500)]
loader: Add check for working MASM compiler

CMake's detection of MASM is very broken, especially if not using MSVC.
This adds a check to see if MASM is working, and if not, disables it,
going back to the fallback path, as intended.

Signed-off-by: Christopher Degawa <ccom@randomderp.com>
11 months agocmake: Don't REQUIRE find_package(VulkanHeaders)
Juan Ramos [Thu, 5 Oct 2023 17:50:15 +0000 (11:50 -0600)]
cmake: Don't REQUIRE find_package(VulkanHeaders)

Allows use of add_subdirectory with the loader

This is the same approach used by the validation layers.

11 months agogn: asm_offset.c shouldn't be compiled
Juan Ramos [Wed, 4 Oct 2023 23:12:01 +0000 (17:12 -0600)]
gn: asm_offset.c shouldn't be compiled

asm_offset.c only makes sense for an executable

11 months agodocs: New SDK branch convention
Juan Ramos [Wed, 4 Oct 2023 22:41:42 +0000 (16:41 -0600)]
docs: New SDK branch convention

Next SDK we will be changing branch/tag naming scheme from
sdk-1.x.yyy to vulkan-sdk-1.x.yyy

11 months agocmake: Remove CMAKE_INSTALL_INCLUDEDIR_PC
Juan Ramos [Wed, 4 Oct 2023 21:58:15 +0000 (15:58 -0600)]
cmake: Remove CMAKE_INSTALL_INCLUDEDIR_PC

Currently this just will default to `include` IE it will default
to system includes.

Which gcc already searches for:
https://stackoverflow.com/a/19839946/19739129

Now vulkan.pc will more closely match VulkanLoaderConfig.cmake

11 months agocmake: Remove PRIVATE_LIBS from vulkan.pc.in
Juan Ramos [Wed, 4 Oct 2023 21:15:35 +0000 (15:15 -0600)]
cmake: Remove PRIVATE_LIBS from vulkan.pc.in

We don't ship APPLE AND BUILD_STATIC_LOADER so supporting
the pkg-config for it is unneccessary and error prone.

This makes both configuration files consistent.

11 months agocmake: Cleanup package config code
Juan Ramos [Wed, 4 Oct 2023 20:34:47 +0000 (14:34 -0600)]
cmake: Cleanup package config code

11 months agoRemove unnecessary comment in build.yml
Charles Giessen [Wed, 4 Oct 2023 17:35:56 +0000 (11:35 -0600)]
Remove unnecessary comment in build.yml

11 months agogithub: re-enable normal mingw build
Christopher Degawa [Tue, 3 Oct 2023 00:17:07 +0000 (19:17 -0500)]
github: re-enable normal mingw build

pulls uasm from msys2

Signed-off-by: Christopher Degawa <ccom@randomderp.com>
11 months agoactions: Re-add -DUSE_MASM=OFF
Christopher Degawa [Mon, 2 Oct 2023 04:38:11 +0000 (23:38 -0500)]
actions: Re-add -DUSE_MASM=OFF

Signed-off-by: Christopher Degawa <ccom@randomderp.com>
11 months agoloader/asm_offset: Add __USE_MINGW_ANSI_STDIO
Christopher Degawa [Mon, 2 Oct 2023 04:37:04 +0000 (23:37 -0500)]
loader/asm_offset: Add __USE_MINGW_ANSI_STDIO

This fixes warnings generated when compiling with mingw-w64 regarding
printf format specifiers that are not available with base msvcrt.

Signed-off-by: Christopher Degawa <ccom@randomderp.com>
11 months agoloader: Add uasm as an alternative name for jwasm
Christopher Degawa [Mon, 2 Oct 2023 03:37:08 +0000 (22:37 -0500)]
loader: Add uasm as an alternative name for jwasm

uasm is a drop-in replacement for jwasm most of the time, but doesn't
always provide a binary named jwasm (such as on archlinux).

Signed-off-by: Christopher Degawa <ccom@randomderp.com>
11 months agoloader: Fix cross-compiling with jwasm
Christopher Degawa [Mon, 2 Oct 2023 02:38:28 +0000 (21:38 -0500)]
loader: Fix cross-compiling with jwasm

fixes a few issues when cross-compiling from linux to windows using
mingw-w64. Particularly with the result of jwasm not being used in the
library. Additionally, allows running the generated asm_offset binary
with wine, if the user provided the wrapper in their toolchain with
`-DCMAKE_CROSSCOMPILING_EMULATOR=wine`.

Signed-off-by: Christopher Degawa <ccom@randomderp.com>
11 months agoFix problems detected by CodeQL static analysis
Charles Giessen [Thu, 28 Sep 2023 19:08:46 +0000 (13:08 -0600)]
Fix problems detected by CodeQL static analysis

3 types of issues were found:
* Incorrect format specifiers
* Not providing required format specifies
* Using alloca in a loop

There are multiple instances of alloca in loops, but to fix them would
require significant refactoring. This commit includes 1 move of alloca inside
a for loop to the outside, but this is because the logic was redoing work
in a for loop that could have been done once at the start of the function.

11 months agoloader/cJSON: Prefix/mark static/remove symbols
Christopher Degawa [Thu, 6 Jul 2023 18:57:56 +0000 (13:57 -0500)]
loader/cJSON: Prefix/mark static/remove symbols

Prefixes the symbols that are used outside the file with `loader_` to
match the others. Marks symbols that are not used outside as static.
Removes the symbols that are not used at all.

Prevents conflicts with other libraries that might also use cjson.
This may cause issues if the internal checkout of cJSON is updated, in
that case, it may be simpler to just prefix all of cJSON's symbols with
`loader_cJSON_`.

Signed-off-by: Christopher Degawa <ccom@randomderp.com>
11 months agobuild: Update to header 1.3.266
Mike Schuchardt [Fri, 29 Sep 2023 14:59:43 +0000 (07:59 -0700)]
build: Update to header 1.3.266

- Update known-good
- Generate source

11 months agofeat: enable codeql
Joyce Brum [Thu, 28 Sep 2023 19:12:29 +0000 (19:12 +0000)]
feat: enable codeql

Signed-off-by: Joyce Brum <joycebrum@google.com>
12 months agoXCode fix - warnings as errors and unused parameter triggers it
Richard S. Wright Jr [Tue, 26 Sep 2023 22:22:15 +0000 (18:22 -0400)]
XCode fix - warnings as errors and unused parameter triggers it

12 months agoTweaked CMakeLists.txt for better organization
Richard S. Wright Jr [Tue, 26 Sep 2023 21:48:16 +0000 (17:48 -0400)]
Tweaked CMakeLists.txt for better organization

12 months agoremoved toolchain
Richard S. Wright Jr [Tue, 26 Sep 2023 20:02:14 +0000 (16:02 -0400)]
removed toolchain

12 months agoWIP: Added defines for iOS
Richard S. Wright Jr [Wed, 19 Jul 2023 15:41:11 +0000 (11:41 -0400)]
WIP: Added defines for iOS

12 months agoWIP: Loader seems to work on iOS
Richard S. Wright Jr [Thu, 6 Jul 2023 21:43:01 +0000 (17:43 -0400)]
WIP: Loader seems to work on iOS

12 months agobuild: Update to header 1.3.265
Mike Schuchardt [Mon, 25 Sep 2023 17:27:53 +0000 (10:27 -0700)]
build: Update to header 1.3.265

- Update known-good
- Generate source

12 months agoFix warning message refering to layers instead of ICDs
Charles Giessen [Tue, 19 Sep 2023 21:23:29 +0000 (15:23 -0600)]
Fix warning message refering to layers instead of ICDs

The warning message about the binary having the wrong bitness for
ICD's was wrongly stating it was about layers having the wrong
bitness.

12 months agoUse backtick instead of single quote in Loader Debugging
Charles Giessen [Mon, 18 Sep 2023 00:10:39 +0000 (18:10 -0600)]
Use backtick instead of single quote in Loader Debugging

Surrounding text with ~ causes markdown to format the text with strike through, which is not intended. Surrounding the ~ with backticks instead of single quotes fixes it.

12 months agoCheck correct magic value in device dispatch table
Charles Giessen [Fri, 15 Sep 2023 19:31:51 +0000 (13:31 -0600)]
Check correct magic value in device dispatch table

The check for a correct magic value in the device dispatch table used
LOADER_MAGIC_NUMBER instead of DEVICE_DISP_TABLE_MAGIC_NUMBER. This causes
every device creation to emit the 'invalid magic value' message, which is
wrong. This commit fixes that, as well as adds the expected value to the
log message.

12 months agocmake: Add find_package support
Juan Ramos [Wed, 13 Sep 2023 16:36:52 +0000 (10:36 -0600)]
cmake: Add find_package support

12 months agocmake: Simplify install code
Juan Ramos [Wed, 13 Sep 2023 16:01:02 +0000 (10:01 -0600)]
cmake: Simplify install code

12 months agocmake: Only search for MASM when using MSVC
sfan5 [Tue, 12 Sep 2023 21:38:47 +0000 (23:38 +0200)]
cmake: Only search for MASM when using MSVC

12 months agocmake: Fix MinGW vulkan.pc
Juan Ramos [Tue, 12 Sep 2023 20:50:39 +0000 (14:50 -0600)]
cmake: Fix MinGW vulkan.pc

Reverts KhronosGroup/Vulkan-Loader/pull/670 which produces an
invalid .pc file

closes #1278

12 months agoAdd device dispatch table magic value check
Charles Giessen [Tue, 22 Aug 2023 21:49:17 +0000 (15:49 -0600)]
Add device dispatch table magic value check

The device dispatch table has a magic value to ensure consistency, but
there was no message logged in case the magic value was corrupted. This
commit adds that check, fixes the message being printed for the instance
magic value check, and adds tests to ensure they are contining to be
checked in the future.

12 months agobuild: Update to header 1.3.264
Mike Schuchardt [Mon, 11 Sep 2023 14:44:29 +0000 (07:44 -0700)]
build: Update to header 1.3.264

- Update known-good
- Generate source

12 months agoMake test_layer delete destroyed devices
Charles Giessen [Fri, 8 Sep 2023 20:28:35 +0000 (14:28 -0600)]
Make test_layer delete destroyed devices

Destroyed devices need to be removed from the test_layer's created_devices
vector, so that it doesn't accidentally mistake dead devices for alive ones
when checking for whether a device extension is supported or not.

This caused multiple days of debugging headache as it caused sporadic test
failures due to the re-use of VkDevice handle values (which is caused by
the memory manager reusing allocations). Since a second VkDevice could share
the handle value of the first, and the first wasn't removed from the vector,
test_layer would use the data assocated with the first device by mistake.

12 months agoAdd Debug extension support to test layer
Charles Giessen [Tue, 5 Sep 2023 22:44:38 +0000 (16:44 -0600)]
Add Debug extension support to test layer

Debug utils, debug report, and debug marker are now supported directly in the
test layer, allowing easy testing of the behavior of layers which support
these debug extensions.

This allows testing the matrix of combinations between drivers, layers, and
loader support for these debug extensions.

This commit also adds a 'injected_extension' concept into the test_layer,
which allows recreating the behavior of layers which modify the extension
list returned by the driver.

12 months agoFix incorrect handling of Debug Marker functions
Charles Giessen [Tue, 5 Sep 2023 22:36:57 +0000 (16:36 -0600)]
Fix incorrect handling of Debug Marker functions

The implementation for VK_KHR_maintenance_5 exposed a bug in how the function
for debug_marker functions were gotten. The bug was to only check if a
driver supports a physical device when querying for device function pointers,
which ignores the possibility of a layer supporting a device extension. This
is an issue for VK_EXT_debug_marker, which requires trampoline functions to
properly unwrap data passed in, resulting in the various debug marker functions
returning NULL instead of a valid function pointer.

12 months agoMSAN fixes
Shahbaz Youssefi [Fri, 8 Sep 2023 13:39:28 +0000 (09:39 -0400)]
MSAN fixes

12 months agobuild: Update to header 1.3.263
Mike Schuchardt [Tue, 5 Sep 2023 18:18:17 +0000 (11:18 -0700)]
build: Update to header 1.3.263

- Update known-good
- Generate source

13 months agobuild: Update to header 1.3.262
Mike Schuchardt [Fri, 25 Aug 2023 18:39:57 +0000 (11:39 -0700)]
build: Update to header 1.3.262

- Update known-good
- Generate source

13 months agocmake: Fix gtest CMake warning
Juan Ramos [Fri, 25 Aug 2023 17:59:19 +0000 (11:59 -0600)]
cmake: Fix gtest CMake warning

https://github.com/google/googletest/pull/4288

13 months agocmake: Cleanup Threads::Threads logic
Juan Ramos [Fri, 25 Aug 2023 17:52:28 +0000 (11:52 -0600)]
cmake: Cleanup Threads::Threads logic

Android isn't supported

13 months agocmake: Fail when building for Android
Juan Ramos [Fri, 25 Aug 2023 17:51:45 +0000 (11:51 -0600)]
cmake: Fail when building for Android

13 months ago1. Update build-qnx content to make it buildable again.
Mike Gorchak [Thu, 24 Aug 2023 17:19:39 +0000 (13:19 -0400)]
1. Update build-qnx content to make it buildable again.
2. Switch __QNXNTO__ macro check to __QNX__

During last 23 years the QNX Neutrino microkernel was active, __QNXNTO__ macro belongs to it. Now QNX Muon microkernel is under development, so __QNX__ macro covers both versions: Neutrino and Muon.

First public announce of QNX Muon was here: https://blogs.blackberry.com/en/2023/04/get-in-the-sdv-podcast-from-blackberry-season-2-episode-3

13 months agoAdd support for AppleClang and iOS cross compilation
Charles Giessen [Thu, 17 Aug 2023 22:12:26 +0000 (16:12 -0600)]
Add support for AppleClang and iOS cross compilation

Compiling for iOS on an intel mac failed due to not handling the locations of
gen_defines.asm and asm_offset.s when running under AppleClang. This solution
works for the toolchain file used during development but may not work in other
situations.

iOS does not support secure_getenv, which is fine, except that the cmake
code check_function_exists seems to think it is supported, causing compilation
to fail. Just hardcoding secure_getenv to not be supported is enough for
the unix shim logic to compile.

The compilation revelaed a few issues in the test code, like not using
[[maybe_unused]] and a signed/unsigned comparison.

13 months agoDocument VK_DRIVER_FILES ability to look in folders
Charles Giessen [Wed, 9 Aug 2023 19:48:01 +0000 (13:48 -0600)]
Document VK_DRIVER_FILES ability to look in folders

Orinigally VK_ICD_FILENAMES was documented to only be able to use full paths to
ICD Manifest files. This is untrue, as VK_ICD_FILENAMES, and its replacement
VK_DRIVER_FILES is able to find drivers using full paths as well as paths to
folders containing manifest files. This commit amends the documentation to
reflect that capability as well as adding a test for that use case.

13 months agoAdd VK_LOADER_LAYERS_ALLOW environment variable.
Charles Giessen [Tue, 1 Aug 2023 23:22:15 +0000 (17:22 -0600)]
Add VK_LOADER_LAYERS_ALLOW environment variable.

This new environment variable prevents the VK_LOADER_LAYERS_DISABLE
env-var from applying to layers in the VK_LOADER_LAYERS_ALLOw env-var.

The purpose of it is to act like VK_LOADER_LAYERS_ENABLE in regards to
VK_LOADER_LAYER_DISABLE without force enabling the layers. That way,
implicit layers which normally would only be enabled in certain
circumstances (eg their enable_environment is set) can be allowed
while still disallowing other implicit layers.

13 months agoMove filter Env-Var parsing to top level functions
Charles Giessen [Tue, 1 Aug 2023 20:56:57 +0000 (14:56 -0600)]
Move filter Env-Var parsing to top level functions

The loader was querying the layer environment variable filters multiple
times during instance creation. The solution is to move the queries out
of the function that use them and do them once at the start of every
API call that needs them. That way the filters can be passed into each
function and shared.

13 months agoConsolidate envvar filters into single struct
Charles Giessen [Tue, 1 Aug 2023 20:03:09 +0000 (14:03 -0600)]
Consolidate envvar filters into single struct

There are many places where both the enable & disable envvar filter are
passed down into functions. This commit consolidates that by introducing
a new struct to hold both the enable & disable envvar filter. This
reduces the number of parameters to many functions and streamlines the
logic. It also enables future changes to what filters are available.

13 months agoAdd CRT Warnings & fix them
Charles Giessen [Sat, 29 Jul 2023 19:02:30 +0000 (13:02 -0600)]
Add CRT Warnings & fix them

Fixes the many uses of strncpy and strncat to use versions of the functions
which the CRT approves of. This means adding the length of the destination
string as a parameter.

The function loader_platform_combine_path was removed and the single use of
it was replaced with a call to snprinf, which achieves the same goal.

There are a few other functions that the CRT warns about, like fopen and
the wide char version of strcpy. These were also replaced with the 'safe'
functions.

13 months agobuild: Update to header 1.3.261
Mike Schuchardt [Fri, 4 Aug 2023 21:59:15 +0000 (14:59 -0700)]
build: Update to header 1.3.261

- Update known-good
- Generate source

13 months agoMake maintenance 5 require the feature to be enabled
Charles Giessen [Wed, 2 Aug 2023 18:31:06 +0000 (12:31 -0600)]
Make maintenance 5 require the feature to be enabled

The maintenance 5 behavior should only apply when the feature is enabled in
addition to the extension being enabled.

13 months agoEnable VK_KHR_maintenance_5 support
Charles Giessen [Mon, 31 Jul 2023 21:28:40 +0000 (15:28 -0600)]
Enable VK_KHR_maintenance_5 support

The extension changes the behavior of vkGetDeviceProcAddr to no longer allow
querying of core functions beyond the version specified in VkApplicationInfo.
Thus, a check is needed to ensure that if the extension is enabled, the
apiVersion is sufficient for the function to be returned.

13 months agoUnwrap VkInstance in set name/tag debug functions
Charles Giessen [Mon, 31 Jul 2023 19:30:49 +0000 (13:30 -0600)]
Unwrap VkInstance in set name/tag debug functions

It is possible for a layer to wrap the instance handle, and when the various
Set Name/Tag debug functions are called, the passed structure may contain an
instance handle which was previously not being unwrapped before calling down
the chain. This caused renderdoc to crash, as the instance handle was not
known to it.

13 months agobuild: Update to header 1.3.260
Mike Schuchardt [Mon, 31 Jul 2023 15:58:07 +0000 (08:58 -0700)]
build: Update to header 1.3.260

- Update known-good
- Generate source

13 months agoFixed the value of the FATAL_ERROR bit
Charles Giessen [Sat, 29 Jul 2023 19:15:13 +0000 (13:15 -0600)]
Fixed the value of the FATAL_ERROR bit

0x160 is *not* the next highest power of two in hex after 0x80, it is in fact 0x100.

This error caused the log function to always log every message, rather than just
fatal ones and whatever messages match the VK_LOADER_LOG environment variable.

13 months agoAdd relative path support to test harness
Charles Giessen [Thu, 25 Aug 2022 17:38:49 +0000 (11:38 -0600)]
Add relative path support to test harness

Makes sure the loader test framework can create relative paths in
the library_path fields. Adds a test to insure those paths still
work.

Since the contents of "library_path" is mututally exclusive with
the existing use_dynamic_library_default_search_paths, a new enum
was added to allow tests to choose which of the three content
types a given ICD or Layer manifest should use.

14 months agoMake fatal log messages be written to stderr
Charles Giessen [Thu, 27 Jul 2023 22:37:46 +0000 (16:37 -0600)]
Make fatal log messages be written to stderr

When the loader is about to call abort(), it calls loader_log to tell the user
why the loader is crashing. Unfortunately, unless the user set VK_LOADER_DEBUG
before starting the loader, they will not see this message. This commits adds
a new debug flag to signal to loader_log() that this message should be written
to stderr no matter what. This commit also changes all current loader_log call
sites that subsequently call abort() to use this flag.

14 months agoFix wrong file name in comments
Gregory Schlomoff [Thu, 27 Jul 2023 19:21:24 +0000 (12:21 -0700)]
Fix wrong file name in comments

14 months agoMake Disabling Dynamic Library unloading a runtime option
Charles Giessen [Thu, 27 Jul 2023 20:10:06 +0000 (14:10 -0600)]
Make Disabling Dynamic Library unloading a runtime option

This behavior was previously only available if compiled with a specific
option, but its useful enough to be moved into a runtime option.

To enable the behavior, set the environment variable
VK_LOADER_DISABLE_DYNAMIC_LIBRARY_UNLOADING to "1".

14 months agoAdd tests for explicit layers with pre_instance_functions
Charles Giessen [Wed, 13 Jul 2022 17:23:59 +0000 (11:23 -0600)]
Add tests for explicit layers with pre_instance_functions

Makes sure that any explicit layers with pre_instance_functions are
ignored, even if they would be enabled by an override layer or the
settings file.

14 months agoCheck api version when querying device commands
Charles Giessen [Wed, 21 Jun 2023 01:19:14 +0000 (19:19 -0600)]
Check api version when querying device commands

Note: This behavior is not enabled at this time. Future work is needed
to determine when to enable the behavior described below

Device commands from versions newer than the apiVersion should not be used,
since the app did not enable support for them. But querying for the functions
ignored the API version. This commit makes the loader check the apiVersion
before deciding whether to return a valid function pointer or NULL.

Tests were added for verifying each behavior, however the tests are
only partially implemented as there is no mechanism to enable the behavior
at the current time.

14 months agoSet correct API version in tests
Charles Giessen [Thu, 20 Jul 2023 19:53:04 +0000 (13:53 -0600)]
Set correct API version in tests

The manifest file version and physical device properties versions should match
in many of the tests, to insure that there isn't unintended behavior occuring.

This commit also cleans up the LayerPhysDeviceMod tests so they aren't adding
an ICD at the very top, which appears to have been accidental. Making that fix
did require modifying the test logic to put physical devices in a slightly
different order in the physical device groups.

14 months agoRemove unecessary version setting in tests
Charles Giessen [Thu, 20 Jul 2023 19:51:14 +0000 (13:51 -0600)]
Remove unecessary version setting in tests

The default value is 1.0, so it isn't necessary to set it.

14 months agoCleanup how tests create PhysicalDeviceGroup vectors
Charles Giessen [Thu, 20 Jul 2023 18:25:12 +0000 (12:25 -0600)]
Cleanup how tests create PhysicalDeviceGroup vectors

Makes use of the vectors initialization constructor to remove iterating over
the elements of the vector to set the sType manually.

Also zero's out the VkPhysicalDevice array in the TestICD so that non-filled
in elements have a value of zero instead of being uninitialized.

14 months agoAdd VK_LAYER to layer names in tests
Charles Giessen [Thu, 20 Jul 2023 18:23:01 +0000 (12:23 -0600)]
Add VK_LAYER to layer names in tests

Layer names should begin with VK_LAYER, which wasn't being done in certain
tests which this commit fixes.

14 months agoWarn when ICD Manifest version differs from vkEnumerateInstanceVersion
Charles Giessen [Thu, 20 Jul 2023 18:16:22 +0000 (12:16 -0600)]
Warn when ICD Manifest version differs from  vkEnumerateInstanceVersion

The apiVersion inside of the ICD Manifest is the first version the loader uses
to determine what the driver is capable of. If it is 1.1+, it will query for
vkEnumerateInstanceVersion & call it. This commit adds warnings for when the
returned version is 1.0 as well as when the function failed to be queried,
which a 1.1+ driver should not fail.

This warning is in response to a real issue due to behavioral differences in
the loader between 1.0 and 1.1 drivers, as the manifest file reported 1.1
while the vkEnumerateInstanceVersion reported 1.0.

14 months agoEnhance warning messages for portability enumeration
Charles Giessen [Mon, 24 Jul 2023 16:37:25 +0000 (10:37 -0600)]
Enhance warning messages for portability enumeration

There are three different ways for applications to fail to enumerate
portability drivers, not enabling the flag bit, not enabling the extension,
and both. These were all reported as the same error, which isn't as helpful
as it printing a separate message for each case.

This also makes it possible to emit a VUID for the case of setting the flag
bit but not the extension.

14 months agobuild: Update to header 1.3.259
Mike Schuchardt [Mon, 24 Jul 2023 16:47:32 +0000 (09:47 -0700)]
build: Update to header 1.3.259

- Update known-good
- Generate source

14 months agocmake: Remove cmake-format
Juan Ramos [Fri, 21 Jul 2023 22:18:58 +0000 (16:18 -0600)]
cmake: Remove cmake-format

14 months agobuild: Update to header 1.3.258
Mike Schuchardt [Fri, 21 Jul 2023 16:31:31 +0000 (09:31 -0700)]
build: Update to header 1.3.258

- Update known-good
- Generate source

14 months agoSet SYSCONFDIR in linux-32 actions CI run
Charles Giessen [Mon, 3 Jul 2023 23:35:45 +0000 (17:35 -0600)]
Set SYSCONFDIR in linux-32 actions CI run

Ensures that this build setting is exercised.

14 months agoAdd test for override layer path logging
Charles Giessen [Mon, 3 Jul 2023 21:45:23 +0000 (15:45 -0600)]
Add test for override layer path logging

14 months agoFix wrong pointer usage
Charles Giessen [Mon, 3 Jul 2023 21:44:02 +0000 (15:44 -0600)]
Fix wrong pointer usage

get_override_layer_override_paths logs the path used, but during the refactor it
failed to dereference the double pointer properly, leading to the loader_log
message reading garbage. This was not caught on x64 address sanitizer builds, but
was on the 32 bit build.

14 months agoFix duplicate layer test which used /etc
Charles Giessen [Mon, 3 Jul 2023 20:18:10 +0000 (14:18 -0600)]
Fix duplicate layer test which used /etc

The ImplicitLayers.DuplicateLayers test requires there to be two separate
files on the file system, located in different paths. To accomplish that, the
test writes a file to /etc and another to the default location. By default,
that is typically /usr/local/share. If the project is configured to set /etc
as that default location, only one file will be written.

The fix is to move the duplicate file from /etc to the default home directory,
since that is configured from inside the tests itself. This does change the
order the layers are found in, so the logic of the test had to be flipped.

14 months agoCreate SECURITY.md
Joyce [Fri, 14 Jul 2023 19:55:54 +0000 (16:55 -0300)]
Create SECURITY.md

Signed-off-by: Joyce <joycebrum@google.com>
14 months agoFix Condition Statement Error
mylifeyouwill [Thu, 13 Jul 2023 08:53:34 +0000 (16:53 +0800)]
Fix Condition Statement Error

14 months agobuild: Update to header 1.3.257
Mike Schuchardt [Mon, 10 Jul 2023 15:49:22 +0000 (08:49 -0700)]
build: Update to header 1.3.257

- Update known-good
- Generate source

14 months agoloader: add support for GNU/Hurd
Pino Toscano [Sun, 2 Jul 2023 16:30:58 +0000 (18:30 +0200)]
loader: add support for GNU/Hurd

* add the Hurd to COMMON_UNIX_PLATFORMS, as it is a POSIX OS
* use the Linux paths for getting the executable path (i.e. using
  /proc/self/exe): the Linux procfs provides both "self" and
  "<pid>/exe"
* follow the Linux behaviour in tests w.r.t. the platform shim
  behaviour, the test dummy binaries, and few more other bits

14 months agobuild: Update to header 1.3.256
Mike Schuchardt [Fri, 30 Jun 2023 18:53:36 +0000 (11:53 -0700)]
build: Update to header 1.3.256

- Update known-good
- Generate source

15 months agobuild: Update to header 1.3.255
Mike Schuchardt [Fri, 23 Jun 2023 17:39:22 +0000 (10:39 -0700)]
build: Update to header 1.3.255

- Update known-good
- Generate source

15 months agoAdd test for layer_prop_list out of bounds indexing
Charles Giessen [Fri, 23 Jun 2023 03:42:26 +0000 (21:42 -0600)]
Add test for layer_prop_list out of bounds indexing

This test makes sure that we correctly query for unknown functions implemented
only in a single layer while there are other layers present. This commit
successfully reproduces the error that the previous commit fixes. It was
difficult to reproduce because to get an crash, the test has to have the
instance_layer_list be in a different order than how they appear in
expanded_activated_layer_list.

15 months agoRemove indexing on layer_prop_list
Charles Giessen [Fri, 23 Jun 2023 03:36:39 +0000 (21:36 -0600)]
Remove indexing on layer_prop_list

The usage of the layer property list inside of
loader_check_layer_list_for_phys_dev_ext_address was modified when the
list changed from an array of struct loader_layer_properties, to an array
of pointers to struct loader_layer_properties. Except, the usages of
layer_prop_list were not updated in kind, leading to out of bounds indexes
when searching for unknown physical device functions in layers. This causes
crashes in the validation layer tests, which make use of this functionality.

15 months agoCleanup test layer GIPA & GDPA function exports
Charles Giessen [Fri, 23 Jun 2023 03:46:17 +0000 (21:46 -0600)]
Cleanup test layer GIPA & GDPA function exports

Splits apart the Version 0 layer into one with 'vkGetInstanceProcAddr'
and one with 'test_layerGetInstanceProcAddr' (with a similar change for
vkGetDeviceprocAddr). This is more in line with how layers in the wild
are written.

Removes the NO_PREFIX GIPA & GDPA exports as that is not supported by
the loader.

15 months agoClarify requirements for Layer Interface Version 1
Charles Giessen [Fri, 23 Jun 2023 03:45:05 +0000 (21:45 -0600)]
Clarify requirements for Layer Interface Version 1

The loader has never searched for `GetInstanceProcAddr` or `GetDeviceProcAddr`,
yet has documented that Layer Interface Version 1 supports layers that export
those functions.

15 months agocmake: Update update_deps.py logic
Juan Ramos [Wed, 21 Jun 2023 18:04:34 +0000 (12:04 -0600)]
cmake: Update update_deps.py logic

15 months agoRefactor return value of env.add_icd()
Charles Giessen [Mon, 19 Jun 2023 03:47:51 +0000 (21:47 -0600)]
Refactor return value of env.add_icd()

Make it return the driver that was just added rather than the ICD that
holds the driver, allowing for more concise code. This is because most
tests which modify the driver in some fashion do it in one go, and by
using the builder pattern, can be done all in a single statement.

15 months agoCleanup test creation of queues
Charles Giessen [Mon, 19 Jun 2023 02:52:43 +0000 (20:52 -0600)]
Cleanup test creation of queues

This commit removes queue creation from many tests because they were not a
primary part of the test. Many tests are written by first copying a previous
test and modifying it, which meant that a handful of initial tests would
include queue creation logic then get copied into many other tests where it
does not make sense.

15 months agoRefactor how tests load function pointers
Charles Giessen [Mon, 19 Jun 2023 02:08:35 +0000 (20:08 -0600)]
Refactor how tests load function pointers

The `load()` helper function exists so that tests dont need to
manually reinterpret_cast the returned value.

Also took liberty to change the names of function pointers which
come from extensions to include the extension in the name.
EX: AcquireDrmDisplay -> AcquireDrmDisplayEXT

15 months agoAdd EnumerateLayerDeviceExtensions helper to tests
Charles Giessen [Mon, 19 Jun 2023 00:30:49 +0000 (18:30 -0600)]
Add EnumerateLayerDeviceExtensions helper to tests

Removes code duplication by taking EnumerateDeviceExtensions and modifying
it to accept a layer parameter.

15 months agoRemove tests PhysicalDevice constructor overload
Charles Giessen [Mon, 19 Jun 2023 00:09:48 +0000 (18:09 -0600)]
Remove tests PhysicalDevice constructor overload

Having constructors to initialize specific values doesn't make sense when
the struct itself has extensive setter functions for the value in question.

15 months agoRefactor how tests enable WSI
Charles Giessen [Sun, 18 Jun 2023 23:44:17 +0000 (17:44 -0600)]
Refactor how tests enable WSI

Moved the various free functions to setup WSI on drivers &
instances to member functions.

15 months agoUse [[maybe_unused]] in tests
Charles Giessen [Sun, 18 Jun 2023 22:42:29 +0000 (16:42 -0600)]
Use [[maybe_unused]] in tests

Many components of the test framework have functions where not all parameters
are used, necessitating marking the parameter as unused. Before C++17, this was
done with `(void)parameter;` syntax, but now can be done more cleanly.

15 months agoRemove unnecessary constructors in tests
Charles Giessen [Sun, 18 Jun 2023 22:34:44 +0000 (16:34 -0600)]
Remove unnecessary constructors in tests

C++11 does not allow aggregate initialization for types with default values.
Thus, many structs used in the tests had to have constructors written which only
filled in values. With C++17, these constructors can be removed and aggregate
initialization used in many places.

This commit also provides default values for previously undefined structs to
prevent any bugs deriving from uninitialized data.

15 months agoUpdate tests to require a C++17 compiler
Charles Giessen [Fri, 16 Jun 2023 21:09:00 +0000 (15:09 -0600)]
Update tests to require a C++17 compiler

15 months agoCleanup BUILD.md
Charles Giessen [Fri, 16 Jun 2023 21:06:23 +0000 (15:06 -0600)]
Cleanup BUILD.md

Removes a lot of unnecessary text, fixes a few places that still
referred to Vulkan-ValidationLayers, replaces usage of CMake
options in the form `-DOPTION=...` with `-D OPTION=...`, moves a
few blocks of text to be in a more sensible order, and adds a
brief description of the build requirements like needing a C99
compiler.

15 months agoAdd ENABLE_WERROR to github actions
Charles Giessen [Fri, 16 Jun 2023 18:20:48 +0000 (12:20 -0600)]
Add ENABLE_WERROR to github actions

Makes github actions fail if there are any warnings generated.

15 months agoAdd and fix warnings for unused functions and parameters
Charles Giessen [Thu, 15 Jun 2023 21:47:23 +0000 (15:47 -0600)]
Add and fix warnings for unused functions and parameters

These warnings were disabled, and this commit enables them.
It also fixes the many warnings that were present but were silenced. This
includes many unused parameters that could be safely removed. But it also
required marking some parameters as `(void)param;` to indicate to the
compiler that the parameter is infact required. If a function is a stub
function, then instead all of the names of the parameters were removed.

The biggest change is for vk_dispatch_table_helper.h which had stubs for
every device function. Rather than try to mark every parameter as unused
it was simpler to remove all stub functions, which aren't useful for
testing anyhow. Tests should crash rather than silently continue anyhow.