Re-implement GLSL texture sampler variables.

GLSL sampler variables indicate which texture unit to use for TEX instructions.
Previously, this was baked into the fragment/vertex program and couldn't be
readily changed once set.
Now, SamplerUnits[] array indicates which texture unit is to be used for
each sampler variable.  These values are set with glUniform1i().
This is extra state that must be passed to the fragment/vertex program
executor at runtime.
This commit is contained in:
Brian
2007-10-26 19:19:09 -06:00
parent 789d248558
commit 8fed2466e4
31 changed files with 264 additions and 108 deletions

View File

@@ -78,3 +78,17 @@ softpipe_set_texture_state(struct pipe_context *pipe,
softpipe->dirty |= SP_NEW_TEXTURE;
}
void
softpipe_set_sampler_units(struct pipe_context *pipe,
uint num_samplers, const uint *units )
{
struct softpipe_context *softpipe = softpipe_context(pipe);
uint i;
for (i = 0; i < num_samplers; i++)
softpipe->sampler_units[i] = units[i];
softpipe->dirty |= SP_NEW_SAMPLER;
}