When loader_get_fullpath() gets an empty string as the 'dir' parameter,
it immediately writes out the original, unexpanded filename. Setting
the default drivers and layers paths to an empty string on Linux will
allow the unmodified filenames to be passed to dlopen(3) without having
to maintain a separate code path for Windows.
Now that there is no longer a default path for drivers or layers on
Linux, ${CMAKE_INSTALL_LIBDIR} no longer needs to be baked into the
loader binary. Note that any ICDs or layers that are currently getting
installed to the previous default paths (e.g. /usr/lib/vulkan/icd or
/usr/lib/vulkanlayer) will not be discoverable when specified as plain
filenames, unless these directories happen to be configured in the
loader's search path on the system in question.
The previous attempt at using GNU standard paths
limited searching to the prefix where the loader
was installed. What we really want though is to
always search in /usr, also search in whatever
local prefix the user installed at if it wasn't
/usr, and use the standard GNU libdir, sysconfdir,
and datadir under those prefixes. This change
implements that behavior.
Signed-off-by: James Jones <jajones@nvidia.com>
Tested-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
These should get inherited from the build environment, which should
handle the variation between /usr/lib/$triple on debian vs /usr/lib{,64}
on redhat.
Signed-off-by: Adam Jackson <ajax@redhat.com>
Since the sample Intel driver hasn't been ported to Windows, this nulldrv is
being used to bootstrap Windows support. It can also provide a hint to new
IHV's for how to set the magic number.
The intention is for Linux developers to catch more problems (real or
annoyance) before porting to Windows.
The new warnings are:
-Wpointer-arith
-Wsign-compare
These are not used for the Intel sample driver (mostly because the Intel
compiler from Mesa3D generates lots of these warnings, which code we don't want
to modify), nor for the tests.
Not sure how this affects Glave on Linux.
Add -fno-strict-aliasing -fno-builtin-memcmp - Both of these are
used by the Mesa driver, and without the first one, we hang? in
link_shaders on release builds
Move cube's LoadTexture out of an assert so it isn't skipped in
release builds
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).
Time to start sifting through the code now to make it as functional as possible for when the driver catches up and we can really test things again.
Conflicts:
glave-generate.py
Lots of updates required to DrawState and MemTracker layers so just commenting them out the build initially.
Conflicts:
layers/draw_state.c
layers/multi.cpp
xgl-layer-generate.py
xgl.py
Includes an auto generated layer (GenericLayer) that wraps all api calls.
Includes a basic handwritten layer (basicLayer) that wraps a few apis.
Adds xglGetProcAddr as a new api, which is used to chain layers together.
All layers and loader implement a dispatch table.