diff options
author | Brian Paul <[email protected]> | 2010-07-05 20:07:07 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2010-07-05 20:14:39 -0600 |
commit | abd5627a6a034885b0b01b995c73870da1361bb0 (patch) | |
tree | f13fb38b514f020d6637d64cdf709c4f94e7a876 /src/mesa/main/teximage.c | |
parent | e54164b4e3890e3eddc4ae976e3cc2f1fa2f441b (diff) |
mesa: initial support for unnormalized integer texture formats
As defined by GL_EXT_texture_integer.
Diffstat (limited to 'src/mesa/main/teximage.c')
-rw-r--r-- | src/mesa/main/teximage.c | 52 |
1 files changed, 50 insertions, 2 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index ff752155ea9..f3073220104 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -348,12 +348,60 @@ _mesa_base_tex_format( GLcontext *ctx, GLint internalFormat ) case GL_SLUMINANCE8_EXT: return GL_LUMINANCE; default: - ; /* fallthrough */ + ; /* fallthrough */ } } - #endif /* FEATURE_EXT_texture_sRGB */ + if (ctx->Extensions.EXT_texture_integer) { + switch (internalFormat) { + case GL_RGBA8UI_EXT: + case GL_RGBA16UI_EXT: + case GL_RGBA32UI_EXT: + case GL_RGBA8I_EXT: + case GL_RGBA16I_EXT: + case GL_RGBA32I_EXT: + return GL_RGBA; + case GL_RGB8UI_EXT: + case GL_RGB16UI_EXT: + case GL_RGB32UI_EXT: + case GL_RGB8I_EXT: + case GL_RGB16I_EXT: + case GL_RGB32I_EXT: + return GL_RGB; + case GL_ALPHA8UI_EXT: + case GL_ALPHA16UI_EXT: + case GL_ALPHA32UI_EXT: + case GL_ALPHA8I_EXT: + case GL_ALPHA16I_EXT: + case GL_ALPHA32I_EXT: + return GL_ALPHA; + case GL_INTENSITY8UI_EXT: + case GL_INTENSITY16UI_EXT: + case GL_INTENSITY32UI_EXT: + case GL_INTENSITY8I_EXT: + case GL_INTENSITY16I_EXT: + case GL_INTENSITY32I_EXT: + return GL_INTENSITY; + case GL_LUMINANCE8UI_EXT: + case GL_LUMINANCE16UI_EXT: + case GL_LUMINANCE32UI_EXT: + case GL_LUMINANCE8I_EXT: + case GL_LUMINANCE16I_EXT: + case GL_LUMINANCE32I_EXT: + return GL_LUMINANCE; + case GL_LUMINANCE_ALPHA8UI_EXT: + case GL_LUMINANCE_ALPHA16UI_EXT: + case GL_LUMINANCE_ALPHA32UI_EXT: + case GL_LUMINANCE_ALPHA8I_EXT: + case GL_LUMINANCE_ALPHA16I_EXT: + case GL_LUMINANCE_ALPHA32I_EXT: + return GL_LUMINANCE_ALPHA; + default: + ; /* fallthrough */ + } + } + return -1; /* error */ } |