diff options
author | Brian Paul <[email protected]> | 2010-04-26 20:35:19 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2010-04-26 20:35:19 -0600 |
commit | 84407d7365e101c36a83fd0a58c58b0c0c57db14 (patch) | |
tree | c52f70cd8e5bb600220a86bfa5371cda1c7d41cd /src/mesa/main/texformat.c | |
parent | b1ceadf2ee11a961530645eec40624211298382d (diff) |
mesa: start adding GL 3.1 signed normalized texture formats
Diffstat (limited to 'src/mesa/main/texformat.c')
-rw-r--r-- | src/mesa/main/texformat.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c index 096945a6432..06e6fd92fca 100644 --- a/src/mesa/main/texformat.c +++ b/src/mesa/main/texformat.c @@ -294,6 +294,32 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, } } + if (ctx->VersionMajor * 10 + ctx->VersionMinor >= 31) { + switch (internalFormat) { + case GL_RED_SNORM: + case GL_R8_SNORM: + return MESA_FORMAT_SIGNED_R8; + case GL_RG_SNORM: + case GL_RG8_SNORM: + return MESA_FORMAT_SIGNED_RG88; + case GL_RGB_SNORM: + case GL_RGB8_SNORM: + return MESA_FORMAT_SIGNED_RGBX8888; + case GL_RGBA_SNORM: + case GL_RGBA8_SNORM: + return MESA_FORMAT_SIGNED_RGBA8888; + case GL_R16_SNORM: + return MESA_FORMAT_SIGNED_R_16; + case GL_RG16_SNORM: + return MESA_FORMAT_SIGNED_RG_16; + case GL_RGB16_SNORM: + return MESA_FORMAT_SIGNED_RGB_16; + case GL_RGBA16_SNORM: + return MESA_FORMAT_SIGNED_RGBA_16; + default: + ; /* fall-through */ + } + } #if FEATURE_EXT_texture_sRGB if (ctx->Extensions.EXT_texture_sRGB) { |