[Mesa-dev] [PATCH 11/11] i965: Fill in brw_format_for_mesa_format for some non-rendering formats.

Eric Anholt eric at anholt.net
Tue Apr 16 17:21:23 PDT 2013


This should have no change on driver operation, but it means that when you
wonder why some format isn't supported natively, you can just look at the
table above, instead of wondering if maybe there's an appropriate entry in
the surface formats table that is already supported.
---
 src/mesa/drivers/dri/i965/brw_wm_surface_state.c |   36 +++++++++++-----------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
index a2598bc..3ea38e8 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -376,7 +376,7 @@ brw_format_for_mesa_format(gl_format mesa_format)
       [MESA_FORMAT_XRGB8888] = BRW_SURFACEFORMAT_B8G8R8X8_UNORM,
       [MESA_FORMAT_XRGB8888_REV] = 0,
       [MESA_FORMAT_RGB888] = 0,
-      [MESA_FORMAT_BGR888] = 0,
+      [MESA_FORMAT_BGR888] = BRW_SURFACEFORMAT_R8G8B8_UNORM,
       [MESA_FORMAT_RGB565] = BRW_SURFACEFORMAT_B5G6R5_UNORM,
       [MESA_FORMAT_RGB565_REV] = 0,
       [MESA_FORMAT_ARGB4444] = BRW_SURFACEFORMAT_B4G4R4A4_UNORM,
@@ -477,11 +477,11 @@ brw_format_for_mesa_format(gl_format mesa_format)
 
       [MESA_FORMAT_R_INT8] = BRW_SURFACEFORMAT_R8_SINT,
       [MESA_FORMAT_RG_INT8] = BRW_SURFACEFORMAT_R8G8_SINT,
-      [MESA_FORMAT_RGB_INT8] = 0,
+      [MESA_FORMAT_RGB_INT8] = BRW_SURFACEFORMAT_R8G8B8_SINT,
       [MESA_FORMAT_RGBA_INT8] = BRW_SURFACEFORMAT_R8G8B8A8_SINT,
       [MESA_FORMAT_R_INT16] = BRW_SURFACEFORMAT_R16_SINT,
       [MESA_FORMAT_RG_INT16] = BRW_SURFACEFORMAT_R16G16_SINT,
-      [MESA_FORMAT_RGB_INT16] = 0,
+      [MESA_FORMAT_RGB_INT16] = BRW_SURFACEFORMAT_R16G16B16_SINT,
       [MESA_FORMAT_RGBA_INT16] = BRW_SURFACEFORMAT_R16G16B16A16_SINT,
       [MESA_FORMAT_R_INT32] = BRW_SURFACEFORMAT_R32_SINT,
       [MESA_FORMAT_RG_INT32] = BRW_SURFACEFORMAT_R32G32_SINT,
@@ -490,11 +490,11 @@ brw_format_for_mesa_format(gl_format mesa_format)
 
       [MESA_FORMAT_R_UINT8] = BRW_SURFACEFORMAT_R8_UINT,
       [MESA_FORMAT_RG_UINT8] = BRW_SURFACEFORMAT_R8G8_UINT,
-      [MESA_FORMAT_RGB_UINT8] = 0,
+      [MESA_FORMAT_RGB_UINT8] = BRW_SURFACEFORMAT_R8G8B8_UINT,
       [MESA_FORMAT_RGBA_UINT8] = BRW_SURFACEFORMAT_R8G8B8A8_UINT,
       [MESA_FORMAT_R_UINT16] = BRW_SURFACEFORMAT_R16_UINT,
       [MESA_FORMAT_RG_UINT16] = BRW_SURFACEFORMAT_R16G16_UINT,
-      [MESA_FORMAT_RGB_UINT16] = 0,
+      [MESA_FORMAT_RGB_UINT16] = BRW_SURFACEFORMAT_R16G16B16_UINT,
       [MESA_FORMAT_RGBA_UINT16] = BRW_SURFACEFORMAT_R16G16B16A16_UINT,
       [MESA_FORMAT_R_UINT32] = BRW_SURFACEFORMAT_R32_UINT,
       [MESA_FORMAT_RG_UINT32] = BRW_SURFACEFORMAT_R32G32_UINT,
@@ -509,7 +509,7 @@ brw_format_for_mesa_format(gl_format mesa_format)
       [MESA_FORMAT_SIGNED_RGBA8888_REV] = BRW_SURFACEFORMAT_R8G8B8A8_SNORM,
       [MESA_FORMAT_SIGNED_R16] = BRW_SURFACEFORMAT_R16_SNORM,
       [MESA_FORMAT_SIGNED_GR1616] = BRW_SURFACEFORMAT_R16G16_SNORM,
