summaryrefslogtreecommitdiffstats
path: root/src/egl/drivers/dri2/egl_dri2.c
diff options
context:
space:
mode:
authorAnatoli Antonovitch <[email protected]>2015-06-10 14:42:31 +0200
committerMarek Olšák <[email protected]>2015-07-03 16:23:28 +0200
commitb193f2b9b6ae4d071e2cdef62d4398fec5d9aad8 (patch)
tree805c34dadd920a99f1ce8340adcdf9a44e7f1d53 /src/egl/drivers/dri2/egl_dri2.c
parenta84505c71920f2c70bc8d83cee3e223cd2d976ad (diff)
egl: implement EGL_KHR_gl_texture_3D_image
Most of the code has been in place already.
Diffstat (limited to 'src/egl/drivers/dri2/egl_dri2.c')
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 223cc5c5fbf..400ee635e77 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -1566,9 +1566,15 @@ dri2_create_image_khr_texture(_EGLDisplay *disp, _EGLContext *ctx,
gl_target = GL_TEXTURE_2D;
break;
case EGL_GL_TEXTURE_3D_KHR:
- depth = attrs.GLTextureZOffset;
- gl_target = GL_TEXTURE_3D;
- break;
+ if (disp->Extensions.KHR_gl_texture_3D_image) {
+ depth = attrs.GLTextureZOffset;
+ gl_target = GL_TEXTURE_3D;
+ break;
+ }
+ else {
+ _eglError(EGL_BAD_PARAMETER, "dri2_create_image_khr");
+ return EGL_NO_IMAGE_KHR;
+ }
case EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR:
case EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR:
case EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y_KHR:
@@ -1868,6 +1874,14 @@ dri2_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp,
case EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z_KHR:
case EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR:
return dri2_create_image_khr_texture(disp, ctx, target, buffer, attr_list);
+ case EGL_GL_TEXTURE_3D_KHR:
+ if (disp->Extensions.KHR_gl_texture_3D_image) {
+ return dri2_create_image_khr_texture(disp, ctx, target, buffer, attr_list);
+ }
+ else {
+ _eglError(EGL_BAD_PARAMETER, "dri2_create_image_khr");
+ return EGL_NO_IMAGE_KHR;
+ }
case EGL_GL_RENDERBUFFER_KHR:
return dri2_create_image_khr_renderbuffer(disp, ctx, buffer, attr_list);
#ifdef HAVE_LIBDRM