gallium: Add egl-apis target.
authorChia-I Wu <olv@lunarg.com>
Wed, 5 May 2010 07:38:02 +0000 (15:38 +0800)
committerChia-I Wu <olv@lunarg.com>
Sat, 8 May 2010 06:57:21 +0000 (14:57 +0800)
The new target installs client API modules to EGL_DRIVER_INSTALL_DIR.
They are used by st/egl.

The client APIs are built from OpenGL and OpenVG state trackers.  For
this to work, st/vega is modified to produce a static library,
libvega.a, instead.  st/es is also not needed any more.  It is removed
and --with-state-trackers=es is replaced by --enable-gles-overlay.

As st/egl now has its own client API modules, this solves the ABI issue
between st/egl and client APIs, as long as the client API modules are
distributed with st/egl.  Plus, this allows st/egl to support OpenGL
with non-Gallium libGL.so.

14 files changed:
configs/autoconf.in
configs/default
configure.ac
src/gallium/state_trackers/es/Makefile [deleted file]
src/gallium/state_trackers/es/st_es1.c [deleted file]
src/gallium/state_trackers/es/st_es2.c [deleted file]
src/gallium/state_trackers/vega/Makefile
src/gallium/state_trackers/vega/vg_api.h [new file with mode: 0644]
src/gallium/state_trackers/vega/vg_manager.c
src/gallium/targets/egl-apis/Makefile [new file with mode: 0644]
src/gallium/targets/egl-apis/api_GL.c [new file with mode: 0644]
src/gallium/targets/egl-apis/api_GLESv1_CM.c [new file with mode: 0644]
src/gallium/targets/egl-apis/api_GLESv2.c [new file with mode: 0644]
src/gallium/targets/egl-apis/api_OpenVG.c [new file with mode: 0644]

index f760d8d14a0c5dac395fbb7ae8e464cade1be77e..39e7327c7c1178530720fc6f2430ba4887d8f141 100644 (file)
@@ -101,6 +101,7 @@ PROGRAM_DIRS = @PROGRAM_DIRS@
 # Driver specific build vars
 DRI_DIRS = @DRI_DIRS@ 
 EGL_DISPLAYS = @EGL_DISPLAYS@
+EGL_CLIENT_APIS = @EGL_CLIENT_APIS@
 
 # Dependencies
 X11_INCLUDES = @X11_INCLUDES@
index 4bb98074c29285b977217febd33723d8e5dd16a3..4a5d3fd37a091dfbb2db970fb4b5d1bebc3abd26 100644 (file)
@@ -116,6 +116,7 @@ GALLIUM_STATE_TRACKERS_DIRS = glx vega
 
 # native displays EGL should support
 EGL_DISPLAYS = x11
+EGL_CLIENT_APIS = $(GL_LIB)
 
 # Library dependencies
 #EXTRA_LIB_PATH ?=
index 896abd431e3ab9aebb8e070cbfb93146247b85a4..c40c84269509c04178bd486150ec7344e7b84116 100644 (file)
@@ -749,6 +749,11 @@ AC_ARG_ENABLE([gles2],
         [enable support for OpenGL ES 2.x API @<:@default=no@:>@])],
     [enable_gles2="$enableval"],
     [enable_gles2=no])
+AC_ARG_ENABLE([gles-overlay],
+    [AS_HELP_STRING([--enable-gles-overlay],
+        [build separate OpenGL ES only libraries @<:@default=no@:>@])],
+    [enable_gles_overlay="$enableval"],
+    [enable_gles_overlay=no])
 
 API_DEFINES=""
 APIS=""
@@ -766,8 +771,12 @@ if test "x$enable_gles2" = xyes; then
     API_DEFINES="$API_DEFINES -DFEATURE_ES2=1"
     APIS="$APIS es2"
 fi
-if test "x$enable_gles1" = xyes -o "x$enable_gles2" = xyes; then
+if test "x$enable_gles_overlay" = xyes -o \
+    "x$enable_gles1" = xyes -o "x$enable_gles2" = xyes; then
     CORE_DIRS="mapi/es1api mapi/es2api $CORE_DIRS"
