[Mesa-dev] glsl es question: invalid pragma debug argument

Matt Turner mattst88 at gmail.com
Mon Nov 24 11:04:07 PST 2014

On Mon, Nov 24, 2014 at 2:13 AM, Samuel Iglesias Gonsálvez
<siglesias at igalia.com> wrote:
> Hash: SHA1
> Hello,
> I found a GLSL ES test that provides an invalid argument to #pragma
> debug() such as:
>     #pragma debug (1.23)
> And it expects a compilation error. Mesa doesn't complain about it,
> just ignore the whole thing. The allowed keywords are 'on' and 'off'
> for that pragma.
> - From GLSL ES 3.00 spec, chapter 3.4 (Preprocessor), page 12:
>        "#pragma allows implementation dependent compiler control.
>        Tokens following #pragma are not subject to preprocessor macro
>        expansion. If an implementation does not recognize the tokens
>        following #pragma, then it will ignore that pragma. [...] The
>        debug pragma
>           #pragma debug(on)
>           #pragma debug(off)
>        can be used to enable compiling and annotating a shader with
>        debug information, so that it can be used with a debugger. It
>        can only be used outside function definitions. By default, debug
>        is turned off.
>        The scope as well as the effect of the optimize and debug
>        pragmas is implementation-dependent except that their use must
>        not generate an error."
> So, from the spec, I understand that Mesa is doing the right thing but
> I would like to have a confirmation because it is a valid pragma but
> with wrong argument.

I think you're correct that Mesa is doing the right thing. The spec
seems pretty black-and-white to me.

More information about the mesa-dev mailing list