Commit Graph

1058 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 f0fc8cf491 Guard loader.instances access with mutex.
While the adding and removing of data from this global linked list
was guarded, GetInstanceProcAddr & GetDeviceProcAddr did not have
such guards. This results in race conditions that were detected with
thread sanitizer. This commit adds a mutex solely for the
loader.instances global variable.
2022-10-12 10:48:16 -06:00
Charles Giessen 5d7a40f42d Fix issue with MSVC 15 failing to compile test code
Was a basic case of googletest not allowing implicit conversion between
types.
2022-10-11 13:01:07 -06:00
Charles Giessen 7a0aaefde3 Don't abort when drivers don't support WSI calls
Instance extensions are aggregated, therefore an application has no way of
knowing whether an ICD supports a WSI function or not. This necessitates
returning instead of aborting from WSI functions, as well as writing 0,
NULL, or returning false as needed for each function. This also needs
additional NULL checks before calling down into the driver.
2022-10-10 14:54:07 -06:00
Charles Giessen 159bc8ad0f Enable cross compile test discovery
gtest_discover_tests() doesn't work in cross compilation environments, so if
that is happening fall back to gtest_add_tests().
2022-10-06 17:00:40 -06:00
PaperChalice 59fa8e2755 loader: fix log message 2022-09-26 11:56:43 -06: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 7f10040d01 Remove unneeded exports in test_wrap_layers
Some functions in the wrapping test layer exported functions that are not necessary.
This caused some warnings in builds. Removing them fixes the warnings.
2022-09-01 13:13:14 -06:00
Charles Giessen 735f1d45a3 Refactor loader_icd_scan()
Put all of the parsing for ICD Manifest data into a separate function.
This cleans it up by not requiring manual tracking of allocated resources
while parsing, and allow much saner 'skipping' of incorrect ICD's.

This commit also addresses an issue where OOM during ICD parsing wasn't
immediately ending parsing and returning.
2022-09-01 13:13:14 -06:00
Charles Giessen f9d0e0d0f3 Refactor unknown function tests
Allow multiple layers to intercept an unknown function and then create a single test
which tests many common combinations.
2022-09-01 12:23:17 -06:00
Brad Smith f3cce0e816 tests: Further fixes to be able to build on OpenBSD 2022-09-01 12:21:19 -06:00
Brad Smith 2d04b71e5c loader: Add stub function for OpenBSD executable path 2022-08-31 14:11:59 -06:00
Charles Giessen 52ba0949c8 Dont pass portability bit to ICDs that dont expect it
There was a small issue with the initial version of the portability
enumeration extension where the portability enumeration flag bit would
be passed down to ICDs which did not expect flags to contain anything
other than zero.

While an argument could be made for those drivers to ignore flags they
do not recognize, just like extensions and other 'unknown' things, it
is best to play nice as this is the first instance creation flag bit
added.
2022-08-31 11:49:56 -06:00
Brad Smith 643e51844c loader: Add OpenBSD support 2022-08-31 10:02:13 -06:00
Charles Giessen 8c34a62d0b Fix corrupted pNext chain in vkCreateDevice
When creating a device, the loader looks for the VkDeviceGroupCreateInfo
structure and replaces it with its own. This allows the loader to edit the
struct. However, to do this required editing the pNext chain. Because the
edited chain contained pointers to structures whose lifetimes end when the
vkCreateDevice function returns, the pNext chain is now corrupted.

This commit fixes that by storing a pointer to the user's
VkDeviceGroupCreateInfo and fixing up the pNext chain to use that instead.
2022-07-07 18:17:34 -06:00
Charles Giessen 1763b0ae2a Initialize properly when statically linked
Previously, the loader supported static linking. This capability was restricted
to MacOS only, however the necessary functionality was never implemented. This
commit adds the required code to properly initialize the loader when statically
linked with MacOS

Since the test framework was designed to dynamically load everything, it would
require significant rearchitecting to support it. As such, a simple verification
executable was added to the live_verification folder, instead of full support
in the test framework.
2022-07-07 14:41:01 -06:00
Jesse Natalie 62efb88939 Enable the Vulkan loader to load VulkanOn12/Dozen out of the D3DMappingLayers app package 2022-07-05 14:34:53 -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
Andrew Naumov 697f1801c5 loader: Add unicode support 2022-06-24 13:14:10 -06:00
Charles Giessen 0dbe5db838 Add 32 & 64 bit field to json manifests
Allows drivers and layers to specify if they are 32 bit or 64 bit in the
manifest file. This makes the loader able to prune manifests without
loading the library and finding that it failed to load.
2022-06-22 10:28:18 -06:00
Mike Schuchardt 637329a14e build: Update to header 1.3.218
- Update known-good
- Generate source
- Add missing enums to test framework
2022-06-16 13:35:17 -07:00
Mike Schuchardt 05e54d82ee tests: Shuffle devices for sort test
Shuffle the bus IDs for discrete devices pd0, pd3, and pd4. Notably this
puts pd0 from icd0 in between pd4 and pd3 from icd2, making default
sorted order extremely unlikely if not impossible.
2022-06-16 13:35:17 -07:00
Charles Giessen 565ff9668a Only check first GPDPA in the layer chain.
When checking for unknown physical device functions, check the first layer that supports
vk_layerGetPhysicalDeviceProcAddr in the chain starting with the layer closest to the
application. This prevents unecessary work being done, and if any layer wraps VkInstance
will properly call through the wrapping layer first without calling into any other layer.
2022-06-06 21:34:36 -06:00
Charles Giessen c129609717 Fix crashes from OOM in vkDestroyInstance
Various situations could cause an OOM to turn into a hard crash due to double freeing
of memory that was improperly cleaned up. Also fixed memory leaks when layers would
report OOM.
2022-05-27 17:25:52 -06:00
Charles Giessen 4f6ccc2f2f Keep allocated debug callbacks until destroy instance
Previously the loader would destroy any debug callbacks created during instance creation
to later create new ones during instance destruction. This required a memory allocation
to occur inside vkDestroyInstance, which can cause leaks if an OOM occurs during
instance destruction.

