summaryrefslogtreecommitdiff
path: root/src/mesa/main/texformat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/texformat.c')
-rw-r--r--src/mesa/main/texformat.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c
index b9271ef58e..894c0130b4 100644
--- a/src/mesa/main/texformat.c
+++ b/src/mesa/main/texformat.c
@@ -54,7 +54,7 @@
* will typically override this function with a specialized version.
*/
gl_format
-_mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat,
+_mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat,
GLenum format, GLenum type )
{
(void) format;
@@ -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;
}