platform/upstream/Vulkan-Loader.git
2 years agobuild: Update to header 1.3.226 upstream/1.3.226
Mike Schuchardt [Thu, 1 Sep 2022 15:32:22 +0000 (08:32 -0700)]
build: Update to header 1.3.226

- Update known-good
- Generate source

2 years agoloader: Add stub function for OpenBSD executable path
Brad Smith [Wed, 31 Aug 2022 19:56:19 +0000 (15:56 -0400)]
loader: Add stub function for OpenBSD executable path

2 years agoDont pass portability bit to ICDs that dont expect it
Charles Giessen [Thu, 25 Aug 2022 18:16:54 +0000 (12:16 -0600)]
Dont pass portability bit to ICDs that dont expect it

There was a small issue with the initial version of the portability
enumeration extension where the portability enumeration flag bit would
be passed down to ICDs which did not expect flags to contain anything
other than zero.

While an argument could be made for those drivers to ignore flags they
do not recognize, just like extensions and other 'unknown' things, it
is best to play nice as this is the first instance creation flag bit
added.

2 years agoloader: Add OpenBSD support
Brad Smith [Wed, 31 Aug 2022 00:14:18 +0000 (20:14 -0400)]
loader: Add OpenBSD support

2 years agobuild: Update to header 1.3.225
Mike Schuchardt [Thu, 18 Aug 2022 19:32:49 +0000 (12:32 -0700)]
build: Update to header 1.3.225

- Update known-good
- Generate source

2 years agoSeparate Major.minor version checks from Full version checks
Charles Giessen [Tue, 9 Aug 2022 00:18:02 +0000 (18:18 -0600)]
Separate Major.minor version checks from Full version checks

loader_make_Version previously would decode the major, minor, and patch info out of version data. This results in
erroneous version checks that took into account patch version when they shouldn't of. The loader_make_full_version
function is introduced for code that wishes to get the full major.minor.patch version and uses of
loader_make_version that need the full version have been replaced.

2 years agobuild: Update to header 1.3.224
Mike Schuchardt [Thu, 4 Aug 2022 16:49:24 +0000 (09:49 -0700)]
build: Update to header 1.3.224

- Update known-good
- Generate source

2 years agoUse memmove for copying pApplicationInfo
Charles Giessen [Fri, 29 Jul 2022 21:49:56 +0000 (15:49 -0600)]
Use memmove for copying pApplicationInfo

Replace memcpy with memmove in terminator_CreateInstance to prevent possible issues
with the same memory being the source of the copy and the dest, as there is a for
loop which makes it possible for that to happen.

2 years agobuild: Update to header 1.3.223
Mike Schuchardt [Thu, 28 Jul 2022 15:46:56 +0000 (08:46 -0700)]
build: Update to header 1.3.223

- Update known-good
- Generate source

2 years agobuild: Update to header 1.3.222
Mike Schuchardt [Thu, 21 Jul 2022 16:28:00 +0000 (09:28 -0700)]
build: Update to header 1.3.222

- Update known-good
- Generate source

2 years agoFix typo in setting linux environment variables
Pan [Fri, 15 Jul 2022 06:10:08 +0000 (14:10 +0800)]
Fix typo in setting linux environment variables

Replace `;` with `:` in setting linux environment variables.

2 years agobuild: Update to header 1.3.221
Mike Schuchardt [Thu, 14 Jul 2022 16:10:27 +0000 (09:10 -0700)]
build: Update to header 1.3.221

- Update known-good
- Generate source

2 years agoloader: Dynamically load Win8+ functions
Mike Schuchardt [Mon, 11 Jul 2022 17:41:03 +0000 (10:41 -0700)]
loader: Dynamically load Win8+ functions

Allow loader to run on Windows 7 by dynamically loading function
pointers for Windows 8 and above APIs.

2 years agoDisable VulkanOn12/Dozen in Windows 7
Charles Giessen [Fri, 8 Jul 2022 18:17:01 +0000 (12:17 -0600)]
Disable VulkanOn12/Dozen in Windows 7

