diff options
Diffstat (limited to 'mesalib/include/GL/internal')
-rw-r--r-- | mesalib/include/GL/internal/dri_interface.h | 74 | ||||
-rw-r--r-- | mesalib/include/GL/internal/glcore.h | 4 |
2 files changed, 73 insertions, 5 deletions
diff --git a/mesalib/include/GL/internal/dri_interface.h b/mesalib/include/GL/internal/dri_interface.h index 910c9166b..1d4e82e15 100644 --- a/mesalib/include/GL/internal/dri_interface.h +++ b/mesalib/include/GL/internal/dri_interface.h @@ -230,6 +230,13 @@ struct __DRItexOffsetExtensionRec { }; +/* Valid values for format in the setTexBuffer2 function below. These + * values match the GLX tokens for compatibility reasons, but we + * define them here since the DRI interface can't depend on GLX. */ +#define __DRI_TEXTURE_FORMAT_NONE 0x20D8 +#define __DRI_TEXTURE_FORMAT_RGB 0x20D9 +#define __DRI_TEXTURE_FORMAT_RGBA 0x20DA + #define __DRI_TEX_BUFFER "DRI_TexBuffer" #define __DRI_TEX_BUFFER_VERSION 2 struct __DRItexBufferExtensionRec { @@ -262,10 +269,20 @@ struct __DRItexBufferExtensionRec { * Used by drivers that implement DRI2 */ #define __DRI2_FLUSH "DRI2_Flush" -#define __DRI2_FLUSH_VERSION 1 +#define __DRI2_FLUSH_VERSION 3 struct __DRI2flushExtensionRec { __DRIextension base; void (*flush)(__DRIdrawable *drawable); + + /** + * Ask the driver to call getBuffers/getBuffersWithFormat before + * it starts rendering again. + * + * \param drawable the drawable to invalidate + * + * \since 3 + */ + void (*invalidate)(__DRIdrawable *drawable); }; @@ -734,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 diff --git a/mesalib/include/GL/internal/glcore.h b/mesalib/include/GL/internal/glcore.h index 18f657662..547b11137 100644 --- a/mesalib/include/GL/internal/glcore.h +++ b/mesalib/include/GL/internal/glcore.h @@ -178,8 +178,4 @@ typedef struct __GLcontextModesRec { #define GLX_TEXTURE_2D_BIT_EXT 0x00000002 #define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004 -#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8 -#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9 -#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA - #endif /* __gl_core_h_ */ |