Mesa (master): st/egl: Make api_OpenGL support OpenGL ES.

Chia-I Wu olv at kemper.freedesktop.org
Tue Jun 29 02:17:25 PDT 2010


Module: Mesa
Branch: master
Commit: f9574c5f890f3205efa4ab4ff509223e2a7c6b74
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f9574c5f890f3205efa4ab4ff509223e2a7c6b74

Author: Chia-I Wu <olv at lunarg.com>
Date:   Wed Jun 23 17:45:06 2010 +0800

st/egl: Make api_OpenGL support OpenGL ES.

This allows api_OpenGL.so to support OpenGL ES.

---

 src/gallium/targets/egl-apis/Makefile        |    8 +++++++-
 src/gallium/targets/egl-apis/api_GL.c        |   20 +++++++++++++++++++-
 src/gallium/targets/egl-apis/api_GLESv1_CM.c |    4 ++--
 src/gallium/targets/egl-apis/api_GLESv2.c    |    5 ++---
 src/gallium/targets/egl-apis/api_OpenVG.c    |    2 +-
 5 files changed, 31 insertions(+), 8 deletions(-)

diff --git a/src/gallium/targets/egl-apis/Makefile b/src/gallium/targets/egl-apis/Makefile
index 88915bf..1275cc7 100644
--- a/src/gallium/targets/egl-apis/Makefile
+++ b/src/gallium/targets/egl-apis/Makefile
@@ -15,6 +15,12 @@ GLESv1_CM_INCLUDES := $(GL_INCLUDES)
 GLESv2_INCLUDES := $(GL_INCLUDES)
 OpenVG_INCLUDES := -I$(TOP)/src/gallium/state_trackers/vega -I$(TOP)/src/gallium/include
 
+# cflags
+GL_CFLAGS := $(API_DEFINES)
+GLESv1_CM_CFLAGS :=
+GLESv2_CFLAGS :=
+OpenVG_CFLAGS :=
+
 # 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)
@@ -46,7 +52,7 @@ OpenVG_OBJECTS := api_OpenVG.o
 default: $(OUTPUTS)
 
 api_%.o: api_%.c
-	$(CC) -c -o $@ $< $($*_INCLUDES) $(DEFINES) $(CFLAGS)
+	$(CC) -c -o $@ $< $($*_INCLUDES) $($*_CFLAGS) $(DEFINES) $(CFLAGS)
 
 define mklib
 $(MKLIB) -o $(notdir $@) -noprefix -linker '$(CC)' -ldflags '$(LDFLAGS)' \
diff --git a/src/gallium/targets/egl-apis/api_GL.c b/src/gallium/targets/egl-apis/api_GL.c
index 6d17274..676300b 100644
--- a/src/gallium/targets/egl-apis/api_GL.c
+++ b/src/gallium/targets/egl-apis/api_GL.c
@@ -1,7 +1,25 @@
 #include "state_tracker/st_gl_api.h"
 
+#if FEATURE_GL
 PUBLIC struct st_api *
-st_api_create_OpenGL()
+st_api_create_OpenGL(void)
 {
    return st_gl_api_create();
 }
+#endif
+
+#if FEATURE_ES1
+PUBLIC struct st_api *
+st_api_create_OpenGL_ES1(void)
+{
+   return st_gl_api_create_es1();
+}
+#endif
+
+#if FEATURE_ES2
+PUBLIC struct st_api *
+st_api_create_OpenGL_ES2(void)
+{
+   return st_gl_api_create_es2();
+}
+#endif
diff --git a/src/gallium/targets/egl-apis/api_GLESv1_CM.c b/src/gallium/targets/egl-apis/api_GLESv1_CM.c
index 825fdac..0c8de89 100644
--- a/src/gallium/targets/egl-apis/api_GLESv1_CM.c
+++ b/src/gallium/targets/egl-apis/api_GLESv1_CM.c
@@ -1,7 +1,7 @@
 #include "state_tracker/st_gl_api.h"
 
 PUBLIC struct st_api *
-st_api_create_OpenGL_ES1()
+st_api_create_OpenGL_ES1(void)
 {
-   return st_gl_api_create();
+   return st_gl_api_create_es1();
 }
diff --git a/src/gallium/targets/egl-apis/api_GLESv2.c b/src/gallium/targets/egl-apis/api_GLESv2.c
index 5c773aa..87b3e65 100644
--- a/src/gallium/targets/egl-apis/api_GLESv2.c
+++ b/src/gallium/targets/egl-apis/api_GLESv2.c
@@ -1,8 +1,7 @@
 #include "state_tracker/st_gl_api.h"
 
 PUBLIC struct st_api *
-st_api_create_OpenGL_ES2()
+st_api_create_OpenGL_ES2(void)
 {
-   /* linker magic creates different versions */
-   return st_gl_api_create();
+   return st_gl_api_create_es2();
 }
diff --git a/src/gallium/targets/egl-apis/api_OpenVG.c b/src/gallium/targets/egl-apis/api_OpenVG.c
index f85ebea..e29a237 100644
--- a/src/gallium/targets/egl-apis/api_OpenVG.c
+++ b/src/gallium/targets/egl-apis/api_OpenVG.c
@@ -2,7 +2,7 @@
 #include "vg_api.h"
 
 PUBLIC struct st_api *
-st_api_create_OpenVG()
+st_api_create_OpenVG(void)
 {
    return (struct st_api *) vg_api_get();
 }



More information about the mesa-commit mailing list