glsl: Return -1 for program interface query locations in many cases.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 29 Mar 2016 20:21:48 +0000 (13:21 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Sat, 2 Apr 2016 05:05:20 +0000 (22:05 -0700)
commitc123294dfe2e52443f2eff2723ef922f22972ef5
treea17e4c54d9efcc7ddc2a28e8d8674834b32e29ea
parent9fe211bec4533bd5cebeb61b38343ae9c174abb7
glsl: Return -1 for program interface query locations in many cases.

We were recording locations for all variables, even ones without an
explicit location set.  Implement the rules from the spec, and record
-1 in the resource list accordngly.  Make program_resource_location
stop doing math on negative values.  Remove hacks that are no longer
necessary now that we've stopped doing that.

Fixes 4 dEQP-GLES31.functional.program_interface_query tests:
- program_input.location.separable_fragment.var
- program_input.location.separable_fragment.var_array
- program_output.location.separable_vertex.var_array
- program_output.location.separable_vertex.var_array

v2: Delete more code

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
src/compiler/glsl/linker.cpp
src/mesa/main/shader_query.cpp