summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util/u_blitter.c
diff options
context:
space:
mode:
authorHenri Verbeet <[email protected]>2011-03-12 16:33:50 +0100
committerHenri Verbeet <[email protected]>2011-03-12 16:43:58 +0100
commitab21147c899ba1506df38438b6750d3dc5eaabdf (patch)
tree537a4fa2e2f0bec5b064f8118cd4d2b20ac6a3fc /src/gallium/auxiliary/util/u_blitter.c
parent6da4866ffdb19315bbb48f6778d1a5297b842a77 (diff)
u_blitter: Do blits in linear color space.
Blits between sRGB and linear formats should happen in linear color space. This fixes piglit fbo/fbo-srgb-blit.
Diffstat (limited to 'src/gallium/auxiliary/util/u_blitter.c')
-rw-r--r--src/gallium/auxiliary/util/u_blitter.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c
index bdc13b547db..a4c399052fd 100644
--- a/src/gallium/auxiliary/util/u_blitter.c
+++ b/src/gallium/auxiliary/util/u_blitter.c
@@ -785,6 +785,7 @@ void util_blitter_copy_region(struct blitter_context *blitter,
/* Get surface. */
memset(&surf_templ, 0, sizeof(surf_templ));
u_surface_default_template(&surf_templ, dst, bind);
+ surf_templ.format = util_format_linear(dst->format);
surf_templ.u.tex.level = dstlevel;
surf_templ.u.tex.first_layer = dstz;
surf_templ.u.tex.last_layer = dstz;
@@ -823,7 +824,7 @@ void util_blitter_copy_region(struct blitter_context *blitter,
normalized = src->target != PIPE_TEXTURE_RECT;
/* Initialize sampler view. */
- u_sampler_view_default_template(&viewTempl, src, src->format);
+ u_sampler_view_default_template(&viewTempl, src, util_format_linear(src->format));
view = pipe->create_sampler_view(pipe, src, &viewTempl);
/* Set rasterizer state, shaders, and textures. */