summaryrefslogtreecommitdiffstats
path: root/src/mesa/pipe/softpipe
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-06-22 13:37:47 -0600
committerBrian <[email protected]>2007-06-22 13:37:47 -0600
commit5d69aeb0028f44d06093faede5c545908b0df89a (patch)
treeab6ed83af7f9f0c590e0ab1cd0b2f156217f127f /src/mesa/pipe/softpipe
parent13682d959ddacde1ce65843aa8c5b43dc9017b32 (diff)
initial texture object, texture format code
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.h2
-rw-r--r--src/mesa/pipe/softpipe/sp_state.h4
-rw-r--r--src/mesa/pipe/softpipe/sp_state_sampler.c15
4 files changed, 22 insertions, 0 deletions
diff --git a/src/mesa/pipe/softpipe/sp_context.c b/src/mesa/pipe/softpipe/sp_context.c
index 07b529fc6e4..0d00c7eb6cd 100644
--- a/src/mesa/pipe/softpipe/sp_context.c
+++ b/src/mesa/pipe/softpipe/sp_context.c
@@ -77,6 +77,7 @@ struct pipe_context *softpipe_create( void )
softpipe->pipe.set_fs_state = softpipe_set_fs_state;
softpipe->pipe.set_polygon_stipple = softpipe_set_polygon_stipple;
softpipe->pipe.set_sampler_state = softpipe_set_sampler_state;
+ softpipe->pipe.set_texture_state = softpipe_set_texture_state;
softpipe->pipe.draw_vb = softpipe_draw_vb;
softpipe->pipe.clear = softpipe_clear;
diff --git a/src/mesa/pipe/softpipe/sp_context.h b/src/mesa/pipe/softpipe/sp_context.h
index d8c0de0ad1a..7c816dbc1a7 100644
--- a/src/mesa/pipe/softpipe/sp_context.h
+++ b/src/mesa/pipe/softpipe/sp_context.h
@@ -63,6 +63,7 @@ enum interp_mode {
#define G_NEW_ALPHA_TEST 0x200
#define G_NEW_DEPTH_TEST 0x400
#define G_NEW_SAMPLER 0x800
+#define G_NEW_TEXTURE 0x1000
#define PIPE_ATTRIB_MAX 32
@@ -86,6 +87,7 @@ struct softpipe_context {
struct pipe_scissor_rect scissor;
struct pipe_poly_stipple poly_stipple;
struct pipe_sampler_state sampler[PIPE_MAX_SAMPLERS];
+ struct pipe_texture_object *texture[PIPE_MAX_SAMPLERS];
GLuint dirty;
/* Clip derived state:
diff --git a/src/mesa/pipe/softpipe/sp_state.h b/src/mesa/pipe/softpipe/sp_state.h
index faaa043a56c..735d039748a 100644
--- a/src/mesa/pipe/softpipe/sp_state.h
+++ b/src/mesa/pipe/softpipe/sp_state.h
@@ -63,6 +63,10 @@ void softpipe_set_sampler_state( struct pipe_context *,
GLuint unit,
const struct pipe_sampler_state * );
+void softpipe_set_texture_state( struct pipe_context *,
+ GLuint unit,
+ struct pipe_texture_object * );
+
void softpipe_set_scissor_rect( struct pipe_context *,
const struct pipe_scissor_rect * );
diff --git a/src/mesa/pipe/softpipe/sp_state_sampler.c b/src/mesa/pipe/softpipe/sp_state_sampler.c
index 6b422acfb6c..060e2c8c987 100644
--- a/src/mesa/pipe/softpipe/sp_state_sampler.c
+++ b/src/mesa/pipe/softpipe/sp_state_sampler.c
@@ -43,7 +43,22 @@ softpipe_set_sampler_state(struct pipe_context *pipe,
{
struct softpipe_context *softpipe = softpipe_context(pipe);
+ assert(unit < PIPE_MAX_SAMPLERS);
softpipe->sampler[unit] = *sampler;
softpipe->dirty |= G_NEW_SAMPLER;
}
+
+
+void
+softpipe_set_texture_state(struct pipe_context *pipe,
+ GLuint unit,
+ struct pipe_texture_object *texture)
+{
+ struct softpipe_context *softpipe = softpipe_context(pipe);
+
+ assert(unit < PIPE_MAX_SAMPLERS);
+ softpipe->texture[unit] = texture; /* ptr, not struct */
+
+ softpipe->dirty |= G_NEW_TEXTURE;
+}