Chromium still supports building for Win7, as such the newly added support for
VulkanOn12/Dozen needs to be excluded from said build. This is achieved by using
the SDK version macros defined in <sdkddkver>

2 years agoFix corrupted pNext chain in vkCreateDevice
Charles Giessen [Thu, 7 Jul 2022 22:58:26 +0000 (16:58 -0600)]
Fix corrupted pNext chain in vkCreateDevice

When creating a device, the loader looks for the VkDeviceGroupCreateInfo
structure and replaces it with its own. This allows the loader to edit the
struct. However, to do this required editing the pNext chain. Because the
edited chain contained pointers to structures whose lifetimes end when the
vkCreateDevice function returns, the pNext chain is now corrupted.

This commit fixes that by storing a pointer to the user's
VkDeviceGroupCreateInfo and fixing up the pNext chain to use that instead.

2 years agoInitialize properly when statically linked
Charles Giessen [Thu, 7 Jul 2022 19:25:22 +0000 (13:25 -0600)]
Initialize properly when statically linked

Previously, the loader supported static linking. This capability was restricted
to MacOS only, however the necessary functionality was never implemented. This
commit adds the required code to properly initialize the loader when statically
linked with MacOS

Since the test framework was designed to dynamically load everything, it would
require significant rearchitecting to support it. As such, a simple verification
executable was added to the live_verification folder, instead of full support
in the test framework.

2 years agoRefactor vk_loader_platform.h
Charles Giessen [Tue, 21 Jun 2022 15:57:37 +0000 (10:57 -0500)]
Refactor vk_loader_platform.h

Move includes of vulkan headers into loader_common.h, delete dead code
and unnecessary macro defines, and generally clean up the header.

2 years agobuild: Update to header 1.3.220
Mike Schuchardt [Thu, 7 Jul 2022 17:10:58 +0000 (10:10 -0700)]
build: Update to header 1.3.220

- Update known-good
- Generate source

2 years agoEnable the Vulkan loader to load VulkanOn12/Dozen out of the D3DMappingLayers app...
Jesse Natalie [Thu, 30 Jun 2022 19:55:55 +0000 (12:55 -0700)]
Enable the Vulkan loader to load VulkanOn12/Dozen out of the D3DMappingLayers app package

2 years agoMake tests get files in a consistent order
Charles Giessen [Tue, 28 Jun 2022 23:46:39 +0000 (17:46 -0600)]
Make tests get files in a consistent order

Use the order defined the FolderManager's to define the order readdir
uses, rather than leaving it undetermined. This makes tests more consistent
by forcing layers and drivers to always be found in the same order on all
systems.

Note: MacOS doesn't currently have consistent ordering due to a crash with
ASAN. But even if ASAN isn't running, the dirent structure is being filled
out incorrectly, causing further test failures. While not ideal to disable
consistent ordering on MacOS, it is needed for linux and thus the issue
isn't high enough priority to resolve.

2 years agobuild: Update to header 1.3.219
Mike Schuchardt [Thu, 30 Jun 2022 18:08:38 +0000 (11:08 -0700)]
build: Update to header 1.3.219

- Update known-good
- Generate source

2 years agoFix BUILD.gn
Yuly Novikov [Thu, 30 Jun 2022 17:43:15 +0000 (17:43 +0000)]
Fix BUILD.gn

Add newly added file stack_allocation.h

Fixes #846

2 years agoloader: device array dealloc fix
Marcin Kańtoch [Thu, 23 Jun 2022 15:46:34 +0000 (17:46 +0200)]
loader: device array dealloc fix

2 years agoloader: Add unicode support
Andrew Naumov [Mon, 14 Feb 2022 11:21:43 +0000 (14:21 +0300)]
loader: Add unicode support

2 years agoAdd 32 & 64 bit field to json manifests
Charles Giessen [Mon, 20 Jun 2022 20:38:56 +0000 (15:38 -0500)]
Add 32 & 64 bit field to json manifests

