[Mesa-dev] [PATCH 04/10] i965: Add mapping from MESA_FORMAT to BRW_SURFACEFORMAT for integer.
Eric Anholt
eric at anholt.net
Fri Nov 4 15:01:25 PDT 2011
Like non-integer, we can't render to RGB textures, so we promote them
to RGBA.
---
src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 24 ++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 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 04dc389..66ff1e6 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -124,6 +124,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];
--
1.7.7
More information about the mesa-dev
mailing list