8 #ifdef EGL_KHR_image_base
12 * Parse the list of image attributes and return the proper error code.
15 _eglParseImageAttribList(_EGLImageAttribs
*attrs
, _EGLDisplay
*dpy
,
16 const EGLint
*attrib_list
)
18 EGLint i
, err
= EGL_SUCCESS
;
22 memset(attrs
, 0, sizeof(attrs
));
23 attrs
->ImagePreserved
= EGL_FALSE
;
24 attrs
->GLTextureLevel
= 0;
25 attrs
->GLTextureZOffset
= 0;
30 for (i
= 0; attrib_list
[i
] != EGL_NONE
; i
++) {
31 EGLint attr
= attrib_list
[i
++];
32 EGLint val
= attrib_list
[i
];
35 /* EGL_KHR_image_base */
36 case EGL_IMAGE_PRESERVED_KHR
:
37 attrs
->ImagePreserved
= val
;
40 /* EGL_KHR_gl_image */
41 case EGL_GL_TEXTURE_LEVEL_KHR
:
42 attrs
->GLTextureLevel
= val
;
44 case EGL_GL_TEXTURE_ZOFFSET_KHR
:
45 attrs
->GLTextureZOffset
= val
;
48 /* EGL_MESA_drm_image */
55 case EGL_DRM_BUFFER_FORMAT_MESA
:
56 attrs
->DRMBufferFormatMESA
= val
;
58 case EGL_DRM_BUFFER_USE_MESA
:
59 attrs
->DRMBufferUseMESA
= val
;
61 case EGL_DRM_BUFFER_STRIDE_MESA
:
62 attrs
->DRMBufferStrideMESA
= val
;
66 /* unknown attrs are ignored */
70 if (err
!= EGL_SUCCESS
) {
71 _eglLog(_EGL_DEBUG
, "bad image attribute 0x%04x", attr
);
81 _eglInitImage(_EGLImage
*img
, _EGLDisplay
*dpy
)
83 _eglInitResource(&img
->Resource
, sizeof(*img
), dpy
);
89 #endif /* EGL_KHR_image_base */