Allows drivers and layers to specify if they are 32 bit or 64 bit in the
manifest file. This makes the loader able to prune manifests without
loading the library and finding that it failed to load.

2 years agoFix use-after-free in loader_add_layer_properties
Charles Giessen [Mon, 20 Jun 2022 20:53:25 +0000 (15:53 -0500)]
Fix use-after-free in loader_add_layer_properties

Occurs after file_vers is freed and when the layer manifest has a layers field
but has a version of 1.0.0.

2 years agoonly descend into layer GPDPA from trampoline
Brad Grantham [Tue, 7 Jun 2022 21:11:54 +0000 (14:11 -0700)]
only descend into layer GPDPA from trampoline

2 years agoPrevent loader config from overriding project config
Graeme Leese [Mon, 20 Jun 2022 14:45:25 +0000 (15:45 +0100)]
Prevent loader config from overriding project config

The loader options dummy targets were being linked into the public
interface of the loader, meaning that they were also set in projects the
include the loader as a sub-project. These override the containing
projects settings and can break things. There don't seem to be any
interface requirements in these settings, so include them as PRIVATE, so
that they stay local to the loader.

2 years agobuild: Update to header 1.3.218
Mike Schuchardt [Thu, 16 Jun 2022 16:02:49 +0000 (09:02 -0700)]
build: Update to header 1.3.218

- Update known-good
- Generate source
- Add missing enums to test framework

2 years agotests: Shuffle devices for sort test
Mike Schuchardt [Thu, 16 Jun 2022 18:58:39 +0000 (11:58 -0700)]
tests: Shuffle devices for sort test

Shuffle the bus IDs for discrete devices pd0, pd3, and pd4. Notably this
puts pd0 from icd0 in between pd4 and pd3 from icd2, making default
sorted order extremely unlikely if not impossible.

2 years agobuild: Update to header 1.3.217
Mike Schuchardt [Mon, 13 Jun 2022 19:02:40 +0000 (12:02 -0700)]
build: Update to header 1.3.217

- Update known-good
- Generate source

2 years agoOnly check first GPDPA in the layer chain.
Charles Giessen [Mon, 6 Jun 2022 18:05:52 +0000 (12:05 -0600)]
Only check first GPDPA in the layer chain.

When checking for unknown physical device functions, check the first layer that supports
vk_layerGetPhysicalDeviceProcAddr in the chain starting with the layer closest to the
application. This prevents unecessary work being done, and if any layer wraps VkInstance
will properly call through the wrapping layer first without calling into any other layer.

2 years agobuild: Update to header 1.3.216
Mike Schuchardt [Thu, 2 Jun 2022 18:41:38 +0000 (11:41 -0700)]
build: Update to header 1.3.216

- Update known-good
- Generate source

2 years agoRevert "fix #948 Only calls the first GPDPA in layer chain"
Charles Giessen [Thu, 2 Jun 2022 01:14:04 +0000 (19:14 -0600)]
Revert "fix #948 Only calls the first GPDPA in layer chain"

This reverts commit a8c17d6a367417509aa7b11cf65083eac2b2f4c9.

2 years agoRevert "Comment tweak to reflect new behaviour."
Charles Giessen [Thu, 2 Jun 2022 01:14:04 +0000 (19:14 -0600)]
Revert "Comment tweak to reflect new behaviour."

This reverts commit d86dc61e76f66b32b6955e8e7cbfa3edc7ed7b32.

2 years agoComment tweak to reflect new behaviour.
Andrew Cox [Wed, 1 Jun 2022 17:08:36 +0000 (18:08 +0100)]
Comment tweak to reflect new behaviour.

2 years agofix #948 Only calls the first GPDPA in layer chain
Andrew Cox [Wed, 1 Jun 2022 16:51:29 +0000 (17:51 +0100)]
fix #948 Only calls the first GPDPA in layer chain

2 years agoUpdate layer and driver vkGetPhysDevProcAddr docs
Charles Giessen [Tue, 24 May 2022 23:34:38 +0000 (17:34 -0600)]
Update layer and driver vkGetPhysDevProcAddr docs