This commit simplifies the logic by keeping around the allocations made during instance
creation by moving them into their own debug node chain. Then during instance destruction
moves them back.

Also renames several functions to better describe their intended purpose.
2022-05-27 17:14:25 -06:00
Charles Giessen 33f0d2f61c Fix a NULL inst crashing during loader_icd_scan
When checking for the portability driver field of driver manifests,
the loader did not check if inst was NULL first. Since this function
is called in pre-instance functions, this crashes the loader.
2022-05-25 13:14:04 -06:00
Mike Schuchardt a43773fae1 build: Update to header 1.3.213
- Update known-good
- Generate source
2022-05-11 10:31:02 -07:00
Charles Giessen 711031a24a Revert "Implement unknown function intercept in layers"
This reverts commit fc845625ed.
2022-05-11 08:57:30 -06:00
Charles Giessen 1dbe2ea63f Make portability drivers not load by default
Unless the portability enumeration extension is enabled and the create instance flags
contain VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR, do not enumerate drivers that
contain `is_portability_driver` in their JSON Manifest. This is phase 2 of the release
for the VK_KHR_portability_enumeration extension.

An error message will be printed when no drivers were reported but there was a
portability driver which was skipped over.
2022-05-04 15:40:27 -06:00
Charles Giessen fc845625ed Implement unknown function intercept in layers
Make it possible for layers to declare that they support unknown functions
and set up the layer dispatch table appropriately. A very niche use case
but helpful when developing validation for functions not yet out in the
public headers.
2022-05-03 17:38:09 -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 fde05a9f49 Increase discovery timeout for Gtest test to 100 seconds 2022-04-06 16:23:51 -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 082bf4913a Fix missed Physical Devices in Windows
The previous logic would cause any non-sorted physical devices to be missed
when aggregating the final list. This caused crashes due to the phys_dev
value not being initialized. The fix is to make sure both sorted and non
sorted physical devices are included in the final output of
setup_loader_term_phys_devs().
2022-04-04 16:38:17 -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 8f95a59c5b Add test for different ICD interface versions
Fix Test Framework not skipping Drivers which have a different LUID.
2022-04-04 16:38:17 -06:00
Charles Giessen b8bc04cebd Dont emit warnings on unknown manifest file versions
Since the loader is meant to be forward compatible, it makes little sense to emit
a warning when an ICD or Layer manifest is found with a version that it doesn't
understand. Thus they now are INFO level.
2022-03-31 11:54:03 -06:00
unknown 36567bdade Fixup several small issues found by Visual Studio
The VS Analyzer went through the codebase and pointed out a dozen warnings and
one possible crash.
2022-03-30 10:06:23 -06:00
Charles Giessen c5c8d7296b Enable /W4 errors and support clang-cl
Enable /W4 errors on MSVC and fix all corresponding errors.

Refactor the CMakeLists.txt to allow for compiling with clang-cl. This required
figuring out that -Wall -Wextra mangle the set of warnings used. The solution
is to use /W4 instead when compiling with clang-cl on Windows.
2022-03-29 16:10:30 -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
Mark Young 768baf2cf7 Apply code review comments from @charles-lunarg 2022-03-25 15:29:40 -06:00
Mark Young bb19d51b3c Fix #888 crash in Lutris with Linux sorting
The sorting algorithm needed to take into account both the application
API version as well as the driver API version.

This required additional changes to the sorting algorithm for the fallback
since even if the instance supports the extension or Vulkan 1.1, the individual
drivers may not.

Also, add supporting tests which would catch these cases in the future.
In the process, I realized we assumed that the presence of an extension in the
test_icd indicated "enablement" which was incorrect.  So I separated out
that into a set of "enabled instance extensions"
2022-03-25 15:29:40 -06:00
Charles Giessen 9ef85c237b Fixup windows test infrastructure
Cleaned up several bugs in the testing framework in the windows shim.
Rewrote the tests that exercise DXGI/D3DKMT functionality.
2022-03-24 19:00:28 -06:00
Mark Young 1f54c8d711 Fix non-sorted surface indexing
The physical device terminator was missing the ICD index in the
non-sorted path.  This caused crashes in Angle before it was realized
that the sorting code was unintentionally disabled in that build
path.

Also, add tests to catch this case in the future in the WSI code, but
this required converting all the TEST_F tests to TEST since Gtest
didn't like mixing the 2 on my system.

Finally, fix a few WSI error messages in the loader which were
missing spaces.

Fixes #863 for non-sorting paths
2022-03-24 15:22:04 -06:00