aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Ashburn <jon@lunarg.com>2015-02-11 12:40:00 -0700
committerJon Ashburn <jon@lunarg.com>2015-02-11 15:30:18 -0700
commitd10ea3ff6996a1a8153eca4f8421ced82347d567 (patch)
tree970fb92617cccbf08259ea51b38931d82b9feb65
parent41efb4c0b047f8b85be2bb1ed4aa442cf85966ed (diff)
downloadusermoji-d10ea3ff6996a1a8153eca4f8421ced82347d567.tar.xz
loader: Update README.md to instancing API and C++ ICDs
-rw-r--r--loader/README.md19
1 files changed, 14 insertions, 5 deletions
diff --git a/loader/README.md b/loader/README.md
index 5e81eee2..fe012974 100644
--- a/loader/README.md
+++ b/loader/README.md
@@ -23,15 +23,24 @@ LIBXGL\_LAYER\_NAMES colon separate list of layer names to be activated. Examp
LIBXGL\_LAYER\_NAMES=MemTracker:DrawState
## Interface to driver (ICD)
-- xglInitAndEnumerateGpus exported
+- xglEnumerateGpus exported
+- xglCreateInstance exported
+- xglDestroyInstance exported
- xglGetProcAddr exported and returns valid function pointers for all the XGL API entrypoints
- all objects created by ICD can be cast to (XGL\_LAYER\_DISPATCH\_TABLE **)
where the loader will replace the first entry with a pointer to the dispatch table which is
owned by the loader. This implies two things for ICD drivers:
1. the ICD must return a pointer for the opaque object handle
- 2. this pointer points to a structure with the first entry being a pointer.
+ 2. this pointer points to a regular C structure with the first entry being a pointer.
+ Note: for any C++ ICD's that implement XGL objects directly as C++ classes.
+ The C++ compiler may put a vtable at offset zero if your class is virtual.
+ In this case use a regular C structure as follows for your C++ objects:
+```
+ struct {
+ void *reservedForLoader;
+ myObjectClass myObj;
+ } xglObj;
+```
- the ICD may or may not implement a dispatch table
-- ICD entrypoints can be named anything including the offcial xgl name such as xglCreateDevice(). However, beware of inter
-posing by dynamic OS library loaders if the offical names are used. On Linux,
-if offical names are used, the ICD library must be linked with -Bsymbolic
+- ICD entrypoints can be named anything including the offcial xgl name such as xglCreateDevice(). However, beware of interposing by dynamic OS library loaders if the offical names are used. On Linux, if offical names are used, the ICD library must be linked with -Bsymbolic