mesa: fix active subroutine uniforms properly

Graphics / Mesa 3D Graphics Library / Mesa - Timothy Arceri [collabora.com] - 28 November 2016 22:29 UTC

07fe2d565b introduced a big hack in order to return NumSubroutineUniforms when querying ACTIVE_RESOURCES for _SUBROUTINE_UNIFORM interfaces. However this is the wrong fix we are meant to be returning the number of active resources i.e. the count of subroutine uniforms in the resource list which is what the code was previously doing, anything else will cause trouble when trying to retrieve the resource properties based on the ACTIVE_RESOURCES count.

The real problem is that NumSubroutineUniforms was counting array elements as separate uniforms but the innermost array is always considered a single uniform so we fix that count instead which was counted incorrectly in 7fa0250f9.

Idealy we could probably completely remove NumSubroutineUniforms and just compute its value when needed from the resource list but this works for now.

0303201 mesa: fix active subroutine uniforms properly
src/compiler/glsl/link_uniforms.cpp | 2 +
src/compiler/glsl/linker.cpp | 1 -
src/mesa/main/program_resource.c | 111 +++--------------------------------
3 files changed, 10 insertions(+), 104 deletions(-)

Upstream: cgit.freedesktop.org


  • Share