Commit Graph

1237 Commits

Author SHA1 Message Date
Mark Young ef57449c9a Report a warning if the number of GPUs doesn't match
We've encountered situations where a layer removes physical devices
from the list which can cause issues on some systems if it's done
incorrectly.  For now, simply throw a warning if the loader determines
that a layer has removed devices.

NOTE: In the long-run, I think we should define a policy which states
that layers can re-order devices, but not add or remove.  If a layer
wants to add, it should become an ICD.
2021-07-08 08:48:19 -06:00
Mike Schuchardt cc3faa040b build: Update to header 1.2.184
- Update known-good
- Generate source

Change-Id: Ib2cfed88095541a127c23cf7418e9a66d81bd35e
2021-07-06 14:00:46 -06:00
Charles Giessen a1ceae74ea docs: Add info on DXGI adapters in Windows ICD Discovery 2021-06-29 18:36:52 -06:00
Bob Ellison d2fa58d604 copyrights: updated copyrights on MIT files
During SDK testing we identified that the runtime copyrights
were out-of-date.  The loader runtime includes two separate
MIT copyrights, each attributed to a pair of source files,
one initiated by Dave Gamble and one by joseph werle.

I examined these files to discover that the last LunarG change to
three out of the four was actually in 2017, not 2016.  This
date should be attributed to Khronos, Valve, and LunarG.

By updating the copyright notice in these files, we ensure that
the license registry remains up-to-date.

Note that no real content changed (which is why the copyrights are not
being updated to 2021).
2021-06-29 17:27:16 -06:00
xantares 6131cf2528 Loader shared lib: back to default cmake prefix
but it changed the import lib name (libvulkan.dll.a instead of libvulkan-1.dll.a) which in turns breaks cmake detection in FindVulkan
now we go back to using the default cmake prefix which is equivalent to what #595 wants, (prior to #523), but without the broken behavior

cc @Biswa96
2021-06-24 10:36:34 -06:00
Mike Schuchardt 1ff4c76125 build: Update to header 1.2.182
- Update known-good
- Disable codegen for VK_HUAWEI_subpass_shading
  https://github.com/KhronosGroup/Vulkan-Docs/issues/1564
- Generate source

Change-Id: If59954254bdf433bd5171f2a63cad88e34069c89
2021-06-21 10:07:16 -07:00
Christophe 346680554c Add layer manifest version 1.2.0 to history 2021-06-17 09:19:10 -06:00
Charles Giessen 649409e50f loader: Change VkResult when no ICDs were found
ReadDataFilesInRegistry would return VK_ERROR_INITIALIZATION_FAILED in several cases
which could cause the loader to short cirtuit and return that value when no drivers were
found in the registry. This is inconsistent with the later check of the size of the list
of manifest, which if it is 0 returns VK_ERROR_INCOMPATABLE_DRIVER. This commit changes
the instances of INIT_FAILED into INCOMPATABLE_DRIVER where relevant.
2021-06-11 13:59:14 -07:00
Charles Giessen 214f0429b3 loader: Create AddManifestFile function 2021-06-11 13:59:14 -07:00
Charles Giessen 63ce968f1a loader: Replace consistency checks with asserts 2021-06-11 13:59:14 -07:00
Biswapriyo Nath 7f55d1fd82 CMake: Fix linking option and libraries for MinGW.
Check MSVC for Visual Studio specific libraries.
2021-06-01 11:56:24 -06:00
Charles Giessen 7ea951714e loader: Silence erroneous implicit layer warning
When the override layer or an implicit meta layer is detected, the loader will
go and find all of the explicit layers because the override/meta layer might
require them. During that process `loaderAddLayerProperties` is called. It was
accidentally called with `is_implicit = true`, which causes the loader to interpret the manifest files as if they were implicit, generating
many erroneous warnings.

Change-Id: I8bc6bfa0d2a81159ebc33406e18ebf2099355768
2021-06-01 11:40:49 -06:00
Charles Giessen fce963ab33 loader: Add pragma once to adapters.h
This allows the header to be included multiple times without error.

Change-Id: I4f4ca4ab57c0b7f8606f397d61dadfadc2597b0b
2021-05-27 16:59:28 -06:00
Charles Giessen 7a8240d40d cmake: Make loader use same CRT in debug mode
This solves the issue of debug asserts appearing in the output due to
mixed CRT's in the same build.

Change-Id: I06169c143614dd1102c901f57aa4bdf431df8846
2021-05-27 16:59:28 -06:00
Mike Schuchardt 4dfe247549 build: Update to header 1.2.178
- Update known-good
- Generate source

Change-Id: I3e2756d9dc0452cc3743a05840d8e2a76961406a
2021-05-11 12:43:53 -07:00
Charles Giessen 70fecadb5a loader: Emit DEBUG for unknown function names
Loader previously emitted WARN level log messages for unknown
function names. This isn't wrong behavior and is mainly useful to
loader developers. Many layers and applications try to load all
function pointers they know about, so this code path is well
travelled.

