mesa: faster validation of sampler unit mapping for SSO
authorGregory Hainaut <gregory.hainaut@gmail.com>
Fri, 24 Jun 2016 08:07:02 +0000 (10:07 +0200)
committerTimothy Arceri <timothy.arceri@collabora.com>
Tue, 5 Jul 2016 06:44:31 +0000 (16:44 +1000)
commit6a524c76f502fe15bb3612065a23ece693aed237
tree3ca20d9043342502b503abc81b44d489870215db
parentcb728df9670d8399479db8502145bbc6f653cfb3
mesa: faster validation of sampler unit mapping for SSO

Code was inspired from _mesa_update_shader_textures_used

However unlike _mesa_update_shader_textures_used that only check for a single
stage, it will check all stages.

It avoids to loop on all uniforms, only active samplers are checked.

For my use case: high FS frequency switches with few samplers.
Perf event (relative to nouveau_dri.so) goes from 5.01% to 1.68% for
the _mesa_sampler_uniforms_pipeline_are_valid function.

Signed-off-by: Gregory Hainaut <gregory.hainaut@gmail.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
src/mesa/main/uniform_query.cpp