aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2013-05-28 10:59:53 -0700
committerEric Anholt <[email protected]>2013-05-28 17:53:44 -0700
commit4dea6cf21557bcd3bbab3402e19e19f665d7e177 (patch)
tree1cb5aafe79341cc7f15c9280c4518161282b22dc /src/mesa
parentf43f07d5889645240de6e4740412f325d7a4eb38 (diff)
intel: Enable blit glCopyTexSubImage/glBlitFramebuffer with sRGB.
Since the introduction of default-to-SARGB8 window system framebuffers, non-blorp hardware lost blit acceleration for these two paths between the window system and ARGB8888 textures. Since we shouldn't be doing any conversion anyway, just compatibility-check the linear variants of the formats. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61954 Reviewed-by: Kenneth Graunke <[email protected]> Tested-by: Tobias Jakobi <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_copy.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_tex_copy.c b/src/mesa/drivers/dri/intel/intel_tex_copy.c
index 4a13b9ae2c2..6fb4e380c36 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_copy.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_copy.c
@@ -80,17 +80,23 @@ intel_copy_texsubimage(struct intel_context *intel,
perf_debug("no support for array textures\n");
}
- copy_supported = intelImage->base.Base.TexFormat == intel_rb_format(irb);
+ /* glCopyTexImage (and the glBlitFramebuffer() path that reuses this)
+ * doesn't do any sRGB conversions.
+ */
+ gl_format src_format = _mesa_get_srgb_format_linear(intel_rb_format(irb));
+ gl_format dst_format = _mesa_get_srgb_format_linear(intelImage->base.Base.TexFormat);
+
+ copy_supported = src_format == dst_format;
/* Converting ARGB8888 to XRGB8888 is trivial: ignore the alpha bits */
- if (intel_rb_format(irb) == MESA_FORMAT_ARGB8888 &&
- intelImage->base.Base.TexFormat == MESA_FORMAT_XRGB8888) {
+ if (src_format == MESA_FORMAT_ARGB8888 &&
+ dst_format == MESA_FORMAT_XRGB8888) {
copy_supported = true;
}
/* Converting XRGB8888 to ARGB8888 requires setting the alpha bits to 1.0 */
- if (intel_rb_format(irb) == MESA_FORMAT_XRGB8888 &&
- intelImage->base.Base.TexFormat == MESA_FORMAT_ARGB8888) {
+ if (src_format == MESA_FORMAT_XRGB8888 &&
+ dst_format == MESA_FORMAT_ARGB8888) {
copy_supported_with_alpha_override = true;
}