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/texformat.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/texformat.c')
-rw-r--r-- | src/mesa/main/texformat.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c index d235485721a..b9271ef58ef 100644 --- a/src/mesa/main/texformat.c +++ b/src/mesa/main/texformat.c @@ -382,6 +382,53 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, } #endif /* FEATURE_EXT_texture_sRGB */ + if (ctx->Extensions.EXT_texture_integer) { + switch (internalFormat) { + case GL_RGBA32UI_EXT: + case GL_RGB32UI_EXT: + case GL_ALPHA32UI_EXT: + case GL_INTENSITY32UI_EXT: + case GL_LUMINANCE32UI_EXT: + case GL_LUMINANCE_ALPHA32UI_EXT: + return MESA_FORMAT_RGBA_UINT32; + case GL_RGBA16UI_EXT: + case GL_RGB16UI_EXT: + case GL_ALPHA16UI_EXT: + case GL_INTENSITY16UI_EXT: + case GL_LUMINANCE16UI_EXT: + case GL_LUMINANCE_ALPHA16UI_EXT: + return MESA_FORMAT_RGBA_UINT16; + case GL_RGBA8UI_EXT: + case GL_RGB8UI_EXT: + case GL_ALPHA8UI_EXT: + case GL_INTENSITY8UI_EXT: + case GL_LUMINANCE8UI_EXT: + case GL_LUMINANCE_ALPHA8UI_EXT: + return MESA_FORMAT_RGBA_UINT8; + case GL_RGBA32I_EXT: + case GL_RGB32I_EXT: + case GL_ALPHA32I_EXT: + case GL_INTENSITY32I_EXT: + case GL_LUMINANCE32I_EXT: + case GL_LUMINANCE_ALPHA32I_EXT: + return MESA_FORMAT_RGBA_INT32; + case GL_RGBA16I_EXT: + case GL_RGB16I_EXT: + case GL_ALPHA16I_EXT: + case GL_INTENSITY16I_EXT: + case GL_LUMINANCE16I_EXT: + case GL_LUMINANCE_ALPHA16I_EXT: + return MESA_FORMAT_RGBA_INT16; + case GL_RGBA8I_EXT: + case GL_RGB8I_EXT: + case GL_ALPHA8I_EXT: + case GL_INTENSITY8I_EXT: + case GL_LUMINANCE8I_EXT: + case GL_LUMINANCE_ALPHA8I_EXT: + return MESA_FORMAT_RGBA_INT8; + } + } + _mesa_problem(ctx, "unexpected format in _mesa_choose_tex_format()"); return MESA_FORMAT_NONE; } |