[Mesa-dev] [PATCH] glcpp: Don't define macros for extensions that aren't in ES
Matt Turner
mattst88 at gmail.com
Wed Nov 14 18:01:14 PST 2012
On Wed, Nov 14, 2012 at 4:45 PM, Kenneth Graunke <kenneth at whitecape.org> wrote:
> On 11/14/2012 10:34 AM, Matt Turner wrote:
>>
>> Fixes 54 gles3conform tests.
>> ---
>> src/glsl/glcpp/glcpp-parse.y | 59
>> +++++++++++++++++++++--------------------
>> 1 files changed, 30 insertions(+), 29 deletions(-)
>>
>> The changes in whitespace make this patch hard to read. Here it is
>> without whitespace changes:
>>
>> --- a/src/glsl/glcpp/glcpp-parse.y
>> +++ b/src/glsl/glcpp/glcpp-parse.y
>> @@ -1138,13 +1138,13 @@ glcpp_parser_create (const struct gl_extensions
>> *extensions, int api)
>> parser->has_new_source_number = 0;
>> parser->new_source_number = 0;
>>
>> + if (api == API_OPENGLES2)
>> + add_builtin_define(parser, "GL_ES", 1);
>> + else {
>> /* Add pre-defined macros. */
>> add_builtin_define(parser, "GL_ARB_draw_buffers", 1);
>> add_builtin_define(parser, "GL_ARB_texture_rectangle", 1);
>>
>> - if (api == API_OPENGLES2)
>> - add_builtin_define(parser, "GL_ES", 1);
>> -
>> if (extensions != NULL) {
>> if (extensions->EXT_texture_array) {
>> add_builtin_define(parser, "GL_EXT_texture_array", 1);
>> @@ -1180,6 +1180,7 @@ glcpp_parser_create (const struct gl_extensions
>> *extensions, int api)
>> if (extensions->ARB_texture_cube_map_array)
>> add_builtin_define(parser, "GL_ARB_texture_cube_map_array",
>> 1);
>> }
>> + }
>>
>> language_version = 110;
>> add_builtin_define(parser, "__VERSION__", language_version);
>> --
>>
>> diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y
>> index d487521..72308e0 100644
>> --- a/src/glsl/glcpp/glcpp-parse.y
>> +++ b/src/glsl/glcpp/glcpp-parse.y
>> @@ -1138,47 +1138,48 @@ glcpp_parser_create (const struct gl_extensions
>> *extensions, int api)
>> parser->has_new_source_number = 0;
>> parser->new_source_number = 0;
>>
>> - /* Add pre-defined macros. */
>> - add_builtin_define(parser, "GL_ARB_draw_buffers", 1);
>> - add_builtin_define(parser, "GL_ARB_texture_rectangle", 1);
>> -
>> if (api == API_OPENGLES2)
>> add_builtin_define(parser, "GL_ES", 1);
>> + else {
>> + /* Add pre-defined macros. */
>> + add_builtin_define(parser, "GL_ARB_draw_buffers", 1);
>> + add_builtin_define(parser, "GL_ARB_texture_rectangle", 1);
>
>
> Nitpick: Could you leave the /* Add pre-defined macros. */ comment before
> the new if statement? Both branches do that...it's just that the set of
> pre-defined macros depends on your API.
Oh, yeah. I'd interpreted that comment as being applicable to only the
ARB_draw_buffers and ARB_texture_rectangle, but I suppose it's not.
> Assuming you fix the OES_image_external bit,
> Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Thanks!
More information about the mesa-dev
mailing list