From 6cb87cf26f904b891faa42268f373864fa33541d Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Fri, 21 Sep 2007 07:00:20 -0400 Subject: Make the alpha test state a cso. --- src/mesa/pipe/i915simple/i915_context.h | 2 +- src/mesa/pipe/i915simple/i915_state.c | 24 ++++++++++++++++++++---- src/mesa/pipe/i915simple/i915_state_immediate.c | 6 +++--- 3 files changed, 24 insertions(+), 8 deletions(-) (limited to 'src/mesa/pipe/i915simple') diff --git a/src/mesa/pipe/i915simple/i915_context.h b/src/mesa/pipe/i915simple/i915_context.h index f1e10f3433..9958a8592d 100644 --- a/src/mesa/pipe/i915simple/i915_context.h +++ b/src/mesa/pipe/i915simple/i915_context.h @@ -154,13 +154,13 @@ struct i915_context /* The most recent drawing state as set by the driver: */ + const struct pipe_alpha_test_state *alpha_test; const struct i915_blend_state *blend; const struct i915_sampler_state *sampler[PIPE_MAX_SAMPLERS]; const struct i915_depth_stencil_state *depth_stencil; const struct i915_rasterizer_state *rasterizer; const struct pipe_shader_state *fs; - 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/i915simple/i915_state.c b/src/mesa/pipe/i915simple/i915_state.c index 525f8ce13a..8bfd2da3b5 100644 --- a/src/mesa/pipe/i915simple/i915_state.c +++ b/src/mesa/pipe/i915simple/i915_state.c @@ -394,16 +394,29 @@ static void i915_delete_depth_stencil_state(struct pipe_context *pipe, free(depth_stencil); } -static void i915_set_alpha_test_state(struct pipe_context *pipe, - const struct pipe_alpha_test_state *alpha) + +static void * +i915_create_alpha_test_state(struct pipe_context *pipe, + const struct pipe_alpha_test_state *alpha) +{ + return 0; +} + +static void i915_bind_alpha_test_state(struct pipe_context *pipe, + void *alpha) { struct i915_context *i915 = i915_context(pipe); - i915->alpha_test = *alpha; + i915->alpha_test = (const struct pipe_alpha_test_state*)alpha; i915->dirty |= I915_NEW_ALPHA_TEST; } +static void i915_delete_alpha_test_state(struct pipe_context *pipe, + void *alpha) +{ +} + static void i915_set_scissor_state( struct pipe_context *pipe, const struct pipe_scissor_state *scissor ) { @@ -664,6 +677,10 @@ static void i915_set_vertex_element( struct pipe_context *pipe, void i915_init_state_functions( struct i915_context *i915 ) { + i915->pipe.create_alpha_test_state = i915_create_alpha_test_state; + i915->pipe.bind_alpha_test_state = i915_bind_alpha_test_state; + i915->pipe.delete_alpha_test_state = i915_delete_alpha_test_state; + i915->pipe.create_blend_state = i915_create_blend_state; i915->pipe.bind_blend_state = i915_bind_blend_state; i915->pipe.delete_blend_state = i915_delete_blend_state; @@ -686,7 +703,6 @@ i915_init_state_functions( struct i915_context *i915 ) i915->pipe.bind_vs_state = i915_bind_vs_state; i915->pipe.delete_vs_state = i915_delete_shader_state; - i915->pipe.set_alpha_test_state = i915_set_alpha_test_state; i915->pipe.set_blend_color = i915_set_blend_color; i915->pipe.set_clip_state = i915_set_clip_state; i915->pipe.set_clear_color_state = i915_set_clear_color_state; diff --git a/src/mesa/pipe/i915simple/i915_state_immediate.c b/src/mesa/pipe/i915simple/i915_state_immediate.c index 874c3819f2..014fddfdda 100644 --- a/src/mesa/pipe/i915simple/i915_state_immediate.c +++ b/src/mesa/pipe/i915simple/i915_state_immediate.c @@ -121,9 +121,9 @@ static void upload_S6( struct i915_context *i915 ) /* I915_NEW_ALPHA_TEST */ - if (i915->alpha_test.enabled) { - int test = i915_translate_compare_func(i915->alpha_test.func); - ubyte refByte = float_to_ubyte(i915->alpha_test.ref); + if (i915->alpha_test->enabled) { + int test = i915_translate_compare_func(i915->alpha_test->func); + ubyte refByte = float_to_ubyte(i915->alpha_test->ref); LIS6 |= (S6_ALPHA_TEST_ENABLE | -- cgit v1.2.3