On 31 July 2013 16:09, Ian Romanick <i...@freedesktop.org> wrote: > On 07/30/2013 09:25 PM, Kenneth Graunke wrote: > >> 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. >> > > Except that we need some way to determine when to enable 3.2 in > compute_version. Using either GLSL version or this flag would do it. > > We have already encountered at least one application that wants to use > GLSL 3.30 without geometry shaders (Dota2), so the plan of enabling higher > GLSL versions without the rest of the core GL version may not be so crazy. > However, we might just want to do it for whitelisted apps. >
Hmm, that's an interesting data point. > > *shrug* > Yeah, that's kind of how I feel right now too. At this point I've reworked my branch to follow Ken's suggestions. If in the future we decide we want to switch to the ctx->Const.GeometryShaders150 approach, it will be an easy change.
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev