diff options
author | Marek Olšák <[email protected]> | 2017-06-05 01:08:41 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-06-07 18:46:21 +0200 |
commit | f34abf77e90355739038d0bab0d80b54eb4e5246 (patch) | |
tree | c2cdabcd5dba74f60bc9c33bfde643a08ad493e7 /src/mesa/state_tracker/st_manager.c | |
parent | f7523f1ef6709fba0d8ee79eddcb501f30ee628d (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_manager.c')
-rw-r--r-- | src/mesa/state_tracker/st_manager.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c index cc781f46209..d0f32ff0f63 100644 --- a/src/mesa/state_tracker/st_manager.c +++ b/src/mesa/state_tracker/st_manager.c @@ -217,7 +217,12 @@ st_framebuffer_validate(struct st_framebuffer *stfb, u_surface_default_template(&surf_tmpl, textures[i]); ps = st->pipe->create_surface(st->pipe, textures[i], &surf_tmpl); if (ps) { - 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); /* ownership transfered */ pipe_surface_reference(&ps, NULL); |