On 08/13/2013 03:50 PM, Matt Turner wrote:
On Tue, Aug 13, 2013 at 1:35 PM, Ian Romanick <i...@freedesktop.org> wrote:
and the spec doesn't explicitly forbid it.

I was surprised by this, so I verified it.

In the GLSL ES 3.0 spec:

single_declaration
  fully_specified_type
   type_specifier
    precision_qualifier type_specifier_no_prec

precision_qualifier
  <highp, mediump, lowp>

type_specifier_no_prec
  type_specifier_nonarray
   <expands to list of built-in types>

Seems weird, but legitimate.

C allows empty declarations too. I believe it's a side-effect of function prototypes without formal parameter names. If you can do

int foo(int, float, struct S *);

it's easy to end up with a parser that can also do

int;
float;
struct S *;

It's actually more work to reject those (or generate a warning).

Have we actually seen 'highp float;' in the wild (outside of piglit)?

Not that I know of.

Assuming that the two instances of "highp" in precision_names is
intentional (or was not, but is fixed)

I had to put something in the ast_precision_none slot, and that seemed as good a choice as any. "" didn't seem too good. :)

Reviewed-by: Matt Turner <matts...@gmail.com>

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to