aboutsummaryrefslogtreecommitdiff
path: root/loader/loader.c
AgeCommit message (Collapse)Author
2015-05-07misc: Add vkGetInstanceProcAddr() entrypointJon Ashburn
Adding this entrypoint as this has been discussed in khronos and is needed for the loader/layer/extension proposal. Caveats: 1) Have not updated layers or any tests/demos yet that will come later; 2) No one including loader is using this call yet; 3) Leaving exisitng vkGetProcAddr() as is for now; later once loader is using vkGetInstanceProcAddr call can switch vkGetProcAddr() to vkGetDeviceProcAddr()
2015-05-07loader: logging on Windows to both debug output and stderrJon Ashburn
2015-05-05loader: rename a few dispatch utiltiesJon Ashburn
2015-04-29loader: Eliminate compiler warnings on Windows.Ian Elliott
2015-04-29loader: Terminate chain of GetProcAddr() in driver if gpu obj is baseJon Ashburn
Fixes issue when driver doesn't implement an entrypoint of recursing and unwrapping gpu object too many times.
2015-04-27loader: Fix bug on layer name prefix string lengthJon Ashburn
Also add GetGlobalExtensionInfo to layer .def file
2015-04-22misc: Changes to fix warnings in Windows / VC++ buildTony Barbour
2015-04-22misc: Changes to clean up warnings in Release buildTony Barbour
2015-04-22loader: Make sure max layer count is set properlyCourtney Goeltzenleuchter
2015-04-22vkEnumerateLayers: Update to match upstreamCourtney Goeltzenleuchter
The upstream vulkan.h header removed maxLayerCount parameter from vkEnumerateLayers. This patch implements that change for the sample driver and layers.
2015-04-21vulkan.h: Fix up warnings and use VkObject appropriatelyTony Barbour
2015-04-17update to vulkan.h header version 90, bug 13529Mike Stroyan
2015-04-17loader: add a missing VKAPIChia-I Wu
loader_gpa_internal() needs VKAPI.
2015-04-16Bug 13632 Header 84 Assorted questions and comments on vulkan.hTony Barbour
2015-04-16misc: Change vkEnumerateGpus to vkEnumeratePhysicalDevicesJon Ashburn
Conflicts: loader/loader.h
2015-04-16Win: Some compilation/link fixes.Ian Elliott
2015-04-16loader: Add support for loading layers that support a groupJon Ashburn
Specifically support the "Validation" group for activating any layer which supports that name.
2015-04-16loader: Add check for invalid enabled extensions at CreateInstanceJon Ashburn
2015-04-16loader: Fix GetProcAddr to return proper function pointers for appJon Ashburn
Add case of handling null gpu object for global functions. For device specifc functions use the dispatch table or the loader entrypoints depending on if the trampoline code can be skipped or not. Conflicts: loader/CMakeLists.txt vk-generate.py v2: undo accidental rename of LayerInterceptProcSubcommand fix WinDefFileSubcommand due to rebase (olv)
2015-04-16vulkan: Add vkGetGlobalExtensionInfo entrypointJon Ashburn
have loader use it to enumerate all extensions from layers and drivers. Non-gode_gen layers also updated to include vkGetGlobalExtensionInfo Includes verion info as part of GetExtensionSupport return data. TODO: vk-layer-generate needs work v2: do not check for non-existing ENABLE_WSI_X11 (olv)
2015-04-16layers: Remove wrapping of GPU objects by loader and layersJon Ashburn
Loader only wraps GPU objects for creating a layer chain. After layer activation layers and loader use unwrapped gpu object returned by the driver. This is a large simplification. This fixes a nasty bug where layers intercepting entrypoints with gpu objects but not all these entrypoints would fail. These would cause non-uniform unwrapping of gpu objects by the time the driver was called with a gpu object. Fixes issue in loader_get_icd where it was trying to compare a wrapped GPU against a non-wrapped GPU.
2015-04-16loader: Don't have GetExtensionSupport as loader special case codeJon Ashburn
Allows layers to intercept GetExtensionSupport()
2015-04-16loader: Activate layers at EnumerateGpus instead of CreateDeviceJon Ashburn
2015-04-16loader: refactor layer activation function to handle more general inputsJon Ashburn
Renamed structure types as well. TODO: verify vk-layer-generate.py v2: fix LoaderEntrypointsSubcommand (olv)
2015-04-16loader: Store the enabled extensions at CreateInstanceJon Ashburn
2015-04-16vulkan: beautification changesCourtney Goeltzenleuchter
TODO: verify vk-layer-generate.py TODO: need to rename object tracker generator v2: fix "python3 vulkan.py" fix dead cod in tri introduced by rebase beautify wsi_null.c (olv)
2015-04-16Win: Fix typo and incorrect strlen for finding/loading ICDs.Ian Elliott
2015-04-16vulkan: API renamingCourtney Goeltzenleuchter
VK_DEVICE_QUEUE_CREATE_INFO => VkDeviceQueueCreateInfo VK_DEVICE_CREATE_INFO => VkDeviceCreateInfo VK_INSTANCE_CREATE_INFO => VkInstanceCreateInfo VK_LAYER_CREATE_INFO => VkLayerCreateInfo VK_MEMORY_ALLOC_INFO => VkMemoryAllocInfo VK_MEMORY_ALLOC_IMAGE_INFO => VkMemoryAllocImageInfo VK_MEMORY_ALLOC_BUFFER_INFO => VkMemoryAllocBufferInfo VK_BUFFER_CREATE_INFO => VkBufferCreateInfo VK_BUFFER_VIEW_CREATE_INFO => VkBufferViewCreateInfo
2015-04-16Stage 1 of renameCourtney Goeltzenleuchter
TODO: re-enable glave build, advance API for glave v2: get rid of outdated code in tri introduced by rebase rename wsi_null.c (olv)
2015-04-16misc: Add create_info struct to CreateInstance()Jon Ashburn
Allows extnesion or layer enablement at CreateInstance Khronos Bug 13637
2015-04-16loader: Merge extensions and layersCourtney Goeltzenleuchter
Update loader so that it extensions and layers work in same basic fashion. That is, application can query for extension/layer support by calling GetExtensionSupport. The loader will then query the available drivers AND layers for that support. Likewise, when the application does CreateDevice the list of "extensions" can be both layers and extensions and the loader will figure out the right thing to do. Conflicts: loader/loader.c xgl-generate.py
2015-04-16loader: Fix Dbg entrypoints with instance param to not loop all instancesJon Ashburn
DbgRegisterMsgCallback, DbgUnregisterMsgCallback, DbgSetGlobalOption were all making these calls for all instances rather than just instance passed in as parameter.
2015-04-16xgl: update xglDbg.h for XGL_INSTANCECourtney Goeltzenleuchter
Add XGL_INSTANCE as the first parameter of xglDbgRegisterMsgCallback(), xglDbgUnregisterMsgCallback(), and xglDbgSetGlobalOption(). The loader is simplified. loader_log() is modified to always output to stderr. glave is modified to register its message callback after xglEnumerateGpus(), and xglDbgUnregisterMsgCallback() is called only before xglDestroyInstance(). XGL_INSTANCE is ignored by the layers and the driver for now. Bump up API version to XGL_MAKE_VERSION(0, 56, 1).
2015-04-16loader: Fix prefix used to find layer library.Courtney Goeltzenleuchter
2015-04-03Fix NULL-pointer dereference if can't find registry entry.Ian Elliott
2015-03-31New loader_get_registry_value() function reads 32/64 registry ...Ian Elliott
This version should be able to find a key/value if it exists in either the 32 or 64 bit hive. Also, it also doesn't allocate any string data until it knows what size is needed. Changed the "xcv_nvidia.cpp" file to also use the new registry approach.
2015-02-20loader: Fix merge of layer names from env and CreateDeviceJon Ashburn
2015-02-19loader: initialize result for xglCreateInstance().Ian Elliott
2015-02-18loader: Correct layer path lookup nameCourtney Goeltzenleuchter
2015-02-18loader: Windows now uses registry + env's (diff names)Ian Elliott
The loader on Windows now looks in the Windows Registry + in environment variables for the following (Note the new names--"LIB" was dropped): - XGL_DRIVERS_PATH - XGL_LAYERS_PATH - XGL_LAYER_NAMES Linux still retains the "LIB" at the start of the environment variable names. If both are used, they are concatenated into a semi-colon-delimited list. A generic loader_get_registry_and_env() func is used to perform this (only for Windows, since Linux doesn't have a registry).
2015-02-17loader: Enable env extensions as well as app.Courtney Goeltzenleuchter
2015-02-13Eliminate "-Wsign-compare" warnings on Linux ...Ian Elliott
With these being newly enabled for the loader, layers, and demos (and it turns out, for the icd/common directory), it is appropriate to fix them.
2015-02-12Win: Attempt to keep from using Linux functions.Ian Elliott
This is a hopefully-temporary solution to prevent some of the problems of people breaking the Windows build while developing on Linux (or vice-versa). This uses macros of the names of Linux/Windows-specific functions in order to catch people who use those functions directly, instead of using the platform-compatibility-layer functions. In order to avoid problems with the layers #include'ing "loader_platform.h" before they #include system files (which can mess them up), I #include "loader_platform.h" twice. The 2nd time, it #define's the hopefully-temporary macros. Note: For some reason, we can't #define LoadLibrary(). It generates warnings on Windows.
2015-02-12icd: add loader magic word to verify ICD is compatibleCourtney Goeltzenleuchter
We wanted a more explicit way to determine if the driver ICD being loaded is providing compatible objects. To do that we check for a magic dword value at the beginning of the object. Non-compliant ICDs will assert in the loader or the loader's dispatch functions if an object does not have the correct value. Dispatch checks are debug only.
2015-02-06Fix unitialized value in xglCreateInstance().Ian Elliott
This causes a problem when no ICD is found. The function's "res" variable is returned despite never being intialized. For now, I chose to return XGL_ERROR_INCOMPATIBLE_DRIVER.
2015-02-05Win: Eliminate VS2013 compiler warnings for "loader.c" ...Ian Elliott
As part of this, eliminated some similar warnings within/across usage of "loader_platform.h". One of these is #define'ing _CRT_SECURE_NO_WARNINGS, so that VisualStudio won't issue warnings with our use of _snprint() (which they don't consider secure enough; but their desired function doesn't match the signature of snprintf()).
2015-02-05Win: Move some macros to "loader_platform.h"Ian Elliott
2015-02-04Can compile "loader" and "layers" on Windows and Linux ...Ian Elliott
These directories build and are partially turned-on on Windows, using the "tri" demo (follow-on commit) and a "NULL driver" that was created out of the sample/Intel driver. The GetProcAddress() is not yet finding symbols in the NULL driver. For now: - "C:\Windows\System32" is the default XGL driver directory. The getenv() isn't yet working. I suggest creating your own #define in order to point to where a driver is. - In order to recognize a Windows driver, we must look at both its prefix and suffix (i.e. it is named "XGL_*.dll", e.g. "XGL_i965.dll). - We autogenerate Windows ".def" files for the layers. Additional info is: - This is necessary in order for a DLL to export symbols that can be queried using GetProcAddress(). We can't use the normal Windows approach of declaring these functions using "__declspec(dllexport)", because these functions are declared in "xgl.h". - This involves adding and running the new "xgl-win-def-file-generate.py" file. - NOTE: Layers don't have the xglInitAndEnumerateGpus() entrypoint, just the xglGetProcAddr() entrypoint (and now the xglEnumerateLayers() entrypoint). Generating them is pretty simple. NOTE: In order to build on a 64-bit Windows 7/8 system, I did the following: - Install VisualStudio 2013 Professional - Install CMake from: http://www.cmake.org/cmake/resources/software.html - I let it add itself to the system PATH environment variable. - Install Python 3 from: https://www.python.org/downloads - I let it add itself to the system PATH environment variable. - Obtain the Git repository, checkout the "ian-150127-WinBuild" branch. - Using a Cygwin shell: I did the following: - "cd" to the top-level directory (i.e. the one that contains the ".git" directory). - "mkdir _out64" - "cd _out64" - "cmake -G "Visual Studio 12 Win64" .." - At this point, I used WindowsExplorer to open the "XGL.sln" file. I can build. CMake causes the build shortcut to be "Ctrl-Shift-B" instead of the normal "F7". I had to right-click the "ALL_BUILD" project, go to Properties->Debugging and change the debug Command and Working Directory to point to "tri.exe" and where the executable are. At this point, I can debug (using the normal "F5" shortcut).
2015-02-04loader: Make sure loader instances get updated upon DestroyInstance()Jon Ashburn
2015-02-04instance: Remove xglInitAndEnumerateGpusJon Ashburn