X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fstate_tracker%2Fst_cb_eglimage.c;h=8531afb29a741b3bfbe27aa446bbdbe842be75ce;hb=52f748792393c681f35025be7d843e6426fa327d;hp=5209fc795d3658adfe72d3b07e2935bcf8cb5804;hpb=892a2542a3f0753a7064c710b96f077dd5490624;p=mesa.git diff --git a/src/mesa/state_tracker/st_cb_eglimage.c b/src/mesa/state_tracker/st_cb_eglimage.c index 5209fc795d3..8531afb29a7 100644 --- a/src/mesa/state_tracker/st_cb_eglimage.c +++ b/src/mesa/state_tracker/st_cb_eglimage.c @@ -1,6 +1,5 @@ /* * Mesa 3-D graphics library - * Version: 7.9 * * Copyright (C) 2010 LunarG Inc. * @@ -26,7 +25,6 @@ * Chia-I Wu */ -#include "main/mfeatures.h" #include "main/texobj.h" #include "main/teximage.h" #include "util/u_inlines.h" @@ -38,8 +36,6 @@ #include "st_format.h" #include "st_manager.h" -#if FEATURE_OES_EGL_image - /** * Return the base format just like _mesa_base_fbo_format does. */ @@ -78,15 +74,12 @@ st_egl_image_target_renderbuffer_storage(struct gl_context *ctx, struct st_context *st = st_context(ctx); struct st_renderbuffer *strb = st_renderbuffer(rb); struct pipe_surface *ps; - unsigned usage; - usage = PIPE_BIND_RENDER_TARGET; - ps = st_manager_get_egl_image_surface(st, (void *) image_handle, usage); + ps = st_manager_get_egl_image_surface(st, (void *) image_handle); if (ps) { strb->Base.Width = ps->width; strb->Base.Height = ps->height; strb->Base.Format = st_pipe_format_to_mesa_format(ps->format); - strb->Base.DataType = st_format_datatype(ps->format); strb->Base._BaseFormat = st_pipe_format_to_base_format(ps->format); strb->Base.InternalFormat = strb->Base._BaseFormat; @@ -103,10 +96,11 @@ st_bind_surface(struct gl_context *ctx, GLenum target, struct gl_texture_image *texImage, struct pipe_surface *ps) { + struct st_context *st = st_context(ctx); struct st_texture_object *stObj; struct st_texture_image *stImage; GLenum internalFormat; - gl_format texFormat; + mesa_format texFormat; /* map pipe format to base format */ if (util_format_get_component_bits(ps->format, UTIL_FORMAT_COLORSPACE_RGB, 3) > 0) @@ -131,14 +125,15 @@ st_bind_surface(struct gl_context *ctx, GLenum target, /* 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); + st_texture_release_all_sampler_views(st, stObj); pipe_resource_reference(&stImage->pt, stObj->pt); stObj->width0 = ps->width; stObj->height0 = ps->height; stObj->depth0 = 1; + stObj->surface_format = ps->format; - _mesa_dirty_texobj(ctx, texObj, GL_TRUE); + _mesa_dirty_texobj(ctx, texObj); } static void @@ -149,10 +144,8 @@ st_egl_image_target_texture_2d(struct gl_context *ctx, GLenum target, { struct st_context *st = st_context(ctx); struct pipe_surface *ps; - unsigned usage; - usage = PIPE_BIND_SAMPLER_VIEW; - ps = st_manager_get_egl_image_surface(st, (void *) image_handle, usage); + ps = st_manager_get_egl_image_surface(st, (void *) image_handle); if (ps) { st_bind_surface(ctx, target, texObj, texImage, ps); pipe_surface_reference(&ps, NULL); @@ -165,5 +158,3 @@ st_init_eglimage_functions(struct dd_function_table *functions) functions->EGLImageTargetTexture2D = st_egl_image_target_texture_2d; functions->EGLImageTargetRenderbufferStorage = st_egl_image_target_renderbuffer_storage; } - -#endif /* FEATURE_OES_EGL_image */