Commit Graph

3428 Commits

Author SHA1 Message Date
Charles Giessen
85765687d2 test: Add ELF test binaries for 32 and 64 bit
These binaries are necessary for testing whether the loader correctly
ignores binaries of the wrong architecture. Since they are data files
more than executables, they are being checked in.

Currently only Unix binaries are added but in the future windows along
with any other platform binaries will be added.
2021-08-16 11:38:17 -06:00
Charles Giessen
de99f8f6be loader: Make use of a generated header version
This changes the loader to always set the version to the one which was used when
generating the source files that are checked into the repo, instead of using the
version gotten from the Vulkan-Headers find cmake file.

Change-Id: Id0955ddfd10e35e0f358f5a77799d8baa4992b04
2021-08-11 15:17:20 -06:00
Charles Giessen
52859e7695 loader: Reformated loader source code
Previously, clang-format was required for all new commits but the codebase
itself wasn't conformant. This commit formats the source files in the loader
folder.
2021-08-11 15:16:56 -06:00
Charles Giessen
773f1d2076 test: Revamp which linux paths are redirected
Adds FALLBACK_DATA_DIRS, FALLBACK_CONFIG_DIRS, SYSCONFDIR, and EXTRASYSCONFDIR
to the list of redirected paths. They were previously 'covered' by manual entries.
This commit makes them responsive to changes in the build system.

This commit also makes sure that the path used for redirection is one searched by
the loader by using the SYSCONFIG variable. Previously it would use /usr/local/etc/
which was only correct on systems where CMAKE_INSTALL_PREFIX was set to /usr/local.
2021-08-11 15:16:33 -06:00
Mark Young
baf0ffd791 Fix environment test failure.
It was looking for a specific output for the manifest file search string.
Re-add that string for now.
2021-08-11 10:20:01 -06:00
Mike Schuchardt
fbb56aacce build: Update to header 1.2.188
- Update known-good
- Generate source (no change)
2021-08-10 12:40:45 -07:00
Mike Schuchardt
1d30345f2b scripts: Use altlen instead of parsing latexmath
KhronosGroup/Vulkan-ValidationLayers switched to this method a while ago
and this syncs the KhronosGroup/Vulkan-Loader version of
helper_file_generator.py to match.
2021-08-10 12:40:45 -07:00
Mark Young
b0841ad150 Allow "icd" as well as "implem" for VK_LOADER_DEBUG 2021-08-10 12:10:47 -06:00
Mark Young
1941128d41 Add layer and implementation-specific logging
Add logging that will allow end-users to specifically just look at
messages for layers and implementations/ICDs.
Setting VK_LOADER_DEBUG to include one of the following:
  - layer        : enables layer-specific logging
  - implem       : enables implementation/ICD-specific logging
