platform/upstream/Vulkan-Loader.git
4 years agoBUILD.gn: Generate libvulkan.so.1 on Linux
Corentin Wallez [Thu, 16 Apr 2020 09:08:59 +0000 (11:08 +0200)]
BUILD.gn: Generate libvulkan.so.1 on Linux

On Linux the standard name to use the Vulkan loader is libvulkan.so.1,
so we add a copy step to the GN build that copies libvulkan.so to
libvulkan.so.1.

Also ran `gn format` on BUILD.gn

4 years agotests: fix non-msvc windows test building
Charles Giessen [Wed, 15 Apr 2020 17:52:27 +0000 (11:52 -0600)]
tests: fix non-msvc windows test building

Building the tests outside of msvc wouldn't work due to improper setup.
This commit fixes the typos and missing debug/release switches for
google-test.

Change-Id: Ifdc2cdab8236c35ba9e14663fffaa412f40aaa6a

4 years agoloader: Fix deadlock introduced by preloading ICDs
Charles Giessen [Sat, 11 Apr 2020 07:45:19 +0000 (01:45 -0600)]
loader: Fix deadlock introduced by preloading ICDs

The call to `loader_unload_preloaded_icds()` in vkDestroyInstance happens before the
loader_lock mutex was released, causing a deadlock due to the mutex not allowing
self re-entrant locking.
The fix is simply unload the ICDs after this lock was released.

Change-Id: I3f5774463b9872127893ed00183693dcf17a35d1

4 years agoloader: Preload ICD's to speed up common path
Charles Giessen [Mon, 2 Mar 2020 22:04:30 +0000 (15:04 -0700)]
loader: Preload ICD's to speed up common path

The ideal of having the loader be stateless causes serious slowdowns
in application startup due to the need to load then unload ICD's
repeatedly while calling pre vkCreateInstance functions. By pre-
loading the ICD's which are found using loader_icd_scan, the
unecessary reloading of ICD's is avoided.

The preloaded ICD's will be unloaded with vkDestroyInstance. This
allows subsequent vkCreateInstance calls to use the most recent ICD
on the system, preventing issue where a new driver was installed
but an application couldn't use it unless they unloaded the loader
library completely.

Changes to be committed:
modified:   loader/loader.c
modified:   loader/loader.h
modified:   loader/trampoline.c

Change-Id: Id169f94bea15e569b75c3a663b25444cc6c52c40

4 years agobuild: Find headers package from external dir
Lenny Komow [Wed, 8 Apr 2020 21:28:22 +0000 (15:28 -0600)]
build: Find headers package from external dir

A previous change allowed finding vulkan headers in the external
directory. This change modifies that to use the find_package()
interface through CMake. This allows versioning to work properly.

Change-Id: Ic00c45545d343286dce5c1ea4108e186d2bb6268

4 years agoLog debug messages with verbose severity instead of info
Kévin Petit [Thu, 9 Apr 2020 12:54:21 +0000 (13:54 +0100)]
Log debug messages with verbose severity instead of info

Both the loader and VK_EXT_debug_utils define four levels of severity,
map them one to one.

Signed-off-by: Kévin Petit <kpet@free.fr>
4 years agobuild: Update known-good for 1.2.137 header
Shannon McPherson [Wed, 8 Apr 2020 21:52:42 +0000 (15:52 -0600)]
build: Update known-good for 1.2.137 header

Updated `known_good.json` and generated new source files

Change-Id: If8edd83ec20ef78e0067a43d5acbee80cfe00ead

4 years agotests: Update layer path test to strip empty paths
Lenny Komow [Fri, 21 Dec 2018 21:58:28 +0000 (14:58 -0700)]
tests: Update layer path test to strip empty paths

Change-Id: Ib6f209650894e44955b82aa47a5e24f2d3640acc

4 years agoloader: Strip out empty search paths
Lenny Komow [Fri, 21 Dec 2018 21:57:50 +0000 (14:57 -0700)]
loader: Strip out empty search paths

Change-Id: Ibb0dfba07207716ccda0181cb2317dafc5bef2f4

4 years agoloader: Fix clang-format formatting issues
David Hubbard [Fri, 21 Dec 2018 19:09:57 +0000 (13:09 -0600)]
loader: Fix clang-format formatting issues

4 years agoloader: Remove duplicate search paths on posix
David Hubbard [Fri, 21 Dec 2018 18:56:49 +0000 (12:56 -0600)]
loader: Remove duplicate search paths on posix

Windows platforms remove duplicate search paths due to registry keys
that are not device-specific but need to be searched. For the most
part, mac and linux do not need to do that. But if duplicate paths
crop up on a posix platform, it can cause the same device showing up
twice in the vkEnumeratePhysicalDevices results. There may be other
places it causes unexpected results as well.

