Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/KhronosGroup/Vulkan-Loader.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-11-12Handle invalid files & symlinks properlyHEADmasterCharles Giessen
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
2022-11-12Recheck API version in terminator_CreateInstanceCharles Giessen
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.
2022-11-11Remove redundant codeWaffl3x
loader_make_version recently was changed to zero out the patch version, explicitly doing it is no longer necessary.
2022-11-11cmake: CMake cleanupJuan Ramos
- 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
2022-11-11Add macOS-latest CI actionCharles Giessen
Re-enables using the macOS-latest github actions runner now that the loader has been fixed for newer macOS versions.
2022-11-10build: Update to header 1.3.234v1.3.234Mike Schuchardt
- Update known-good - Generate source
2022-11-10Call both EnumPhysDevs & EnumAdapterPhysDevs on driversCharles Giessen
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.
2022-11-10Remove log message of ICD extension listsCharles Giessen
2022-11-10Dont abort when WSI functions are NULL.Charles Giessen
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.
2022-11-09cmake: Use new VulkanHeaders cmake supportJuan Ramos
Removes need to have FindVulkanHeaders.cmake
2022-11-08Remove USE_CCACHE build optionCharles Giessen
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.
2022-11-07loader/cJSON: replace sprintf calls with snprintfMark Mentovai
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.
2022-11-05Fix vulkan.pc Libs.private for static buildsCharles Giessen
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.
2022-11-04Fix tests for env-var filtering due to previous commitCharles Giessen
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.
2022-11-04Fix env-var filtering in layer enumerationCharles Giessen
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.
2022-11-04Add the 1.3.224 Header version to the Env-Var documentationCharles Giessen
This way users know exactly which version of the loader contains the new environment variables.
2022-11-04Remove redundant layer searching in term_EnumDevExtsCharles Giessen
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.
2022-11-04Update and clarify filter documentationMark Young
Based on review feedback from @hadess
2022-11-04Put placeholder for loader versionMark Young
TODO: Replace all 1.3.yyyy with appropriate header version after approval.
2022-11-04Update so filters apply results to vkEnumInstanceLayerPropsMark Young
Also remove duplication so that common code is used in several places.
2022-11-04Add loader enable/disable env varsMark Young
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.
2022-11-04Do not include vk_sdk_platform.hJeremy Gebben
Nothing in this file was being used.
2022-11-03build: Update to header 1.3.233v1.3.233Mike Schuchardt
- Update known-good - Generate source
2022-11-03Dont abort when driver doesn't support debug utilsCharles Giessen
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.
2022-11-02Remove override layer expirationCharles Giessen
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.
2022-11-02Remove implicit fallthroughs; Add warningCharles Giessen
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.
2022-11-01Test Wrap Layer didn't unwrap in vkGetInstanceProcAddrCharles Giessen
Wrapping layer should be unwrapping the instance handle inside of GetProcAddr functions.
2022-11-01Null check vk_icdGetPhysicalDeviceProcAddrCharles Giessen
Forgotten NULL check causes crashes if a driver forgets to export vk_icdGetPhysicalDeviceProcAddr but does report a 4 or higher ICD Interface Version.
2022-11-01Use macos-11 in github actions to work around bugsCharles Giessen
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.
2022-11-01Remove Device functions from ICD Dispatch tableCharles Giessen
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.
2022-10-27build: Update to header 1.3.232v1.3.232Mike Schuchardt
- Update known-good - Generate source
2022-10-26Revert "Remove vkCreateSwapchainKHR from ICD Dispatch table"Charles Giessen
This reverts commit d79e2731d45bf4c81f650f27205e208a023269aa.
2022-10-26Revert "Document vk_icdGetInstanceProcAddr querying device functions"Charles Giessen
This reverts commit 068e83f5f20e38c3ae1687e7f1aeb59bf6ce3e72.
2022-10-26Document vk_icdGetInstanceProcAddr querying device functionsCharles Giessen
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.
2022-10-26Remove vkCreateSwapchainKHR from ICD Dispatch tableCharles Giessen
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.
2022-10-26Add 32 bit github actions CICharles Giessen
2022-10-26Fix linux 32 bit unknown function error handlingCharles Giessen
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.
2022-10-26Revert "Don't query vkCreateSwapchainKHR with GIPA"Charles Giessen
This reverts commit af67fccebe59e8d8e30e8c02b7b0069ce4242fc4.
2022-10-26Revert "Document vk_icdGetInstanceProcAddr querying device functions"Charles Giessen
This reverts commit e5680db8ae5640dde10b58b8ab45e4a6201ae3e9.
2022-10-25fix: format codeDanny Zhu
2022-10-25fix: add null pointer checkingDanny Zhu
2022-10-25fix: add dev pointer checkingDanny Zhu
2022-10-25fix: add dev pointer checking before usingdanny.zhu
2022-10-25Document vk_icdGetInstanceProcAddr querying device functionsCharles Giessen
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.
2022-10-25Don't query vkCreateSwapchainKHR with GIPACharles Giessen
Previously, the loader would initialize vkCreateSwapchainKHR and vkGetDeviceGroupSurfacePresentModeskHR with vkGetInstanceProcAddr, instead of what should have happened, which is to use vkGetDeviceProcAddr.
2022-10-25Update BUILD.mdCharles Giessen
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.
2022-10-25Restore asm_offset printing codeCharles Giessen
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.
2022-10-22Use correct allocator in debug_utils.cCharles Giessen
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.
2022-10-19Only deduplicate driver manifestsCharles Giessen
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.
2022-10-19Write gen_defines.asm using a python scriptCharles Giessen
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.