2021-08-10 12:10:47 -06:00
Mark Young
9e43839765 Fix loader_log messages to use LOADER_ log levels
The loader_log messages were using the DEBUG_REPORT log levels
which just happened to coincide with the existing LOADER_ log levels.
Going forward, to add layer logging in its own level, this would not
have worked.
2021-08-10 12:10:47 -06:00
Charles Giessen
a2edd93673 test: Prevent macro collision 2021-08-06 16:00:06 -06:00
Charles Giessen
1f522f5570 test: Make MetaLayer test add extensions
Needed to fixup more of the manifest writer in the process
2021-08-06 16:00:06 -06:00
Charles Giessen
363f736a03 test: Make invalid meta layer test more comprehensive
This required fixing a few bugsin the Manifest file printing logic
2021-08-06 16:00:06 -06:00
Charles Giessen
6259c5754d test: Add simple invalid-meta layer test
Creates a meta layer whose component layers do not exist
2021-08-06 16:00:06 -06:00
Samiullah Khawaja
4c901a731a Deallocate the extension lists when deleting an item from layer list
Vulkan Loader loads the meta layer list and filters the ones that are
not valid. During filter it deallocates the attributes of the loaded
meta layer but does not deallocate the associated extension list.
2021-08-04 14:09:17 -06:00
Charles Giessen
f7aab801ef test: Clear TestICDs before each test
Calling `dlclose` doesn't necessarily mean that the static variables will
be reset nor the libraries destructor gets called. This caused cascading
errors in tests on linux with GCC. By always manually resetting the ICD
or Layer before each test, we prevent any funny business from occuring.
2021-08-04 09:57:16 -06:00
Charles Giessen
78c3e74427 test: Update tests/README.md
Include note to always destroy the instance at the end of a test.
2021-08-04 09:57:16 -06:00
Charles Giessen
ab97762603 test: Make all tests call vkDestroyInstance
This caused spurious failures in other tests due to the dynamic library
not being closed.
2021-08-04 09:57:16 -06:00
Charles Giessen
3d635aceda test: Add CreateInstance.LayerPresent test 2021-08-04 09:57:16 -06:00
Charles Giessen
63a9f8dc4c test: Update framework_config to include paths to layer binaries 2021-08-04 09:57:16 -06:00
Charles Giessen
9d4e0bdc9a test: Add noexcept in test_environment 2021-08-04 09:57:16 -06:00
Charles Giessen
1550eeb10a test: add CreateInstance.LayerNotPresent test
Remove the corresponding test in loader_validation_tests.cpp
2021-08-04 09:57:16 -06:00
Charles Giessen
56722cb3d6 test: Implemente layer create instance/device
Added the necessary bits to make calling create instance and device function,
though it may not work in all circumstances
2021-08-04 09:57:16 -06:00
Mike Schuchardt
fa67fe730d build: Update to header 1.2.187
- Update known-good
- Generate source (no change)
2021-08-03 15:16:04 -07:00
Mark Young
e07667a99a Fix loader debug documentation
The loader debug environment variable (VK_LOADER_DEBUG) is not inclusive
of higher importance messages, it is exclusive to the types specifically
enabled.
2021-08-02 16:19:55 -06:00
Charles Giessen
3aeed853ab test: Add basic threading test
Requires adding ability for device to return functions with
vkGetDeviceProcAddr that aren't necessarily useable functions.

Also added checks to make sure that the handle passed in by the loader
to the TestICD is the 'right handle' where necessary, as some functions
do not need to know which device is being called on, just that it is correct.
2021-07-30 10:33:15 -06:00
Mike Schuchardt
99a7440204 build: Update to header 1.2.186
- Update known-good
- Generate source (no change)

Change-Id: I7c0699f8613ecbfefe79981f34faa5e276703324
2021-07-27 13:27:49 -07:00
Mike Schuchardt
a0c69f0d3a build: Update to header 1.2.185
- Update known-good
- Re-enable code generation for VK_HUAWEI_subpass_shading
- Generate source

Change-Id: I6607e1de097d1b8a2f631cd1f11b088204b8bb3a
2021-07-20 15:29:56 -06:00
Jamie Madill
9d05cd96cf build: Disable -Wimplicit-fallthrough in GN.
This flag was recently enabled by default in Chrome and ANGLE
and other projects inherit these build settings. Explicitly
dsiable this warning until it is enabled in the non-GN build.

Change-Id: I8f353f8abc3f7857481ff9cc774aff3618eaf35a
2021-07-20 11:42:47 -06:00
Charles Giessen
99c0b1433a loader: Dont return OOM on function load failure
Win7 does not support D3DKMTEnumAdapters2, as such when the loader goes to
query it, it gets NULL back. Except, instead of just erroring out, it would
return VK_ERROR_OUT_OF_HOST_MEMORY. Problem was that change
73296a0467
starts checking for OOM, and finding one when running in Win7. This change
alters that behavior so that it doesn't report an OOM when one hasn't occured.
2021-07-14 12:55:05 -06:00
Bob Ellison
15e1bbe99a windows: update the loader copyright date
The date, specified in loader/loader.rc, was incorrectly set to 2020.
2021-07-13 16:31:46 -06:00
Charles Giessen
7033871e47 ci: Re-add code and commit formatting verification
Change-Id: I240f912daa03d001f2dbd2527d8374bbf394ac4a
2021-07-13 10:36:25 -06:00
Mark Young
8c45e953d0 Update contact information 2021-07-13 08:12:54 -06:00
Charles Giessen
550b23a566 test: Move more old tests to new test framework
Remove them from the calling scripts where appropriate. Notably the 'get count
then run tests and pass in count' are now using the framework where that is
completely redundant.