Better describe the function's purpose and behavior, moving the
reason for introducing vk_layer|icdGetPhysicalDeviceProcAddr to
a following section for clarity.

2 years agofix typo
Tim Gfrerer [Tue, 31 May 2022 09:19:05 +0000 (10:19 +0100)]
fix typo

resulsts -> results

2 years agoFix crashes from OOM in vkDestroyInstance
Charles Giessen [Fri, 27 May 2022 22:36:35 +0000 (16:36 -0600)]
Fix crashes from OOM in vkDestroyInstance

Various situations could cause an OOM to turn into a hard crash due to double freeing
of memory that was improperly cleaned up. Also fixed memory leaks when layers would
report OOM.

2 years agoKeep allocated debug callbacks until destroy instance
Charles Giessen [Tue, 24 May 2022 23:30:23 +0000 (17:30 -0600)]
Keep allocated debug callbacks until destroy instance

Previously the loader would destroy any debug callbacks created during instance creation
to later create new ones during instance destruction. This required a memory allocation
to occur inside vkDestroyInstance, which can cause leaks if an OOM occurs during
instance destruction.

This commit simplifies the logic by keeping around the allocations made during instance
creation by moving them into their own debug node chain. Then during instance destruction
moves them back.

Also renames several functions to better describe their intended purpose.

2 years agoUse calloc to allocate memory for the search path
Charles Giessen [Thu, 26 May 2022 23:25:19 +0000 (17:25 -0600)]
Use calloc to allocate memory for the search path

This prevents bugs where uninitialized memory is treated as a real path. It
should fix an issue where sometimes CI would fail due to what appears to be a
spurious path with junk characters.

2 years agoFix typo in env var table
Mark Young [Fri, 27 May 2022 16:28:18 +0000 (10:28 -0600)]
Fix typo in env var table

Introduced a typo in my last commit in the table regarding the
disabling of instance extensions.  This is not a Linux only env
var.

2 years agoClean up environment var docs
Mark Young [Thu, 26 May 2022 17:40:36 +0000 (11:40 -0600)]
Clean up environment var docs

Split up into two tables:
  - Active
  - Deprecated

Clean up restrictions into their own column for easier viewing.
Made text slightly smaller to fit more in a smaller space.

2 years agoClarify JSON Manifest "api_version"
Mark Young [Wed, 25 May 2022 21:38:33 +0000 (15:38 -0600)]
Clarify JSON Manifest "api_version"

Clarify what is indicated by the "api_version" field in both
layer and driver manifest files.

Fixes issue #336.

2 years agoFix a NULL inst crashing during loader_icd_scan
Charles Giessen [Wed, 25 May 2022 16:47:55 +0000 (10:47 -0600)]
Fix a NULL inst crashing during loader_icd_scan

When checking for the portability driver field of driver manifests,
the loader did not check if inst was NULL first. Since this function
is called in pre-instance functions, this crashes the loader.

2 years agoUse calloc instead of alloc+memset
Charles Giessen [Sat, 21 May 2022 01:56:19 +0000 (19:56 -0600)]
Use calloc instead of alloc+memset

Replace naked uses of malloc & free with loader_alloc & loader_free.

2 years agoUse VkAllocationCallback in cJSON
Charles Giessen [Sat, 21 May 2022 01:40:53 +0000 (19:40 -0600)]
Use VkAllocationCallback in cJSON

Make cJSON pass the VkAllocationCallbacks instead of the loader_instance.
This removes and unecessary dependency between cJSON and the loader headers.
It also somewhat simplifies the interface by not requiring the inst parameter
everywhere, just in the creation of cJSON pointers and freeing.

2 years agoUse VkAllocationCallbacks in windows dirent
Charles Giessen [Sat, 21 May 2022 01:38:05 +0000 (19:38 -0600)]
Use VkAllocationCallbacks in windows dirent

