summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2009-09-12 12:01:52 -0400
committerKristian Høgsberg <krh@redhat.com>2009-09-12 12:01:52 -0400
commit7d7d666b72257dee01379fe96be177984337f52b (patch)
treee03653d54c5de0660aabc88b8987a24141c963fa
parent433faebf56ad3057cf49886ce6cefc949aef1362 (diff)
Add hack to export fbo gem integration entry points.
-rw-r--r--eagle.c56
-rw-r--r--eagle.h12
2 files changed, 68 insertions, 0 deletions
diff --git a/eagle.c b/eagle.c
index 959187b..38b6116 100644
--- a/eagle.c
+++ b/eagle.c
@@ -41,6 +41,41 @@ static EGLint lastError;
static EGLContext currentContext;
static void
+(*_mesa_TextureExternalMESA)(GLint target,
+ GLint glx_texture_format,
+ GLuint cpp,
+ GLuint width, GLuint height,
+ GLuint pitch, GLuint handle);
+static void
+(*_mesa_RenderbufferExternalMESA)(GLint target,
+ GLint internalFormat,
+ GLuint width, GLuint height,
+ GLuint pitch, GLuint handle);
+
+EAGLE_EXPORT void
+glTextureExternalMESA(GLint target,
+ GLint glx_texture_format,
+ GLuint cpp,
+ GLuint width, GLuint height,
+ GLuint pitch, GLuint handle)
+{
+ _mesa_TextureExternalMESA(target, glx_texture_format, cpp,
+ width, height, pitch, handle);
+}
+
+EAGLE_EXPORT void
+glRenderbufferExternalMESA(GLint target,
+ GLint internalFormat,
+ GLuint width, GLuint height,
+ GLuint pitch, GLuint handle)
+{
+ _mesa_RenderbufferExternalMESA(target, internalFormat,
+ width, height, pitch, handle);
+}
+
+
+
+static void
eglSetError(EGLint error)
{
lastError = error;
@@ -105,6 +140,25 @@ static const __DRIextension *eglLoaderExtensions[] = {
static const char driDriverPath[] = EAGLE_DRIVER_PATH;
+static void
+lookup_hacks(EGLDisplay display)
+{
+ _mesa_TextureExternalMESA =
+ dlsym(display->driver, "_mesa_TextureExternalMESA");
+ if (_mesa_TextureExternalMESA == NULL) {
+ fprintf(stderr, "_mesa_TextureExternalMESA not found\n");
+ exit(1);
+ }
+
+ _mesa_RenderbufferExternalMESA =
+ dlsym(display->driver, "_mesa_RenderbufferExternalMESA");
+ if (_mesa_RenderbufferExternalMESA == NULL) {
+ fprintf(stderr, "_mesa_RenderbufferExternalMESA not found\n");
+ exit(1);
+ }
+
+}
+
static int
eglLoadDriver(EGLDisplay display, const char *driverName)
{
@@ -131,6 +185,8 @@ eglLoadDriver(EGLDisplay display, const char *driverName)
return -1;
}
+ lookup_hacks(display);
+
extensions = dlsym(display->driver, __DRI_DRIVER_EXTENSIONS);
if (extensions == NULL) {
fprintf(stderr, "dlsym: %s\n", dlerror());
diff --git a/eagle.h b/eagle.h
index 9c0b9a7..73a2651 100644
--- a/eagle.h
+++ b/eagle.h
@@ -342,4 +342,16 @@ extern EGLBoolean eglSwapInterval(EGLDisplay dpy,
extern void (*eglGetProcAddress(const char *procname))(void);
+
+extern void glTextureExternalMESA(GLint target,
+ GLint glx_texture_format,
+ GLuint cpp,
+ GLuint width, GLuint height,
+ GLuint pitch, GLuint handle);
+
+extern void glRenderbufferExternalMESA(GLint target,
+ GLint internalFormat,
+ GLuint width, GLuint height,
+ GLuint pitch, GLuint handle);
+
#endif