Commit Graph

46 Commits

Author SHA1 Message Date
ZhangLiang 89db313139 updata1.4.309
Signed-off-by: ZhangLiang <zhangliang335@h-partners.com>
2025-05-13 01:52:59 +00:00
ZhangLiang 5f37082b15 回撤版本升级:需要合入特性分支
Signed-off-by: ZhangLiang <zhangliang335@h-partners.com>
Change-Id: I4420b53f53db336c687c92c99d576eb0711a98aa
2025-04-27 09:34:11 +00:00
ZhangLiang ddaa6baf89 updata1.4.309
Signed-off-by: ZhangLiang <zhangliang335@h-partners.com>
Change-Id: I1bde61e9a201f5570fa58213c0968e9c9d76cdea
2025-04-23 09:58:25 +00:00
andrew0229 3f7fe7b7b4 update to v1.3.275
Signed-off-by: andrew0229 <zhangzhao62@huawei.com>
Change-Id: Ifc4224db2c6ea7c159d3cabe8f075475d47a41a8
2024-05-21 08:09:09 +00:00
Charles Giessen 8623a30ef7 Allow implicit layers for all API versions
This change makes the loader conform to the latests specification
update, 1.3.227, which removes the requirement that implicit layers
API version is at least as high as the application provided API
version.

This change reduces friction for layer developers and API users.
2022-09-08 13:48:46 -06:00
Charles Giessen 3abfdb2f2d 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.
2022-07-01 13:36:27 -06:00
Charles Giessen 04cb622abe Add app_key OverrideMetaLayer tests 2022-04-14 13:18:54 -06:00
Charles Giessen c8713e1fbe Refactor FrameworkEnvironment API a bit
Redo some of API's for adding layers and ICD's to the test framework.
2022-04-12 13:00:32 -06:00
Charles Giessen ec37453641 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.
2022-04-06 18:25:09 -06:00
Charles Giessen a9c65f6fe5 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.
2022-04-04 19:17:07 -06:00
Charles Giessen 4300734bf2 Clean up version checking logic
Add a few helper functions to simplify checking that a X.Y.Z version is sufficient.
2022-04-04 19:17:07 -06:00
Charles Giessen e23d3208d3 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
2022-04-04 16:38:17 -06:00
Charles Giessen d27e4c0069 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).
2022-03-29 16:10:30 -06:00
Charles Giessen 0bc6454e6b 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.
2022-03-14 23:31:26 -06:00
Charles Giessen f75f0fa196 Fix compiler warnings in tests on MSVC 2022-03-09 15:06:30 -07:00
Mark Young ef91b4821f Clean up layer test
My previous commit to enable physical device modifications in a layer
required new compiled layers to do the work.  Since this can more
cleanly be done by setting layer flags (as suggested by @charles-lunarg)
I have gone back and done that.
2022-02-16 10:09:29 -07:00
Mark Young d4701211de Loader single EnumPhysDev call through layers
The loader trampoline previously would query all devices every time
vkEnumeratePhysicalDevices was called.
To do this, it would make two calls every time:
  - First, it would ignore the passed in user values
  - Second, it would query the total number of available devices.
  - Third, it would query the values for every available device

This resulted in layers reporting 2 vkEnumeratePhysicalDevices call for
every 1 the application made which could get very polluted in output.
It didn't break any functionality, just made things messy.

This change removes that behavior and adds a bunch of test cases to verify
nothing broke in the move.
2022-02-16 08:29:42 -07:00
Mark Young e432b52eff Switch ASSERT_EQ(false,true) for FAIL() in tests 2022-02-15 14:56:05 -07:00
Mark Young 21141af225 Add a few device layer tests
Since device layers are pretty much ignored, make sure that they don't
change any behavior.
Also add a few "load" entrypoint helper routines based on what was already
done elsewhere in the test system.
2022-02-15 14:56:05 -07:00
Mark Young ac36e0212e Add a test to verify that VK_INSTANCE_LAYERS behaves properly 2022-02-15 11:24:56 -07:00
Mark Young f9bb0a4c6d Test layer pre-instance functions
Add tests to verify that the 3 pre-instance functions are properly
intercepted by the layer when everything is well-defined.

Also include two fixes:
 1) Disable environment variable value of 0 should be treated the same as not present
 2) The vkEnumerateInstanceVersion override path was broken, missing a NULL check
2022-02-15 10:47:36 -07:00
Charles Giessen ef44cdd106 Clarify behavior of override_paths + VK_LAYER_PATH
If a meta layer which contains `override_paths` is active, all of the paths in
VK_LAYER_PATH are ignored when searchign for explicit layers. This may be changed
changed in the future but for now is better tested and documented.
2022-02-11 14:16:05 -07:00
Mark Young 811925ee6d Verify GIPA on device extensions
Verify that using vkGetInstanceProcAddr to get an entrypoint to a device
extension works when the extension is enabled, and crashes when the
extension isn't enabled.

