aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texformat.c
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2010-09-28 17:24:39 -0700
committerIan Romanick <[email protected]>2010-10-01 15:49:13 -0700
commit5d1387b2da3626326410804026f8b92f1a121fdc (patch)
treec810e7ff2d1444bef186e17547556c31a93d94f8 /src/mesa/main/texformat.c
parent214a33f6104511bc163fdb964161d264e67090d3 (diff)
ARB_texture_rg: Add R8, R16, RG88, and RG1616 internal formats
Diffstat (limited to 'src/mesa/main/texformat.c')
-rw-r--r--src/mesa/main/texformat.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c
index b9271ef58ef..24efb108bb6 100644
--- a/src/mesa/main/texformat.c
+++ b/src/mesa/main/texformat.c
@@ -429,6 +429,29 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat,
}
}
+ if (ctx->Extensions.ARB_texture_rg) {
+ switch (internalFormat) {
+ case GL_R8:
+ case GL_RED:
+ case GL_COMPRESSED_RED:
+ return MESA_FORMAT_R8;
+
+ case GL_R16:
+ return MESA_FORMAT_R16;
+
+ case GL_RG:
+ case GL_RG8:
+ case GL_COMPRESSED_RG:
+ return MESA_FORMAT_RG88;
+
+ case GL_RG16:
+ return MESA_FORMAT_RG1616;
+
+ default:
+ ; /* fallthrough */
+ }
+ }
+
_mesa_problem(ctx, "unexpected format in _mesa_choose_tex_format()");
return MESA_FORMAT_NONE;
}