Pass the allocation callbacks directly to dirent_on_windows.
This removes a unecessary dependency between the loader headers and
dirent_on_windows.

2 years agoRefactor loader allocation functionality
Charles Giessen [Sat, 21 May 2022 00:40:30 +0000 (18:40 -0600)]
Refactor loader allocation functionality

Created wrapper functions loader_alloc, loader_calloc, loader_free,
and loader_realloc. Made the existing loader allocation functions use
them. Replaced manual usage of VkAllocatorCallbacks with the new
wrapper functions.

2 years agobuild: Update to header 1.3.215
Mike Schuchardt [Tue, 24 May 2022 15:55:38 +0000 (08:55 -0700)]
build: Update to header 1.3.215

- Update known-good
- Generate source

2 years agodocs: Fix typo in MoltenVK url
Rutwik Choughule [Fri, 20 May 2022 08:18:00 +0000 (13:48 +0530)]
docs: Fix typo in MoltenVK url

2 years agoUpdate supported versions in the docs
Ludovico de Nittis [Fri, 20 May 2022 15:05:34 +0000 (17:05 +0200)]
Update supported versions in the docs

Mention the supported versions that were missing.

Signed-off-by: Ludovico de Nittis <ludovico.denittis@collabora.com>
2 years agobuild: Update to header 1.3.214
Mike Schuchardt [Tue, 17 May 2022 15:20:27 +0000 (08:20 -0700)]
build: Update to header 1.3.214

- Update known-good
- Generate source

2 years agobuild: Update to header 1.3.213
Mike Schuchardt [Wed, 11 May 2022 16:46:59 +0000 (09:46 -0700)]
build: Update to header 1.3.213

- Update known-good
- Generate source

2 years agoRevert "Implement unknown function intercept in layers"
Charles Giessen [Wed, 11 May 2022 14:43:14 +0000 (08:43 -0600)]
Revert "Implement unknown function intercept in layers"

This reverts commit 0fd2ff83845abb924db9426b1741882e5ca064bf.

2 years agoOutput message if override app_keys mismatch on app name
Mark Young [Thu, 5 May 2022 16:01:39 +0000 (10:01 -0600)]
Output message if override app_keys mismatch on app name

Output a layer message if the override layer is present and the
app name is not in the app_keys list.
Fixes issue #917.

2 years agoUpdate layer manifest file
Mark Young [Wed, 4 May 2022 20:33:53 +0000 (14:33 -0600)]
Update layer manifest file

Some fields specific to manifest files were missing.  Also updated
file to clearly indicate where fields are valid and usable.

2 years agoMake portability drivers not load by default
Charles Giessen [Tue, 3 May 2022 20:29:06 +0000 (14:29 -0600)]
Make portability drivers not load by default

Unless the portability enumeration extension is enabled and the create instance flags
contain VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR, do not enumerate drivers that
contain `is_portability_driver` in their JSON Manifest. This is phase 2 of the release
for the VK_KHR_portability_enumeration extension.

An error message will be printed when no drivers were reported but there was a
portability driver which was skipped over.

2 years agoFix CMake code for getting Git Version information
Charles Giessen [Tue, 3 May 2022 19:53:07 +0000 (13:53 -0600)]
Fix CMake code for getting Git Version information

The ${CMAKE_SOURCE_DIR} uses the wrong directory when the loader is included as a
subproject. By using ${CMAKE_CURRENT_LIST_DIR}, the CMake code to find the git
commit and branch name will use the correct directory.

Additionally, the logic was ammended to curtail this issue in the future. Quotes are
included in the string to allow it to be used as a string literal, instead of
needing a const char[] variable and macros. Also, the CMake code was restructured
to always define GIT_BRANCH_NAME and GIT_TAG_INFO.

2 years agoImplement unknown function intercept in layers
Charles Giessen [Tue, 29 Mar 2022 07:00:20 +0000 (01:00 -0600)]
Implement unknown function intercept in layers

Make it possible for layers to declare that they support unknown functions
and set up the layer dispatch table appropriately. A very niche use case
but helpful when developing validation for functions not yet out in the
public headers.

