Commit Graph

271 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
ZhangLiang 3cb6452bfb bundleMgrHelp
Signed-off-by: ZhangLiang <zhangliang335@h-partners.com>
Change-Id: I939342427adde843812bac847ad42a860787bd1c
2024-10-15 08:18:16 +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 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
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 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 e8116b8872 Correctly check for NULL in loader_get_dispatch 2022-05-03 13:39:00 -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 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 b986091316 Move unknown function logic into dedicated file
unknown_function_handling.c now holds all of the unknown function handling
logic.
2022-03-14 23:31:26 -06:00
Mark Young 759d5b4c94 Add "additive" environment variables
Add "additive" environment variables for adding additional layer
paths or driver JSON files instead of replacing default ones.

Also, rename VK_ICD_FILENAMES to VK_DRIVER_FILES since we're trying
to remove references to ICDs because software driver implementations
of Vulkan aren't ICDs (but continue to support the old name as well).

Added documentation around these changes to reflect the new name and
the new variables.
2022-03-04 15:38:46 -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 035140a542 Update loader to include handle validation
Validate the Vulkan dispatchable handles (VkInstance, VkPhysicalDevice, etc) for
any trampoline functions the loader uses to query the dispatch table from.
This is so we can at least report errors before something bad happens.

Also, add tests to the test framework to catch this case.  Right now they simply
check to make sure we aborted, but they don't know why the loader aborted.
Eventually, we need to come back and check the loader messages and make sure it
aborted for the reasons we want.

Fix a generator warning in dispatch_table_helper_generator.py where a compare was
the wrong type.

Fixes GH Issue #64.
2021-11-19 10:32:13 -07:00
Charles Giessen ae5fb026f9 loader: Move struct decls to loader_common.h
Not all structs declarations in loader.h were moved to loader_common.h. This
caused compilation errors due to not having the struct declaration available
in the headers it was needed.
2021-09-10 14:25:29 -06:00
Charles Giessen 3ffea375b7 loader: Move Windows logic to dedicated file
Relocated most windows specific functionality into loader_windows.h/.c
This removes the need for loader.c to include windows specific header files.
2021-09-09 11:28:56 -06:00
Charles Giessen 7086472793 loader: Make logging and getenv their own headers
This commit pulls the logging capabilities into a single log.h/.c file and does
the same for the getenv functionality.
2021-09-09 11:28:56 -06:00
Charles Giessen 5036328e1d loader: Move allocation functions to a header
Functions pertainting to allocation (malloc, realloc, free) have been moved to
their own translation unit for better organizational purposes.
2021-09-09 11:28:56 -06:00
Charles Giessen f262576472 loader: Remove TLS
The only purpose TLS was serving was as a channel for allocation callbacks to
be useable inside cJSON and dirent_on_windows. TLS didn't solve any specific
threading problem. Instead it served as an information channel. On top of that,
the only time when the TLS was used was inside vkCreateInstance as the
pre-instance calls would have the TLS pointer to loader_instance be set to
NULL.
2021-09-09 11:28:56 -06:00
Charles Giessen 0285e227ea loader: Move loader struct defs into common file
This commit separates the structure definitions from the function declarations.
The reason to do this is to allow splitting of loader.h/.c functionality into
individual headers, which may require access to these structs but don't need to
know about the other functions.
2021-09-09 11:28:56 -06:00
Charles Giessen dc9e3aa765 loader: Update Copyright for 2021 2021-09-09 11:28:56 -06:00
Charles Giessen 823f36fd01 loader: Use #pragma once everywhere
The #pragma once include guard is sufficiently widespread enough to allow
usage of it everywhere.
2021-09-09 11:28:56 -06:00
Charles Giessen ef81d2ef2a loader: Update Copyright 2021-09-09 11:28:56 -06:00
Charles Giessen 68a7e7e3e3 loader: Move layer cleanup to a single function
Previously the logic to free all the components of loader_layer_properties was spread
across a half dozen different places, resulting in leaks. This commit moves the logic
into a single location, centralizing the process and making it easier to add new
fields to the loader_layer_properties struct.
2021-09-09 11:14:49 -06:00
Charles Giessen a406025ca2 loader: Make all loader functions use snake_case
Before it was a mix of camelCase, PascalCase, and snake_case.

"Vulkan" functions, like terminator_GetPhysicalDeviceProperties, remain in camelCase.
This way it looks visually similar with the actual vulkan functions they correspond to.
2021-09-03 11:11:25 -06:00
Mark Young 11f477c781 Add layer and implementation-specific logging
Add logging that will allow end-users to specifically just look at
messages for layers and implementations/ICDs.
Setting VK_LOADER_DEBUG to include one of the following:
  - layer        : enables layer-specific logging
  - implem       : enables implementation/ICD-specific logging
2021-08-10 12:10:47 -06:00
Mark Young 1cc8fb0cf3 Fix loader_log messages to use LOADER_ log levels
The loader_log messages were using the DEBUG_REPORT log levels
which just happened to coincide with the existing LOADER_ log levels.
Going forward, to add layer logging in its own level, this would not
have worked.
2021-08-10 12:10:47 -06:00
Mike Gorchak ff7918e9a0 Add support for QNX platform. 2021-04-06 14:52:51 -06:00
J.D. Rouan 1eaf7849ba Add GGP WSI platform support to Vulkan-Loader
Add GGP WSI platform support to Vulkan-Loader. GGP is Google Games
Platform, the platform for Stadia.
2020-11-23 09:12:55 -07:00
Craig Stout c6ed84db5b Add support for VK_FUCHSIA_imagepipe_surface 2020-10-26 17:59:09 -06:00
Lenny Komow fad280320b loader: Sort physical devices on Windows
This change adds a mechanism to allow sorting of physical devices
and physical device groups on Windows 10 if a driver supports a new
interface.
2020-08-14 14:38:31 -06:00
Lenny Komow 72e0af28b1 loader: Make invalid std val layer an error
Standard validation was changed to khronos validation. This change
moves the warning when illegally using standard validation to an
error that will not allow a user to continue and will tell the user
to use khronos validation.

