summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/formats.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2011-03-18 13:44:51 +0100
committerMarek Olšák <[email protected]>2011-03-29 12:04:55 +0200
commit0be369975fdfa79bcb702d0c13aa0a221055f61b (patch)
tree4ed36637e10ea45d61ba7458a5aa593bde7a57ff /src/mesa/main/formats.c
parent47e3896dfd89a26abbe4ca2469c2480f3982b204 (diff)
mesa: initial EXT_texture_snorm support
The component ordering of some formats has been been reversed to match Gallium types.
Diffstat (limited to 'src/mesa/main/formats.c')
-rw-r--r--src/mesa/main/formats.c100
1 files changed, 91 insertions, 9 deletions
diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
index db10c9b4c2e..e62170b71c1 100644
--- a/src/mesa/main/formats.c
+++ b/src/mesa/main/formats.c
@@ -809,8 +809,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
1, 1, 1 /* BlockWidth/Height,Bytes */
},
{
- MESA_FORMAT_SIGNED_RG88,
- "MESA_FORMAT_SIGNED_RG88",
+ MESA_FORMAT_SIGNED_RG88_REV,
+ "MESA_FORMAT_SIGNED_RG88_REV",
GL_RG,
GL_SIGNED_NORMALIZED,
8, 8, 0, 0,
@@ -847,8 +847,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
/* Signed 16 bits / channel */
{
- MESA_FORMAT_SIGNED_R_16,
- "MESA_FORMAT_SIGNED_R_16",
+ MESA_FORMAT_SIGNED_R16,
+ "MESA_FORMAT_SIGNED_R16",
GL_RED,
GL_SIGNED_NORMALIZED,
16, 0, 0, 0,
@@ -856,8 +856,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
1, 1, 2
},
{
- MESA_FORMAT_SIGNED_RG_16,
- "MESA_FORMAT_SIGNED_RG_16",
+ MESA_FORMAT_SIGNED_GR1616,
+ "MESA_FORMAT_SIGNED_GR1616",
GL_RG,
GL_SIGNED_NORMALIZED,
16, 16, 0, 0,
@@ -963,6 +963,80 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
4, 0, 0, 0, 0,
4, 4, 16 /* 16 bytes per 4x4 block */
},
+
+ /* Signed formats from EXT_texture_snorm that are not in GL3.1 */
+ {
+ MESA_FORMAT_SIGNED_A8,
+ "MESA_FORMAT_SIGNED_A8",
+ GL_ALPHA,
+ GL_SIGNED_NORMALIZED,
+ 0, 0, 0, 8,
+ 0, 0, 0, 0, 0,
+ 1, 1, 1
+ },
+ {
+ MESA_FORMAT_SIGNED_L8,
+ "MESA_FORMAT_SIGNED_L8",
+ GL_LUMINANCE,
+ GL_SIGNED_NORMALIZED,
+ 0, 0, 0, 0,
+ 8, 0, 0, 0, 0,
+ 1, 1, 1
+ },
+ {
+ MESA_FORMAT_SIGNED_AL88,
+ "MESA_FORMAT_SIGNED_AL88",
+ GL_LUMINANCE_ALPHA,
+ GL_SIGNED_NORMALIZED,
+ 0, 0, 0, 8,
+ 8, 0, 0, 0, 0,
+ 1, 1, 2
+ },
+ {
+ MESA_FORMAT_SIGNED_I8,
+ "MESA_FORMAT_SIGNED_I8",
+ GL_INTENSITY,
+ GL_SIGNED_NORMALIZED,
+ 0, 0, 0, 0,
+ 0, 8, 0, 0, 0,
+ 1, 1, 1
+ },
+ {
+ MESA_FORMAT_SIGNED_A16,
+ "MESA_FORMAT_SIGNED_A16",
+ GL_ALPHA,
+ GL_SIGNED_NORMALIZED,
+ 0, 0, 0, 16,
+ 0, 0, 0, 0, 0,
+ 1, 1, 2
+ },
+ {
+ MESA_FORMAT_SIGNED_L16,
+ "MESA_FORMAT_SIGNED_L16",
+ GL_LUMINANCE,
+ GL_SIGNED_NORMALIZED,
+ 0, 0, 0, 0,
+ 16, 0, 0, 0, 0,
+ 1, 1, 2
+ },
+ {
+ MESA_FORMAT_SIGNED_AL1616,
+ "MESA_FORMAT_SIGNED_AL1616",
+ GL_LUMINANCE_ALPHA,
+ GL_SIGNED_NORMALIZED,
+ 0, 0, 0, 16,
+ 16, 0, 0, 0, 0,
+ 1, 1, 4
+ },
+ {
+ MESA_FORMAT_SIGNED_I16,
+ "MESA_FORMAT_SIGNED_I16",
+ GL_INTENSITY,
+ GL_SIGNED_NORMALIZED,
+ 0, 0, 0, 0,
+ 0, 16, 0, 0, 0,
+ 1, 1, 2
+ }
};
@@ -1530,10 +1604,14 @@ _mesa_format_to_type_and_comps(gl_format format,
return;
case MESA_FORMAT_SIGNED_R8:
+ case MESA_FORMAT_SIGNED_A8:
+ case MESA_FORMAT_SIGNED_L8:
+ case MESA_FORMAT_SIGNED_I8:
*datatype = GL_BYTE;
*comps = 1;
return;
- case MESA_FORMAT_SIGNED_RG88:
+ case MESA_FORMAT_SIGNED_RG88_REV:
+ case MESA_FORMAT_SIGNED_AL88:
*datatype = GL_BYTE;
*comps = 2;
return;
@@ -1549,11 +1627,15 @@ _mesa_format_to_type_and_comps(gl_format format,
*comps = 4;
return;
- case MESA_FORMAT_SIGNED_R_16:
+ case MESA_FORMAT_SIGNED_R16:
+ case MESA_FORMAT_SIGNED_A16:
+ case MESA_FORMAT_SIGNED_L16:
+ case MESA_FORMAT_SIGNED_I16:
*datatype = GL_SHORT;
*comps = 1;
return;
- case MESA_FORMAT_SIGNED_RG_16:
+ case MESA_FORMAT_SIGNED_GR1616:
+ case MESA_FORMAT_SIGNED_AL1616:
*datatype = GL_SHORT;
*comps = 2;
return;