VkPhysicalDeviceIDProperties.deviceUUID can be used later to tell that
the two entries are actually the same device and not a multi-GPU
system, but finding the root cause at that point is going to be very
difficult.

4 years agobuild: Fix not finding registry path in some cases
Jamie Madill [Sun, 20 Oct 2019 13:40:46 +0000 (09:40 -0400)]
build: Fix not finding registry path in some cases

The Vulkan Headers detection script was coded to look for the Vulkan
registry in ${VULKAN_REGISTRY_PATH_HINT}/share/vulkan/registry. When
using the Vulkan-Headers repo the registry is located in just
${VULKAN_REGISTRY_PATH_HINT}/registry. This fix should allow both uses.

4 years agodocs: Improve vkNegotiateLoaderLayerInterfaceVersion's description
Wang YanQing [Thu, 26 Mar 2020 07:07:10 +0000 (15:07 +0800)]
docs: Improve vkNegotiateLoaderLayerInterfaceVersion's description

The current description about the version number negotiation between
loader and layer is easy to cause disagreement, and the description
about the version number negotiation between loader and ICD is much
more readable, so I think it is better to adopt the same way as the
vk_icdNegotiateLoaderICDInterfaceVersion description to describe the
vkNegotiateLoaderLayerInterfaceVersion.

Signed-off-by: Wang YanQing <udknight@gmail.com>
4 years agoAdd newlines to two DXGI files
Aaron Franke [Sat, 21 Mar 2020 06:57:59 +0000 (02:57 -0400)]
Add newlines to two DXGI files

4 years agodocs: Correct one minor discrepancy in "Implicit vs Explicit Layers"
Wang YanQing [Wed, 25 Mar 2020 05:42:20 +0000 (13:42 +0800)]
docs: Correct one minor discrepancy in "Implicit vs Explicit Layers"

No place mentions the way previously that we could use environment
variable to enable explicit layers, so I think it is better to move
the notice in brackets to the more proper place.

4 years agobuild: Enable building static loader on MacOS
Lenny Komow [Wed, 1 Apr 2020 19:26:02 +0000 (13:26 -0600)]
build: Enable building static loader on MacOS

4 years agoAllow vkGetInstanceProcAddr to resolve itself with no instance
Ricardo Garcia [Thu, 2 Apr 2020 12:41:47 +0000 (14:41 +0200)]
Allow vkGetInstanceProcAddr to resolve itself with no instance

Fixes #365

4 years agoloader: fix mispelling of implement
Charles Giessen [Mon, 30 Mar 2020 17:55:28 +0000 (11:55 -0600)]
loader: fix mispelling of implement

This somehow went under the radar for the spelling mistakes commit
previously.

Change-Id: I377e145d949b9e659dc89dc3bb912931eb9daca4

4 years agotests: Use complete version from header
Mike Weiblen [Thu, 27 Feb 2020 19:12:54 +0000 (12:12 -0700)]
tests: Use complete version from header

Change-Id: Ic194ff680af778d7221b60be14be20db57930244

4 years agoloader: Use complete version from header
Mike Weiblen [Thu, 27 Feb 2020 19:12:38 +0000 (12:12 -0700)]
loader: Use complete version from header

Change-Id: I97b4f2aa42f24cea082ac574dfcedd853f02caf8

4 years agodocs: Fix wrong type name in InterceptFunctionName prototype
Wang YanQing [Thu, 26 Mar 2020 03:32:41 +0000 (11:32 +0800)]
docs: Fix wrong type name in InterceptFunctionName prototype

The right type name of InterceptFunctionName's first argument
is VkEnumerateInstanceExtensionPropertiesChan instead of the
VkEnumerateInstanceExtensionProperties.

Signed-off-by: Wang YanQing <udknight@gmail.com>
4 years agoscripts: stubs in dispatch table lacked matching return types
Charles Giessen [Tue, 10 Mar 2020 17:06:18 +0000 (11:06 -0600)]
scripts: stubs in dispatch table lacked matching return types

Generated functions stubs had either a return type of void or
VkResult. Recent vulkan extensions had functions which returned
uint32_t, uint64_t, and VkDeviceAddress. The
dispatch_table_helper_generator didn't account for this and GCC would
complain about mismatching types. While likely not an issue, it did
create very noisy builds.

Modified files:
loader/generated/vk_dispatch_table_helper.h
scripts/dispatch_table_helper_generator.py

Change-Id: Iba229093461b75fd6ccd195cf60e200a22b8678f

4 years agoloader: check for duplicates in device extension count
Charles Giessen [Wed, 18 Mar 2020 06:39:00 +0000 (00:39 -0600)]
loader: check for duplicates in device extension count

