[Mesa-dev] [PATCH] glsl: Add gl_MaxViewports to available builtin constants

Matt Turner mattst88 at gmail.com
Mon Dec 15 11:55:32 PST 2014


On Sun, Dec 14, 2014 at 11:47 AM, Maxence Le Doré
<maxence.ledore at gmail.com> wrote:
> Hi Matt,
>
> To be sure to not missing something, I used a simple vertex shader I have
> there and had
> the following line in :
>
> int a = gl_MaxDrawBuffers;
>
> At runtime, everything was ok, and GLSL compiler didn't complain about
> anything. So there is nothing in mesa to prevent the use of some GLSL
> constants having some specifity to one or more shading stage.
>
> But a more interesting stuff is when I took a look at GLSL 4.1 spec there :
> https://www.opengl.org/registry/doc/GLSLangSpec.4.10.6.clean.pdf
>
> See section 7.3
>
> "Built-In Constants
> The following built-in constants are provided to all shaders. The actual
> values used are implementation dependent, but must be at least the value
> shown. Some are deprecated, as indicated in comments."
>
> Follows a list where gl_MaxViewports is.

Interesting. So the extensions spec is just behind the times. Thanks
for clearing that up!

Reviewed-by: Matt Turner <mattst88 at gmail.com>

I'll commit this.


More information about the mesa-dev mailing list