Can compile "loader" and "layers" on Windows and Linux ...

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).
17 files changed
tree: ea74596b1b30e743047cf263c61aef8a2d07566d
  1. cmake/
  2. docs/
  3. include/
  4. layers/
  5. loader/
  6. tests/
  7. .gitignore
  8. BUILD.md
  9. CMakeLists.txt
  10. glave-generate.py
  11. README.md
  12. update_external_sources.sh
  13. xgl-generate.py
  14. xgl-layer-generate.py
  15. xgl-win-def-file-generate.py
  16. xgl.py
  17. xgl_helper.py
README.md

Explicit GL (XGL) Ecosystem Components

Version 0.7, 18 Dec 2014

This project provides open source tools for XGL Developers.

Introduction

XGL is an Explicit API, enabling direct control over how GPUs actually work. No validation, shader recompilation, memory management or synchronization is done inside an XGL driver. Applications have full control and responsibility. Any errors in how XGL is used are likely to result in a crash. This project provides layered utility libraries to ease development and help guide developers to proven safe patterns.

New with XGL in an extensible layered architecture that enables significant innovation in tools:

  • Cross IHV support enables tools vendors to plug into a common, extensible layer architecture
  • Layered tools during development enable validating, debugging and profiling without production performance impact
  • Modular validation architecture encourages many fine-grained layers--and new layers can be added easily
  • Encourages open community of tool developers: led by Valve, LunarG, Codeplay and others
  • Customized interactive debugging and validation layers will be available together with first drivers

The components here are being shared with the Khronos community to provide insights into the specification as we approach an alpha header, and to assists those doing demos for GDC.

The following components are available:

New

  • XGL API trace and capture tools. See tools/glave/README.md for details.
  • Sample driver now supports multiple render targets. Added TriangleMRT to test that functionality.
  • Added XGL_SLOT_SHADER_TEXTURE_RESOURCE to xgl.h as a descriptor slot type to work around confusion in GLSL between textures and buffers as shader resources.
  • Misc. fixes for layers and Intel sample driver

Prior updates

  • Added mutex to APIDump, APIDumpFile and DrawState to prevent apparent threading issues using printf
  • Fix support for {Fill,Copy}Memory
  • MemTracker can report issues to application via debug callback
  • Update test infrastructure to improve ease of writing new tests. Add image comparison feature for regression testing. Requires ImageMagick library.
  • Misc. fixes to demos, layers and Intel sample driver
  • Added mutex to APIDump, APIDumpFile and DrawState to prevent apparent threading issues using printf
  • Fix support for {Fill,Copy}Memory
  • MemTracker can report issues to application via debug callback
  • Update test infrastructure to improve ease of writing new tests. Add image comparison feature for regression testing. Requires ImageMagick library.
  • Misc. fixes to demos, layers and Intel sample driver

How to Build and Run

BUILD.md includes directions for building all the components, running the validation tests and running the demo applications.

Information on how to enable the various Debug and Validation layers is in layers/README.md.

References

This version of the components are written based on the following preliminary specs and proposals:

License

This work is intended to be released as open source under a BSD-style license once the XGL specification is public. Until that time, this work is covered by the Khronos NDA governing the details of the XGL API.

Acknowledgements

While this project is being developed by LunarG, Inc; there are many other companies and individuals making this possible: Valve Software, funding project development; Intel Corporation, providing full hardware specifications and valuable technical feedback; AMD, providing XGL spec editor contributions; ARM, contributing a Chairman for this working group within Khronos; Nvidia, providing an initial co-editor for the spec; Qualcomm for picking up the co-editor's chair; and Khronos, for providing hosting within GitHub.

Contact

If you have questions or comments about this driver; or you would like to contribute directly to this effort, please contact us at XGL@LunarG.com; or if you prefer, via the GL Common mailing list: gl_common@khronos.org