Commit Graph

20 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 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 c947827900 Refactor loader allocation functionality
Created wrapper functions loader_alloc, loader_calloc, loader_free,
and loader_realloc. Made the existing loader allocation functions use
them. Replaced manual usage of VkAllocatorCallbacks with the new
wrapper functions.
2022-05-24 14:18:26 -06:00
Mark Young 3ef8aed3d9 Fix handle validation crash in RenderDoc
When handle wrapping is performed in a layer, the loader would provide the incorrect
instance handles after the recent handle validation changes.  This was exposed by
RenderDoc.

Also add several tests to catch this case.
2021-12-02 08:46:14 -07:00
Charles Giessen e9f5392333 loader: Header include cleanup
Separated headers into common groups, with system headers being first, then
Vulkan API headers, followed by loader headers.

Then alphabetized headers in each group. Due to moving _GNU_SOURCE to being set
by cmake, there isn't any implicit dependency between the include order used.

Made sure headers should be able to be included independently, such as
including the vulkan headers where appropriate.
2021-09-09 11:28:56 -06:00
Charles Giessen c084d162eb loader: Make _GNU_SOURCE a cmake definition
Moves the many instances of #define _GNU_SOURCE into a single cmake call which
sets the macro in all translation units for the vulkan library. This way it
cannot be forgotten and makes behavior across the library consistent.
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 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
Mark Young 25a7deb2bd Fix loader not knowing about extensions enabled in layers
This change allows the loader to know extensions enabled in the layers
as well as extensions enabled but handled by layers.
This should fix several issues where the enabled extensions is not
known soon enough for layers to use.
2021-09-02 14:31:28 -06:00
Charles Giessen ba755b239e loader: Reformated loader source code
Previously, clang-format was required for all new commits but the codebase
itself wasn't conformant. This commit formats the source files in the loader
folder.
2021-08-11 15:16:56 -06:00
nihui 102ecdd3ec Fix crash with NULL messenger 2021-01-28 17:21:53 -07:00
Ricardo Garcia 1c5214cbc9 loader: Destroy debug callbacks/messengers properly
When creating debug callbacks or messengers, each of them is added to a
linked list from the terminator, with the handle provided by the ICD.

When enabling some validation layers, this handle is renamed as part of
the chain and the application gets a different one.

In the removal process, the application usually receives one of these
function pointers using vkGetInstanceProcAddr:

  - debug_utils_DestroyDebugReportCallbackEXT
  - debug_utils_DestroyDebugUtilsMessengerEXT

Those trigger the chain calls but then try to remove the callback or
messenger from the linked list using the application-level handle, which
is not found because it doesn't match the one from the ICD.

The linked list should be accessed from the destruction terminators,
when the handle has already been unwrapped by the layers.
2019-04-03 08:36:29 -06:00
Tobin Ehlis 76be7dc30e loader: Fix unknown type
Set var to VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT instead of
VK_OBJECT_TYPE_UNKNOWN.
2018-10-31 11:04:12 -06:00
Mark Young ba8501fa05 loader: Fix multiple SubmitDebugUtils callbacks
If an ICD also supported the VK_EXT_debug_utils extension, then
any call to vkSubmitDebutUtilsMessageEXT would get duplicated.

Change-Id: Ica3224ee598a99a925ec9343b6618d4d8ba190d0
2018-10-30 09:40:20 -06:00
Mark Young 71f32e8e96 loader: Fix vkSubmitDebugUtilsMessageEXT
If the object count was 0, then no message was reported by the loader.

Change-Id: Ia809d193fb117e85742af0db9856f896be0b2ea3
2018-10-29 12:14:53 -06:00
Tom Anderson a8358804f3 Fix build with CFLAGS="-std=c11 -D_GNU_SOURCE" 2018-07-26 10:25:32 -06:00
John Zulauf a95b00f70a loader: Eliminate warning for uninitialized value.
Added default value to severity to kill a Linux warning.

Change-Id: Iaf3e62a0fa01d74874aaec4951f9a2aa38479ca0
2018-04-25 15:15:22 -06:00
Lenny Komow 1de1112cdc loader: Fix debug_report not returning NULL
Fix a bug where debug_report would be treated as an unknown extension
if it was used without being enabled.
2018-03-09 13:54:31 -07:00
Mark Young e3e9b56d9e Implement initial VK_EXT_debug_utils changes
This affects the loader, scripts, and layers and introduces the
changes to support the VK_EXT_debug_utils extension.

Change-Id: Ia5336f63e85b00f1e59416c06aacd4ae331fd692
2018-03-09 13:54:31 -07:00