program_resource: subroutine active uniforms should return NumSubroutineUniforms
authorAlejandro Piñeiro <apinheiro@igalia.com>
Thu, 18 Aug 2016 17:44:55 +0000 (19:44 +0200)
committerAlejandro Piñeiro <apinheiro@igalia.com>
Wed, 24 Aug 2016 09:33:04 +0000 (11:33 +0200)
commit07fe2d565bb117e8ae0a96b084633cc5a18b029d
treee07ab0bcdbde7111becee9bf211ee187c360471d
parent690ead4a135aed68ddb8dcfceccd11adf27ff1f1
program_resource: subroutine active uniforms should return NumSubroutineUniforms

Before this commit, GetProgramInterfaceiv for pname ACTIVE_RESOURCES
and all the <shader>_SUBROUTINE_UNIFORM programInterface were
returning the count of resources on the shader program using that
interface, instead of the num of uniform resources. This would get a
wrong value (for example) if the shader has an array of subroutine
uniforms.

Note that this means that in order to get a proper value, the shader
needs to be linked, something that is not explicitly mentioned on
ARB_program_interface_query spec, but comes from the general
definition of active uniform. If the program is not linked we
return 0.

v2: don't generate an error if the program is not linked, returning 0
    active uniforms instead, plus extra spec references (Tapani Palli)

Fixes GL44-CTS.program_interface_query.subroutines-compute

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
src/mesa/main/program_resource.c