From f34abf77e90355739038d0bab0d80b54eb4e5246 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Mon, 5 Jun 2017 01:08:41 +0200 Subject: st/mesa: cache pipe_surface for GL_FRAMEBUFFER_SRGB changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Samuel Pitoiset Reviewed-by: Nicolai Hähnle --- src/mesa/state_tracker/st_cb_eglimage.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/mesa/state_tracker/st_cb_eglimage.c') diff --git a/src/mesa/state_tracker/st_cb_eglimage.c b/src/mesa/state_tracker/st_cb_eglimage.c index a104b649eae..0f649f4ab43 100644 --- a/src/mesa/state_tracker/st_cb_eglimage.c +++ b/src/mesa/state_tracker/st_cb_eglimage.c @@ -158,7 +158,12 @@ st_egl_image_target_renderbuffer_storage(struct gl_context *ctx, strb->Base._BaseFormat = st_pipe_format_to_base_format(ps->format); strb->Base.InternalFormat = strb->Base._BaseFormat; - pipe_surface_reference(&strb->surface, ps); + struct pipe_surface **psurf = + util_format_is_srgb(ps->format) ? &strb->surface_srgb : + &strb->surface_linear; + + pipe_surface_reference(psurf, ps); + strb->surface = *psurf; pipe_resource_reference(&strb->texture, ps->texture); pipe_surface_reference(&ps, NULL); -- cgit v1.2.3