diff options
author | Zack Rusin <zack@tungstengraphics.com> | 2007-09-17 09:47:41 -0400 |
---|---|---|
committer | Zack Rusin <zack@tungstengraphics.com> | 2007-09-18 06:31:22 -0400 |
commit | f117327a3f246713abfd4dc4320d4a1a7f1b811a (patch) | |
tree | 81c5c58c0ae0685c917996ad04f10003aa95cfa3 /src/mesa/pipe/softpipe/sp_state_sampler.c | |
parent | e16c045b83f5c5b4f4064df67623bb76b46b6619 (diff) |
Make sampler an immutable state object.
Switch the sample to be an immutable state object.
Diffstat (limited to 'src/mesa/pipe/softpipe/sp_state_sampler.c')
-rw-r--r-- | src/mesa/pipe/softpipe/sp_state_sampler.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/src/mesa/pipe/softpipe/sp_state_sampler.c b/src/mesa/pipe/softpipe/sp_state_sampler.c index 2e3d0c3d65..09898eb579 100644 --- a/src/mesa/pipe/softpipe/sp_state_sampler.c +++ b/src/mesa/pipe/softpipe/sp_state_sampler.c @@ -34,21 +34,39 @@ +const struct pipe_sampler_state * +softpipe_create_sampler_state(struct pipe_context *pipe, + const struct pipe_sampler_state *sampler) +{ + struct pipe_sampler_state *new_sampler = malloc(sizeof(struct pipe_sampler_state)); + memcpy(new_sampler, sampler, sizeof(struct pipe_sampler_state)); + + return new_sampler; +} + void -softpipe_set_sampler_state(struct pipe_context *pipe, - unsigned unit, - const struct pipe_sampler_state *sampler) +softpipe_bind_sampler_state(struct pipe_context *pipe, + unsigned unit, + const struct pipe_sampler_state *sampler) { struct softpipe_context *softpipe = softpipe_context(pipe); assert(unit < PIPE_MAX_SAMPLERS); - softpipe->sampler[unit] = *sampler; + softpipe->sampler[unit] = sampler; softpipe->dirty |= SP_NEW_SAMPLER; } void +softpipe_delete_sampler_state(struct pipe_context *pipe, + const struct pipe_sampler_state *sampler) +{ + free((struct pipe_sampler_state*)sampler); +} + + +void softpipe_set_texture_state(struct pipe_context *pipe, unsigned unit, struct pipe_mipmap_tree *texture) |