[Mesa-dev] [PATCH 1/2] mesa: add support for ARB_texture_buffer_object_rgb32
Marek Olšák
maraeo at gmail.com
Sat Dec 15 04:28:17 PST 2012
On Sat, Dec 15, 2012 at 1:18 PM, Marek Olšák <maraeo at gmail.com> wrote:
> On Sat, Dec 15, 2012 at 4:38 AM, Dave Airlie <airlied at gmail.com> wrote:
>> This adds the extensions + the tex buffer support for checking
>> the formats.
>>
>> There is a piglit test enhancement sent to that list.
>>
>> Signed-off-by: Dave Airlie <airlied at redhat.com>
>> ---
>> src/mesa/main/extensions.c | 1 +
>> src/mesa/main/mtypes.h | 1 +
>> src/mesa/main/teximage.c | 13 +++++++++++++
>> 3 files changed, 15 insertions(+)
>>
>> diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
>> index e86e436..98711b3 100644
>> --- a/src/mesa/main/extensions.c
>> +++ b/src/mesa/main/extensions.c
>> @@ -127,6 +127,7 @@ static const struct extension extension_table[] = {
>> { "GL_ARB_sync", o(ARB_sync), GL, 2003 },
>> { "GL_ARB_texture_border_clamp", o(ARB_texture_border_clamp), GLL, 2000 },
>> { "GL_ARB_texture_buffer_object", o(ARB_texture_buffer_object), GLC, 2008 },
>> + { "GL_ARB_texture_buffer_object_rgb32", o(ARB_texture_buffer_object_rgb32), GLC, 2009 },
>> { "GL_ARB_texture_compression", o(dummy_true), GLL, 2000 },
>> { "GL_ARB_texture_compression_rgtc", o(ARB_texture_compression_rgtc), GL, 2004 },
>> { "GL_ARB_texture_cube_map", o(ARB_texture_cube_map), GLL, 1999 },
>> diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
>> index b59498f..67eaadd 100644
>> --- a/src/mesa/main/mtypes.h
>> +++ b/src/mesa/main/mtypes.h
>> @@ -2989,6 +2989,7 @@ struct gl_extensions
>> GLboolean ARB_sync;
>> GLboolean ARB_texture_border_clamp;
>> GLboolean ARB_texture_buffer_object;
>> + GLboolean ARB_texture_buffer_object_rgb32;
>> GLboolean ARB_texture_compression_rgtc;
>> GLboolean ARB_texture_cube_map;
>> GLboolean ARB_texture_cube_map_array;
>> diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
>> index 47c4ed2..7a0d944 100644
>> --- a/src/mesa/main/teximage.c
>> +++ b/src/mesa/main/teximage.c
>> @@ -3848,6 +3848,13 @@ get_texbuffer_format(const struct gl_context *ctx, GLenum internalFormat)
>> case GL_R32UI:
>> return MESA_FORMAT_R_UINT32;
>>
>> + case GL_RGB32F:
>> + return MESA_FORMAT_RGB_FLOAT32;
>> + case GL_RGB32UI:
>> + return MESA_FORMAT_RGB_UINT32;
>> + case GL_RGB32I:
>> + return MESA_FORMAT_RGB_INT32;
>> +
>> default:
>> return MESA_FORMAT_NONE;
>> }
>> @@ -3879,6 +3886,12 @@ validate_texbuffer_format(const struct gl_context *ctx, GLenum internalFormat)
>> if (base_format == GL_R || base_format == GL_RG)
>> return MESA_FORMAT_NONE;
>> }
>> +
>> + if (!ctx->Extensions.ARB_texture_buffer_object_rgb32) {
>
> This should also check whether ctx->API is API_OPENGL_CORE.
Sorry, it's not needed. The check for the API is in the caller of
validate_texbuffer_format. For the series:
Reviewed-by: Marek Olšák <maraeo at gmail.com>
Marek
More information about the mesa-dev
mailing list