Commit Graph

3396 Commits

Author SHA1 Message Date
Mark Young 1b11a75de4 Update contact information 2021-07-13 08:12:54 -06:00
Charles Giessen 0b14ceae6c 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 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 99c066a0c6 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 e68175413f test: Add Enumeration Function stubs to TestLayer
Change-Id: I68b3597877fed803f4284e7e67f19ce4e3e2fe53
2021-07-06 10:03:29 -06:00
Charles Giessen bb68c98c56 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 0eb3ae0661 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 43b3cdb34f test: Update Framework Readme.md
Change-Id: Iaf3740b046b3f6457c337988c573a73f068ff1a3
2021-07-06 10:03:29 -06:00
Charles Giessen 81314c2f89 test: Use a new string_eq function instead of raw strcmp
Change-Id: I703763133c42eb78ae3c6e194450411e3f784e35
2021-07-06 10:03:29 -06:00
Charles Giessen 57c6c8e8c7 test: Drop fp_ from function pointer names
Change-Id: Ibd047e99f442d4a9755ac186e16b3620d3544e37
2021-07-06 10:03:29 -06:00
Charles Giessen 9b90dd7cb3 test: Remove some redundant tests in old test suite
Change-Id: Icc84b25bb092e15e054433651112e86b30726e52
2021-07-06 10:03:29 -06:00
Charles Giessen b862e98220 test: Rename regressions test cases
From RegressionTests.CreateInstanceExampleTestCase
To CreateInstance.ExampleTestCase

Change-Id: Ibd74541f93edbcaccb3daa9016dcacf8ecccfa78
2021-07-06 10:03:29 -06:00
Charles Giessen 2443f46735 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 de73b4f7eb 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 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
Charles Giessen 76b10a878e test: Delete old temp folders when starting tests/framework/test_util
Make sure the work space is clean before starting a test, this is mainly for developer builds, as CI
runs will generally wipe the entire build tree instead.
2021-06-23 15:15:56 -06:00
Charles Giessen 9960d41a54 test: Update googlestest to 1.10.0 2021-06-23 15:15:56 -06:00
Charles Giessen 2e9d8dc1a8 test: Add revamped allocation tests
Creates a memory tracker class and rewrites the existing allocation tests.

Change-Id: I09ca2dc5b4d83f775ae0e3fd362a3fa4f7255d27
2021-06-23 15:15:56 -06:00
Charles Giessen 266e0783a7 ci: Enable regression tests on MacOS
Change-Id: I85b08bfd2914e03840a027240470e2596415f4dc
2021-06-22 12:03:05 -06:00
Charles Giessen 820fc25d1d test: Fix framework to work on MacOS
Main issue was getting function redireciton to work, dyld-interposer accomplishes that.
It required making the shim-library a dylib, but otherwise only required minor changes.

Change-Id: I7b7e2c86cc0c0b082f58241a7e146b74af72e792
2021-06-22 12:03:05 -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
Mike Schuchardt 0907c364e9 build: Update to header 1.2.181
- Update known-good
- Generate source (no change)

Change-Id: I7aed911c95d3faa89f7cd012ce56ccde00927943
2021-06-14 12:31:20 -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
Charles Giessen db6662c3f8 test: Refactor tests that use VK_ICD_FILENAMES
Change-Id: I34117fd500f7110669ae19d32ff1e1be920238a9
2021-06-07 14:07:38 -07:00
Charles Giessen f6fab4352d test: Control process elevation on Windows
Since the loader only uses environment variables if the process is
not running with elevated priviledges, the test harness needs to be
able to control that aspect to ensure consistency as CI systems may
run the tests in an 'elevated' context.

Change-Id: I8b15a1ecd4ab4960049ba198af8199943e872bba
2021-06-07 14:07:38 -07:00
Charles Giessen b9f4dd01e2 test: Delete files properly on windows
Move windows specific error reporting to test_util.h
This allows for its use anywhere its required.

Change-Id: I14a0da85dc0d3f4e651b99aa005469b47d98d940
2021-06-07 14:07:38 -07:00
Charles Giessen 2077a55194 ci: Enable building of tests 2021-06-07 14:07:38 -07:00
Charles Giessen 6830271a61 test: Fix Windows x86 icd shim exports
_stdcall in Windows x86 builds would mangle names even with `export "C"`
By adding .def files, the correct name is used in the .dll and the loader will
correctly load it.

Additionally, ShimEnumAdapters2 needs _stdcall for 32 bit mode

