summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_atom_sampler.c
diff options
context:
space:
mode:
authorZack Rusin <zack@tungstengraphics.com>2007-09-17 09:47:41 -0400
committerZack Rusin <zack@tungstengraphics.com>2007-09-18 06:31:22 -0400
commitf117327a3f246713abfd4dc4320d4a1a7f1b811a (patch)
tree81c5c58c0ae0685c917996ad04f10003aa95cfa3 /src/mesa/state_tracker/st_atom_sampler.c
parente16c045b83f5c5b4f4064df67623bb76b46b6619 (diff)
Make sampler an immutable state object.
Switch the sample to be an immutable state object.
Diffstat (limited to 'src/mesa/state_tracker/st_atom_sampler.c')
-rw-r--r--src/mesa/state_tracker/st_atom_sampler.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mesa/state_tracker/st_atom_sampler.c b/src/mesa/state_tracker/st_atom_sampler.c
index d65565f991..9a728e2d79 100644
--- a/src/mesa/state_tracker/st_atom_sampler.c
+++ b/src/mesa/state_tracker/st_atom_sampler.c
@@ -33,6 +33,7 @@
#include "st_context.h"
+#include "st_cache.h"
#include "st_atom.h"
#include "pipe/p_context.h"
#include "pipe/p_defines.h"
@@ -142,10 +143,13 @@ update_samplers(struct st_context *st)
/* XXX more sampler state here */
}
- if (memcmp(&sampler, &st->state.sampler[u], sizeof(sampler)) != 0) {
+ const struct pipe_sampler_state *cached_sampler =
+ st_cached_sampler_state(st, &sampler);
+
+ if (cached_sampler == st->state.sampler[u]) {
/* state has changed */
- st->state.sampler[u] = sampler;
- st->pipe->set_sampler_state(st->pipe, u, &sampler);
+ st->state.sampler[u] = cached_sampler;
+ st->pipe->bind_sampler_state(st->pipe, u, cached_sampler);
}
}
}