Also, update a copyright notice date for my last commit.
2022-02-03 15:17:17 -07:00
Mark Young e956e9300c Add tests to validate layer extensions
We had tests that verified that instance and device extensions defined
in a layer had the non-null pointers returned from the corresponding
vkGetXXXProcAddr functions, but we weren't verifying that the functions
actually got called.
2022-02-01 09:39:39 -07:00
Charles Giessen 9850f714d2 Add test for implicit layer with 0.1 API version
The loader disables implicit layers if their API version isn't the same or
greater than the application. Make sure this still works even with pre 1.0
versions.
2022-01-28 16:24:27 -07:00
Charles Giessen e92d79c4bb Add override_paths tests for OverrideLayer
Add 4 tests:
* Shows the override_paths object in the layer manifest is being used to find a
layer.
* Shows that regular explicit layers are not found
* Shows that the log properly identifies meta layers which have an
override_paths object but shouldn't according to their manifest.
* Shows that implicit layers not in the override paths are not found.
2022-01-25 12:32:56 -07:00
Charles Giessen d5c2f57b5e Make layer tests specify number of extensions
It is good practice to make use of equality checks vs comparison checks where
possible. Here, the number of extensions is knowable, as its debug_report +
debug_utils + however many come from implicit layers, which some tests do.
2022-01-25 12:32:56 -07:00
Charles Giessen 7d50dfc706 Add meta layer blacklist test 2022-01-25 12:32:56 -07:00
Charles Giessen a6a6447285 Add check_permutation test helper
This allows easily checking that the returned list of extensions or layers
is a valid permutation. Since the order of layers and extensions isn't
deterministic, tests cannot rely on the returned order to verify the output.
2022-01-25 12:32:56 -07:00
Charles Giessen 591aef05b8 Add many meta-layer tests
Add tests for:
ExplicitMetaLayer - meta layer found in explicit paths
MetaLayerNameInComponentLayers - meta layer contains itself
MetaLayerWhichAddsmetaLayer - when a meta layer enables another meta layer
InstanceExtensionInComponentLayer - instance extension propagation
DeviceExtensionInComponentLayer - device extension propagation
OverrideMetaLayer.OlderVersionThanInstance - Checks behavior of override layer
  if the applications version is greater.
2022-01-25 12:32:56 -07:00
Charles Giessen 5619a77034 Add test for older implicit layer version
Add NewerInstanceVersionThanImplicitLayer test which exercises the loader's
removal of layers whoses API version is less than the application specified
API version.
2022-01-12 17:44:07 -07:00
Charles Giessen 4a4708058f Add meta-layer versioning tests
Adds three tests:
* OlderMetaLayerWithNewerInstanceVersion - Checks for interaction between app's
instance version and the meta layer version
* NewerComponentLayerInMetaLayer - When a component layer has an API version
newer than the meta layer, the meta layer is disabled.
* OlderComponentLayerInMetaLayer - When a component layer has an API version
older than the meta layer, the meta layer is disabled.
2022-01-12 17:44:07 -07:00
Charles Giessen 4354ab8f5e Add test for manually enabled implicit layer
If an application manually enabled an implicit layer, the layer should
be enabled without issue.
2022-01-12 17:44:07 -07:00
Mark Young 59df16b1ab Add layer tests for instance extension support
Verify that the loader properly handles instance extensions defined
in a layer (both implicit and explicit).
2022-01-07 16:56:38 -07:00
Mark Young 08677c866f Add device extension layer tests
Need to make sure the loader behaves appropriately for layers which report
one or more device extensions.
2022-01-07 16:56:38 -07:00
Charles Giessen b9b8032c90 Use std::function in Layer callbacks
Also fixed the compilation issues in the linux build
2021-12-10 17:08:23 -07:00
Charles Giessen ade4922867 Refactor TestLayer framework interface
By adding builder style usage to most of the layer interface, it is easier to
create and use layers in tests. This commit refactors the layer interface and
updates most of the tests to use this style.
2021-12-10 17:08:23 -07:00
Charles Giessen 9661a8c019 Refactor tests FrameworkEnvironment class
Move all the behavior found in child classes of FrameworkEnvironment to the
FrameworkEnvironment itself, allowing easier composibility of behavior. The
original idea was to allow special case behavior for specific test cases but
this resulted in a lot of code duplication and difficulty combining different
framework behavior, such as adding a fake ICD and setting VK_ICD_FILENAMES at
the same time.
2021-12-10 17:08:23 -07:00
Charles Giessen 936a4c7a57 test: Update WrapObjects test to new framework
Moved over the WrapObjects test logic into the new framework, removing all
the old tests infrastructure that is no longer needed.
2021-10-07 10:00:08 -06:00
Charles Giessen 4cf1c82589 test: Update ExtraLoaderTests
Updated the enable/disable env-var tests to use the test framework.
Removed the run_extra_loader_tests.sh.
2021-10-05 12:09:50 -06:00
Charles Giessen 5f96256afb test: Add test which calls GetPDProps inside CreateInstance
This test makes sure that any layer calling GetPDProps inside of CreateInstance
succeeds and doesn't crash.
2021-09-10 13:59:45 -06:00
Charles Giessen e33645b0ed test: Add test for Override Meta Layer 2021-09-09 11:14:49 -06:00
Charles Giessen d76cef07ce test: Improved Test Wrapper interface
Made InstanceWrapper and DeviceWrapper simpler to use by moving them to test_environment
then making the Create() member functions and doing the gtest assertions in the function
itself.

Additionally:
Removed the `detail` namespace in the test_environment.
Renamed get_new_test_icd/layer to just `reset_icd/layer`. This is clearer about what it
is doing and makes the interface more expressive with code such as
`env->reset_icd().SetMinInterfaceVersion(5);`
2021-09-06 18:19:14 -06:00
Charles Giessen e8ed23923c 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 f572032fd6 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 6e53c1e511 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