Change-Id: Iaeae6cffa4494a299f408033569163a7c61d3105
2020-08-07 13:29:39 -06:00
Nicolas Caramelli 33adf476d6 loader: Add support for directfb surface extension
The new VK_EXT_directfb_surface extension is a WSI extension and
thereforce needs loader support like the other surface extensions.
2020-07-07 10:33:54 -06:00
Charles Giessen 92f381fa07 loader: add per-application override layer settings
An array of strings was added to the override layer to provide
per-application overrides. The loader will now look for an override profile
which contains an app_key entry that matches the path & name of the currently
running executable. Previous behavior with a global override still works as
intended.

This changes is in conjunction with the VkConfig rewrite to allow for more
than one override profile to be enabled.

Changes to be committed:
	modified:   loader/loader.c
	modified:   loader/loader.h
	modified:   loader/vk_loader_platform.h

Change-Id: I9ddbc98a098d48064110db6c29998eddb336fcda
2020-05-26 09:52:38 -06:00
Charles Giessen d348b8043f loader: Preload ICD use its own mutex
Previously, if a layer called a pre-instance function
while being initialized (inside vkCreateInstance) a deadlock
would occur because the preload icd call used the same mutex.

Change-Id: I085ecfbcab26d746d77ca8466b4f63a13f6bea10
2020-05-15 13:18:31 -06:00
Charles Giessen 92cea629f2 loader: Preload ICD's to speed up common path
The ideal of having the loader be stateless causes serious slowdowns
in application startup due to the need to load then unload ICD's
repeatedly while calling pre vkCreateInstance functions. By pre-
loading the ICD's which are found using loader_icd_scan, the
unecessary reloading of ICD's is avoided.

The preloaded ICD's will be unloaded with vkDestroyInstance. This
allows subsequent vkCreateInstance calls to use the most recent ICD
on the system, preventing issue where a new driver was installed
but an application couldn't use it unless they unloaded the loader
library completely.

Changes to be committed:
	modified:   loader/loader.c
	modified:   loader/loader.h
	modified:   loader/trampoline.c

Change-Id: Id169f94bea15e569b75c3a663b25444cc6c52c40
2020-04-10 19:39:11 -06:00
Charles Giessen 7c979b0749 loader: add null check to loaderValidateLayers
The loader will now make sure to check if utf8 is null before
validating the string, preventing needless segfaults.

Change-Id: I48139e56719e3c518b85f2ded1ca0b682447413f
2020-02-04 14:36:08 -07:00
Lenny Komow 45463bf2b9 loader: Fix debug utils terminators being skipped
Change-Id: I9e08b59669bd301e3c5361ae4ea16102461fb34b
2020-02-03 03:19:32 -07:00
Lenny Komow ed2616ee30 loader: Remove code for building a static loader
Change-Id: Id795e795a52ace1bf3c0c0fdbc5aed19d05bef01
2019-11-21 16:50:59 -07:00
Lenny Komow 9c5dad498e loader: Add support for metal surfaces
The adds support for the VK_EXT_metal_surface extension

Change-Id: Ibb1c21e19fb053fe332ea075c3d32de59f7f8881
2019-09-18 18:01:52 -06:00
Felix Dörre bc769fc6cb layers: formatting 2019-04-29 16:13:15 -06:00
Felix Dörre 160c28c37e layers: fix compile problems for WIN32 2019-04-29 16:13:15 -06:00
Felix Dörre ad01506f7b cleanup: address review findings 2019-04-29 16:13:15 -06:00
Felix Dörre c7eeeb44e5 layers: add layer callbacks for device creation 2019-04-29 16:13:15 -06:00
Felix Dörre 340e139383 loader: use more specific arguments 2019-04-29 16:13:15 -06:00
Felix Dörre 72fdf15de4 trampoline: extract device cration routine 2019-04-29 16:13:15 -06:00
Bryan Law-Smith d708e3ea4c loader: VK_EXT_headless_surface additions
As VK_EXT_headless_surface is a WSI extension, supporting it
requires changes to the loader. This commit makes the necessary
changes, which are mostly straightforward plumbing.

However, this commit also includes a minor tweak to avoid a
segmentation fault when an implicitly enabled layer provides
support for an instance extension.
2019-04-26 15:23:45 -06:00
Mike Schuchardt 5a735ce511 scripts: Update known-good for 1.1.106 header
Changes:
- Integrate upstream script changes: We have to plumb-through the new
conventions object to continue using the makeCParamDecl utility function
- Add GGP to available platforms
- Add handling for extension dependencies: Previously, the codegen for
loader trampolines could not handle an extension command that depends on
more than one extension being present. This removes that limitation
- Add checks for device extensions: This adds a check for two functions
at device creation time:
  * VK_KHR_device_group
  * VK_EXT_full_screen_exclusive
The loader needs to know about these extensions for proper handling
of the vkGetDeviceGroupSurfacePresentModes2EXT terminator
- Update known-good file

Updated:
- `loader/loader.c`
- `loader/loader.h`
- `scripts/common_codegen.py`
- `scripts/dispatch_table_helper_generator.py`
- `scripts/helper_file_generator.py`
- `scripts/known_good.json`
- `scripts/loader_extension_generator.py`
- `scripts/loader_genvk.py`

Change-Id: I9f0828a8eee0e8e95b479e1b8feb31acaa10040d
2019-04-08 16:38:37 -06:00