summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_cb_eglimage.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-06-05 01:08:41 +0200
committerMarek Olšák <[email protected]>2017-06-07 18:46:21 +0200
commitf34abf77e90355739038d0bab0d80b54eb4e5246 (patch)
treec2cdabcd5dba74f60bc9c33bfde643a08ad493e7 /src/mesa/state_tracker/st_cb_eglimage.c
parentf7523f1ef6709fba0d8ee79eddcb501f30ee628d (diff)
st/mesa: cache pipe_surface for GL_FRAMEBUFFER_SRGB changes
Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_cb_eglimage.c')
-rw-r--r--src/mesa/state_tracker/st_cb_eglimage.c7
1 files changed, 6 insertions, 1 deletions
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);