Commit Graph

18 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 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 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 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 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 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 12d70af385 loader log error if a requested layer not loaded
This should throw an error message if a requested layer didn't load.
This could happen if the JSON file is present, but only a library
exists on the system for the wrong target (like 32 vs 64-bit).

If it did fail because of being the wrong bit-type, we report an info
message only, unless it was directly requested by the application.

Modify the improper bit-depth layer loading test so that it is now 4
tests:
 - Verify bad explicit layer generates VK_ERROR_LAYER_NOT_PRESENT error
 - Verify bad implicit layer generates only an info in the loader output
 - Test case with both a bad implicit and explicit layer with INFO logging
   we should see both messages.
 - Test case with both a bad implicit and explicit layer with ERROR logging
   we should see only the explicit failure message.

Report info failure for ICD wrong bit-type as well.

Finally, fixed a small compilation warning for disabled code.
2022-01-31 14:35:07 -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 870303f36e test: Add test for memory leak in setup_tramp_phys_devs
Tries to trick the loader by increasing the number of physical devices
after the call to vkEnumeratePhysicalDevices to get the count.
2021-09-09 12:15: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 4c03d42092 test: Use proper allocation count in tests
The test used to only keep track of the maximum number of allocations and fail
if it was exceeded, as calling free would decrease this number. Now tests use
the total number of times allocate was called, and realloc was added to this
metric. This should offer better OOM coverage due to failing at each and
every possible OOM place. The code does make sure not to increase the count
if realloc was called to 'downsize' the allocation, which shouldn't cause
OOM to occur ever.
2021-08-16 15:18:43 -06:00
Charles Giessen 5d448542f2 test: Add test for PR #639
This test tries to recreate an out of memory condition which causes
a binary of the wrong type to be confused with a valid binary, which
causes VK_ERROR_INCOMPATIBLE_DRIVER to be returned instead of VK_SUCCESS
(Or OOM if the case may be)
2021-08-16 15:18:43 -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 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