mesa/program_resource: return -1 for index if no location.
authorDave Airlie <airlied@redhat.com>
Mon, 23 May 2016 20:41:21 +0000 (06:41 +1000)
committerDave Airlie <airlied@redhat.com>
Mon, 6 Jun 2016 20:10:19 +0000 (06:10 +1000)
commit07403014c3a29bfdecc89def187389ac9f208529
tree7886817d884483ae38d2f18ec346ee42a201d704
parentec2b52e2d9d7114df6e6023eec5949c4c6a76d52
mesa/program_resource: return -1 for index if no location.

The GL4.5 spec quote seems clear on this:
"The value -1 will be returned by either command if an error occurs,
if name does not identify an active variable on programInterface,
or if name identifies an active variable that does not have a valid
location assigned, as described above."

This fixes:
GL45-CTS.program_interface_query.output-built-in

[airlied: use _mesa_program_resource_location_index as
suggested by Eduardo]
Reviewed-by: Eduardo Lima Mitev <elima@igalia.com>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/mesa/main/shader_query.cpp