summaryrefslogtreecommitdiffstats
path: root/src/mesa/pipe/softpipe
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/pipe/softpipe')
-rw-r--r--src/mesa/pipe/softpipe/sp_context.c1
-rw-r--r--src/mesa/pipe/softpipe/sp_context.h1
-rw-r--r--src/mesa/pipe/softpipe/sp_quad_fs.c1
-rw-r--r--src/mesa/pipe/softpipe/sp_state.h3
-rw-r--r--src/mesa/pipe/softpipe/sp_state_sampler.c14
5 files changed, 20 insertions, 0 deletions
diff --git a/src/mesa/pipe/softpipe/sp_context.c b/src/mesa/pipe/softpipe/sp_context.c
index 476d4ac01cc..58ef744f304 100644
--- a/src/mesa/pipe/softpipe/sp_context.c
+++ b/src/mesa/pipe/softpipe/sp_context.c
@@ -318,6 +318,7 @@ struct pipe_context *softpipe_create( struct pipe_winsys *pipe_winsys,
softpipe->pipe.set_feedback_state = softpipe_set_feedback_state;
softpipe->pipe.set_framebuffer_state = softpipe_set_framebuffer_state;
softpipe->pipe.set_polygon_stipple = softpipe_set_polygon_stipple;
+ softpipe->pipe.set_sampler_units = softpipe_set_sampler_units;
softpipe->pipe.set_scissor_state = softpipe_set_scissor_state;
softpipe->pipe.set_texture_state = softpipe_set_texture_state;
softpipe->pipe.set_viewport_state = softpipe_set_viewport_state;
diff --git a/src/mesa/pipe/softpipe/sp_context.h b/src/mesa/pipe/softpipe/sp_context.h
index 3e77bd6b856..88a418d3c7d 100644
--- a/src/mesa/pipe/softpipe/sp_context.h
+++ b/src/mesa/pipe/softpipe/sp_context.h
@@ -95,6 +95,7 @@ struct softpipe_context {
struct pipe_viewport_state viewport;
struct pipe_vertex_buffer vertex_buffer[PIPE_ATTRIB_MAX];
struct pipe_vertex_element vertex_element[PIPE_ATTRIB_MAX];
+ uint sampler_units[PIPE_MAX_SAMPLERS];
unsigned dirty;
/*
diff --git a/src/mesa/pipe/softpipe/sp_quad_fs.c b/src/mesa/pipe/softpipe/sp_quad_fs.c
index 3371b109fcb..9b9504cd157 100644
--- a/src/mesa/pipe/softpipe/sp_quad_fs.c
+++ b/src/mesa/pipe/softpipe/sp_quad_fs.c
@@ -85,6 +85,7 @@ shade_quad(
/* Consts does not require 16 byte alignment. */
machine->Consts = softpipe->mapped_constants[PIPE_SHADER_FRAGMENT];
+ machine->SamplerUnits = softpipe->sampler_units;
machine->InterpCoefs = quad->coef;
machine->Inputs[0].xyzw[0].f[0] = fx;
diff --git a/src/mesa/pipe/softpipe/sp_state.h b/src/mesa/pipe/softpipe/sp_state.h
index c194f0ea0db..61532bcdebb 100644
--- a/src/mesa/pipe/softpipe/sp_state.h
+++ b/src/mesa/pipe/softpipe/sp_state.h
@@ -99,6 +99,9 @@ void softpipe_delete_vs_state(struct pipe_context *, void *);
void softpipe_set_polygon_stipple( struct pipe_context *,
const struct pipe_poly_stipple * );
+void softpipe_set_sampler_units( struct pipe_context *,
+ uint numSamplers, const uint *units );
+
void softpipe_set_scissor_state( struct pipe_context *,
const struct pipe_scissor_state * );
diff --git a/src/mesa/pipe/softpipe/sp_state_sampler.c b/src/mesa/pipe/softpipe/sp_state_sampler.c
index c00e815f2d4..e70eabd578b 100644
--- a/src/mesa/pipe/softpipe/sp_state_sampler.c
+++ b/src/mesa/pipe/softpipe/sp_state_sampler.c
@@ -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;
+}
+
+