Previously, the logic to get the pProperyCount in
terminator_EnumerateDeviceExtensionProperties when pProperties is null did
not check for duplicates. This meant that the subsequent call to
vkEnumerateDeviceExtensionProperties could write fewer extensions out as
duplicates aren't allowed. This commit should make it so that two calls
to vkEnumerateDeviceExtensionProperties return the same pPropertyCount's

Change-Id: I5d5513673322c02ed78dff5bb85605334beb5c6c

4 years agotravis: Remove GN build failures from 'allowed' list
Mark Lobodzinski [Wed, 18 Mar 2020 15:52:53 +0000 (09:52 -0600)]
travis: Remove GN build failures from 'allowed' list

GN build failures will now cause the travis builds to fail.

Change-Id: I985e4b8da6c151fc5c18cd5a82e4d074fcfb838d

4 years agobuild: Update known-good for 1.2.135 header
Shannon McPherson [Tue, 17 Mar 2020 18:11:59 +0000 (12:11 -0600)]
build: Update known-good for 1.2.135 header

Updated `CMakeLists.txt` and `common_codegen.py` to allow access to beta
types and commands when including `vulkan.h`. Generated new loader
header files.

Change-Id: I7241ff08cf9d70cd22472735f53d8f6d72fb8a46

4 years agoFindVulkanHeaders: Match header lines more precisely
Simon McVittie [Tue, 17 Mar 2020 19:03:37 +0000 (19:03 +0000)]
FindVulkanHeaders: Match header lines more precisely

In recent versions of Vulkan-Headers, we need to avoid matching the line
that defines VK_HEADER_VERSION_COMPLETE, because that would result in
thinking the micro version was 1 instead of the correct 134.

Change-Id: I9047e207c5a0bd4612908f16a9742c3cb1659348
Fixes: https://github.com/KhronosGroup/Vulkan-Loader/issues/352
Signed-off-by: Simon McVittie <smcv@collabora.com>
4 years agoloader: Handle no surface for surface caps 2 funcs
Joshua Ashton [Thu, 12 Mar 2020 22:57:49 +0000 (22:57 +0000)]
loader: Handle no surface for surface caps 2 funcs

Change-Id: I8b7b586bd7f3e15e5e0d41a325c1dd51dfd48427

4 years agoloader: Migrate get surface caps 2 funcs to wsi
Joshua Ashton [Thu, 12 Mar 2020 04:42:26 +0000 (04:42 +0000)]
loader: Migrate get surface caps 2 funcs to wsi

This was not exported correctly unlike other wsi funcs

Fixes #342

Change-Id: I456e3c495a05da8ff3063d7de9d970c0e52d45c8

4 years agoloader: Fix skipping all layers if one bad is found
Charles Giessen [Thu, 12 Mar 2020 18:03:41 +0000 (12:03 -0600)]
loader: Fix skipping all layers if one bad is found

The logic for loaderScanForLayers would jump to out if any issue was found
loading any layer. This prevented any correct layers from being detected.
The other fix is in loader_get_json to return if the length is zero,
which would cause a VK_ERROR_OUT_OF_HOST_MEMORY to be thrown because
cJSON_Parse would fail.

Change-Id: Ie7a5de5d0f38edd9b9012b9cd22fecd9ed86eb5c

4 years agoloader: fix crash when json doesn't contain an object
Charles Giessen [Tue, 10 Mar 2020 22:59:13 +0000 (16:59 -0600)]
loader: fix crash when json doesn't contain an object

When `loaderAddLayerProperties` has a json that doesn't contain an object as
the topmost value, it segfaults when looking for the `file_format_version`.
This commit fixes it by making sure the json is of the correct type before
proceding.

Files modified:
loader/loader.c

Change-Id: I4a624e3627d5f35a1a37ec4a17b03a3926ba5907

4 years agobuild: Update known-good for 1.2.134 header
Shannon McPherson [Wed, 11 Mar 2020 17:20:15 +0000 (11:20 -0600)]
build: Update known-good for 1.2.134 header

Change-Id: I01d0ff7ac2adcaca8630eb58755ebc8852c39c8d

4 years agoloader: Remove standard_val refs from LoaderLayerIF doc
Mark Lobodzinski [Thu, 20 Feb 2020 19:05:43 +0000 (12:05 -0700)]
loader: Remove standard_val refs from LoaderLayerIF doc

Change-Id: I1f76bda5ff497def8522690367ee86d19a40e5e2

4 years agoMove BUILD_TESTS option up as well
dan sinclair [Wed, 19 Feb 2020 02:40:29 +0000 (21:40 -0500)]
Move BUILD_TESTS option up as well

4 years agoAllow Vulkan-Headers to be in externals.
dan sinclair [Wed, 19 Feb 2020 02:22:13 +0000 (21:22 -0500)]
Allow Vulkan-Headers to be in externals.