2 years agoCorrectly check for NULL in loader_get_dispatch
Charles Giessen [Tue, 3 May 2022 19:28:57 +0000 (13:28 -0600)]
Correctly check for NULL in loader_get_dispatch

2 years agoFix typo
Sein Lee [Fri, 29 Apr 2022 20:53:17 +0000 (05:53 +0900)]
Fix typo

2 years agoci: Remove fbactions/setup-winsdk
Mike Schuchardt [Thu, 21 Apr 2022 17:02:52 +0000 (10:02 -0700)]
ci: Remove fbactions/setup-winsdk

The default version 18362 started 404'ing and a new enough version is
present in the base image.

2 years agobuild: Update to header 1.3.212
Mike Schuchardt [Thu, 21 Apr 2022 16:12:12 +0000 (09:12 -0700)]
build: Update to header 1.3.212

- Update known-good
- Generate source

2 years agoAdd app_key OverrideMetaLayer tests
Charles Giessen [Thu, 14 Apr 2022 17:33:06 +0000 (11:33 -0600)]
Add app_key OverrideMetaLayer tests

2 years agoUpdate LoaderDriverInterface.md
Erik Faye-Lund [Wed, 13 Apr 2022 07:21:52 +0000 (09:21 +0200)]
Update LoaderDriverInterface.md

Fix link-syntax.

2 years agoRefactor FrameworkEnvironment API a bit
Charles Giessen [Wed, 6 Apr 2022 04:51:04 +0000 (22:51 -0600)]
Refactor FrameworkEnvironment API a bit

Redo some of API's for adding layers and ICD's to the test framework.

2 years agoDocument VK_KHR_portability_enumeration support
Charles Giessen [Thu, 7 Apr 2022 17:39:01 +0000 (11:39 -0600)]
Document VK_KHR_portability_enumeration support

2 years agoWarn if portability_enumeration extension should be enabled
Charles Giessen [Tue, 5 Apr 2022 06:14:49 +0000 (00:14 -0600)]
Warn if portability_enumeration extension should be enabled

Log an error if an application creates a VkDevice from a physical device which
was enumerated from a driver that is a portability driver but the application
didn't correctly enable the portability enumeration flag & extension.

2 years agoIncrease discovery timeout for Gtest test to 100 seconds
Charles Giessen [Wed, 6 Apr 2022 22:04:29 +0000 (16:04 -0600)]
Increase discovery timeout for Gtest test to 100 seconds

2 years agoRevert 32bit linux unknown ext chain change
Charles Giessen [Wed, 6 Apr 2022 21:29:47 +0000 (15:29 -0600)]
Revert 32bit linux unknown ext chain change

Fix breaking of builds due to the dropping of GOT addressing mode.

2 years agobuild: Update to header 1.3.211
Mike Schuchardt [Tue, 5 Apr 2022 16:51:59 +0000 (09:51 -0700)]
build: Update to header 1.3.211

- Update known-good
- Generate source

2 years agoAllow meta layers to have newer component layers
Charles Giessen [Wed, 30 Mar 2022 21:02:30 +0000 (15:02 -0600)]
Allow meta layers to have newer component layers

Relax the requirement that all component layers in a meta layer must equal the version of the meta layer.
This allows enabling layers that do not have the same API version as the meta layer.

2 years agoClean up version checking logic
Charles Giessen [Fri, 25 Mar 2022 23:08:57 +0000 (17:08 -0600)]
Clean up version checking logic

Add a few helper functions to simplify checking that a X.Y.Z version is sufficient.

2 years agoFix 32 bit linux unknown function handling
Charles Giessen [Mon, 4 Apr 2022 23:47:47 +0000 (17:47 -0600)]
Fix 32 bit linux unknown function handling

Building and running the regression tests reveals that the 32 bit unknown function
handling on linux is broken. It required the same fixes as did windows 32 bit, since
the code is almost identical.

wsi.c also would not compile in 32 bit linux due to the warnings-as-errors being enabled,
which has also been fixed.

