aboutsummaryrefslogtreecommitdiff
path: root/loader/loader.c
AgeCommit message (Collapse)Author
2018-01-19loader: Fix static library initializationLenny Komow
Fix the loader's global initialization being skipped when the loader is built as a static library on windows Change-Id: I492f87104fb3bf32aed3c7d251dee2caeb4f00ba
2018-01-19loader: Restore pNext data in CreateDeviceJoey Bzdek
In the terminator for CreateDevice, the VkDeviceGroupDeviceCreateInfoKHX struct in the pNext chain is replaced by a copy that has VkPhysicalDevice handles remapped. At the end of the terminator, restore the modified pNext pointer to partially comply to the const argument and give consistent behavior to the caller. Change-Id: I83a60a0102a736d056729383733e62b38b0ace2c
2018-01-18loader: Fix enabling extensions from layersLenny Komow
This resolves a bug where it was impossible to enable an extension that was defined in a layer if that layer was not passed by the application. This applied to implicit layers, explicit layers enabled by environment variables, and metalayers. Change-Id: I03bee6fb778936d970f78b9142679654424f80ae
2018-01-16loader: Clean up mutexes on destructionLenny Komow
Change-Id: I7d1524da9167a576420c109ebbce8ebb5121cad0
2018-01-16Loader: fix open registry handle leakSlawomir Cygan
Each handle returned by RegOpenKey*() API functions should be closed using RegCloseKey(). This change fixes AppVerifier warning on leaklin HKEY objects.
2018-01-09loader: Add pre-instance functions for layersLenny Komow
Allow implicit layers (not explicit) to intercept calls before an instance has been created. Change-Id: I41f5bb0f5a6314fbab8003ebe71059dd04afc860
2018-01-03loader: Change overzealous warning to debug msgLenny Komow
Change-Id: Idde5f8c8f009e365bdcf1fffaffa669d0557d66b
2017-12-04loader: Fix Clang errors/warnings.Jamie Madill
Fixes: format specifies type 'int' but the argument has type 'DWORD' (aka 'unsigned long') [-Werror,-Wformat] error : expected ')' (issue with __FUNCTION__ and format string)
2017-11-28loader: fix memory leak for layers with >1 dev_extsCort Stratton
2017-11-27loader: Fix improper cast warning.Jamie Madill
warning C4057: 'function': 'LPBYTE' differs in indirection to slightly different base types This was popping up in some Windows builds. Also add it to the list of warnings enabled by default with MSVS. Change-Id: I2703f2e57ba3fb33ec03fbc7b8324c75187abec6
2017-10-16loader: Fix info message when activating a layerLenny Komow
Change-Id: Ibc6df4964a752c9cce574a208714eb096576973c
2017-10-10Loader: Fix OOM in loaderGetDeviceRegistryFiles()Igor Ostrowski
loaderGetDeviceRegistryEntry() out of memory result was not handled properly.
2017-09-13loader: Fix crash from loading invalid ICDLenny Komow
Addresses LunarXchange issue 711 Change-Id: Ia67441a3adde5ddf9d72ffd12c8cc5fb44071b96
2017-09-06loader: Allow layer loading from pnp registryLenny Komow
Change-Id: I70682cf5904b95b52881457e14bbc2f9a772259d
2017-09-06loader: Fix PnP 32-bit registry handlingLenny Komow
Change-Id: I25eae83b4783e702ca5fbe74a99d7bdeae6218f0
2017-08-29loader: Fix GetProcAddress loading illegal funcsLenny Komow
The loader would return an unknown device extension handler when specifying a function from a layer that was available, but not enabled. Change-Id: I0d77a7489d66e4d77aa8446018ec545c930f5bcf
2017-08-25Loader: Fix out-of-memory handling in loaderGetDeviceRegistryFilesSlawomir Cygan
Wrongly handled OOM error causes dEQP-VK.api.object_management.alloc_callback_fail test to fail, because wrong error code is returned.
2017-08-10loader: Replace overzealous warnings with infoLenny Komow
The new ICD search functionality was logging warnings in some places where information was more appropriate, such as when opening a device or for some errors that simply indicated that the new format is not supported yet. Change-Id: Ifc8ce33d778783f3f55102783bf6ede0dd7c2a00
2017-08-10loader: Don't load manifest files more than onceLenny Komow
Change-Id: I2802ad0c1fd16c0287ed24b96ec6d81c4b3c711a
2017-08-10loader: Fix size handling when scanning registriesSlawomir Cygan
loaderGetRegistryFiles() should not start from 4096 size, if loaderGetDeviceRegistryFiles function has already appended something into the buffer.
2017-08-10loader: Add new ICD search paths to loaderSlawomir Cygan
This change extends the functionality of searching for ICD JSONs by adding registry locations specific to given display adapter and software components associated with this display adapter. The exact locations in registry are queried using Windows public PnP Configuration Manager API[1]. This change is required, as previous ICD locations (constant path in "HKLM/Software") may be unreachable for drivers and their installers on Windows RS3[2]. Similar change is being made for OpenCL[2] [1]https://msdn.microsoft.com/en-us/library/windows/hardware/ff549713.aspx [2]https://github.com/KhronosGroup/OpenCL-ICD-Loader/pull/21
2017-07-18loader: Fix vkEnumerateDeviceLayerPropertiesMark Young
The device layers should list the names of the original layers enabled during vkCreateInstance. We were expanding the meta-layers which caused there to be a mismatch in names. NOTE: that this list still include Implicit and Environment variable enabled layers since those are techincally enabled at vkCreateInstance as well. Change-Id: I3ef88623e96a12a8f18f8f04e95a6f5444f4be56
2017-07-17loader: Do not enumerate extensions from disabled implicit layersJean-Francois Roy
This patch adds a check to vkEnumerateInstanceExtensionProperties to omit extensions provided by disabled implicit layers. Per section 31.2 (1.0.51), "When pLayerName parameter is NULL, only extensions provided by the Vulkan implementation or by implicitly enabled layers are returned." Arguably, implicit layers that have been disabled are not "implicitly enabled".
2017-06-29loader: Add validation for apiVersionMark Young
Add a check to determine if the API version being requested can be handled by the loader. If it can't, then we return incompatible driver. If we can, we continue along our merry way. An addendum is that we also bumped the Loader/ICD interface version. This was requested by Nvidia so that the ICDs know that we pay attention to the version in the loader. If they don't see the new Loader/ICD interface version, they will handle the failing on all non-1.0 API requests. Change-Id: Icb7dd45e754c9f6a6c8186198333bacc68077b93
2017-06-26loader: Fix handling of JSONMark Young
If a JSON layer manifest file says it contained device extensions but didn't provide a list, or the list was malformed, it caused issues. Change-Id: I94b97b190aca35f9464918eb7195486566becaa0
2017-06-12loader: Change std_val to ignore swapchain layerMark Lobodzinski
Change-Id: I560dda7156d8550af6b7073eb7fcd0a14aa97131
2017-06-12loader: replace UTF-8 “” with "Nekotekina
2017-06-05loader: Fix buffer overflow in loader_add_to_dev_ext_listGabríel Arthúr Pétursson
The size argument to a call to memcpy is for the wrong struct. The type of `ext->list[idx].props` is VkExtensionProperties. Credit goes to AddressSanitizer for spotting this bug.
2017-05-26loader: Fix env usage and cleanup messagesMark Young
Fix the environment variable usage of VK_LOADER_DISABLE_INST_EXT_FILTER so that it will also ignore the unknown extensions during vkCreateInstance and clean up a few more messages. The previous messages were confusing and didn't indicate what was actually wrong. Change-Id: Iccd0a4b2cfd673187cb7e92fe9cec23deb058ff2
2017-05-26loader: Extend emulation to VkDevice creationLenny Komow
Add support for VkPhysicalDeviceFeatures2KHR and VkDeviceGroupDeviceCreateInfoKHX structs in the pNext chain of VkDeviceCreateInfo for emulated physical devices Change-Id: Ib00e35546f064f57f987d8eda14fba17bceab52c
2017-05-23loader: Use correct instance in gpdpa callTony Barbour
Change-Id: I662a6a182680ef7da6ad51a738fcc5aaff54f043
2017-05-19loader: gh1771-Fix realloc handlingMark Young
Fix how the loader handles realloc calls. Instead of always overriding the pointer, check to see if the allocation succeeds. Also, set the paths in our run_all_tests.ps1 to global paths. Finally, fix a spelling error in the test names. Change-Id: I7b2e0d246dbe6353d29fb56367397c5d8767aaa2
2017-05-16loader: Expand error message infoMark Young
Expand loader_platform_open_library_error on Windows to include the error message from GetLastError(); Also, modify the loading of the layer library to use the loader_platform_open_library_error message sincce we want to get as much error information in that as possible. And fix a typo in a comment. Change-Id: I1ef5ede8c6716c4624b31ddb3b32b83392920a6c
2017-05-10loader : gh1675 - Further strncat changesMark Young
This doesn't completely satisfy GH 1675, but at least resolves a few of the holes discovered by @randomascii. Change-Id: Idb2273851e36d4470d2f14cb09d6ac1c314497a8
2017-05-09loader: Optimize layer removalMark Young
In the case we remove a meta-layer, use memmove once, not in an array. Change-Id: Ia7496c4436e987011a0ad504a096c15f9d320c28
2017-05-09loader: Code review fixesMark Young
Fix some potential issues discovered by Karl in the code review. Also, fix CMake warning on newly added VkLayer_standard_layer. The CMake generation code I had been using expected a project with the same name as the JSON. Change-Id: I8738ff03ac08bcfc13aa8d11c570a0b507de450a
2017-05-09loader: Update meta-layersMark Young
Use the meta-layer Manifest API version to check against each of its component layer API versions. This will force us to make sure each JSON file is properly updated in sync. Add a section to the LoaderAndLayerInterface markdown doc about the usage of meta-layers, and an example of how they look in a Manifest JSON file. Change-Id: I667cfd3013cbcf201c83935dc6f1c2bb937c7742
2017-05-09loader: Fix layer Enumerate bugMark Young
This fixes a bug found by Timothee Besset regarding calling vkEnumerateDeviceLayerProperties when no layers are present. This resulted in a negative number being filled into a uint32_t which caused an invalid number of layers to be returned. Now that we have meta-layers implemented instead of hard-coded, I created two lists: an application provided list of layers, and an expanded list of layers (where meta-layers are broken up into their component layers). The former is used when working with the enumerate calls, but the later is used internally for final layer activation. Change-Id: If723fdfb5acb1dc57923282d2c641c582870ad1c
2017-05-09loader: Meta-layer supportMark Young
Integrate Lenny and my changes for Meta-layers. Includes adding initial JSON file for standard_validation. Change-Id: Ibc1da464fad4949e14e171dbc7dd9990621e1081
2017-04-26loader: gh1681 - Restrict error in JSONMark Young
Restrict the loader's JSON errors when reading ICD manifest files to only return an overall error if there are no valid drivers. Change-Id: I10edb1cdc7e4db9cfdc0b3595416f0614ed22867
2017-04-07loader: Fix loader and layer negotiationMark Young
Resolve missing struct sType as well as extern of vkNegotiateLoaderAndLayerInterface as a C function. Finally, bump up the JSON file version so it looks for the negotiate function. Change-Id: I7fd4784fce6cbd0c303f7b2bb354542e4b16b1df
2017-03-31loader: Fix loader crash with multiple instancesLenny Komow
Change-Id: Ia72feb84bcc8bfa479694e901beb4fa685fdfdf3
2017-03-22loader: Add guard around cmake header include.Jamie Madill
This allows non-cmake platforms to compile the loader. Use a define named VULKAN_NON_CMAKE_BUILD to disable CMAKE-specific features. Change-Id: I6f6d8731fe1be60fd138e9fe1006c913fb029b47
2017-03-16loader: Fix vkEnumeratePhysicalDeviceGroupsKHXMark Young
vkEnumeratePhysicalDeviceGroupsKHX was not properly generating the physical device information or groups. Several changes resolve most of the issue, however, I'm still seeing issues when certain layers enabled. Change-Id: Id8d4553da25491a3d0a97e8d44e21340b41bc09c
2017-03-16build: Fix potentially uninitialized VS2015 warningJamie Madill
This fixes the a few occurences in demos, the loader and a test. It also adds the warning to the always-on list so it will prevent future regressions. Fixes #1587. Change-Id: I26f69e977b57749a3ab4ddb548ada95384131edc
2017-03-14loader: Initialize json_versionMike Stroyan
Fields of json_version were left uninitialized if file_format_version in a layer json file was incomplete. Initialize them to 0.
2017-03-09loader: Set pointer to NULLMark Young
Cleanup enabled extension array pointer passed down to driver. If the loader overrode the create info struct, the pointer could be garbage if the enabled extension count was 0. Now, make sure it is NULL. Change-Id: I558d768e786892e7afc44f58b4173a2b8db3deee
2017-03-09loader: Use secure_getenv only when necessaryMark Young
secure_getenv should only be used on something that is security sensitive. Certain environment variable settings do not fall into that category. So, only use it when necessary. Change-Id: Ib8b8dc1a1528a2f67f7cdc25051be078292ee19a
2017-03-09loader: Update secure_getenv checkMark Young
The previous check was against the compiler, not against the libc. Implement the check in CMake and generate a new header file which defines appropriate defines (loader_cmake_config.h). Change-Id: I2ae0e8d482fb4ce13089128157c11d18b0c178b9
2017-03-08spelling: Fix spelling errorsMark Young
Fix some spelling errors (caught by VS2017 spelling extension) and a few floating func defs that are no longer valid. Change-Id: Ifd9394227dfe3b3255c27429dadaf405433232d2