Change-Id: I00d561a85047742a849df48818398b10c62d3b74
2021-07-12 16:23:15 -06:00
Mark Young
8daad81803 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
7ae227e8a7 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
17bc7b4c6d test: Fix TestLayer exports on windows
* `get_instance_func` needed to have __stdcall (VKAPI_ATTR) added
* Several .def files were incorrect
* vk_layer.h forward declares vkNegotiateLoaderLayerInterfaceVersion. This is
problomatic because it doesn't have __declspec(dllexport), a token added by
FRAMEWORK_EXPORT on windows. We have to special case the export macro here to
prevent that mismatched definition.
2021-07-06 10:03:29 -06:00
Charles Giessen
3adb0474e7 test: Add Enumeration Function stubs to TestLayer
Change-Id: I68b3597877fed803f4284e7e67f19ce4e3e2fe53
2021-07-06 10:03:29 -06:00
Charles Giessen
9cd092f705 test: Flesh out TestLayer to include relevant exports
Functions needed in the various layer interface versions are now
exported as well as guarded behind macros configurable from CMake.
The export_definitions folder was populated as well.

Change-Id: Iebfdd8ae02062eb81b8aa9f705885c9384c95be9
2021-07-06 10:03:29 -06:00
Charles Giessen
ba70a411f8 test: Use MACRO=1 in TestICD for definition style
This replaces instances of `#ifdef MACRO_NAME` with `#if MACRO_NAME` as now
MACRO_NAME will have a value of 0 or 1, instead of it being defined or not
defined.

Change-Id: I27a4330511a0f0d779f41851fe816fc79e868de2
2021-07-06 10:03:29 -06:00
Charles Giessen
0a8af1ba78 test: Update Framework Readme.md
Change-Id: Iaf3740b046b3f6457c337988c573a73f068ff1a3
2021-07-06 10:03:29 -06:00
Charles Giessen
77f74505d9 test: Use a new string_eq function instead of raw strcmp
Change-Id: I703763133c42eb78ae3c6e194450411e3f784e35
2021-07-06 10:03:29 -06:00
Charles Giessen
436222fdfc test: Drop fp_ from function pointer names
Change-Id: Ibd047e99f442d4a9755ac186e16b3620d3544e37
2021-07-06 10:03:29 -06:00
Charles Giessen
8074954f95 test: Remove some redundant tests in old test suite
Change-Id: Icc84b25bb092e15e054433651112e86b30726e52
2021-07-06 10:03:29 -06:00
Charles Giessen
5097a3d4e6 test: Rename regressions test cases
From RegressionTests.CreateInstanceExampleTestCase
To CreateInstance.ExampleTestCase

Change-Id: Ibd74541f93edbcaccb3daa9016dcacf8ecccfa78
2021-07-06 10:03:29 -06:00
Charles Giessen
0a1a346b0b test: Remove Allocation tests from old test suite
loader_alloc_callback_tests.cpp now contain all of the removed tests.

Change-Id: Ia99df3a8f86d40f0d5e89a62b7b0a5f9bebafb7c
2021-07-06 10:03:29 -06:00
Mike Schuchardt
b70cf11abb build: Update to header 1.2.183
- Update known-good
- Generate source (no change)

Change-Id: I059e6c2d8430228b4f20cadb83929b220efa5d0d
2021-06-30 15:37:42 -06:00
Charles Giessen
873040b7dc docs: Add info on DXGI adapters in Windows ICD Discovery 2021-06-29 18:36:52 -06:00
Bob Ellison
cb11f9b68d 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
840f63c4f7 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