diff options
author | Abdiel Janulgue <[email protected]> | 2012-11-27 15:19:54 +0200 |
---|---|---|
committer | Chad Versace <[email protected]> | 2013-02-01 11:58:12 -0800 |
commit | 7b7af48e010565cdd11f486c000fd929b6ca99f1 (patch) | |
tree | 3293936e5e5c87b61fdcf6743155111a5bbac594 /include/GL | |
parent | a8a5055f2dea1960898763d17f28043577c3e64e (diff) |
dri2: Create image from texture
Add create image from texture extension and bump version.
v8: - Add appropriate image errors codes in DRI interface so we don't
have to use internal EGL functions in driver. Suggested by Chad Versace.
Reviewed-by: Eric Anholt <[email protected]> (v6)
Reviewed-by: Chad Versace <[email protected]> (v8)
Signed-off-by: Abdiel Janulgue <[email protected]>
Diffstat (limited to 'include/GL')
-rw-r--r-- | include/GL/internal/dri_interface.h | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h index c236cb732fd..42147e90ebd 100644 --- a/include/GL/internal/dri_interface.h +++ b/include/GL/internal/dri_interface.h @@ -938,7 +938,7 @@ struct __DRIdri2ExtensionRec { * extensions. */ #define __DRI_IMAGE "DRI_IMAGE" -#define __DRI_IMAGE_VERSION 5 +#define __DRI_IMAGE_VERSION 6 /** * These formats correspond to the similarly named MESA_FORMAT_* @@ -1022,6 +1022,23 @@ struct __DRIdri2ExtensionRec { #define __DRI_IMAGE_ATTRIB_HEIGHT 0x2005 #define __DRI_IMAGE_ATTRIB_COMPONENTS 0x2006 /* available in versions 5+ */ +/** + * \name Reasons that __DRIimageExtensionRec::createImageFromTexture might fail + */ +/*@{*/ +/** Success! */ +#define __DRI_IMAGE_ERROR_SUCCESS 0 + +/** Memory allocation failure */ +#define __DRI_IMAGE_ERROR_BAD_ALLOC 1 + +/** Client requested an invalid attribute for a texture object */ +#define __DRI_IMAGE_ERROR_BAD_MATCH 2 + +/** Client requested an invalid texture object */ +#define __DRI_IMAGE_ERROR_BAD_PARAMETER 3 +/*@}*/ + typedef struct __DRIimageRec __DRIimage; typedef struct __DRIimageExtensionRec __DRIimageExtension; struct __DRIimageExtensionRec { @@ -1087,6 +1104,19 @@ struct __DRIimageExtensionRec { */ __DRIimage *(*fromPlanar)(__DRIimage *image, int plane, void *loaderPrivate); + + /** + * Create image from texture. + * + * \since 6 + */ + __DRIimage *(*createImageFromTexture)(__DRIcontext *context, + int target, + unsigned texture, + int depth, + int level, + unsigned *error, + void *loaderPrivate); }; |