-      [MESA_FORMAT_SIGNED_RGB_16] = 0,
+      [MESA_FORMAT_SIGNED_RGB_16] = BRW_SURFACEFORMAT_R16G16B16_SNORM,
       [MESA_FORMAT_SIGNED_RGBA_16] = BRW_SURFACEFORMAT_R16G16B16A16_SNORM,
       [MESA_FORMAT_RGBA_16] = BRW_SURFACEFORMAT_R16G16B16A16_UNORM,
 
@@ -523,17 +523,17 @@ brw_format_for_mesa_format(gl_format mesa_format)
       [MESA_FORMAT_LA_LATC2] = 0,
       [MESA_FORMAT_SIGNED_LA_LATC2] = 0,
 
-      [MESA_FORMAT_ETC1_RGB8] = 0,
-      [MESA_FORMAT_ETC2_RGB8] = 0,
-      [MESA_FORMAT_ETC2_SRGB8] = 0,
-      [MESA_FORMAT_ETC2_RGBA8_EAC] = 0,
-      [MESA_FORMAT_ETC2_SRGB8_ALPHA8_EAC] = 0,
-      [MESA_FORMAT_ETC2_R11_EAC] = 0,
-      [MESA_FORMAT_ETC2_RG11_EAC] = 0,
-      [MESA_FORMAT_ETC2_SIGNED_R11_EAC] = 0,
-      [MESA_FORMAT_ETC2_SIGNED_RG11_EAC] = 0,
-      [MESA_FORMAT_ETC2_RGB8_PUNCHTHROUGH_ALPHA1] = 0,
-      [MESA_FORMAT_ETC2_SRGB8_PUNCHTHROUGH_ALPHA1] = 0,
+      [MESA_FORMAT_ETC1_RGB8] = BRW_SURFACEFORMAT_ETC1_RGB8,
+      [MESA_FORMAT_ETC2_RGB8] = BRW_SURFACEFORMAT_ETC2_RGB8,
+      [MESA_FORMAT_ETC2_SRGB8] = BRW_SURFACEFORMAT_ETC2_SRGB8,
+      [MESA_FORMAT_ETC2_RGBA8_EAC] = BRW_SURFACEFORMAT_ETC2_EAC_RGBA8,
+      [MESA_FORMAT_ETC2_SRGB8_ALPHA8_EAC] = BRW_SURFACEFORMAT_ETC2_EAC_SRGB8_A8,
+      [MESA_FORMAT_ETC2_R11_EAC] = BRW_SURFACEFORMAT_EAC_R11,
+      [MESA_FORMAT_ETC2_RG11_EAC] = BRW_SURFACEFORMAT_EAC_RG11,
+      [MESA_FORMAT_ETC2_SIGNED_R11_EAC] = BRW_SURFACEFORMAT_EAC_SIGNED_R11,
+      [MESA_FORMAT_ETC2_SIGNED_RG11_EAC] = BRW_SURFACEFORMAT_EAC_SIGNED_RG11,
+      [MESA_FORMAT_ETC2_RGB8_PUNCHTHROUGH_ALPHA1] = BRW_SURFACEFORMAT_ETC2_RGB8_PTA,
+      [MESA_FORMAT_ETC2_SRGB8_PUNCHTHROUGH_ALPHA1] = BRW_SURFACEFORMAT_ETC2_SRGB8_PTA,
 
       [MESA_FORMAT_SIGNED_A8] = 0,
       [MESA_FORMAT_SIGNED_L8] = 0,
@@ -550,7 +550,7 @@ brw_format_for_mesa_format(gl_format mesa_format)
       [MESA_FORMAT_Z32_FLOAT] = 0,
       [MESA_FORMAT_Z32_FLOAT_X24S8] = 0,
 
-      [MESA_FORMAT_ARGB2101010_UINT] = 0,
+      [MESA_FORMAT_ARGB2101010_UINT] = BRW_SURFACEFORMAT_B10G10R10A2_UINT,
       [MESA_FORMAT_ABGR2101010_UINT] = BRW_SURFACEFORMAT_R10G10B10A2_UINT,
 
       [MESA_FORMAT_XRGB4444_UNORM] = 0,
-- 
1.7.10.4



More information about the mesa-dev mailing list