intel/blorp: Fix blits to R8G8B8_UNORM_SRGB
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 12 Jul 2018 20:55:26 +0000 (13:55 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Sat, 14 Jul 2018 03:57:46 +0000 (20:57 -0700)
In this case, the surface faking will give us a R8_UNORM surface and we
need to do an sRGB conversion in the shader.  Found by inspection.

cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
src/intel/blorp/blorp_blit.c

index b144bddaf5d66adf99f39b8c0f1bf493faa37b5d..f3896fe53f37833dcd0a32b6c9d7236b7d63e1d1 100644 (file)
@@ -1951,6 +1951,10 @@ try_blorp_blit(struct blorp_batch *batch,
       params->x0 *= 3;
       params->x1 *= 3;
 
+      /* If it happens to be sRGB, we need to force a conversion */
+      if (params->dst.view.format == ISL_FORMAT_R8G8B8_UNORM_SRGB)
+         wm_prog_key->dst_format = ISL_FORMAT_R9G9B9E5_SHAREDEXP;
+
       surf_fake_rgb_with_red(batch->blorp->isl_dev, &params->dst);
 
       wm_prog_key->dst_rgb = true;