2 years agoFix missed Physical Devices in Windows
Charles Giessen [Fri, 1 Apr 2022 09:09:35 +0000 (03:09 -0600)]
Fix missed Physical Devices in Windows

The previous logic would cause any non-sorted physical devices to be missed
when aggregating the final list. This caused crashes due to the phys_dev
value not being initialized. The fix is to make sure both sorted and non
sorted physical devices are included in the final output of
setup_loader_term_phys_devs().

2 years agoUse correct TestICD in tests
Charles Giessen [Fri, 1 Apr 2022 09:03:24 +0000 (03:03 -0600)]
Use correct TestICD in tests

Many tests were using the V6 TestICD, which means that it exports the
EnumerateAdapterPhysicalDevices. The loader then only looks for devices
using that functionality and if the test didn't set it up, the driver
won't have its devices found.

Also:
* Cleaned up handle_validation_tests
* Added WSI setup helpers, which put all the setup code for WSI in one place
* Created a to/from_nondispatch_handle function for TestICD, probably should
be in a more general location

2 years agoAdd test for different ICD interface versions
Charles Giessen [Thu, 3 Mar 2022 18:44:49 +0000 (11:44 -0700)]
Add test for different ICD interface versions

Fix Test Framework not skipping Drivers which have a different LUID.

2 years agobuild: Update to header 1.3.210
Mike Schuchardt [Fri, 1 Apr 2022 17:18:57 +0000 (10:18 -0700)]
build: Update to header 1.3.210

- Update known-good
- Generate source

2 years agoDont emit warnings on unknown manifest file versions
Charles Giessen [Thu, 31 Mar 2022 17:32:05 +0000 (11:32 -0600)]
Dont emit warnings on unknown manifest file versions

Since the loader is meant to be forward compatible, it makes little sense to emit
a warning when an ICD or Layer manifest is found with a version that it doesn't
understand. Thus they now are INFO level.

2 years agocmake: Add ENABLE_WERROR option
Biswapriyo Nath [Wed, 30 Mar 2022 16:25:58 +0000 (21:55 +0530)]
cmake: Add ENABLE_WERROR option

This adds a choice for the user whether to treat warnings as errors.
The remaining compiler options are moved where it was before.

2 years agoFixup several small issues found by Visual Studio
unknown [Tue, 15 Mar 2022 04:13:10 +0000 (22:13 -0600)]
Fixup several small issues found by Visual Studio

The VS Analyzer went through the codebase and pointed out a dozen warnings and
one possible crash.

2 years agoEnable /W4 errors and support clang-cl
Charles Giessen [Tue, 29 Mar 2022 05:50:33 +0000 (23:50 -0600)]
Enable /W4 errors and support clang-cl

Enable /W4 errors on MSVC and fix all corresponding errors.

Refactor the CMakeLists.txt to allow for compiling with clang-cl. This required
figuring out that -Wall -Wextra mangle the set of warnings used. The solution
is to use /W4 instead when compiling with clang-cl on Windows.

2 years agoReplace TEST_F with TEST in most tests
Charles Giessen [Tue, 29 Mar 2022 05:12:49 +0000 (23:12 -0600)]
Replace TEST_F with TEST in most tests

Test fixturing (TEST_F) is useful when there is a lot of common code that needs
to be run for a suite of tests. However, the FrameworkEnvironment encapsulates
almost all of the setup work all tests needs, and so doesn't need to be in a
fixture. Making the add_icd call inside the tests makes it clear which binary
is being used.

This commit also uses the corrent signed/unsigned constants in tests, as was
warned by compilers when enhanced warnings were enabled (/W4 in msvc).

2 years agoUpdate issue templates
Mark Young [Tue, 29 Mar 2022 02:32:25 +0000 (20:32 -0600)]
Update issue templates

Expand Bug report and add Feature Request template.

2 years agoAdd Bug Reporting Template
Mark Young [Tue, 29 Mar 2022 02:23:07 +0000 (20:23 -0600)]
Add Bug Reporting Template

