Commit Graph

30 Commits

Author SHA1 Message Date
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 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
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 711031a24a Revert "Implement unknown function intercept in layers"
This reverts commit fc845625ed.
2022-05-11 08:57:30 -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
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 dec1fcac60 Remove hasing of unknown functions
Use a simple linear search instead. This greatly simplifies the logic and
reduces the places for the logic to go awry.
2022-03-14 23:31:26 -06:00
Charles Giessen 81308d62c1 Revamp unknown function tests
Make use of multiple different functions that are used so that its more
obvious when a test is actually calling the right function.
2022-03-14 23:31:26 -06: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 2cac2efc06 Fix Windows build and add proper phys dev group sorting 2022-02-16 08:29:42 -07:00
Mark Young 63db6aa605 Code review comment fixes.
Also, cleaned up Linux vs Windows code so that there was less duplication and
complexity.
2022-02-16 08:29:42 -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 ac36e0212e Add a test to verify that VK_INSTANCE_LAYERS behaves properly 2022-02-15 11:24:56 -07:00
Charles Giessen a4f4aaad22 Expand unknown function handling tests
Add tests for unknown device functions queried with both vkGetDeviceProcAddr
and vkGetInstanceProcAddr. Also loops enough times to exhaust the available
unknown function supply.

Had to fix the vk_layerGetPhysicalDeviceProcAddr in TestLayer to make the tests
pass.

MacOS currently skips tests which use vkGetInstanceProcAddr. This is due to the
need for unknown functions being lower priority and so do not warrent the time
needed to write the assembly necessary to resolve the issue fully.
2022-02-15 10:48:53 -07:00
Charles Giessen f2d1b6e536 Update tests function loading implementation
Remove the need for macros and use well crafted helper loading functions which
can figure out the type to convert to based on the type being assigned.
2022-02-15 10:48:53 -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 1b98e1e2f8 Update tests to use correct version macro
The VK_MAKE_API_VERSION macro and the VK_API_VERSION_1_X macros are better to
use. This commit switches the tests over to the non-deprecated versions of the
macros.
2022-01-28 16:24:27 -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 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 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 fea09c7783 test: Add callback to layers create instance and device
This allows some code to be written inside the test which then gets run
during the call to vkCreateInstance and vkCreateDevice.
2021-09-10 13:59:45 -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 edb1910450 test: Update Device Layers Match test
Move the old EnumerateDeviceLayers.LayersMatch to the new framework,
implementing the necessary components in the TestLayer code path.
2021-08-16 18:06:03 -06:00
Charles Giessen e247227fad 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
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