summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_state.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2013-09-12 15:09:01 -0600
committerBrian Paul <brianp@vmware.com>2013-10-03 14:05:26 -0600
commit8280b29d7c9fa472e2e7e10e5f920e04075186e2 (patch)
tree2e045a2e9dfc1c9ee1a109793fa7402a4c55c6b1 /src/gallium/drivers/r300/r300_state.c
parent0de99d52b7953a90da69cc33dfaf2f15467a0d2b (diff)
downloadexternal_mesa3d-8280b29d7c9fa472e2e7e10e5f920e04075186e2.zip
external_mesa3d-8280b29d7c9fa472e2e7e10e5f920e04075186e2.tar.gz
external_mesa3d-8280b29d7c9fa472e2e7e10e5f920e04075186e2.tar.bz2
radeon: implement pipe_context::bind_sampler_states()
Diffstat (limited to 'src/gallium/drivers/r300/r300_state.c')
-rw-r--r--src/gallium/drivers/r300/r300_state.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c
index 249ee8b..e10ea16 100644
--- a/src/gallium/drivers/r300/r300_state.c
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -1541,6 +1541,31 @@ static void r300_bind_fragment_sampler_states(struct pipe_context* pipe,
r300_mark_atom_dirty(r300, &r300->textures_state);
}
+static void r300_bind_sampler_states(struct pipe_context* pipe,
+ unsigned shader,
+ unsigned start, unsigned count,
+ void** states)
+{
+ struct r300_context* r300 = r300_context(pipe);
+ struct r300_textures_state* state =
+ (struct r300_textures_state*)r300->textures_state.state;
+ unsigned tex_units = r300->screen->caps.num_tex_units;
+
+ assert(start == 0);
+
+ if (shader != PIPE_SHADER_FRAGMENT)
+ return;
+
+ if (count > tex_units)
+ return;
+
+ memcpy(state->sampler_states, states, sizeof(void*) * count);
+ state->sampler_state_count = count;
+
+ r300_mark_atom_dirty(r300, &r300->textures_state);
+}
+
+
static void r300_lacks_vertex_textures(struct pipe_context* pipe,
unsigned count,
void** states)
@@ -2157,6 +2182,7 @@ void r300_init_state_functions(struct r300_context* r300)
r300->context.delete_rasterizer_state = r300_delete_rs_state;
r300->context.create_sampler_state = r300_create_sampler_state;
+ r300->context.bind_sampler_states = r300_bind_sampler_states;
r300->context.bind_fragment_sampler_states = r300_bind_fragment_sampler_states;
r300->context.bind_vertex_sampler_states = r300_lacks_vertex_textures;
r300->context.delete_sampler_state = r300_delete_sampler_state;