EXT(ATI_texture_float , ARB_texture_float , GLL, GLC, x , x , 2002)
EXT(ATI_texture_mirror_once , ATI_texture_mirror_once , GLL, GLC, x , x , 2006)
+EXT(EXT_EGL_image_storage , EXT_EGL_image_storage , GLL, GLC , x , 30, 2018)
EXT(EXT_EGL_sync , dummy_true , GLL, GLC, x , x , 2019)
EXT(EXT_abgr , dummy_true , GLL, GLC, x , x , 1995)
EXT(EXT_base_instance , ARB_base_instance , x , x , x , 30, 2014)
{ "glEGLImageTargetRenderbufferStorageOES", 31, -1 },
{ "glEGLImageTargetTexture2DOES", 31, -1 },
+ /* EXT_EGL_image_storage */
+ { "glEGLImageTargetTexStorageEXT", 31, -1 },
+ { "glEGLImageTargetTextureStorageEXT", 31, -1 },
+
/* GL 3.2 */
{ "glGetInteger64i_v", 32, -1 },
{ "glGetBufferParameteri64v", 32, -1 },
{ "glFramebufferParameteriMESA", 30, -1 },
{ "glGetFramebufferParameterivMESA", 30, -1 },
+ /* EXT_EGL_image_storage */
+ { "glEGLImageTargetTexStorageEXT", 30, -1 },
+
{ NULL, 0, -1 }
};
}
/*
- * Helper used by __mesa_EGLImageTargetTexture2DOES.
+ * Helper used by __mesa_EGLImageTargetTexture2DOES and
+ * _mesa_EGLImageTargetTexStorageEXT.
*/
static void
egl_image_target_texture(struct gl_context *ctx,
struct gl_texture_object *texObj, GLenum target,
- GLeglImageOES image, const char *caller)
+ GLeglImageOES image, bool tex_storage,
+ const char *caller)
{
struct gl_texture_image *texImage;
bool valid_target;
switch (target) {
case GL_TEXTURE_2D:
- valid_target = _mesa_has_OES_EGL_image(ctx);
+ valid_target = _mesa_has_OES_EGL_image(ctx) ||
+ (tex_storage && _mesa_has_EXT_EGL_image_storage(ctx));
break;
case GL_TEXTURE_EXTERNAL_OES:
valid_target =
}
if (!image) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "%s(image=%p)", caller, image);
+ _mesa_error(ctx, GL_INVALID_VALUE, "%s(image=%p)", caller, image);
return;
}
} else {
ctx->Driver.FreeTextureImageBuffer(ctx, texImage);
- ctx->Driver.EGLImageTargetTexture2D(ctx, target,
- texObj, texImage, image);
+ if (tex_storage) {
+ ctx->Driver.EGLImageTargetTexStorage(ctx, target, texObj, texImage,
+ image);
+ } else {
+ ctx->Driver.EGLImageTargetTexture2D(ctx, target, texObj, texImage,
+ image);
+ }
_mesa_dirty_texobj(ctx, texObj);
}
+
+ if (tex_storage)
+ _mesa_set_texture_view_state(ctx, texObj, target, 1);
+
_mesa_unlock_texture(ctx, texObj);
}
return;
}
- egl_image_target_texture(ctx, texObj, target, image, func);
+ egl_image_target_texture(ctx, texObj, target, image, false, func);
+}
+
+static void
+egl_image_target_texture_storage(struct gl_context *ctx,
+ struct gl_texture_object *texObj, GLenum target,
+ GLeglImageOES image, const GLint *attrib_list,
+ const char *caller)
+{
+ /*
+ * EXT_EGL_image_storage:
+ *
+ * "<attrib_list> must be NULL or a pointer to the value GL_NONE."
+ */
+ if (attrib_list && attrib_list[0] != GL_NONE) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "%s(image=%p)", caller, image);
+ return;
+ }
+
+ switch (target) {
+ case GL_TEXTURE_2D:
+ case GL_TEXTURE_EXTERNAL_OES:
+ break;
+ default:
+ /*
+ * The EXT_EGL_image_storage spec allows for many other targets besides
+ * GL_TEXTURE_2D and GL_TEXTURE_EXTERNAL_OES, however these are complicated
+ * to implement.
+ */
+ _mesa_error(ctx, GL_INVALID_OPERATION, "%s(unsupported target=%d)",
+ caller, target);
+ return;
+ }
+
+ egl_image_target_texture(ctx, texObj, target, image, true, caller);
+}
+
+
+void GLAPIENTRY
+_mesa_EGLImageTargetTexStorageEXT(GLenum target, GLeglImageOES image,
+ const GLint *attrib_list)
+{
+ struct gl_texture_object *texObj;
+ const char *func = "glEGLImageTargetTexStorageEXT";
+ GET_CURRENT_CONTEXT(ctx);
+
+ texObj = _mesa_get_current_tex_object(ctx, target);
+ if (!texObj) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "%s(target=%d)", func, target);
+ return;
+ }
+
+ egl_image_target_texture_storage(ctx, texObj, target, image, attrib_list,
+ func);
+}
+
+void GLAPIENTRY
+_mesa_EGLImageTargetTextureStorageEXT(GLuint texture, GLeglImageOES image,
+ const GLint *attrib_list)
+{
+ struct gl_texture_object *texObj;
+ const char *func = "glEGLImageTargetTextureStorageEXT";
+ GET_CURRENT_CONTEXT(ctx);
+
+ if (!(_mesa_is_desktop_gl(ctx) && ctx->Version >= 45) &&
+ !_mesa_has_ARB_direct_state_access(ctx) &&
+ !_mesa_has_EXT_direct_state_access(ctx)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "direct access not supported");
+ return;
+ }
+
+ texObj = _mesa_lookup_texture_err(ctx, texture, func);
+ if (!texObj)
+ return;
+
+ egl_image_target_texture_storage(ctx, texObj, texObj->Target, image,
+ attrib_list, func);
}
/**