Commit Graph

25 Commits

Author SHA1 Message Date
Charles Giessen
9b355f1948 Use VkAllocationCallback in cJSON
Make cJSON pass the VkAllocationCallbacks instead of the loader_instance.
This removes and unecessary dependency between cJSON and the loader headers.
It also somewhat simplifies the interface by not requiring the inst parameter
everywhere, just in the creation of cJSON pointers and freeing.
2022-05-24 14:18:26 -06:00
Charles Giessen
859fb722c2 Document VK_KHR_portability_enumeration support 2022-04-07 11:49:53 -06:00
Charles Giessen
336508b06b 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
Natalie Chouinard
2d69d5c7d4 loader: Add cJSON prefix to update function 2021-09-16 15:06:49 -06:00
Charles Giessen
4799c294d6 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
353e139411 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
995e78dc4a loader: cJSON to use regular heap instead of TLS
Refactored the cJSON library to take an loader_instance pointer everywhere it
allocates memory. This way a TLS loader_instance pointer doesn't need to be
set at initialization and then at vkCreateInstance.
2021-09-09 11:28:56 -06:00
Charles Giessen
7d46bb6db9 loader: Update Copyright for 2021 2021-09-09 11:28:56 -06:00
Charles Giessen
52859e7695 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
Bob Ellison
cb11f9b68d copyrights: updated copyrights on MIT files
During SDK testing we identified that the runtime copyrights
were out-of-date.  The loader runtime includes two separate
MIT copyrights, each attributed to a pair of source files,
one initiated by Dave Gamble and one by joseph werle.

I examined these files to discover that the last LunarG change to
three out of the four was actually in 2017, not 2016.  This
date should be attributed to Khronos, Valve, and LunarG.

By updating the copyright notice in these files, we ensure that
the license registry remains up-to-date.

Note that no real content changed (which is why the copyrights are not
being updated to 2021).
2021-06-29 17:27:16 -06:00
Tobin Ehlis
a60f4ed459 loader:Fix build warnings
Add "fall through" comments on intentional fall through switch cases to
avoid compiler warnings.
2018-04-18 06:25:36 -06:00
Mark Lobodzinski
e2859eb393 repo: Clang-format LVL source files using Google
Switch clang-format standard from the LLVM style to the
Google style for more consistency.

Change-Id: I247c4abc275d7873a91522e1e234198adaa24033
2017-01-26 15:45:51 -07:00
Mark Lobodzinski
91c1075ee7 repo: Clang-format c/cpp/h LVL files using LLVM
Bring all source files in the repo up to date with consistent
coding style/standard.

Change-Id: Iceedbc17109974d3a0437fc4995441c9ad7e0c23
2017-01-26 13:42:36 -07:00
Mark Young
74dd5d177f loader: GH370 - re-enable allocator usage
This reverts commit 5876cc2b7563f909c8ac8cb49f51f7ef715877f8.

This adds the previous fixes as well as additional fixes if Implicit
layers aren't present.  This is not a case that gets tested on Windows
as most SDK installs have at least 1 Implicit layer (RenderDoc).

This change passes an individual run on Jenkins Linux system.

Change-Id: I466cc54b72946e2a9f6477bd4c3d4e4e72eb9579
2016-06-30 13:22:48 -06:00
Mark Young
9e2ac7cb11 Revert "loader: GH370 - re-enable allocator usage"
This reverts commit 0860f9dbac51b241a9690d23b53db14f307b0181.
2016-06-30 11:03:59 -06:00
Mark Young
0389018756 loader: GH370 - re-enable allocator usage
Re-enable reverted changes done in commit
d6f491b88eaf11f6953c02638d079f6a76806658.  But also include
fixes for the Linux and Windows release runs.

Change-Id: I7644bb305faab068b3229eb9c1d8a67b052af165
2016-06-29 18:45:22 -06:00
Chris Forbes
f4ccd6386f Revert "loader: GH370 - re-enable allocator usage"
This reverts commit aa32dbbf147d86257a0c9e091258e0ea2be5a013.

This is broken in both debug and release 64bit linux.
2016-06-30 11:56:45 +12:00
Mark Young
b0a4b4e930 loader: GH370 - re-enable allocator usage
Re-enable the allocator usage in the loader.  Also, fix several
memory leaks.  The leaks were especially noticeable during the Vulkan
conformance object_management.alloc_callback_fail.instance and
object_management.alloc_callback_fail.device tests because the
tests were designed to intentionally fail the Alloc calls.

This change now fully passes the Vulkan CTS
object_management.alloc_callback_fail tests when the loader
uses application-provided Allocators.

Change-Id: I03f2a09bc33259442e02c917a34d78f8937808d8
2016-06-29 16:48:31 -06:00
Mark Young
64d6ee141e loader: GH362 - Fix json output of escape chars
The strings from the JSON file already add escape characters.
So, \ becomes \\ in the JSON file strings.  However, the cJSON
library was adding \\ for ever encountered \ when converting
to a string.  This became messy as C:\\vulkanSDK\\layerfile.json
became C:\\\\vulkanSDK\\\\layerfile.json.

Change-Id: I006252e33d6e91e2bef704dd5dee0777105388a7
2016-06-14 15:02:53 -06:00
Karl Schultz
3fd3d0905c loader: Fix MSVS warnings
Apply branch 'fix-warnings' of https://github.com/null77/Vulkan-LoaderAndValidationLayers into null77-fix-warnings
2016-02-24 17:49:55 -07:00
Jon Ashburn
1c75aec41d loader:Update copyright and apply clang-format (no logic changes) 2016-02-03 09:00:31 -07:00
Antoine Labour
c3371a9d29 Make cJSON case-sensitive 2016-01-21 08:49:34 -07:00
Tony Barbour
3b37a423bb Windows: more fixes for windows compile 2015-07-17 10:05:22 -06:00
Tony Barbour
2e73dfd24e Windows: More windows compilier fixes 2015-07-17 10:05:22 -06:00
Jon Ashburn
752e06e813 loader: Add parsing of JSON file to find location of ICD libraries
Works on Linux not yet on Windows.
2015-07-01 10:29:45 -06:00