program_resource: subroutine active uniforms should return NumSubroutineUniforms

Graphics / Mesa 3D Graphics Library / Mesa - Alejandro Piñeiro [igalia.com] - 24 August 2016 04:33 UTC

Before this commit, GetProgramInterfaceiv for pname ACTIVE_RESOURCES and all the _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

07fe2d5 program_resource: subroutine active uniforms should return NumSubroutineUniforms
src/mesa/main/program_resource.c | 141 +++++++++++++++++++++++++++++++-------
1 file changed, 118 insertions(+), 23 deletions(-)

Upstream: cgit.freedesktop.org


  • Share