Commit 6c978b13 authored by Gurchetan Singh's avatar Gurchetan Singh 💬 Committed by Marge Bot

st/mesa: implement EGLImageTargetTexStorage

We can now support this extension.
Acked-by: default avatarMarek Olšák <marek.olsak@amd.com>
Tested-by: Marge Bot <!3375>
Part-of: <!3375>
parent 2f1032f8
Pipeline #97365 passed with stages
in 12 minutes and 35 seconds
......@@ -268,10 +268,22 @@ st_bind_egl_image(struct gl_context *ctx,
break;
default:
texFormat = st_pipe_format_to_mesa_format(stimg->format);
/* Use previously derived internalformat as specified by
* EXT_EGL_image_storage.
*/
if (tex_storage && texObj->Target == GL_TEXTURE_2D
&& stimg->internalformat) {
internalFormat = stimg->internalformat;
if (internalFormat == GL_NONE) {
_mesa_error(ctx, GL_INVALID_OPERATION, __func__);
return;
}
}
break;
}
assert(texFormat != MESA_FORMAT_NONE);
/* Minify texture size based on level set on the EGLImage. */
uint32_t width = u_minify(stimg->texture->width0, stimg->level);
uint32_t height = u_minify(stimg->texture->height0, stimg->level);
......@@ -308,9 +320,26 @@ st_egl_image_target_texture_2d(struct gl_context *ctx, GLenum target,
pipe_resource_reference(&stimg.texture, NULL);
}
static void
st_egl_image_target_tex_storage(struct gl_context *ctx, GLenum target,
struct gl_texture_object *texObj,
struct gl_texture_image *texImage,
GLeglImageOES image_handle)
{
struct st_egl_image stimg;
if (!st_get_egl_image(ctx, image_handle, PIPE_BIND_SAMPLER_VIEW,
"glEGLImageTargetTexture2D", &stimg))
return;
st_bind_egl_image(ctx, texObj, texImage, &stimg, true);
pipe_resource_reference(&stimg.texture, NULL);
}
void
st_init_eglimage_functions(struct dd_function_table *functions)
{
functions->EGLImageTargetTexture2D = st_egl_image_target_texture_2d;
functions->EGLImageTargetTexStorage = st_egl_image_target_tex_storage;
functions->EGLImageTargetRenderbufferStorage = st_egl_image_target_renderbuffer_storage;
}
......@@ -1018,6 +1018,7 @@ void st_init_extensions(struct pipe_screen *screen,
extensions->EXT_blend_color = GL_TRUE;
extensions->EXT_blend_func_separate = GL_TRUE;
extensions->EXT_blend_minmax = GL_TRUE;
extensions->EXT_EGL_image_storage = GL_TRUE;
extensions->EXT_gpu_program_parameters = GL_TRUE;
extensions->EXT_pixel_buffer_object = GL_TRUE;
extensions->EXT_point_parameters = GL_TRUE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment