summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/softpipe
diff options
context:
space:
mode:
authorZack Rusin <zack@tungstengraphics.com>2007-09-21 07:00:20 -0400
committerZack Rusin <zack@tungstengraphics.com>2007-09-21 07:00:20 -0400
commit6cb87cf26f904b891faa42268f373864fa33541d (patch)
tree3af84bdc648094b7515ed924bd5d3b2f4e03c407 /src/mesa/pipe/softpipe
parentb0fa489eba9170c4b102bf0feb1b1c3f02a34e4e (diff)
Make the alpha test state a cso.
Diffstat (limited to 'src/mesa/pipe/softpipe')
-rw-r--r--src/mesa/pipe/softpipe/sp_context.c4
-rw-r--r--src/mesa/pipe/softpipe/sp_context.h2
-rw-r--r--src/mesa/pipe/softpipe/sp_quad.c2
-rw-r--r--src/mesa/pipe/softpipe/sp_quad_alpha_test.c4
-rw-r--r--src/mesa/pipe/softpipe/sp_state.h12
-rw-r--r--src/mesa/pipe/softpipe/sp_state_blend.c20
6 files changed, 33 insertions, 11 deletions
diff --git a/src/mesa/pipe/softpipe/sp_context.c b/src/mesa/pipe/softpipe/sp_context.c
index cac44606f7..a6ab45314c 100644
--- a/src/mesa/pipe/softpipe/sp_context.c
+++ b/src/mesa/pipe/softpipe/sp_context.c
@@ -260,6 +260,9 @@ struct pipe_context *softpipe_create( struct pipe_winsys *pipe_winsys,
softpipe->pipe.get_param = softpipe_get_param;
/* state setters */
+ softpipe->pipe.create_alpha_test_state = softpipe_create_alpha_test_state;
+ softpipe->pipe.bind_alpha_test_state = softpipe_bind_alpha_test_state;
+ softpipe->pipe.delete_alpha_test_state = softpipe_delete_alpha_test_state;
softpipe->pipe.create_blend_state = softpipe_create_blend_state;
softpipe->pipe.bind_blend_state = softpipe_bind_blend_state;
softpipe->pipe.delete_blend_state = softpipe_delete_blend_state;
@@ -279,7 +282,6 @@ struct pipe_context *softpipe_create( struct pipe_winsys *pipe_winsys,
softpipe->pipe.bind_vs_state = softpipe_bind_vs_state;
softpipe->pipe.delete_vs_state = softpipe_delete_shader_state;
- softpipe->pipe.set_alpha_test_state = softpipe_set_alpha_test_state;
softpipe->pipe.set_blend_color = softpipe_set_blend_color;
softpipe->pipe.set_clip_state = softpipe_set_clip_state;
softpipe->pipe.set_clear_color_state = softpipe_set_clear_color_state;
diff --git a/src/mesa/pipe/softpipe/sp_context.h b/src/mesa/pipe/softpipe/sp_context.h
index 95215eb640..7b1518cfac 100644
--- a/src/mesa/pipe/softpipe/sp_context.h
+++ b/src/mesa/pipe/softpipe/sp_context.h
@@ -70,6 +70,7 @@ struct softpipe_context {
/* The most recent drawing state as set by the driver:
*/
+ const struct pipe_alpha_test_state *alpha_test;
const struct pipe_blend_state *blend;
const struct pipe_sampler_state *sampler[PIPE_MAX_SAMPLERS];
const struct pipe_depth_stencil_state *depth_stencil;
@@ -77,7 +78,6 @@ struct softpipe_context {
const struct pipe_shader_state *fs;
const struct pipe_shader_state *vs;
- struct pipe_alpha_test_state alpha_test;
struct pipe_blend_color blend_color;
struct pipe_clear_color_state clear_color;
struct pipe_clip_state clip;
diff --git a/src/mesa/pipe/softpipe/sp_quad.c b/src/mesa/pipe/softpipe/sp_quad.c
index fc4f8328cf..74a21dc54b 100644
--- a/src/mesa/pipe/softpipe/sp_quad.c
+++ b/src/mesa/pipe/softpipe/sp_quad.c
@@ -54,7 +54,7 @@ sp_build_quad_pipeline(struct softpipe_context *sp)
sp->quad.first = sp->quad.depth_test;
}
- if (sp->alpha_test.enabled) {
+ if (sp->alpha_test->enabled) {
sp->quad.alpha_test->next = sp->quad.first;
sp->quad.first = sp->quad.alpha_test;
}
diff --git a/src/mesa/pipe/softpipe/sp_quad_alpha_test.c b/src/mesa/pipe/softpipe/sp_quad_alpha_test.c
index 64c1624bd0..4f28414b0e 100644
--- a/src/mesa/pipe/softpipe/sp_quad_alpha_test.c
+++ b/src/mesa/pipe/softpipe/sp_quad_alpha_test.c
@@ -14,10 +14,10 @@ static void
alpha_test_quad(struct quad_stage *qs, struct quad_header *quad)
{
struct softpipe_context *softpipe = qs->softpipe;
- const float ref = softpipe->alpha_test.ref;
+ const float ref = softpipe->alpha_test->ref;
unsigned passMask = 0x0, j;
- switch (softpipe->alpha_test.func) {
+ switch (softpipe->alpha_test->func) {
case PIPE_FUNC_NEVER:
quad->mask = 0x0;
break;
diff --git a/src/mesa/pipe/softpipe/sp_state.h b/src/mesa/pipe/softpipe/sp_state.h
index 62323c41c3..f0e1461d25 100644
--- a/src/mesa/pipe/softpipe/sp_state.h
+++ b/src/mesa/pipe/softpipe/sp_state.h
@@ -33,6 +33,15 @@
#include "pipe/p_state.h"
+
+void *
+softpipe_create_alpha_test_state(struct pipe_context *,
+ const struct pipe_alpha_test_state *);
+void
+softpipe_bind_alpha_test_state(struct pipe_context *, void *);
+void
+softpipe_delete_alpha_test_state(struct pipe_context *, void *);
+
void *
softpipe_create_blend_state(struct pipe_context *,
const struct pipe_blend_state *);
@@ -62,9 +71,6 @@ void softpipe_delete_rasterizer_state(struct pipe_context *, void *);
void softpipe_set_framebuffer_state( struct pipe_context *,
const struct pipe_framebuffer_state * );
-void softpipe_set_alpha_test_state( struct pipe_context *,
- const struct pipe_alpha_test_state * );
-
void softpipe_set_blend_color( struct pipe_context *pipe,
const struct pipe_blend_color *blend_color );
diff --git a/src/mesa/pipe/softpipe/sp_state_blend.c b/src/mesa/pipe/softpipe/sp_state_blend.c
index cf47607955..cb0921f687 100644
--- a/src/mesa/pipe/softpipe/sp_state_blend.c
+++ b/src/mesa/pipe/softpipe/sp_state_blend.c
@@ -71,17 +71,31 @@ void softpipe_set_blend_color( struct pipe_context *pipe,
* into one file.
*/
+void *
+softpipe_create_alpha_test_state(struct pipe_context *pipe,
+ const struct pipe_alpha_test_state *alpha)
+{
+ return 0;
+}
+
void
-softpipe_set_alpha_test_state(struct pipe_context *pipe,
- const struct pipe_alpha_test_state *alpha)
+softpipe_bind_alpha_test_state(struct pipe_context *pipe,
+ void *alpha)
{
struct softpipe_context *softpipe = softpipe_context(pipe);
- softpipe->alpha_test = *alpha;
+ softpipe->alpha_test = (const struct pipe_alpha_test_state *)alpha;
softpipe->dirty |= SP_NEW_ALPHA_TEST;
}
+void
+softpipe_delete_alpha_test_state(struct pipe_context *pipe,
+ void *alpha)
+{
+ /* do nothing */
+}
+
void *
softpipe_create_depth_stencil_state(struct pipe_context *pipe,
const struct pipe_depth_stencil_state *depth_stencil)