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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user