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.
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.
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.
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.
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.
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).
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
Re-enable reverted changes done in commit
d6f491b88eaf11f6953c02638d079f6a76806658. But also include
fixes for the Linux and Windows release runs.
Change-Id: I7644bb305faab068b3229eb9c1d8a67b052af165
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
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