glsl/linker: Don’t check precision for shader interface

On GLES, the interface between vertex and fragment shaders doesn’t
need to have matching precision.

Section 4.3.10 of the GLSL ES 3.00 spec:

“The type of vertex outputs and fragment inputs with the same name
 must match, otherwise the link command will fail. The precision does
 not need to match.”

Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
Neil Roberts 2019-04-23 15:19:35 +02:00
parent 230d1e8d86
commit 19b27a8569
1 changed files with 5 additions and 2 deletions

View File

@ -218,9 +218,12 @@ cross_validate_types_and_qualifiers(struct gl_context *ctx,
/* Structures across shader stages can have different name
* and considered to match in type if and only if structure
* members match in name, type, qualification, and declaration
* order.
* order. The precision doesnt need to match.
*/
if (!output->type->record_compare(type_to_match, false, true)) {
if (!output->type->record_compare(type_to_match,
false, /* match_name */
true, /* match_locations */
false /* match_precision */)) {
linker_error(prog,
"%s shader output `%s' declared as struct `%s', "
"doesn't match in type with %s shader input "