This CL updates the CMake files to allow Vulkan-Headers to be in the
external folder. If the externals/Vulkan-Headers folder is present the
scripts will use that version of the headers.

4 years agoloader: Remove queue info count check
Lenny Komow [Wed, 19 Feb 2020 22:48:15 +0000 (15:48 -0700)]
loader: Remove queue info count check

The loader isn't supposed to do error checking unless layers are unable
to do so. This is a check that belongs in the layers

Change-Id: I89428210138d147be1b8d5c548377adeabe34d64

4 years agoloader: Deal with failure loading implicit layer libraries.
Bas Nieuwenhuizen [Sun, 19 Jan 2020 18:47:31 +0000 (19:47 +0100)]
loader: Deal with failure loading implicit layer libraries.

If the error is not dealt with, we'll end up calling dlclose(NULL)
later.

4 years agoloader: correct the name of vkNegotiateLayerInterfaceVersion
Georg Lehmann [Sat, 15 Feb 2020 17:41:34 +0000 (18:41 +0100)]
loader: correct the name of vkNegotiateLayerInterfaceVersion

There is no vkNegotiateLayerInterfaceVersion as far as I know.
The correct name is vkNegotiateLoaderLayerInterfaceVersion.

4 years agobuild: Update known-good for 1.2.133 header
Shannon McPherson [Mon, 17 Feb 2020 21:49:43 +0000 (14:49 -0700)]
build: Update known-good for 1.2.133 header

Change-Id: I2899494f9f76a914aee6b376e278d19e1b03e271

4 years agoloader: Avoid clang warning about parentheses
Cody Northrop [Thu, 6 Feb 2020 15:08:09 +0000 (08:08 -0700)]
loader: Avoid clang warning about parentheses

GN build was getting the following:

  error: using the result of an assignment as a condition without
  parentheses [-Werror,-Wparentheses]

Fixes #326

4 years agoloader: secure_getenv change logging WARN to INFO
Charles Giessen [Wed, 5 Feb 2020 20:54:15 +0000 (13:54 -0700)]
loader: secure_getenv change logging WARN to INFO

Validation Layer tests failed due to using LOADER_WARN_BIT, changing it to LOADER_INFO_BIT as
its more appropriate.

Change-Id: I3abf97796e1f1167f22538343bf22781d1125317

4 years agoloader: don't unconditionally add std-val meta layer
Charles Giessen [Mon, 27 Jan 2020 20:26:48 +0000 (13:26 -0700)]
loader: don't unconditionally add std-val meta layer

Previously, the standard-validation meta layer would always be added
to the list in loaderScanForLayers. This results in erroneous reporting
of its existance when querying for layers. This code is no longer
needed as the std-val meta layer is a proper layer which is included
in the sdk.

Changes to be committed:
modified:   loader/loader.c
modified:   loader/loader.h
modified:   loader/trampoline.c

Change-Id: Ib8dacf82db95cd50b02cb51b1ae688d2873cbbee

4 years agoloader: Fix buffer size updates in registry search
Lenny Komow [Wed, 5 Feb 2020 08:31:43 +0000 (09:31 +0100)]
loader: Fix buffer size updates in registry search

This causes the loader to properly update buffer sizes when reading
Windows registries.

Change-Id: I5fa0d86757177c8acac45871862995e3bacfc732

4 years agoloader: Add core 1.2 functions to gpa_helper
Lenny Komow [Tue, 4 Feb 2020 21:45:33 +0000 (22:45 +0100)]
loader: Add core 1.2 functions to gpa_helper

Change-Id: Ida875db5067265d67ddeae2843d5cf6a258c2693

4 years agoloader: add null check to loaderValidateLayers
Charles Giessen [Mon, 3 Feb 2020 17:28:04 +0000 (10:28 -0700)]
loader: add null check to loaderValidateLayers

The loader will now make sure to check if utf8 is null before
validating the string, preventing needless segfaults.

Change-Id: I48139e56719e3c518b85f2ded1ca0b682447413f

4 years agoloader: Warn when loader_secure_getenv() fails
Charles Giessen [Tue, 4 Feb 2020 18:35:29 +0000 (11:35 -0700)]
loader: Warn when loader_secure_getenv() fails

Whenever a call to loader_secure_getenv() fails and returns a
NULL, the loader will now issue a warning that the environment
variable requested will be ignored.

Change-Id: I2ebdfad2f842cf3dda69a359da31124e6f1eabc2

4 years agobuild: Regenerate files for debug utils changes
Lenny Komow [Sat, 1 Feb 2020 01:52:04 +0000 (18:52 -0700)]
build: Regenerate files for debug utils changes

Change-Id: Ia59f3c34addca92cfa22f4396ea30deb445a1ffc

