[Mesa-dev] [PATCH 1/2] glsl: Refactor #version validation to be more future-proof.

Eric Anholt eric at anholt.net
Thu Jul 26 16:03:28 PDT 2012


Kenneth Graunke <kenneth at whitecape.org> writes:

> The previous implementation required a flag in _mesa_glsl_parse_state
> and line of code to initialize it for every version of the shading
> language we intend to support.  As we look to add 150, 330, 400, 410,
> 420, and beyond, this gets rather unwieldy.
>
> This patch retains the switch statement (to reject, say, #version 111),
> but removes all the bits.  Code to check for ctx->API == API_OPENGL_CORE
> could easily be added to the 110 and 120 cases to reject those.

Reviewed-by: Eric Anholt <eric at anholt.net>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20120726/8730bedb/attachment.pgp>


More information about the mesa-dev mailing list