On 07/30/2013 07:30 PM, Paul Berry wrote:
On 29 July 2013 11:17, Kenneth Graunke <kenn...@whitecape.org
<mailto:kenn...@whitecape.org>> wrote:

    On 07/28/2013 11:03 PM, Paul Berry wrote:

        +/**
        + * Checks if the context supports geometry shaders.
        + */
        +static inline GLboolean
        +_mesa_has_geometry_shaders(const struct gl_context *ctx)
        +{
        +   return _mesa_is_desktop_gl(ctx) &&
        +      (ctx->Version >= 32 || ctx->Extensions.ARB_geometry_shader4);
        +}


    I might change this to:

    return _mesa_is_desktop_gl(ctx) &&
        (ctx->Const.GLSLVersion >= 150 ||
    ctx->Extensions.ARB_geometry___shader4);


I have a minor preference for keeping this as is, since it's conceivable
that we might one day want to support GLSL 1.50 on some platforms that
don't support GL 3.2 (much as Chris Forbes is currently doing to support
GLSL 1.30 on Gen4-5).  The places where _mesa_has_geometry_shaders() is
used are for enabling and disabling API functionality (e.g. determining
whether LINES_ADJACENCY is a valid primitive mode, or whether
glFramebufferTexture() is allowed to be called), and I think that in
this hypothetical platform that supports GLSL 1.50 but not GL 3.2, those
pieces of functionality should be disabled.  But I admit I'm straying
pretty far into thought experiment territory at this point.

Sure, I don't really mind keeping it as is.

I personally believe that exposing GLSL 1.50 without Geometry Shaders isn't legal, but I know not everyone thinks that way. Either way, the GL 3.2 check better captures "the API exists" and should be largely equivalent anyway.

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to