[Mesa-dev] [PATCH 4/4] mesa: update fbo format tablet for integer types.
Ian Romanick
idr at freedesktop.org
Tue Oct 4 17:35:46 PDT 2011
On 10/04/2011 04:47 PM, Eric Anholt wrote:
> On Tue, 4 Oct 2011 21:11:36 +0100, Dave Airlie<airlied at gmail.com> wrote:
>> From: Dave Airlie<airlied at redhat.com>
>>
>> This updates the fbo format table for the integer types.
>>
>> Signed-off-by: Dave Airlie<airlied at redhat.com>
>> ---
>> src/mesa/main/fbobject.c | 62 +++++++++++++++++++++++++++++++++++++++++++++-
>> 1 files changed, 61 insertions(+), 1 deletions(-)
>>
>> diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
>> index 139ff03..bc61ac3 100644
>> --- a/src/mesa/main/fbobject.c
>> +++ b/src/mesa/main/fbobject.c
>> @@ -1220,7 +1220,67 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat)
>> return ctx->Extensions.EXT_texture_shared_exponent ? GL_RGB : 0;
>> case GL_R11F_G11F_B10F:
>> return ctx->Extensions.EXT_packed_float ? GL_RGB : 0;
>> - /* XXX add integer formats eventually */
>> +
>> + 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 ctx->Extensions.EXT_texture_integer ? GL_RGBA : 0;
>> +
>> + 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 ctx->Extensions.EXT_texture_integer ? GL_RGB : 0;
>> +
>> + case GL_R8UI:
>> + case GL_R8I:
>> + case GL_R16UI:
>> + case GL_R16I:
>> + case GL_R32UI:
>> + case GL_R32I:
>> + return ctx->Extensions.ARB_texture_rg&&
>> + ctx->Extensions.EXT_texture_integer ? GL_RED : 0;
>> +
>> + case GL_RG8UI:
>> + case GL_RG8I:
>> + case GL_RG16UI:
>> + case GL_RG16I:
>> + case GL_RG32UI:
>> + case GL_RG32I:
>> + return ctx->Extensions.ARB_texture_rg&&
>> + ctx->Extensions.EXT_texture_integer ? GL_RG : 0;
>> +
>> + case GL_INTENSITY8I_EXT:
>> + case GL_INTENSITY8UI_EXT:
>> + case GL_INTENSITY16I_EXT:
>> + case GL_INTENSITY16UI_EXT:
>> + case GL_INTENSITY32I_EXT:
>> + case GL_INTENSITY32UI_EXT:
>> + return ctx->Extensions.EXT_texture_integer&&
>> + ctx->Extensions.ARB_framebuffer_object ? GL_INTENSITY : 0;
>> +
>> + case GL_LUMINANCE8I_EXT:
>> + case GL_LUMINANCE8UI_EXT:
>> + case GL_LUMINANCE16I_EXT:
>> + case GL_LUMINANCE16UI_EXT:
>> + case GL_LUMINANCE32I_EXT:
>> + case GL_LUMINANCE32UI_EXT:
>> + return ctx->Extensions.EXT_texture_integer&&
>> + ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE : 0;
>> +
>> + case GL_LUMINANCE_ALPHA8I_EXT:
>> + case GL_LUMINANCE_ALPHA8UI_EXT:
>> + case GL_LUMINANCE_ALPHA16I_EXT:
>> + case GL_LUMINANCE_ALPHA16UI_EXT:
>> + case GL_LUMINANCE_ALPHA32I_EXT:
>> + case GL_LUMINANCE_ALPHA32UI_EXT:
>> + return ctx->Extensions.EXT_texture_integer&&
>> + ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE_ALPHA : 0;
>
> Could we drop the _EXT on these tokens?
Since intensity, luminance, and luminance-alpha textures were removed
from the core profile in OpenGL 3.1, the non-EXT enums do not exist.
egrep '(LUMINANCE|LUMINANCE_ALPHA|INTENSITY)[^_]*I' include/GL/glext.h
shows only the _EXT names.
More information about the mesa-dev
mailing list