diff options
author | Keith Whitwell <keithw@vmware.com> | 2010-10-17 19:03:42 -0700 |
---|---|---|
committer | Keith Whitwell <keithw@vmware.com> | 2010-10-17 19:09:42 -0700 |
commit | 0072acd447dc6be652e63752e50215c3105322c8 (patch) | |
tree | 847d1763b54772d336a04e606f8248291c3092b7 /src/mesa/main/texformat.c | |
parent | 543fb77ddece7e1806e8eaa0d65bb2a945ef9a75 (diff) | |
parent | ca2b2ac131933b4171b519813df1aaa3a81621cd (diff) |
Merge remote branch 'origin/master' into lp-setup-llvm
Conflicts:
src/gallium/drivers/llvmpipe/lp_setup_coef.c
src/gallium/drivers/llvmpipe/lp_setup_coef.h
src/gallium/drivers/llvmpipe/lp_setup_coef_intrin.c
src/gallium/drivers/llvmpipe/lp_setup_point.c
src/gallium/drivers/llvmpipe/lp_setup_tri.c
src/gallium/drivers/llvmpipe/lp_state_derived.c
src/gallium/drivers/llvmpipe/lp_state_fs.h
Diffstat (limited to 'src/mesa/main/texformat.c')
-rw-r--r-- | src/mesa/main/texformat.c | 25 |
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; } |