Age | Commit message (Collapse) | Author |
|
If loader_get_json fails due to the file missing or the file being a
stale symlink, it returns VK_ERROR_INITIALIZATION_FAILED
which loader_parse_icd_manifest passed upwards. Since the caller of
loader_parse_icd_manifest wasn't expecting that error code, it didn't
skip the ICD, causing an infinite recusion in EnumInstExtProps due
to the call to dlsym("vkEnumerateInstanceExtensionProperties");
This also required changes to callers of loader_get_json which would
propagate VK_ERROR_INITIALIZATION failed during layer searching to
no longer cause vkCreateInstance to abort if any invalid files were
found.
Added tests for symlinks as the origin of this bug is due to 'stale'
symlinks after driver installers
|
|
Layers are liable of changing the API version during the call down
vkCreateInstance. Certain layers use the guarantees of 1.1 to allow
using VK_KHR_get_physical_device_properties2 functionality. This
commit checks and assignes a new API version if it was modified.
Add tests for when the application forgets to enable 1.1 and when
a layer enabled 1.1 on behalf of the application.
|
|
loader_make_version recently was changed to zero out the patch version, explicitly doing it is no longer necessary.
|
|
- Use idiom for CMAKE_MODULE_PATH
- find_package(PkgConfig) instead of include(FindPkgConfig)
- Remove CMake 2.X code workaround
- Use CMAKE_CURRENT_BINARY_DIR instead of CMAKE_BINARY_DIR
- CMakeParseArguments is now part of the language
|
|
Re-enables using the macOS-latest github actions runner now that the loader
has been fixed for newer macOS versions.
|
|
- Update known-good
- Generate source
|
|
This change is necessary to allow drivers that have both real physical
devices with a LUID and software based physical devices which lack a LUID.
It works by calling both vk_icdEnumerateAdapterPhysicalDevice and
vkEnumeratePhysicalDevice then deduplicating the returned physical devices
using the VkPhysicalDevice handles.
This commit also fixes an issue where tests would erroneously add a layer to the
driver registry.
|
|
|
|
Commit d1db6c5bce9ed474ca124f0bffed9aa2468f3973 changed a few WSI functions
to abort when the driver's function was NULL, which is a change of existing
behavior. It should instead return VK_SUCCESS. At least now there is a
warning message.
This commit also adds tests for the above situation and for debug utils
& debug marker functions to make sure the pre-existing behavior is maintained.
This was tested by running the loader with a previous build through the new
tests and verified that they both passed. The tests run the cases of whether
the extensions were enabled, how the functions were queried (GIPA vs GDPA), and
whether the hardware supports the extensions.
|
|
Removes need to have FindVulkanHeaders.cmake
|
|
The way to use ccache has changed since this documentation & build
option were added. Update the docs with the new way to enable ccache
and remove the build option.
|
|
This makes it possible to build Vulkan-Loader without warnings using the
macOS 13 SDK. Calls to sprintf are replaced with snprintf, passing
appropriate buffer sizes.
It doesn’t appear that any of the changed uses of sprintf were actually
unsafe, so no behavior change is expected aside from SDK compatibility.
The macOS 13 SDK deprecates sprintf as it’s difficult to use safely. The
deprecation warning message is visible when building C++, but it is not
normally visible when building plain C code due to a quirk in how
sprintf is declared in the SDK. However, the deprecation message is
visible when building plain C under Address Sanitizer
(-fsanitize=address). This discrepancy was discovered at
https://crbug.com/1381706 and reported to Apple with a copy at
https://openradar.appspot.com/FB11761475.
The macOS 13 SDK is packaged in Xcode 14.1, released on 2022-11-01. This
also affects the iOS 16 SDK and other 2022-era Apple OS SDKs packaged in
Xcode 14.0, released on 2022-09-12.
Vulkan-Loader is visible to the Chromium build via PDFium, and this
change is needed to allow Chromium to move forward to the macOS 13 SDK.
|
|
The Libs.private field shouldn't be present for shared library builds,
so now the field wont be present in that case. For static library builds
it should be present, but the fields should be deduplicated as well.
Additionally, this adds a github actions run for testing the static
build of the loader on MacOS. This requires making the test framework
capable of using a statically built loader, which mainly took making
VulkanFunctions capable of assigning the statically defined functions
instead of loading them with dlsym.
The static build option required changes to the unix_shim.cpp to not
cause infinite loops.
|
|
The previous commit altered vkCreateInstance erroring out if the
application tries to enable an env-var disabled layer, so the tests
need to be revised for it. This commit also makes lot of modifications
to the tests in addition to that.
Also adds tests for when the override layer is present and when
implicit layer's enable-environment variables are present.
|
|
Disabled layers would appear in the output of EnumerateInstanceLayers, which was
not intended. Move the removal of layers that are disabled by the env-var to after
the explicit layers are found.
|
|
This way users know exactly which version of the loader contains the
new environment variables.
|
|
When terminator_EnumerateDeviceExtensionProperties is called, the app
now only checks that the type flag is implicit rather than building up a new
list of implicit layers, as building a list could cause many suprious log
messages and was unecessary. This commit also removes some redundant copies &
for loops in the function.
|
|
Based on review feedback from @hadess
|
|
TODO: Replace all 1.3.yyyy with appropriate header version after
approval.
|
|
Also remove duplication so that common code is used in several places.
|
|
Add new environment variables that will allow the loader to filter
layers and drivers in specific ways.
This control should give developers ways to more quickly narrow down
issues with a layer or driver.
Also, it should give CI environments a mechanism to selectively enable
only drivers and layers that are needed for testing.
Add tests to support validating the new changes.
Add documentation that describes the new changes and also create new
loader debugging markdown document to help people debug issues with
drivers or layers using the new filter enums.
Rename the old get_environment.* source files to loader_environment.*.
Then put all the environment variable helpers from loader.c into the
new files.
|
|
Nothing in this file was being used.
|
|
- Update known-good
- Generate source
|
|
A recent change made it so that when either vkDebugMarkerSetObjectTagEXT,
vkDebugMarkerSetObjectNameEXT, vkSetDebugUtilsObjectNameEXT, or
vkSetDebugUtilsObjectTagEXT is called, if a driver doesn't support any
of those functions the loader would abort. This is incorrect because drivers
may not support the debug utils extension while the loader & layers might.
Now the loader only aborts if the Device handle is invalid, and simply
returns VK_SUCCESS if a driver doesn't support those functions.
|
|
This was an undocumented feature of the override manifest layer.
Since vkconfig is the primary user of the override layer, and vkconfig
makes no effort to include expiration support, this feature is not being
used. Thus, it is best to remove it entirely.
|
|
Previously, cJSON used implicit fallthrough in a switch statement. Naked
fallthroughs are a common bug source, and while this use case was well
behaved, it did require disabling the compiler warnings for it. Thus,
converting it to an explicit for loop prevents unnecessary compiler
warning flags being disabled.
|
|
Wrapping layer should be unwrapping the instance handle inside of GetProcAddr
functions.
|
|
Forgotten NULL check causes crashes if a driver forgets to export
vk_icdGetPhysicalDeviceProcAddr but does report a 4 or higher
ICD Interface Version.
|
|
There seems to be an incompatible change in macos-12 which breaks the loader's test
framework. While this is being resolved, move the github actions runners from the latest
to only using 11.
|
|
There are numerous terminators to device level functions that the loader must
insert in the call chain. However, the Device Dispatch Tables contain pointers
to these terminators rather than the driver's function. This was worked around
by storing the driver's functions in the ICD dispatch table and calling those.
This leads to rather confusing code where the application is querying for the
ICD dispatch table inside a device level function.
The solution is to create a bespoke dispatch table for device level functions
that require a terminator, and use that table when required.
|
|
- Update known-good
- Generate source
|
|
This reverts commit d79e2731d45bf4c81f650f27205e208a023269aa.
|
|
This reverts commit 068e83f5f20e38c3ae1687e7f1aeb59bf6ce3e72.
|
|
vk_icdGetInstanceProcAddr has similar semantics to vkGetInstanceProcAddr.
It was created to prevent dynamic linker issues. It stated that it should support
global & instance level function querying. But this differs from the Vulkan spec
which states that vkGetInstanceProcAddr should be able to query all functions.
This creates confusion about what takes precendence, the spec or the loader's docs.
This commit makes it explicit that it should have the same semanics what the spec
says.
|
|
vkCreateSwapchainKHR and vkGetDeviceGroupSurfacePresentModesKHR were added to
the icd dispatch table then loaded with GIPA. While this is possible, for best
performance and consistency, the loader should use the device's dispatch table
for these functions. This required changing the terminators for both functions
so that they checked that the dev pointer isn't null and its dispatch entry for
each function isn't null.
Additionally, various debug marker/util functions checked if an ICD supported
surfaces by checking the ICD's dispatch table for vkCreateSwapchainKHR. These
have been updated to use the device's dispatch table instead.
|
|
|
|
The issue was that passing a string to loader_log wouldn't work, likely due
to relocation issues. Workaround is to create a bespoke function that contained
the format string embedded in it.
Additionally, CMAKE_SYSTEM_PROCESSOR is incorrect in the case of x86 builds on
x64. Checking for sizeof(void*) == 8 allows distinguishing building for 32 bit
and 64 bit, and so the correct gen_defines.asm is created while cross compiling.
Also rename the error to note that its a function which isn't supported, not
an extension.
|
|
This reverts commit af67fccebe59e8d8e30e8c02b7b0069ce4242fc4.
|
|
This reverts commit e5680db8ae5640dde10b58b8ab45e4a6201ae3e9.
|
|
|
|
|
|
|
|
|
|
vk_icdGetInstanceProcAddr has similar semantics to vkGetInstanceProcAddr.
It was created to prevent dynamic linker issues. It stated that it should support
global & instance level function querying. But this differs from the Vulkan spec
which states that vkGetInstanceProcAddr should be able to query all functions.
This creates confusion about what takes precendence, the spec or the loader's docs.
This commit makes it explicit that it should have the same semanics what the spec
says.
|
|
Previously, the loader would initialize vkCreateSwapchainKHR and
vkGetDeviceGroupSurfacePresentModeskHR with vkGetInstanceProcAddr, instead
of what should have happened, which is to use vkGetDeviceProcAddr.
|
|
Remove references to VS 2015, as it is no longer supported.
Update the build instructions to include UPDATE_DEPS more prominently.
Move mentions of tests to the very end, and to use `ctest`.
Mention Cross Compilation caveats.
|
|
The cross compiling workaround for asm_offset requires python, but this meant
that all builds required python. This commit re-adds the removed asm_offset
logic and then only requires python during cross compilation.
|
|
loader_calloc_with_instance_fallback is used in places where a user can
supply their own allocator, but should default to the allocator used with
the instance otherwise. The issue was that loader_free was being used with
objects created with the instance allocator, but loader_free only takes the
user provided one, leading to leaks.
|
|
Code which was originally meant to deduplicate drivers that moved from the old
registry HKEY_LOCAL_MACHINE/SOFTWARE/Khronos/Vulkan/Drivers to PnP locations
was incorrectly applied to layers as well. The issue is that multiple layers
can share the same json file name but not actually contain the same manifest.
Worse, the first layer found would be assumed to be correct, even the file had
been deleted from the file system.
|
|
This allows cross compilation to enable unkonwn function handling as
gen_defines.asm will be generated without needing to run code meant for the
target platform. Previously, asm_offset.c wrote the gen_defines.asm file
by being run. Now, compilers emit their intermediate assembly output that the
parse_asm_values.py script knows how to find the relevant information from.
Additionally set the test framework `framework_config` build option to always
copy, instead of copy_if_different. This is needed since cmake wouldn't update
this file when changing from/to debug & release mode.
|