Varyings can be considered inputs or outputs of a program only when SSO is in use. With multi-stage programs, inputs contain only inputs for first stage and outputs contains outputs of the final shader stage.
I've tested that fix works for Assault Android Cactus (demo version) and does not cause Piglit or CTS regressions in glGetProgramiv tests.
Following ES 3.1 CTS separate shader tests that do query properties of varyings in SSO shader programs pass:
ES31-CTS.program_interface_query.separate-programs-vertex ES31-CTS.program_interface_query.separate-programs-fragment
4e7fd66 glsl: add varyings to resource list only with SSO
src/glsl/linker.cpp | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
Upstream: cgit.freedesktop.org