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.c23
1 files changed, 23 insertions, 0 deletions
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;
}