Change-Id: Ia3e4b47eddb36bd02bcbab8452e5a96d03f75bd3
2021-05-04 16:48:39 -06:00
sfricke-samsung db9bdb01b4 Match null queue check for vkGetDeviceQueue 2021-05-04 14:00:42 -06:00
Lenny Komow e886f5453d loader: Prevent crash from VK_KHR_display
Previously, we assumed that the extension VK_KHR_display would be
available on all systems. This appears to no longer be the case. If we
get two ICDs, one which supports the extension and one which does not,
we used to get a crash if trying to call any function from the
extension on the physical device which did not support it. This solves
that crash
2021-04-27 16:57:13 -06:00
Lenny Komow db4ba5f086 loader: Fix stack overflow with large manifests
If the json manifest file was too large, the loader would do a stack
allocation that would fail, throwing an exception or creating
undefined behavior. This changes to a heap allocation.
2021-04-24 13:54:27 -06:00
Charles Giessen d4ba01b700 loader: Fix unused variable warning on Apple 2021-04-23 15:21:07 -06:00
Charles Giessen d1261df41b loader: Silence wrong ELF class errors
Currently the loader does not distinguish between 32 and 64 bit ELF
class files. This causes `dlopen` to fail but is expected because
the different ELF class libraries are located in the same directory.
We can safely ignore this error. If encountered, we will report it
with the INFO logging level.

Change-Id: Icb8e5351208f8a413a29ea9c457bc3fdac7de292
2021-04-22 16:25:44 -06:00
Charles Giessen d2fed3b057 loader: Accept layer manifest version 1.2.0
This change only prevents the loader from warning on the new version.

Change-Id: If8c0aedb2e0052d5b6eb6f72fc4e7ad70b58d8a7
2021-04-21 16:22:47 -06:00
Charles Giessen 6a0f8b9ab9 docs: Update pre-instance-function list
Add `vkEnumerateInstanceVersion` to the list of allowed pre instance
functions in the LoaderLayerInterface.md

Change-Id: I238aec5c3606af4d39bff5c50bbe75e909cd3224
2021-04-21 12:00:01 -06:00
Mike Schuchardt 6594b39ff6 build: Update to header 1.2.176
- Update known-good
- Generate source
- Fix version parsing in FindVulkanHeaders.cmake
- Add to VK_ENABLE_BETA_EXTENSIONS to GN build to pick up beta
  VkObjectType values

Change-Id: Ied4e4e71017e48d344b1c9cacf037ae989aceec9
2021-04-20 09:45:05 -07:00
Charles Giessen 567771943d build: Run generator to update extensions
QNX_screen moved from generated code to wsi.c but the generator was not run
so the old code wasn't deleted. This commit rectifies that.

Change-Id: Iba9cc3e6871605f50159acf7b6a97428f940b49e
2021-04-20 03:39:46 -06:00
Mike Gorchak 7dfa94ccdc Rename build option to make it clearer that it belongs to QNX only. 2021-04-06 14:52:51 -06:00
Mike Gorchak ff7918e9a0 Add support for QNX platform. 2021-04-06 14:52:51 -06:00
Lenny Komow 8535dacc1c docs: Update note about ICD proc addr 2021-03-23 17:21:03 -06:00
Mike Schuchardt 0dd217944b build: Update known-good files for 1.2.173 header
- Update known_good.json
- Generate source files
2021-03-23 13:37:52 -07:00
Shannon McPherson 9a160725b9 build: Update known-good files for 1.2.171 header
Changes:
- Updated `known_good.json`
- Generated new source files
- Added `VK_USE_PLATFORM_SCREEN_QNX` to platform list in
`common_codegen.py`

Change-Id: I2ef49799434ff31ff81680413a8700caea46593c
2021-03-02 15:40:45 -07:00
Jeremy Gebben 47e0359285 build: Update known-good files for 1.2.170 header
Changes:
- Updated `known_good.json`
- Generated new source files

Change-Id: I98c582a8cad9ffbdda5a1b2ffa5517b866803047
2021-02-15 11:58:50 -07:00
J.D. Rouan cc8e6bb52a loader: Do not return OOM when layer count is 0
An application program that overrides malloc with an implementation that
returns NULL for a zero-sized allocation will cause some loader and
trampoline functions to incorrectly return VK_ERROR_OUT_OF_HOST_MEMORY
if there are no layers on the system. This patch prevents these errors
by also checking the layer count.

Fixes: https://github.com/KhronosGroup/Vulkan-Loader/issues/543
2021-02-03 11:34:20 -07:00
Kévin Petit e171ab0db4 loader: Fix AArch64 Android build
The Android NDK doesn't provide a separate libpthread. Don't
explicitly link it in when builing for Android.