+    if test "x$enable_gles_overlay" = xyes; then
+        CORE_DIRS="$CORE_DIRS mesa/es"
+    fi
 fi
 AC_SUBST([API_DEFINES])
 AC_SUBST([APIS])
@@ -1253,6 +1262,10 @@ AC_SUBST([LLVM_LDFLAGS])
 AC_SUBST([LLVM_VERSION])
 
 VG_LIB_DEPS=""
+EGL_CLIENT_APIS='$(GL_LIB)'
+if test "x$enable_gles_overlay" = xyes; then
+    EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GLESv1_CM_LIB) $(GLESv2_LIB)'
+fi
 
 dnl
 dnl Gallium state trackers configuration
@@ -1290,11 +1303,9 @@ yes)
     ;;
 *)
     # verify the requested state tracker exist
-    state_trackers=`IFS=', '; echo $with_state_trackers`
-    for tracker in $state_trackers; do
-        test -d "$srcdir/src/gallium/state_trackers/$tracker" || \
-            AC_MSG_ERROR([state tracker '$tracker' doesn't exist])
-
+    state_trackers=""
+    _state_trackers=`IFS=', '; echo $with_state_trackers`
+    for tracker in $_state_trackers; do
         case "$tracker" in
         dri)
             if test "x$mesa_driver" != xdri; then
@@ -1314,23 +1325,44 @@ yes)
             HAVE_ST_XORG="yes"
             ;;
         es)
-            if test "x$enable_gles1" != xyes -a "x$enable_gles2" != xyes; then
-               CORE_DIRS="mapi/es1api mapi/es2api $CORE_DIRS"
+            AC_MSG_WARN([state tracker 'es' has been replaced by --enable-gles-overlay])
+
+            if test "x$enable_gles_overlay" != xyes; then
+                if test "x$enable_gles1" != xyes -a "x$enable_gles2" != xyes; then
+                    CORE_DIRS="mapi/es1api mapi/es2api $CORE_DIRS"
+                fi
+                CORE_DIRS="$CORE_DIRS mesa/es"
+                EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GLESv1_CM_LIB) $(GLESv2_LIB)'
             fi
-            # mesa/es is required to build es state tracker
-            CORE_DIRS="$CORE_DIRS mesa/es"
+           tracker=""
             ;;
         vega)
             CORE_DIRS="$CORE_DIRS mapi/vgapi"
             VG_LIB_DEPS="$VG_LIB_DEPS -lpthread"
+            EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(VG_LIB)'
             ;;
         esac