Change-Id: Ia60a5e2a9e4378dc3e09864648e04852b10fe524
2021-06-07 14:07:38 -07:00
Charles Giessen 31da9f2af5 ci: Enable regression tests in Windows CI
Change-Id: I5bb1d03f9c9a3be82f7ed0763a325996a5d8dae8
2021-06-07 14:07:38 -07:00
Mike Schuchardt 869a866fa9 build: Update to header 1.2.180
- Update known-good
- Generate source (no change)

Change-Id: I56d4483f777754c9e368ac9b0025d550070fdd83
2021-06-07 14:43:14 -06:00
Jamie Madill e75bd0aa44 GN: Support custom library name.
This allows for projects like ANGLE that build the loader to prevent
conflicts with the system.
2021-06-03 10:34:09 -06: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 7142144bbb tests: Include <memory> in test_util.h
Change-Id: If2b6766521dd6bea5478b6316eadef8ce3e048cf
2021-05-28 18:43:26 -06:00
Charles Giessen 4ffbcccd76 ci: Make linux CI run regression tests
Change-Id: I212a714cc0ec41da11bc69e216b4bb54685415a7
2021-05-27 16:59:28 -06:00
Charles Giessen 45642604f7 cmake: Only enable testing with BUILD_TESTS
`enable_testing()` was previously always enabled when configuring
the loader repository. This commit only does that when `BUILD_TESTS`
is true.

Change-Id: I75666088b84efc4613f72e6938da9ed88b54fb1f
2021-05-27 16:59:28 -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 6198554011 tests: Add CMake to handle Detours library
The Detours library uses a make file to build it. Thus it needed
to be translated into CMake equivalent code to make a useable target.

Change-Id: Ibed33c962e522f44297c7fa9cbe3f62964503ceb
2021-05-27 16:59:28 -06:00
Charles Giessen a4abae9080 tests: fix spelling in loader_validation_tests
Change-Id: I2e278b959cd1d47bdc0d7fc19965e4d57e71b481
2021-05-27 16:59:28 -06:00
Charles Giessen 2c1e399d8c test: Add regression tests code
These files are the current 4 source code files used to create the
regression test suite

loader_regression_tests.cpp and loader_version_tests.cpp contain a
majority of the tests.

loader_wsi_test.cpp is all the tests pertaining to the WSI functions
in the loader.

loader_testing_main.cpp contains the `main()` which has windows CRT
specific calls to disable popups and debug aserts.

There are two executables created, test_regression and test_wsi.
test_regression is both regression_tests and version_tests. test_wsi
is the WSI tests. These tests are separate as they rely on linking
with platform specific windowing libraries which may not be present
on a CI system.

Change-Id: I1c02b0f82826d337599f4a9a7c02dde40ea5afa3
2021-05-27 16:59:28 -06:00
Charles Giessen 6176c3a9d2 test: Add framework test_environment
The test environment is the code which glues the platform shim,
TestICD, and TestLayers together so that test code can be easily
written. The main components tests use are the SingleICDShim and
MultipleICDShim classes. Both take care of copying the ICD binaries,
setting up the manifests, and redirecting the platform specific
systems to point at those manifests.

Change-Id: I7cbb76c9555fe13b323173c3838cbb3616b77a18
2021-05-27 16:59:28 -06:00
Charles Giessen 2a75a4e2f9 test: Add test framekwork layer utility
At the present moment, this change is to define simple layer
utilities that tests in the future may use.

Change-Id: I9ab5e1950da64061997891a0527d0f70a49e41e7
2021-05-27 16:59:28 -06:00
Charles Giessen 9423452b70 test: Add framework platform abstraction shim
The loader queries various platform systems for info such as the
location of ICDs and layers. To isolate the loader during testing
from the system it is running on, the platform shim intercepts the
necessary functions so that the contents of the systems queried by
the loader can be configured by tests.

On windows this involves 2 aspects:
Detouring Win32 API functions and redirecting the registry.
The `Detours` library is used to easily capture Win32 API calls.
And the registry uses `RegOverridePredefKey` to redirect the registry
entries the loader accesses.

On linux this only involves intercepting 3 functions; `opendir`,
`access`, and `fopen`. This allows the framework to tell the loader
what to actuall open/access/fopen. These interceptions call the
underlying function but with altered arguments, specifically to
paths the tests set up.

Change-Id: I3531a1cb190c489ffd9f1f0549d0ebcacb3818c5
2021-05-27 16:59:28 -06:00
Charles Giessen b6401a02ac tests: Add TestICD for mocking ICD's
The TestICD is a configurable ICD which can recreate much of the
behavior the loader expects of an ICD. Combined with a direct line
of communication between the tests and TestICD, tests can setup
specific conditions that have a known response from the loader,
thus allowing proper regression testing.

Change-Id: I84303f0ddb6011fc1b76dad25fd249abb2da29c9
2021-05-27 16:59:28 -06:00