X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fstate_tracker%2Fst_cb_eglimage.c;h=5209fc795d3658adfe72d3b07e2935bcf8cb5804;hb=892a2542a3f0753a7064c710b96f077dd5490624;hp=298f8a5b12bc2ba6f93b62dec0edcdac802fe907;hpb=cd6a31cd4a9ea6deef4778c2eaef2d47240c3a6e;p=mesa.git diff --git a/src/mesa/state_tracker/st_cb_eglimage.c b/src/mesa/state_tracker/st_cb_eglimage.c index 298f8a5b12b..5209fc795d3 100644 --- a/src/mesa/state_tracker/st_cb_eglimage.c +++ b/src/mesa/state_tracker/st_cb_eglimage.c @@ -26,8 +26,8 @@ * Chia-I Wu */ +#include "main/mfeatures.h" #include "main/texobj.h" -#include "main/texfetch.h" #include "main/teximage.h" #include "util/u_inlines.h" #include "util/u_format.h" @@ -53,7 +53,7 @@ st_pipe_format_to_base_format(enum pipe_format format) base_format = GL_DEPTH_STENCIL; } else { - if (format == PIPE_FORMAT_S8_USCALED) + if (format == PIPE_FORMAT_S8_UINT) base_format = GL_STENCIL_INDEX; else base_format = GL_DEPTH_COMPONENT; @@ -106,6 +106,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,13 +123,15 @@ st_bind_surface(struct gl_context *ctx, GLenum target, stObj->surface_based = GL_TRUE; } - _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); + texFormat = st_pipe_format_to_mesa_format(ps->format); + + _mesa_init_teximage_fields(ctx, texImage, + 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); + pipe_sampler_view_reference(&stObj->sampler_view, NULL); pipe_resource_reference(&stImage->pt, stObj->pt); stObj->width0 = ps->width;