trim: Conservatively make shader programs depend on textures
Some shader programs sample textures, so if the shader is included in
the trimmed output the texture needs to be included as well.
We don't have support inside of "apitrace trim" to parse GLSL to find
names of samplers to find these dependencies. Instead, we provide here
a simple heuristic:
In order to sample a texture, the OpenGL program must associate the
name of a texture unit with a location in the shader by calling
glUniform1i (or glUniform1iv). So we can notice whenever texture-unit
names are being passed and create a dependency from the shader to all
texture targets for that unit.
This is conservative on two fronts:
1. The value being passed to glUniformi might only be coincidentally
the same as a texture-unit name and be actually unrelated to
texture sampling.
2. The shader likely doesn't depend on all texture targets, but
again we can't know which without looking inside the shader, so
we associate all of them.