aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_blorp.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2013-10-07 12:44:01 -0700
committerKenneth Graunke <[email protected]>2013-10-09 16:36:50 -0700
commit72aade48fe7d4c4099ef713887c06b3aaacf1acd (patch)
treebbde4ffdf2d5eb0336af716506ff1852d4813c6c /src/mesa/drivers/dri/i965/brw_blorp.cpp
parent0589eaecde2fc0fa35fb2e0c54d76db7b6467498 (diff)
i965/blorp: Rework sRGB override behavior.
The previous code for sRGB overrides assumes that the source and destination formats are equal, other than the color space. This won't be feasible when we add support for format conversions. Here are a few cases, and how the old code handled them: 1. RGB8 -> SRGB8, MSAA ==> SRGB8 -> SRGB8 2. RGB8 -> SRGB8, single ==> RGB8 -> RGB8 3. SRGB8 -> RGB8, MSAA ==> RGB8 -> RGB8 4. SRGB8 -> RGB8, single ==> SRGB8 -> SRGB8 Apparently, preserving the behavior of #1 is important. When doing a multisample to single-sample resolve, blending the samples together in an sRGB correct fashion results in a noticably higher quality image. It also is necessary to pass Piglit's EXT_framebuffer_multisample accuracy color tests. Paul, Eric, Anuj, and I talked about this, and aren't sure that it matters in the other cases. This patch preserves the behavior of #1, but otherwise reverts to doing everything in linear space, changing the behavior of case #4. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Daniel Vetter <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_blorp.cpp')
-rw-r--r--src/mesa/drivers/dri/i965/brw_blorp.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_blorp.cpp b/src/mesa/drivers/dri/i965/brw_blorp.cpp
index c59bb663a76..91df346b887 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp.cpp
@@ -104,15 +104,17 @@ brw_blorp_surface_info::set(struct brw_context *brw,
case MESA_FORMAT_Z16:
this->brw_surfaceformat = BRW_SURFACEFORMAT_R16_UNORM;
break;
- default:
+ default: {
+ gl_format linear_format = _mesa_get_srgb_format_linear(mt->format);
if (is_render_target) {
- assert(brw->format_supported_as_render_target[mt->format]);
- this->brw_surfaceformat = brw->render_target_format[mt->format];
+ assert(brw->format_supported_as_render_target[linear_format]);
+ this->brw_surfaceformat = brw->render_target_format[linear_format];
} else {
- this->brw_surfaceformat = brw_format_for_mesa_format(mt->format);
+ this->brw_surfaceformat = brw_format_for_mesa_format(linear_format);
}
break;
}
+ }
}