[Mesa-dev] [PATCH 2/3] i965: Add B8G8R8X8_SRGB to the alpha format override

Neil Roberts neil at linux.intel.com
Fri Dec 11 04:32:17 PST 2015


brw_init_surface_formats overrides the render format for RGBX formats
which aren't supported for rendering so that they internally use RGBA
instead. However, B8G8R8X8_SRGB was missing so it wasn't marked as a
renderable format. This patch just adds it.

Cc: "11.0 11.1" <mesa-stable at lists.freedesktop.org>
Cc: Ilia Mirkin <imirkin at alum.mit.edu>
---
 src/mesa/drivers/dri/i965/brw_surface_formats.c | 4 ++++
 1 file changed, 4 insertions(+)

This might conflict when ported to the 11.x branches because the code
above doesn't have the if statement there. It should be fine to add it
without the if statement on those branches although it shouldn't
matter if it does have it either.

diff --git a/src/mesa/drivers/dri/i965/brw_surface_formats.c b/src/mesa/drivers/dri/i965/brw_surface_formats.c
index 3fc47c3..7bc8b8b 100644
--- a/src/mesa/drivers/dri/i965/brw_surface_formats.c
+++ b/src/mesa/drivers/dri/i965/brw_surface_formats.c
@@ -674,6 +674,10 @@ brw_init_surface_formats(struct brw_context *brw)
          if (gen < tinfo->render_target)
             render = BRW_SURFACEFORMAT_B8G8R8A8_UNORM;
 	 break;
+      case BRW_SURFACEFORMAT_B8G8R8X8_UNORM_SRGB:
+         if (gen < tinfo->render_target)
+            render = BRW_SURFACEFORMAT_B8G8R8A8_UNORM_SRGB;
+         break;
       case BRW_SURFACEFORMAT_R8G8B8X8_UNORM:
          render = BRW_SURFACEFORMAT_R8G8B8A8_UNORM;
          break;
-- 
1.9.3



More information about the mesa-dev mailing list