4 years agoloader: Fix debug utils terminators being skipped
Lenny Komow [Fri, 31 Jan 2020 22:25:46 +0000 (15:25 -0700)]
loader: Fix debug utils terminators being skipped

Change-Id: I9e08b59669bd301e3c5361ae4ea16102461fb34b

4 years agobuild: Update known-good for 1.2.132 header
Shannon McPherson [Tue, 28 Jan 2020 22:07:22 +0000 (15:07 -0700)]
build: Update known-good for 1.2.132 header

Change-Id: I8607a9a279525391298eb2aceb0078faa8f32fce

4 years agoFix spelling mistakes
Charles Giessen [Mon, 20 Jan 2020 16:57:46 +0000 (09:57 -0700)]
Fix spelling mistakes

Several comments and one error message contained spelling mistakes.
This commit fixes it.

Changes to be committed:
modified:   loader/loader.c
modified:   loader/vk_loader_platform.h

Change-Id: Ida86de154b1c1e80c1d251ce71246a06ab038e2d

4 years agoloader: Update comments for shared aliases
Lenny Komow [Mon, 27 Jan 2020 16:56:52 +0000 (09:56 -0700)]
loader: Update comments for shared aliases

Change-Id: Ic21f144a99345d6ab78d019bfec852390e415fb7

4 years agoloader: Update copyright date to include 2020
Shannon McPherson [Fri, 24 Jan 2020 20:57:45 +0000 (13:57 -0700)]
loader: Update copyright date to include 2020

`loader.rc` copyright date was updated

Change-Id: Id520e571bb0fa3705f945deb8eeca1eda29011a1

4 years agoloader: Improve 1.2 promoted extension fix
Mark Lobodzinski [Wed, 22 Jan 2020 21:00:20 +0000 (14:00 -0700)]
loader: Improve 1.2 promoted extension fix

Change-Id: I33ea7c685c0d91119fed20b503408c7709210833

4 years agoloader: Fix handling of promoted device extensions
Mark Lobodzinski [Wed, 22 Jan 2020 19:47:46 +0000 (12:47 -0700)]
loader: Fix handling of promoted device extensions

Change-Id: Ia301f1bcde6f9fa7252ee4a665821b4a3d72d269

4 years agoFix GN build
Mike Schuchardt [Thu, 16 Jan 2020 00:15:27 +0000 (16:15 -0800)]
Fix GN build

Vulkan-Headers uses a new build_override include to toggle x11 support

4 years agobuild: Header update for 1.2.131
Mike Schuchardt [Fri, 20 Dec 2019 22:19:40 +0000 (14:19 -0800)]
build: Header update for 1.2.131

Change-Id: I1adcfac93f39d869085e90f0fab69faccbfbe77d

4 years agoscripts: Tweak extension detection
Mike Schuchardt [Tue, 22 Oct 2019 04:12:53 +0000 (21:12 -0700)]
scripts: Tweak extension detection

Use tag type instead of feature name

4 years agoscripts: Add support for Vulkan 1.2 codegen
Lenny Komow [Fri, 30 Aug 2019 16:53:16 +0000 (10:53 -0600)]
scripts: Add support for Vulkan 1.2 codegen

Change-Id: I37985dae01a0d17d02d3ba8e8a290cb2d155239b

4 years agoloader: Add support for Vulkan 1.2
Lenny Komow [Fri, 30 Aug 2019 16:54:56 +0000 (10:54 -0600)]
loader: Add support for Vulkan 1.2

Change-Id: Iad8d930ad6ff9eb9493fa3e72178f0d00698b09d

4 years agoloader: Remove loader_platform_basename dead code
Charles Giessen [Mon, 13 Jan 2020 20:14:40 +0000 (13:14 -0700)]
loader: Remove loader_platform_basename dead code

The loader_platform_basename function is not being used anywhere
else and was last modified 4 years ago. Considering the amount of
TODO comments and mentions to replace this, there doesn't seem
like a pressing need to keep it.

Changes to be committed:
modified:   loader/vk_loader_platform.h

Change-Id: Icd7a4d1104889e0519081831fbfaaaa46690438c

5 years agoloader: Add custom terminator to tool properties
Lenny Komow [Thu, 12 Dec 2019 22:38:07 +0000 (15:38 -0700)]
loader: Add custom terminator to tool properties

Since vkGetPhysicalDeviceToolPropertiesEXT is implemented in the layers
and not drivers, this changes the terminator to never call into the
driver.

Change-Id: I3beb92ab5c327672f21a17b857068968099c2345

5 years agobuild: Fix Vulkan registry detection
Caio Marcelo de Oliveira Filho [Tue, 10 Dec 2019 19:23:23 +0000 (11:23 -0800)]
build: Fix Vulkan registry detection