Signed-off-by: Kévin Petit <kevin.petit@arm.com>
2021-01-29 11:11:02 -07:00
nihui 102ecdd3ec Fix crash with NULL messenger 2021-01-28 17:21:53 -07:00
Kévin Petit 729ccd80a5 loader: Fix Android build
- Add missing prototype
- Fix incorrect parameter handling

Signed-off-by: Kévin Petit <kevin.petit@arm.com>
2021-01-28 17:19:33 -07:00
Ludovico de Nittis 94c535286f loader: Do not remove duplicated layers
Linux can support multiple ABIs, but Vulkan Layer manifest does not
allow to specify different library paths, based on the ABI.

As a solution, for ICDs, we can simply create multiple manifests, one
per ABI, and the Loader will try them one by one until it finds the
library that is compatible with the executable class.

Instead, for Vulkan Layers, this method doesn't work because the Loader
will discard the manifests that have a duplicated layer name.

To add support for multiple ABIs to Vulkan Layers, and to make the
behavior similar to the ICDs, with this commit we remove the duplicated
layer name check.
Instead we add to the output list all the Vulkan Layers that we find,
and only when we are actually going to dlopen them, we discard the
layers with the same name that we already successfully opened.

Fixes: #155

Signed-off-by: Ludovico de Nittis <ludovico.denittis@collabora.com>
2021-01-18 02:03:20 -07:00
Charles Giessen b3f75f39b0 loader: silence fread unused result
fread returns the count of values returned but was being ignored.
This commit makes sure to use that value when determining whether to
continue seeking to the end of the file.

Change-Id: Idb818cb3cda0cdde81aba1e5a4dd639c4814a923
2021-01-05 10:23:14 -07:00
Shannon McPherson 5ecdd78cdf build: Update known-good files for 1.2.165 header
Changes:
- Updated `known_good.json`
- Generated new source files

Change-Id: I5156923b1d3fb96d9e4fbe8dddb533f93561adfd
2020-12-19 18:07:29 -07:00
Michel Zou ef2cf2062f Rename LIB_SUFFIX to VULKAN_LIB_SUFFIX
Closes #527
2020-12-18 12:15:59 -07:00
Michel Zou 9285edc575 cmake: remove mingw lib prefix
we want the dll to be named vulkan-1.dll and not libvulkan-1.dll
as it is the default on mingw (for drop-in replacement)
2020-12-01 13:50:08 -07:00
Lenny Komow b21d5c09a7 loader: Remove SEEK_END usage
Change-Id: I699caaf048d70756649d9f6a2c7dfb012c6d2342
2020-12-01 13:49:37 -07:00
Charles Giessen b429366187 loader: Properly check for elevated permissions
The status message for the loader not searching environment
variables when running with elevated permissions didn't properly
check. This commit adds in proper guards to make sure the status
message only prints when compiled with explicit use of non-secure
getenv

Change-Id: I993bb08de21bb0e338852368c24fe615d0d1f9b9
2020-12-01 10:59:06 -07:00
Shannon McPherson 5341556e46 build: Update known-good files for 1.2.162 header
Changes:
- Updated `known_good.json`
- Generated new source files

Change-Id: Ic0f414ccf230314fa648abbb00da9509e1389a31
2020-11-23 09:19:03 -07:00
J.D. Rouan 1eaf7849ba Add GGP WSI platform support to Vulkan-Loader
Add GGP WSI platform support to Vulkan-Loader. GGP is Google Games
Platform, the platform for Stadia.
2020-11-23 09:12:55 -07:00
Biswapriyo Nath fa7070df64 loader: Cast dxgi object to void** to suppress gcc warnings. 2020-11-17 17:03:42 -07:00
Michel Zou d4107b591a pkgconfig: Missing lib suffx on win32
on win32 the library name is vulkan-1, not vulkan
2020-11-17 16:05:23 -07:00
Shannon McPherson 4117c855ef build: Update known-good files for 1.2.160 header
Changes:
- Updated `known_good.json`
- Generated new source files

Change-Id: I8afe698dd58a062d28f40a49f51cfa6c19409387
2020-11-10 11:07:08 -07:00
Michel Zou c5b9dbc07e Add an option to disable MASM
MASM generally goes with msvc, but it is not necessarily available with MinGW.
2020-10-30 11:38:59 -06:00
xantares c768fa91d0 Configure vulkan.pc when pkg-config is available
This allows vulkan.pc to be enabled on MinGW
2020-10-28 13:27:16 -06:00
Shannon McPherson 8bc3ef9763 build: Update known-good files for 1.2.158 header
Changes:
- Updated `known_good.json`
- Generated new source files

Change-Id: I5f06eec6afb61bac576cbad3e6e6982c0bd0440c
2020-10-27 11:11:32 -06:00