Skip to content

Add tests for the precision qualifiers of return values of a function

Neil Roberts requested to merge nroberts/piglit:return-precision into master

In GLSL ES, all types can have a precision qualifier, including the return type of a function. According to this quote in the GLSL ES spec, the precision of the return type should match between multiple declarations of the same function:

Only a precision qualifier is allowed on the return type of a function. […] If a function name is declared twice with the same parameter types, then the return types and all qualifiers must also match, and it is the same function being declared.

This merge request adds a couple of tests to ensure that breaking these rules makes the shader fail to compile.

Mesa currently just ignores precision qualifiers on return types of functions. There is a merge request for Mesa to change this behaviour so that it stores the precision internally and also checks for the mismatches.

Merge request reports