From 5d1387b2da3626326410804026f8b92f1a121fdc Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 28 Sep 2010 17:24:39 -0700 Subject: ARB_texture_rg: Add R8, R16, RG88, and RG1616 internal formats --- src/mesa/main/texformat.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/mesa/main/texformat.c') diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c index b9271ef58e..24efb108bb 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; } -- cgit v1.2.3