[Mesa-dev] [PATCH 6/7] mesa: Update _mesa_has_geometry_shaders
Matt Turner
mattst88 at gmail.com
Wed Sep 23 08:38:21 PDT 2015
On Wed, Sep 23, 2015 at 4:36 AM, Eduardo Lima Mitev <elima at igalia.com> wrote:
> On 09/23/2015 10:42 AM, Marta Lofstedt wrote:
>> From: Marta Lofstedt <marta.lofstedt at intel.com>
>>
>> Updates the _mesa_has_geometry_shaders function to also look
>> for OpenGL ES 3.1 contexts that has OES_geometry_shader enabled.
>> ---
>> src/mesa/main/context.h | 7 +++++--
>> 1 file changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h
>> index 0f7529a..6ce048a 100644
>> --- a/src/mesa/main/context.h
>> +++ b/src/mesa/main/context.h
>> @@ -328,8 +328,11 @@ _mesa_is_gles31(const struct gl_context *ctx)
>> static inline bool
>> _mesa_has_geometry_shaders(const struct gl_context *ctx)
>> {
>> - return _mesa_is_desktop_gl(ctx) &&
>> - (ctx->Version >= 32 || ctx->Extensions.ARB_geometry_shader4);
>> + return (_mesa_is_gles31(ctx) &&
>> + ctx->Extensions.OES_geometry_shader) ||
>> + (_mesa_is_desktop_gl(ctx) &&
>> + (ctx->Version >= 32 ||
>> + ctx->Extensions.ARB_geometry_shader4));
>
> I think there is unnecessary line breaking, what about:
>
> return (_mesa_is_gles31(ctx) && ctx->Extensions.OES_geometry_shader) ||
> (_mesa_is_desktop_gl(ctx) &&
> (ctx->Version >= 32 || ctx->Extensions.ARB_geometry_shader4));
This is a good suggestion, but the last line needs to be indented one
space more since it's part of the && expression with the line above.
More information about the mesa-dev
mailing list