Add initial bug reporting template with requested fields.

2 years agoApply code review comments from @charles-lunarg
Mark Young [Fri, 25 Mar 2022 20:56:25 +0000 (14:56 -0600)]
Apply code review comments from @charles-lunarg

2 years agoFix #888 crash in Lutris with Linux sorting
Mark Young [Fri, 25 Mar 2022 14:42:44 +0000 (08:42 -0600)]
Fix #888 crash in Lutris with Linux sorting

The sorting algorithm needed to take into account both the application
API version as well as the driver API version.

This required additional changes to the sorting algorithm for the fallback
since even if the instance supports the extension or Vulkan 1.1, the individual
drivers may not.

Also, add supporting tests which would catch these cases in the future.
In the process, I realized we assumed that the presence of an extension in the
test_icd indicated "enablement" which was incorrect.  So I separated out
that into a set of "enabled instance extensions"

2 years agoRemove LDP_DRIVER_6
Charles Giessen [Thu, 24 Mar 2022 22:44:14 +0000 (16:44 -0600)]
Remove LDP_DRIVER_6

The cause for this policy was due to dynamic linker behavior which could have
resulted in the wrong symbols being used. However, this didn't occur in
practical usage of the dynamic linker. Also drivers exporting Vulkan
entrypoints was a useful behavior to enable testing and more flexible usage
that this policy actively interfered with.

2 years agoFixup windows test infrastructure
Charles Giessen [Thu, 24 Mar 2022 23:22:16 +0000 (17:22 -0600)]
Fixup windows test infrastructure

Cleaned up several bugs in the testing framework in the windows shim.
Rewrote the tests that exercise DXGI/D3DKMT functionality.

2 years agoFix non-sorted surface indexing
Mark Young [Thu, 24 Mar 2022 19:52:47 +0000 (13:52 -0600)]
Fix non-sorted surface indexing

The physical device terminator was missing the ICD index in the
non-sorted path.  This caused crashes in Angle before it was realized
that the sorting code was unintentionally disabled in that build
path.

Also, add tests to catch this case in the future in the WSI code, but
this required converting all the TEST_F tests to TEST since Gtest
didn't like mixing the 2 on my system.

Finally, fix a few WSI error messages in the loader which were
missing spaces.

Fixes #863 for non-sorting paths

2 years agoUpdate BUILD.gn
Peng Huang [Thu, 24 Mar 2022 16:08:15 +0000 (12:08 -0400)]
Update BUILD.gn

Add  LOADER_ENABLE_LINUX_SORT to workaround ANGLE crashes on Linux

2 years agobuild: Update to header 1.3.209
Mike Schuchardt [Wed, 23 Mar 2022 17:14:51 +0000 (10:14 -0700)]
build: Update to header 1.3.209

- Update known-good
- Generate source

2 years agoLog when core GetToolingProperties is NULL.
Charles Giessen [Mon, 21 Mar 2022 18:07:39 +0000 (12:07 -0600)]
Log when core GetToolingProperties is NULL.

The core entrypoint for vkGetPhysicalDeviceToolingProperties didn't log if the function in the
terminator was NULL. This makes it easier for implementations to know when they aren't
exporting the symbol.

2 years agoMore clean up to make sure we have enough space
Mark Young [Thu, 17 Mar 2022 18:08:49 +0000 (12:08 -0600)]
More clean up to make sure we have enough space

2 years agoModify logging text output
Mark Young [Thu, 17 Mar 2022 17:52:00 +0000 (11:52 -0600)]
Modify logging text output

Modify text output for logs so that we only flag types of messages
we're interested in and also try to add spacing so items line up
cleaner.

2 years agoAdd device log info on vkCreateDevice
Mark Young [Wed, 16 Mar 2022 21:23:06 +0000 (15:23 -0600)]
Add device log info on vkCreateDevice

To make things clearer on output, log the device information for
the physical device being used on vkCreateDevice if either the
layer or the driver log bits are set.

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.