diff options
author | Roland Scheidegger <[email protected]> | 2009-03-27 19:39:52 +0100 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2009-03-28 02:02:42 +0100 |
commit | c6a6cc191813e8343a17b028146a34f193a6ce44 (patch) | |
tree | cb1ecd35ac15c9b2c0cf3740dbdc631c7622233a /src/mesa/main/teximage.c | |
parent | a9bf5b5ccac2a75f1a2470d4910361e65b2d8eab (diff) |
mesa: add new signed rgba texture format
This is a (partial) backport of the signed texture format support in OGL 3.1.
Since it wasn't promoted from an existing extension roll our own.
Diffstat (limited to 'src/mesa/main/teximage.c')
-rw-r--r-- | src/mesa/main/teximage.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 4f297738df1..8c03c36c753 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -349,6 +349,15 @@ _mesa_base_tex_format( GLcontext *ctx, GLint internalFormat ) } } + if (ctx->Extensions.MESA_texture_signed_rgba) { + switch (internalFormat) { + case GL_RGBA_SNORM: + case GL_RGBA8_SNORM: + return GL_RGBA; + default: + ; /* fallthrough */ + } + } if (ctx->Extensions.EXT_packed_depth_stencil) { switch (internalFormat) { @@ -502,6 +511,10 @@ _mesa_is_color_format(GLenum format) case GL_COMPRESSED_SLUMINANCE_ALPHA_EXT: #endif /* FEATURE_EXT_texture_sRGB */ return GL_TRUE; + /* signed texture formats */ + case GL_RGBA_SNORM: + case GL_RGBA8_SNORM: + return GL_TRUE; case GL_YCBCR_MESA: /* not considered to be RGB */ /* fall-through */ default: |