glsl/linker: generalize validate_explicit_variable_location for SSO
authorIago Toral Quiroga <itoral@igalia.com>
Fri, 20 Oct 2017 08:46:10 +0000 (10:46 +0200)
committerIago Toral Quiroga <itoral@igalia.com>
Thu, 26 Oct 2017 06:40:14 +0000 (08:40 +0200)
commitbdaf0589785138f91cd485fd698274a33b7d33d5
tree3aee740cbf4447ee5111a6e78f6ccfdafeea1192
parente7b7fe314e414a6b7953f7b485d86849e00ae5fc
glsl/linker: generalize validate_explicit_variable_location for SSO

For non-SSO programs, we only need to validate outputs, since
the cross validation of outputs to inputs will ensure that we
produce linker errors for invalid inputs too.

Hoever, for the SSO path there is no output to input validation,
so we need to validate inputs explicitly. Generalize the function
so it can handle this as well.

Also, notice that vertex shader inputs and fragment shader outputs
are already validated in assign_attribute_or_color_locations()
for both SSO and non-SSO paths, so we should not try to validate
that here again (in fact, the function would require explicit
paths to handle these two cases properly).

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/compiler/glsl/link_varyings.cpp