Fix incomplete VULKAN_REGISTRY_PATH_HINT for the case where
VULKAN_HEADERS_INSTALL_DIR is not specified.  The hint extracted the
DIRECTORY of the include dir (e.g. "/usr"), but missed the rest of the
expected path for finding vk.xml (e.g. "/usr/share/vulkan/registry").

Tested with CMake 3.16.0.

Fixes: 18664450a ("build: Fix Vulkan headers detection with CMake.")
5 years agocodegen: Fix crash in tooling info terminator
Lenny Komow [Wed, 11 Dec 2019 22:09:29 +0000 (15:09 -0700)]
codegen: Fix crash in tooling info terminator

Change-Id: I5835b73874bd3a8de9330c3244f456545c342ff3

5 years agobuild: Update for 1.1.130 header version
Mark Lobodzinski [Mon, 9 Dec 2019 22:51:19 +0000 (15:51 -0700)]
build: Update for 1.1.130 header version

Change-Id: Ie76beb6ec3eb24ca8a0d2d9c16646ca062e3278c

5 years agoFix a bug found by clang's -Wsizeof-array-div.
Nico Weber [Fri, 6 Dec 2019 02:01:05 +0000 (21:01 -0500)]
Fix a bug found by clang's -Wsizeof-array-div.

5 years agobuild:Add def file for Windows GN build
Tobin Ehlis [Wed, 27 Nov 2019 19:31:37 +0000 (12:31 -0700)]
build:Add def file for Windows GN build

Add vulkan-1.def as a source file for windows GN build and rename
windows target to "vulkan-1" so that functions are correclty
exported for GetProcAddress() lookup.

Fixes #292

5 years agobuild: Update known-good for 1.1.129 header
Shannon McPherson [Tue, 26 Nov 2019 20:01:27 +0000 (13:01 -0700)]
build: Update known-good for 1.1.129 header

Change-Id: I4a16e33c467a266f84aa38cc699c1e26d44f5b7c

5 years agobuild: Add Cfgmgr32.lib to GN build
Mike Schuchardt [Sat, 23 Nov 2019 03:35:35 +0000 (19:35 -0800)]
build: Add Cfgmgr32.lib to GN build

Appears to be needed for registry queries

5 years agoloader: Remove code for building a static loader
Lenny Komow [Fri, 27 Sep 2019 20:49:37 +0000 (14:49 -0600)]
loader: Remove code for building a static loader

Change-Id: Id795e795a52ace1bf3c0c0fdbc5aed19d05bef01

5 years agorepo: Remove the option to build a static loader
Lenny Komow [Fri, 27 Sep 2019 20:16:26 +0000 (14:16 -0600)]
repo: Remove the option to build a static loader

This option should not have been used, as an application that statically
links to the loader is likely to break as a result of driver updates.

Change-Id: I6bc05ac6fac601f439274fd8efeb0cd76564ccd1

5 years agobuild: Fix Vulkan headers detection with CMake.
David 'Digit' Turner [Tue, 19 Nov 2019 17:52:26 +0000 (18:52 +0100)]
build: Fix Vulkan headers detection with CMake.

The logic used to find the location of the Vulkan headers and
registry used simple find_path() calls with HINTS. Unfortunately,
this doesn't work when using a custom toolchain file that sets
CMAKE_FIND_ROOT_PATH_INCLUDE to ONLY, which can happen when
cross-compiling with a custom sysroot.

This patch changes the logic so that:

  - If VULKAN_HEADERS_INSTALL_DIR is specified on the command-line,
    or if it is set in the environment, or if VULKAN_SDK is set in
    the environment, the corresponding paths will be searched for
    the Vulkan headers and register, ignoring the
    CMAKE_FIND_ROOT_PATH. This does not affect other parts of the
    build.

  - Otherwise, use a regular find_path() call which may be restricted
    to the CMAKE_FIND_ROOT_PATH depending on previous configuration
    settings.

This should be equivalent to the previous behaviour, except when
CMAKE_FIND_ROOT_PATH_INCLUDE is set to ONLY.

5 years agoloader: Use unsafe file search for GN builds
Jonah Ryan-Davis [Fri, 8 Nov 2019 21:26:45 +0000 (16:26 -0500)]
loader: Use unsafe file search for GN builds

ANGLE is failing to locate validation layers on some platforms because
it cannot access VK_ICD_FILENAMES and VK_LAYER_PATH. This ensures that
these variables will always be picked up.

5 years agobuild: Update known-good for 1.1.128 header
Shannon McPherson [Mon, 18 Nov 2019 18:07:23 +0000 (11:07 -0700)]
build: Update known-good for 1.1.128 header

Change-Id: I05a369dd1fa9db2a53884193c5740f105c62b197

5 years agoFix build errors on Windows GN
Jonah Ryan-Davis [Wed, 6 Nov 2019 20:02:37 +0000 (15:02 -0500)]
Fix build errors on Windows GN

