diff options
author | Kristian Høgsberg <krh@bitplanet.net> | 2010-02-11 17:45:24 -0500 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2010-02-24 14:28:41 -0500 |
commit | 79cbcb663d738b424466219cf8a1221eac106a6f (patch) | |
tree | 164e22503c8c4a3d66dfe7684e5e214f75f0ff42 /include/GL/internal | |
parent | ccd78fed880c4c8f1fccf1d10fc46442fa146359 (diff) |
dri_interface.h: Add DRI image and eglImageLookup extensions
These are used for implementing the various EGLImage extensions.
Diffstat (limited to 'include/GL/internal')
-rw-r--r-- | include/GL/internal/dri_interface.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h index cb99c270f5..1d4e82e154 100644 --- a/include/GL/internal/dri_interface.h +++ b/include/GL/internal/dri_interface.h @@ -751,4 +751,59 @@ struct __DRIdri2ExtensionRec { }; + +/** + * This extension provides functionality to enable various EGLImage + * extensions. + */ +#define __DRI_IMAGE "DRI_IMAGE" +#define __DRI_IMAGE_VERSION 1 + +/** + * These formats correspond to the similarly named MESA_FORMAT_* + * tokens, except in the native endian of the CPU. For example, on + * little endian __DRI_IMAGE_FORMAT_XRGB8888 corresponds to + * MESA_FORMAT_XRGB8888, but MESA_FORMAT_XRGB8888_REV on big endian. + */ +#define __DRI_IMAGE_FORMAT_RGB565 0x1001 +#define __DRI_IMAGE_FORMAT_XRGB8888 0x1002 +#define __DRI_IMAGE_FORMAT_ARGB8888 0x1003 + +typedef struct __DRIimageRec __DRIimage; +typedef struct __DRIimageExtensionRec __DRIimageExtension; +struct __DRIimageExtensionRec { + __DRIextension base; + + __DRIimage *(*createImageFromName)(__DRIcontext *context, + int width, int height, int format, + int name, int pitch, + void *loaderPrivate); + + __DRIimage *(*createImageFromRenderbuffer)(__DRIcontext *context, + int renderbuffer, + void *loaderPrivate); + + void (*destroyImage)(__DRIimage *image); +}; + +/** + * This extension must be implemented by the loader and passed to the + * driver at screen creation time. The EGLImage entry points in the + * various client APIs take opaque EGLImage handles and use this + * extension to map them to a __DRIimage. At version 1, this + * extensions allows mapping EGLImage pointers to __DRIimage pointers, + * but future versions could support other EGLImage-like, opaque types + * with new lookup functions. + */ +#define __DRI_IMAGE_LOOKUP "DRI_IMAGE_LOOKUP" +#define __DRI_IMAGE_LOOKUP_VERSION 1 + +typedef struct __DRIimageLookupExtensionRec __DRIimageLookupExtension; +struct __DRIimageLookupExtensionRec { + __DRIextension base; + + __DRIimage *(*lookupEGLImage)(__DRIcontext *context, void *image, + void *loaderPrivate); +}; + #endif |