aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_blorp.cpp
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2012-09-24 05:38:32 -0700
committerPaul Berry <[email protected]>2012-09-24 17:03:36 -0700
commit124b214f094fa63ff1ddb7e9f0a1c2e0ba8214fb (patch)
treed2d84460e8d39991d7adecc1041f07dcf49a889a /src/mesa/drivers/dri/i965/brw_blorp.cpp
parent5fdf1f784bf449d7ce9839506fa23c5357696c4c (diff)
i965/blorp: Fix sRGB MSAA resolves.
Commit e2249e8c4d06a85d6389ba1689e15d7e29aa4dff (i965/blorp: Add support for blits between SRGB and linear formats) changed blorp to always configure surface states for in linear format (even if the underlying surface is sRGB). This allowed sRGB-to-linear and linear-to-sRGB blits to occur without causing the image to be inappropriately brightened or darkened. However, it broke sRGB MSAA resolves, since they rely on the destination buffer format being sRGB in order to ensure that samples are averaged together in sRGB-correct fashion. This patch fixes the problem by instead configuring the source buffer to use the *same* format as the destination buffer. This ensures that the image won't be brightened or darkened, but preserves proper sRGB averaging. Fixes piglit tests "EXT_framebuffer_multisample/accuracy srgb". Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55265 NOTE: This is a candidate for stable release branches. Reviewed-by: Eric Anholt <[email protected]> Reviewed-and-tested-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_blorp.cpp')
-rw-r--r--src/mesa/drivers/dri/i965/brw_blorp.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_blorp.cpp b/src/mesa/drivers/dri/i965/brw_blorp.cpp
index 54b3cebcdb6..77b9f8fb3c9 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp.cpp
@@ -95,15 +95,13 @@ brw_blorp_surface_info::set(struct brw_context *brw,
this->brw_surfaceformat = BRW_SURFACEFORMAT_R8G8_UNORM;
break;
default:
- /* Blorp blits don't support any sort of format conversion, so we can
- * safely assume that the same format is being used for the source and
- * destination. Therefore the format must be supported as a render
- * target, even if this is the source image. So we can convert to a
- * surface format using brw->render_target_format.
+ /* Blorp blits don't support any sort of format conversion (except
+ * between sRGB and linear), so we can safely assume that the format is
+ * supported as a render target, even if this is the source image. So
+ * we can convert to a surface format using brw->render_target_format.
*/
- gl_format linear_format = _mesa_get_srgb_format_linear(mt->format);
- assert(brw->format_supported_as_render_target[linear_format]);
- this->brw_surfaceformat = brw->render_target_format[linear_format];
+ assert(brw->format_supported_as_render_target[mt->format]);
+ this->brw_surfaceformat = brw->render_target_format[mt->format];
break;
}
}