From 493f7b5f3ae2eb64eaa65e24e79a7a071c359b81 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 18 Jun 2007 17:54:38 -0600 Subject: Added alpha test state. --- src/mesa/pipe/p_context.h | 9 ++++++--- src/mesa/pipe/p_state.h | 25 +++++++++++++++---------- src/mesa/pipe/softpipe/sp_context.h | 2 ++ 3 files changed, 23 insertions(+), 13 deletions(-) (limited to 'src/mesa/pipe') diff --git a/src/mesa/pipe/p_context.h b/src/mesa/pipe/p_context.h index 5c9b9b14fe..f7374a8380 100644 --- a/src/mesa/pipe/p_context.h +++ b/src/mesa/pipe/p_context.h @@ -56,12 +56,12 @@ struct pipe_context { /* * State functions */ + void (*set_alpha_test_state)( struct pipe_context *, + const struct pipe_alpha_test_state * ); + void (*set_blend_state)( struct pipe_context *, const struct pipe_blend_state * ); - void (*set_framebuffer_state)( struct pipe_context *, - const struct pipe_framebuffer_state * ); - void (*set_cbuf_state)( struct pipe_context *, const struct pipe_surface * ); @@ -71,6 +71,9 @@ struct pipe_context { void (*set_depth_state)( struct pipe_context *, const struct pipe_depth_state * ); + void (*set_framebuffer_state)( struct pipe_context *, + const struct pipe_framebuffer_state * ); + void (*set_fs_state)( struct pipe_context *, const struct pipe_fs_state * ); diff --git a/src/mesa/pipe/p_state.h b/src/mesa/pipe/p_state.h index dba1e11715..71f1e99964 100644 --- a/src/mesa/pipe/p_state.h +++ b/src/mesa/pipe/p_state.h @@ -104,34 +104,39 @@ struct pipe_depth_state { GLuint enabled:1; /**< depth test enabled? */ GLuint writemask:1; /**< allow depth buffer writes? */ - GLuint func:3; /**< depth test func */ + GLuint func:3; /**< depth test func (PIPE_FUNC_x) */ GLfloat clear; /**< Clear value in [0,1] (XXX correct place?) */ }; +struct pipe_alpha_test_state { + GLuint enable:1; + GLuint func:3; /**< PIPE_FUNC_x */ + GLfloat ref; /**< reference value */ +}; -struct pipe_blend_state { - GLuint blend_enable:1; +struct pipe_blend_state { + GLuint blend_enable:1; - GLuint rgb_func:3; - GLuint rgb_src_factor:5; - GLuint rgb_dst_factor:5; + GLuint rgb_func:3; + GLuint rgb_src_factor:5; + GLuint rgb_dst_factor:5; GLuint alpha_func:3; GLuint alpha_src_factor:5; GLuint alpha_dst_factor:5; - GLuint logicop_enable:1; + GLuint logicop_enable:1; GLuint logicop_func:4; }; struct pipe_blend_color { - GLfloat color[4]; + GLfloat color[4]; }; struct pipe_stencil_state { GLuint front_enabled:1; - GLuint front_func:3; /**< PIPE_STENCIL_FUNC_x */ + GLuint front_func:3; /**< PIPE_FUNC_x */ GLuint front_fail_op:3; /**< PIPE_STENCIL_OP_x */ GLuint front_zpass_op:3; /**< PIPE_STENCIL_OP_x */ GLuint front_zfail_op:3; /**< PIPE_STENCIL_OP_x */ @@ -190,7 +195,7 @@ struct pipe_sampler_state GLfloat max_anisotropy; GLuint compare:1; /**< shadow/depth compare enabled? */ GLenum compare_mode:1; /**< PIPE_TEX_COMPARE_x */ - GLenum compare_func:3; /**< PIPE_DEPTH_FUNC_x */ + GLenum compare_func:3; /**< PIPE_FUNC_x */ GLfloat shadow_ambient; /**< shadow test fail color/intensity */ }; diff --git a/src/mesa/pipe/softpipe/sp_context.h b/src/mesa/pipe/softpipe/sp_context.h index f2ebc4272a..efe453ea2c 100644 --- a/src/mesa/pipe/softpipe/sp_context.h +++ b/src/mesa/pipe/softpipe/sp_context.h @@ -59,6 +59,7 @@ enum interp_mode { #define G_NEW_SCISSOR 0x40 #define G_NEW_STIPPLE 0x80 #define G_NEW_FRAMEBUFFER 0x100 +#define G_NEW_ALPHA_TEST 0x200 struct softpipe_context { @@ -72,6 +73,7 @@ struct softpipe_context { struct pipe_setup_state setup; struct pipe_fs_state fs; struct pipe_blend_state blend; + struct pipe_alpha_test_state alpha_test; struct pipe_surface cbuf; struct pipe_clip_state clip; struct pipe_scissor_rect scissor; -- cgit v1.2.3