DXGI was changed to load dynamically. These changes need
to be propagated to GN.

5 years agobuild: Update known-good for 1.1.127 header
Shannon McPherson [Mon, 4 Nov 2019 17:48:06 +0000 (10:48 -0700)]
build: Update known-good for 1.1.127 header

Change-Id: I4abc51b448f786b3633b6cfcba0c18f873bb684d

5 years agoloader: Reset sizes for each call to RegEnumValue
baldurk [Wed, 30 Oct 2019 17:27:15 +0000 (17:27 +0000)]
loader: Reset sizes for each call to RegEnumValue

If we encounter a key that isn't REG_DWORD it might have a smaller
value_size, which will lead to the next RegEnumValue call failing
with ERROR_MORE_DATA even if there's a valid value that comes after
it.

Change-Id: I492979132bd06f012e176be3e8bf08f4df0cd0fd

5 years agogn: Remove stray comma in BUILD.gn
Mike Schuchardt [Wed, 30 Oct 2019 16:13:07 +0000 (09:13 -0700)]
gn: Remove stray comma in BUILD.gn

5 years agobuild: BUILD.gn fix for MacOS
Jonah Ryan-Davis [Wed, 30 Oct 2019 14:48:26 +0000 (10:48 -0400)]
build: BUILD.gn fix for MacOS

MacOS was missing some defines in BUILD.gn. This ensures the same
behavior from BUILD.gn as CMakeLists.txt

5 years agorepo: Switch appveoyor to use VS2015
Lenny Komow [Tue, 29 Oct 2019 21:54:52 +0000 (15:54 -0600)]
repo: Switch appveoyor to use VS2015

Change-Id: I3396230e7eb77810f3c65ea25bc39631a8d275c3

5 years agoloader: Move adapter API into custom header
Lenny Komow [Tue, 29 Oct 2019 21:01:45 +0000 (15:01 -0600)]
loader: Move adapter API into custom header

Change-Id: I8c38cae6cb51be88b0809b3dcc098ece17d871c7

5 years agobuild: Update known-good for 126 header patch
Shannon McPherson [Mon, 28 Oct 2019 17:29:17 +0000 (11:29 -0600)]
build: Update known-good for 126 header patch

An updated version of `vulkan.hpp` was added to the Vulkan-Headers
repository to address an issue discovered when building `cubepp` in the
Vulkan-Tools repository

Change-Id: I347ee871b596a1ba29e4190862c6b8e9aeb629f9

5 years agoloader: Don't drop unknown drivers
Lenny Komow [Mon, 21 Oct 2019 21:26:13 +0000 (15:26 -0600)]
loader: Don't drop unknown drivers

A previous change started matching drivers from the HKLM registry
against a list of known drivers. This change modifiers the behavior so
that unrecognized drivers are used, instead of being dropped.

Change-Id: Ifca2a2450acf560e5674e0ae44e815b2f8ada9e0

5 years agoloader: Only use secure getenv for finding layers
Lenny Komow [Wed, 9 Oct 2019 20:10:28 +0000 (14:10 -0600)]
loader: Only use secure getenv for finding layers

This change stops using secure_getenv when checking environment
variables that enable/disable layers. It is only needed when locating
layers

Change-Id: I36341da4c1823e2b385ac1cceb435547672aa1ef

5 years agobuild: Update known-good for 1.1.126 header
Shannon McPherson [Mon, 21 Oct 2019 21:08:13 +0000 (15:08 -0600)]
build: Update known-good for 1.1.126 header

Change-Id: I176f2b46099c8636972b6d9c281397fe18b096ac

5 years agoloader: move asm_test.S into file; Make more complicated
dan sinclair [Sat, 19 Oct 2019 13:42:19 +0000 (09:42 -0400)]
loader: move asm_test.S into file; Make more complicated

The syntax used in the offset asm file is more complicated then what is
in the asm_test file. This CL extends the asm_test file slightly to
catch more compilers which are unable to process the offset assembly.

Change-Id: I156a1a33de56975c2c8e5e2f835e98299931dce8

5 years agobuild: Update known-good for 1.1.125 header
Shannon McPherson [Tue, 15 Oct 2019 17:51:50 +0000 (11:51 -0600)]
build: Update known-good for 1.1.125 header

Change-Id: I35d7d7f7b06e9163f276bacce1dc4109d3cee630

5 years agoloader: Override doesn't include explicit layers
Charles Giessen [Mon, 7 Oct 2019 22:06:20 +0000 (16:06 -0600)]
loader: Override doesn't include explicit layers

When the override layer is present, it would append any layers
found as if they were implicit. This change prevents non-implicit
layers from being included in loaderScanForImplicitLayers when
the override layer is active.

Change-Id: I95a7555d68e72f3d801bb27e6cd0792611e4596f

