<div dir="ltr">On 31 July 2013 16:09, Ian Romanick <span dir="ltr"><<a href="mailto:idr@freedesktop.org" target="_blank">idr@freedesktop.org</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On 07/30/2013 09:25 PM, Kenneth Graunke wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 07/30/2013 07:30 PM, Paul Berry wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 29 July 2013 11:17, Kenneth Graunke <<a href="mailto:kenneth@whitecape.org" target="_blank">kenneth@whitecape.org</a><br>
<mailto:<a href="mailto:kenneth@whitecape.org" target="_blank">kenneth@whitecape.org</a>><u></u>> wrote:<br>
<br>
On 07/28/2013 11:03 PM, Paul Berry wrote:<br>
<br>
+/**<br>
+ * Checks if the context supports geometry shaders.<br>
+ */<br>
+static inline GLboolean<br>
+_mesa_has_geometry_shaders(<u></u>const struct gl_context *ctx)<br>
+{<br>
+ return _mesa_is_desktop_gl(ctx) &&<br>
+ (ctx->Version >= 32 ||<br>
ctx->Extensions.ARB_geometry_<u></u>shader4);<br>
+}<br>
<br>
<br>
I might change this to:<br>
<br>
return _mesa_is_desktop_gl(ctx) &&<br>
(ctx->Const.GLSLVersion >= 150 ||<br>
ctx->Extensions.ARB_geometry__<u></u>_shader4);<br>
<br>
<br>
I have a minor preference for keeping this as is, since it's conceivable<br>
that we might one day want to support GLSL 1.50 on some platforms that<br>
don't support GL 3.2 (much as Chris Forbes is currently doing to support<br>
GLSL 1.30 on Gen4-5). The places where _mesa_has_geometry_shaders() is<br>
used are for enabling and disabling API functionality (e.g. determining<br>
whether LINES_ADJACENCY is a valid primitive mode, or whether<br>
glFramebufferTexture() is allowed to be called), and I think that in<br>
this hypothetical platform that supports GLSL 1.50 but not GL 3.2, those<br>
pieces of functionality should be disabled. But I admit I'm straying<br>
pretty far into thought experiment territory at this point.<br>
</blockquote>
<br>
Sure, I don't really mind keeping it as is.<br>
<br>
I personally believe that exposing GLSL 1.50 without Geometry Shaders<br>
isn't legal, but I know not everyone thinks that way. Either way, the<br>
GL 3.2 check better captures "the API exists" and should be largely<br>
equivalent anyway.<br>
</blockquote>
<br></div></div>
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.<br>
<br>
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.<br>
</blockquote><div><br></div><div>Hmm, that's an interesting data point.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
*shrug*<br></blockquote><div><br></div><div>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.<br>
</div></div></div></div>