i965: Add mapping from MESA_FORMAT to BRW_SURFACEFORMAT for integer.
authorEric Anholt <eric@anholt.net>
Wed, 5 Oct 2011 20:38:03 +0000 (13:38 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 9 Nov 2011 20:59:09 +0000 (12:59 -0800)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_wm_surface_state.c

index 66a8a5a53bba16cc1e9419dd6f7aff6635d51317..335962217a913fd041b646034406918d9d99f16c 100644 (file)
@@ -127,6 +127,30 @@ brw_format_for_mesa_format(gl_format mesa_format)
       [MESA_FORMAT_SIGNED_RG_RGTC2] = BRW_SURFACEFORMAT_BC5_SNORM,
       [MESA_FORMAT_RGB9_E5_FLOAT] = BRW_SURFACEFORMAT_R9G9B9E5_SHAREDEXP,
       [MESA_FORMAT_R11_G11_B10_FLOAT] = BRW_SURFACEFORMAT_R11G11B10_FLOAT,
+
+      [MESA_FORMAT_R_INT32] = BRW_SURFACEFORMAT_R32_SINT,
+      [MESA_FORMAT_RG_INT32] = BRW_SURFACEFORMAT_R32G32_SINT,
+      [MESA_FORMAT_RGB_INT32] = BRW_SURFACEFORMAT_R32G32B32_SINT,
+      [MESA_FORMAT_RGBA_INT32] = BRW_SURFACEFORMAT_R32G32B32A32_SINT,
+
+      [MESA_FORMAT_R_UINT32] = BRW_SURFACEFORMAT_R32_UINT,
+      [MESA_FORMAT_RG_UINT32] = BRW_SURFACEFORMAT_R32G32_UINT,
+      [MESA_FORMAT_RGB_UINT32] = BRW_SURFACEFORMAT_R32G32B32_UINT,
+      [MESA_FORMAT_RGBA_UINT32] = BRW_SURFACEFORMAT_R32G32B32A32_UINT,
+
+      [MESA_FORMAT_RGBA_UINT16] = BRW_SURFACEFORMAT_R16G16B16A16_UINT,
+      [MESA_FORMAT_RGBA_INT16] = BRW_SURFACEFORMAT_R16G16B16A16_SINT,
+      [MESA_FORMAT_RG_UINT16] = BRW_SURFACEFORMAT_R16G16_UINT,
+      [MESA_FORMAT_RG_INT16] = BRW_SURFACEFORMAT_R16G16_SINT,
+      [MESA_FORMAT_R_UINT16] = BRW_SURFACEFORMAT_R16_UINT,
+      [MESA_FORMAT_R_INT16] = BRW_SURFACEFORMAT_R16_SINT,
+
+      [MESA_FORMAT_RGBA_UINT8] = BRW_SURFACEFORMAT_R8G8B8A8_UINT,
+      [MESA_FORMAT_RGBA_INT8] = BRW_SURFACEFORMAT_R8G8B8A8_SINT,
+      [MESA_FORMAT_RG_UINT8] = BRW_SURFACEFORMAT_R8G8_UINT,
+      [MESA_FORMAT_RG_INT8] = BRW_SURFACEFORMAT_R8G8_SINT,
+      [MESA_FORMAT_R_UINT8] = BRW_SURFACEFORMAT_R8_UINT,
+      [MESA_FORMAT_R_INT8] = BRW_SURFACEFORMAT_R8_SINT,
    };
    assert(mesa_format < MESA_FORMAT_COUNT);
    return table[mesa_format];