X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fstate_tracker%2Fst_cb_eglimage.c;h=dfde821fc19ced24dc53a1ada89e265265e93b46;hb=6bd8647b54054a59bdb4f0c170c4481eaadc81ff;hp=b39a624a612c4f20be026ee8909dbd86645700f1;hpb=cfc81d93f7b07a89437cbbce173fc468070e06da;p=mesa.git diff --git a/src/mesa/state_tracker/st_cb_eglimage.c b/src/mesa/state_tracker/st_cb_eglimage.c index b39a624a612..dfde821fc19 100644 --- a/src/mesa/state_tracker/st_cb_eglimage.c +++ b/src/mesa/state_tracker/st_cb_eglimage.c @@ -26,6 +26,7 @@ * Chia-I Wu */ +#include "main/mfeatures.h" #include "main/texobj.h" #include "main/texfetch.h" #include "main/teximage.h" @@ -106,6 +107,7 @@ st_bind_surface(struct gl_context *ctx, GLenum target, struct st_texture_object *stObj; struct st_texture_image *stImage; GLenum internalFormat; + gl_format texFormat; /* map pipe format to base format */ if (util_format_get_component_bits(ps->format, UTIL_FORMAT_COLORSPACE_RGB, 3) > 0) @@ -122,10 +124,11 @@ st_bind_surface(struct gl_context *ctx, GLenum target, stObj->surface_based = GL_TRUE; } + texFormat = st_pipe_format_to_mesa_format(ps->format); + _mesa_init_teximage_fields(ctx, target, texImage, - ps->width, ps->height, 1, 0, internalFormat); - texImage->TexFormat = st_pipe_format_to_mesa_format(ps->format); - _mesa_set_fetch_functions(texImage, 2); + ps->width, ps->height, 1, 0, internalFormat, + texFormat); /* FIXME create a non-default sampler view from the pipe_surface? */ pipe_resource_reference(&stObj->pt, ps->texture);