summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/r300/r300_blit.c
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2015-03-09 21:20:03 +0100
committerEmil Velikov <emil.l.velikov@gmail.com>2015-03-11 18:14:43 +0000
commitaea510a95fab2e3c2ddeca2a3b3aae349d1ec3dc (patch)
treef6444e547b445273aa983f64a05ebb93b4f9f2bd /src/gallium/drivers/r300/r300_blit.c
parentc898d5c931ff9a19da93f2cc700bb92e02f60cfa (diff)
r300g: fix sRGB->sRGB blits
Cc: 10.5 10.4 <mesa-stable@lists.freedesktop.org> (cherry picked from commit c939231e7223510408a446400ad23b8b5ce2922e)
Diffstat (limited to 'src/gallium/drivers/r300/r300_blit.c')
-rw-r--r--src/gallium/drivers/r300/r300_blit.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gallium/drivers/r300/r300_blit.c b/src/gallium/drivers/r300/r300_blit.c
index 4e7efc560a4..baf05cea965 100644
--- a/src/gallium/drivers/r300/r300_blit.c
+++ b/src/gallium/drivers/r300/r300_blit.c
@@ -803,6 +803,15 @@ static void r300_blit(struct pipe_context *pipe,
(struct pipe_framebuffer_state*)r300->fb_state.state;
struct pipe_blit_info info = *blit;
+ /* The driver supports sRGB textures but not framebuffers. Blitting
+ * from sRGB to sRGB should be the same as blitting from linear
+ * to linear, so use that, This avoids incorrect linearization.
+ */
+ if (util_format_is_srgb(info.src.format)) {
+ info.src.format = util_format_linear(info.src.format);
+ info.dst.format = util_format_linear(info.dst.format);
+ }
+
/* MSAA resolve. */
if (info.src.resource->nr_samples > 1 &&
!util_format_is_depth_or_stencil(info.src.resource->format)) {