+
+       if test -n "$tracker"; then
+            test -d "$srcdir/src/gallium/state_trackers/$tracker" || \
+                AC_MSG_ERROR([state tracker '$tracker' doesn't exist])
+            if test -n "$state_trackers"; then
+                state_trackers="$state_trackers $tracker"
+            else
+                state_trackers="$tracker"
+            fi
+        fi
     done
     GALLIUM_STATE_TRACKERS_DIRS="$state_trackers"
     ;;
 esac
 
 AC_SUBST([VG_LIB_DEPS])
+AC_SUBST([EGL_CLIENT_APIS])
+
+if test "x$HAVE_ST_EGL" = xyes; then
+       GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS egl-apis"
+fi
 
 if test "x$HAVE_ST_XORG" = xyes; then
     PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
@@ -1587,6 +1619,9 @@ if echo "$SRC_DIRS" | grep 'gallium' >/dev/null 2>&1; then
     echo "        Winsys dirs:     $GALLIUM_WINSYS_DIRS"
     echo "        Driver dirs:     $GALLIUM_DRIVERS_DIRS"
     echo "        Trackers dirs:   $GALLIUM_STATE_TRACKERS_DIRS"
+    if test "x$HAVE_ST_EGL" = xyes; then
+        echo "        EGL client APIs: $EGL_CLIENT_APIS"
+    fi
 else
     echo "        Gallium:         no"
 fi
@@ -1597,6 +1632,7 @@ echo "        Shared libs:     $enable_shared"
 echo "        Static libs:     $enable_static"
 if test "$enable_egl" = yes; then
     echo "        EGL:             $EGL_DRIVERS_DIRS"
+    echo "        EGL displays:    $EGL_DISPLAYS"
 else
     echo "        EGL:             no"
 fi
diff --git a/src/gallium/state_trackers/es/Makefile b/src/gallium/state_trackers/es/Makefile
deleted file mode 100644 (file)
index 37a78a5..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-# src/gallium/state_trackers/es/Makefile
-
-# Build the ES 1/2 state tracker libraries
-# This consists of core Mesa ES, plus GL/gallium state tracker.
-
-TOP = ../../../..
-include $(TOP)/configs/current
-
-GLES_1_VERSION_MAJOR = 1
-GLES_1_VERSION_MINOR = 1
-GLES_1_VERSION_PATCH = 0
-
-GLES_2_VERSION_MAJOR = 2
-GLES_2_VERSION_MINOR = 0
-GLES_2_VERSION_PATCH = 0
-
-
-# Maybe move these into configs/default:
-GLES_1_LIB = GLESv1_CM
-GLES_1_LIB_NAME = lib$(GLES_1_LIB).so
-GLES_2_LIB = GLESv2
-GLES_2_LIB_NAME = lib$(GLES_2_LIB).so
-
-
-# These two objects indirectly reference all public functions thanks to the use
-# of _glapi_get_proc_address.
-ES1_OBJECTS = st_es1.o
-ES2_OBJECTS = st_es2.o
-
-
-ES1_LIBS = \
-       $(TOP)/src/mesa/es/libes1gallium.a \
-       $(TOP)/src/mapi/es1api/libes1api.a
-
-ES2_LIBS = \
-       $(TOP)/src/mesa/es/libes2gallium.a \
-       $(TOP)/src/mapi/es2api/libes2api.a
-
-SYS_LIBS = -lm -pthread
-
-
-INCLUDE_DIRS = \
-       -I$(TOP)/include \
-       -I$(TOP)/src/mapi \
-       -I$(TOP)/src/mesa \
-       -I$(TOP)/src/gallium/include
-
-.c.o:
-       $(CC) -c $(INCLUDE_DIRS) $(DEFINES) $(CFLAGS) $< -o $@
-
-
-# Default: make both GL ES 1.1 and GL ES 2.0 libraries
-default: $(TOP)/$(LIB_DIR)/$(GLES_1_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLES_2_LIB_NAME)
-
-# Make the shared libs
-$(TOP)/$(LIB_DIR)/$(GLES_1_LIB_NAME): $(ES1_OBJECTS) $(ES1_LIBS) $(GALLIUM_AUXILIARIES)
-       $(MKLIB) -o $(GLES_1_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
-               -major $(GLES_1_VERSION_MAJOR) \
-               -minor $(GLES_1_VERSION_MINOR) \
-               -patch $(GLES_1_VERSION_PATCH) \
-               -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \
-               $(ES1_OBJECTS) $(ES1_LIBS) $(GALLIUM_AUXILIARIES) $(SYS_LIBS)
-
-$(TOP)/$(LIB_DIR)/$(GLES_2_LIB_NAME): $(ES2_OBJECTS) $(ES1_LIBS) $(GALLIUM_AUXILIARIES)
-       $(MKLIB) -o $(GLES_2_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
-               -major $(GLES_2_VERSION_MAJOR) \
-               -minor $(GLES_2_VERSION_MINOR) \
-               -patch $(GLES_2_VERSION_PATCH) \
-               -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \
-               $(ES2_OBJECTS) $(ES2_LIBS) $(GALLIUM_AUXILIARIES) $(SYS_LIBS)
-
-install: default
-       $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GLES
-       $(INSTALL) -m 644 $(TOP)/include/GLES/*.h $(DESTDIR)$(INSTALL_DIR)/include/GLES
-       $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GLES2
-       $(INSTALL) -m 644 $(TOP)/include/GLES2/*.h $(DESTDIR)$(INSTALL_DIR)/include/GLES2
-       $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
-       $(MINSTALL) $(TOP)/$(LIB_DIR)/libGLESv1* $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
-       $(MINSTALL) $(TOP)/$(LIB_DIR)/libGLESv2* $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
-
-clean:
-       -rm -f *.o *~
-       -rm -f $(TOP)/$(LIB_DIR)/$(GLES_1_LIB_NAME)* $(TOP)/$(LIB_DIR)/$(GLES_2_LIB_NAME)*
-
-depend:
diff --git a/src/gallium/state_trackers/es/st_es1.c b/src/gallium/state_trackers/es/st_es1.c
deleted file mode 100644 (file)
index 825fdac..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#include "state_tracker/st_gl_api.h"
-
-PUBLIC struct st_api *
-st_api_create_OpenGL_ES1()
-{
-   return st_gl_api_create();
-}
diff --git a/src/gallium/state_trackers/es/st_es2.c b/src/gallium/state_trackers/es/st_es2.c
deleted file mode 100644 (file)
index 5c773aa..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#include "state_tracker/st_gl_api.h"
-
-PUBLIC struct st_api *
-st_api_create_OpenGL_ES2()
-{
-   /* linker magic creates different versions */
-   return st_gl_api_create();
-}
index f6c80899ffc09b91609048aa1750c1bb9d26ee48..e0a87151c43f9776d6d259e162daca144120044f 100644 (file)
@@ -3,16 +3,13 @@
 TOP = ../../../..
 include $(TOP)/configs/current
 
-VG_LIB = OpenVG
-VG_LIB_NAME = lib$(VG_LIB).so
+LIBNAME = vega
 
-VG_MAJOR = 1
-VG_MINOR = 0
-VG_TINY = 0
-
-### Lists of source files, included by Makefiles
+LIBRARY_INCLUDES = \
+       -I$(TOP)/include \
+       -I$(TOP)/src/mapi
 
-VG_SOURCES = \
+C_SOURCES = \
            api.c           \
            api_context.c   \
            api_filters.c   \
@@ -41,56 +38,4 @@ VG_SOURCES = \
            shader.c \
            shaders_cache.c
 
-VG_OBJECTS = $(VG_SOURCES:.c=.o)
-
-VG_LIBS = $(GALLIUM_AUXILIARIES) $(TOP)/src/mapi/vgapi/libvgapi.a
-VG_LIB_DEPS = $(EXTRA_LIB_PATH) -lm
-
-### Include directories
-
-INCLUDE_DIRS = \
-       -I$(TOP)/include \
-       -I$(TOP)/src/mapi \
-       -I$(TOP)/src/gallium/include \
-       -I$(TOP)/src/gallium/auxiliary
-
-
-.c.o:
-       $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
-
-default: depend $(TOP)/$(LIB_DIR)/$(VG_LIB_NAME)
-
-# Make the OpenVG library
-$(TOP)/$(LIB_DIR)/$(VG_LIB_NAME): $(VG_OBJECTS) $(VG_LIBS)
-       $(MKLIB) -o $(VG_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
-               -major $(VG_MAJOR) \
-               -minor $(VG_MINOR) \
-               -patch $(VG_TINY) \
-               -install $(TOP)/$(LIB_DIR) \
-               $(VG_OBJECTS) $(VG_LIBS) $(VG_LIB_DEPS)
-
-######################################################################
-# Generic stuff
-
-depend: $(VG_SOURCES)
-       @ echo "running $(MKDEP)"
-       @ rm -f depend  # workaround oops on gutsy?!?
-       @ touch depend
-       @ $(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) $(VG_SOURCES) \
-               > /dev/null 2>/dev/null
-
-install: default
-       $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/VG
-       $(INSTALL) -m 644 $(TOP)/include/VG/*.h $(DESTDIR)$(INSTALL_DIR)/include/VG
-       $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
-       $(MINSTALL) $(TOP)/$(LIB_DIR)/libOpenVG* $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
-
-# Emacs tags
-tags:
-       etags `find . -name \*.[ch]` $(TOP)/include/VG/*.h
-
-clean:
-       rm -f $(VG_OBJECTS)
-       rm -f depend depend.bak
-
-sinclude depend
+include ../../Makefile.template
diff --git a/src/gallium/state_trackers/vega/vg_api.h b/src/gallium/state_trackers/vega/vg_api.h
new file mode 100644 (file)
index 0000000..ce2a0d6
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Mesa 3-D graphics library
+ * Version:  7.9
+ *
+ * Copyright (C) 2010 LunarG Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Authors:
+ *    Chia-I Wu <olv@lunarg.com>
+ */
+
+#ifndef VG_API_H
+#define VG_API_H
+
+struct st_api;
+
+const struct st_api *
+vg_api_get(void);
+
+#endif /* VG_API_H */
index 9671bbed6cff720f4086741efd75b14727b0c552..f1bc57878557b22f7cd3eeb489af7dfbdabfc62e 100644 (file)
@@ -36,6 +36,7 @@
 #include "util/u_format.h"
 #include "util/u_sampler.h"
 
+#include "vg_api.h"
 #include "vg_manager.h"
 #include "vg_context.h"
 #include "image.h"
@@ -543,10 +544,9 @@ vg_api_get_proc_address(struct st_api *stapi, const char *procname)
 static void
 vg_api_destroy(struct st_api *stapi)
 {
-   free(stapi);
 }
 
-struct st_api st_vg_api = {
+static const struct st_api vg_api = {
    vg_api_destroy,
    vg_api_get_proc_address,
    vg_api_is_visual_supported,
@@ -555,8 +555,8 @@ struct st_api st_vg_api = {
    vg_api_get_current,
 };
 
-struct st_api *
-st_api_create_OpenVG(void)
+const struct st_api *
+vg_api_get(void)
 {
-   return &st_vg_api;
+   return &vg_api;
 }
diff --git a/src/gallium/targets/egl-apis/Makefile b/src/gallium/targets/egl-apis/Makefile
new file mode 100644 (file)
index 0000000..15556a1
--- /dev/null
@@ -0,0 +1,67 @@
+# src/gallium/targets/egl-apis
+
+TOP = ../../../..
+include $(TOP)/configs/current
+
+OUTPUT_PREFIX := api_
+OUTPUT_PATH := $(TOP)/$(LIB_DIR)/egl
+
+OUTPUTS := $(addsuffix .so, $(EGL_CLIENT_APIS))
+OUTPUTS := $(addprefix $(OUTPUT_PATH)/$(OUTPUT_PREFIX), $(OUTPUTS))
+
+# include dirs
+GL_INCLUDES := -I$(TOP)/src/mesa -I$(TOP)/src/gallium/include
+GLESv1_CM_INCLUDES := $(GL_INCLUDES)
+GLESv2_INCLUDES := $(GL_INCLUDES)
+OpenVG_INCLUDES := -I$(TOP)/src/gallium/state_trackers/vega -I$(TOP)/src/gallium/include
+
+# system libs
+GL_SYS := -lpthread -lm -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
+GLESv1_CM_SYS := -lpthread -lm -L$(TOP)/$(LIB_DIR) -l$(GLESv1_CM_LIB)
+GLESv2_SYS := -lpthread -lm -L$(TOP)/$(LIB_DIR) -l$(GLESv2_LIB)
+OpenVG_SYS := -lm -L$(TOP)/$(LIB_DIR) -l$(VG_LIB)
+
+# project libs
+GL_LIBS := $(TOP)/src/mesa/libmesagallium.a
+GLESv1_CM_LIBS := $(TOP)/src/mesa/es/libes1gallium.a
+GLESv2_LIBS := $(TOP)/src/mesa/es/libes2gallium.a
+OpenVG_LIBS := $(TOP)/src/gallium/state_trackers/vega/libvega.a
+
+# objects
+GL_OBJECTS := api_GL.o
+GLESv1_CM_OBJECTS := api_GLESv1_CM.o
+GLESv2_OBJECTS := api_GLESv2.o
+OpenVG_OBJECTS := api_OpenVG.o
+
+default: $(OUTPUTS)
+
+api_%.o: api_%.c
+       $(CC) -c -o $@ $< $($*_INCLUDES) $(DEFINES) $(CFLAGS)
+
+define mklib
+$(MKLIB) -o $(notdir $@) -noprefix -linker '$(CC)' -ldflags '$(LDFLAGS)' \
+       -install $(OUTPUT_PATH) $(MKLIB_OPTIONS) \
+       $($(1)_OBJECTS) $($(1)_LIBS) $(GALLIUM_AUXILIARIES) $($(1)_SYS)
+endef
+
+$(OUTPUT_PATH)/$(OUTPUT_PREFIX)$(GL_LIB).so: $(GL_OBJECTS) $(GL_LIBS)
+       $(call mklib,GL)
+
+$(OUTPUT_PATH)/$(OUTPUT_PREFIX)$(GLESv1_CM_LIB).so: $(GLESv1_CM_OBJECTS) $(GLESv1_CM_LIBS)
+       $(call mklib,GLESv1_CM)
+
+$(OUTPUT_PATH)/$(OUTPUT_PREFIX)$(GLESv2_LIB).so: $(GLESv2_OBJECTS) $(GLESv2_LIBS)
+       $(call mklib,GLESv2)
+
+$(OUTPUT_PATH)/$(OUTPUT_PREFIX)$(VG_LIB).so: $(OpenVG_OBJECTS) $(OpenVG_LIBS)
+       $(call mklib,OpenVG)
+
+install: $(OUTPUTS)
+       $(INSTALL) -d $(DESTDIR)$(EGL_DRIVER_INSTALL_DIR)
+       for out in $(OUTPUTS); do \
+               $(MINSTALL) -m 755 "$$out" $(DESTDIR)$(EGL_DRIVER_INSTALL_DIR); \
+       done
+
+clean:
+       -rm -f $(OUTPUTS)
+       -rm -f *.o
diff --git a/src/gallium/targets/egl-apis/api_GL.c b/src/gallium/targets/egl-apis/api_GL.c
new file mode 100644 (file)
index 0000000..6d17274
--- /dev/null
@@ -0,0 +1,7 @@
+#include "state_tracker/st_gl_api.h"
+
+PUBLIC struct st_api *
+st_api_create_OpenGL()
+{
+   return st_gl_api_create();
+}
diff --git a/src/gallium/targets/egl-apis/api_GLESv1_CM.c b/src/gallium/targets/egl-apis/api_GLESv1_CM.c
new file mode 100644 (file)
index 0000000..825fdac
--- /dev/null
@@ -0,0 +1,7 @@
+#include "state_tracker/st_gl_api.h"
+
+PUBLIC struct st_api *
+st_api_create_OpenGL_ES1()
+{
+   return st_gl_api_create();
+}
diff --git a/src/gallium/targets/egl-apis/api_GLESv2.c b/src/gallium/targets/egl-apis/api_GLESv2.c
new file mode 100644 (file)
index 0000000..5c773aa
--- /dev/null
@@ -0,0 +1,8 @@
+#include "state_tracker/st_gl_api.h"
+
+PUBLIC struct st_api *
+st_api_create_OpenGL_ES2()
+{
+   /* linker magic creates different versions */
+   return st_gl_api_create();
+}
diff --git a/src/gallium/targets/egl-apis/api_OpenVG.c b/src/gallium/targets/egl-apis/api_OpenVG.c
new file mode 100644 (file)
index 0000000..f85ebea
--- /dev/null
@@ -0,0 +1,8 @@
+#include "state_tracker/st_api.h"
+#include "vg_api.h"
+
+PUBLIC struct st_api *
+st_api_create_OpenVG()
+{
+   return (struct st_api *) vg_api_get();
+}