5 years agobuild: Update known-good for 1.1.124 header
Shannon McPherson [Mon, 7 Oct 2019 16:17:08 +0000 (10:17 -0600)]
build: Update known-good for 1.1.124 header

Changes:
- Updated known good files
- Generated new files using `generate_source.py`

Updated:
- `loader/generated/vk_dispatch_table_helper.h`
- `loader/generated/vk_layer_dispatch_table.h`
- `loader/generated/vk_loader_extensions.c`
- `scripts/known_good.json`

Change-Id: I60f219b3fb252667250f2392b0196ba458dbdca8

5 years agolayers: allow concurrent layer device creation
Felix Dörre [Mon, 12 Aug 2019 18:03:47 +0000 (20:03 +0200)]
layers: allow concurrent layer device creation

5 years agorepo: Set build to not force dashes into arugments
Daniel Russell [Wed, 18 Sep 2019 21:39:34 +0000 (14:39 -0700)]
repo: Set build to not force dashes into arugments

This improves handling for any system that does not use dashes when
passing compiler options. This should allow the project to build with
clang-cl.

Change-Id: I76ee3119677dfaf65b25d304a28d89220ec4b44b

5 years agoloader: Dynamically load DXGI
Joshua Ashton [Sat, 21 Sep 2019 03:07:25 +0000 (04:07 +0100)]
loader: Dynamically load DXGI

Avoids recursively having DXGI and the loader call eachother back and forth when DXVK is in use.
Fixes #253

5 years agoloader: Use dxgi1_2 header instead of 1_6
Joshua Ashton [Sat, 21 Sep 2019 02:40:16 +0000 (03:40 +0100)]
loader: Use dxgi1_2 header instead of 1_6

Allows better compatibility with older versions of the Windows SDK given none of the newer features are used.

5 years agorepo: Generate code with metal support
Lenny Komow [Mon, 16 Sep 2019 22:26:14 +0000 (16:26 -0600)]
repo: Generate code with metal support

Change-Id: I2cc25f49a1b18f4d906ac02b151f46d1921ad4d5

5 years agoloader: Add support for metal surfaces
Lenny Komow [Mon, 16 Sep 2019 22:14:36 +0000 (16:14 -0600)]
loader: Add support for metal surfaces

The adds support for the VK_EXT_metal_surface extension

Change-Id: Ibb1c21e19fb053fe332ea075c3d32de59f7f8881

5 years agorepo: Bump known good for metal surface support
Lenny Komow [Mon, 16 Sep 2019 22:14:07 +0000 (16:14 -0600)]
repo: Bump known good for metal surface support

Change-Id: Ia5d934f8ed5039cbe354b4d9f56c604a82a2287f

5 years agobuild: Update known-good for 1.1.123 header
Shannon McPherson [Tue, 17 Sep 2019 16:58:27 +0000 (10:58 -0600)]
build: Update known-good for 1.1.123 header

Change-Id: Iff55cf1499d7640a22e58cdf9553e74be8d52e00

5 years agodocs: Update documentation for loader changes
Lenny Komow [Fri, 13 Sep 2019 15:44:55 +0000 (09:44 -0600)]
docs: Update documentation for loader changes

Change-Id: Id4c18d91c977d8698bcccd4680e0740877378c95

5 years agoloader: Match ICDs against DXGI adapters
Lenny Komow [Mon, 9 Sep 2019 09:33:41 +0000 (03:33 -0600)]
loader: Match ICDs against DXGI adapters

Previously, ICDs located through the HKLM registry would be loaded all
the time. This changes the loader to iterate DXGI adapters and only
loader the driver is there is an adapter that it corresponds to.

Change-Id: I204f37916b9e8ca668921507e68ef6e8e18a440a

5 years agoChange CMake paths for asm_offset.
Dan Sinclair [Wed, 11 Sep 2019 13:49:10 +0000 (09:49 -0400)]
Change CMake paths for asm_offset.

The current Unix configuration for the asm_offset program uses the
CMAKE_CURRENT_BINARY_DIR as the path prefix. This breaks if the loaders
are used in a third_party repository. This CL removes the path prefixes
from the asm_offset command, which makes it the same as how Windows is
configured.

5 years agoloader: Skip user specific paths if high integrity
Lenny Komow [Mon, 9 Sep 2019 05:45:31 +0000 (23:45 -0600)]
loader: Skip user specific paths if high integrity

Change-Id: Id994543bb2eae8a23f2bbaba7fb11a6cbc295aff

5 years agoloader: Implement secure getenv on Windows
Lenny Komow [Mon, 26 Aug 2019 15:50:48 +0000 (09:50 -0600)]
loader: Implement secure getenv on Windows

Change-Id: Ib88e539be3e3890fb92b2d6d7a514e04f4b677d7