summaryrefslogtreecommitdiff
path: root/src/mesa/softpipe
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-05-30 16:07:39 -0600
committerBrian <brian.paul@tungstengraphics.com>2007-05-30 16:07:39 -0600
commit8f2888758129b0a40d71fa4ce10d606b4bcf7631 (patch)
tree3d46a57d2675465dc6c491daf5e61f570cb6218b /src/mesa/softpipe
parent4c9b48dcc510929951516f3cd17b98654ac93a9a (diff)
added depth(Z) state support
Diffstat (limited to 'src/mesa/softpipe')
-rw-r--r--src/mesa/softpipe/sp_context.h3
-rw-r--r--src/mesa/softpipe/sp_defines.h10
-rw-r--r--src/mesa/softpipe/sp_state.h9
-rw-r--r--src/mesa/softpipe/state_tracker/st_atom.h1
-rw-r--r--src/mesa/softpipe/state_tracker/st_context.h1
5 files changed, 24 insertions, 0 deletions
diff --git a/src/mesa/softpipe/sp_context.h b/src/mesa/softpipe/sp_context.h
index e047a9330b..e2b678f80f 100644
--- a/src/mesa/softpipe/sp_context.h
+++ b/src/mesa/softpipe/sp_context.h
@@ -43,6 +43,9 @@ struct softpipe_context {
void (*set_clip_state)( struct softpipe_context *,
const struct softpipe_clip_state * );
+ void (*set_depth_state)( struct softpipe_context *,
+ const struct softpipe_depth_state * );
+
void (*set_viewport)( struct softpipe_context *,
const struct softpipe_viewport * );
diff --git a/src/mesa/softpipe/sp_defines.h b/src/mesa/softpipe/sp_defines.h
index bc88e3d71e..e1c773a407 100644
--- a/src/mesa/softpipe/sp_defines.h
+++ b/src/mesa/softpipe/sp_defines.h
@@ -89,4 +89,14 @@
#define SP_STENCIL_OP_DECR_WRAP 6
#define SP_STENCIL_OP_INVERT 7
+#define SP_DEPTH_FUNC_NEVER 0
+#define SP_DEPTH_FUNC_LESS 1
+#define SP_DEPTH_FUNC_EQUAL 2
+#define SP_DEPTH_FUNC_LEQUAL 3
+#define SP_DEPTH_FUNC_GREATER 4
+#define SP_DEPTH_FUNC_NOTEQUAL 5
+#define SP_DEPTH_FUNC_GEQUAL 6
+#define SP_DEPTH_FUNC_ALWAYS 7
+
+
#endif
diff --git a/src/mesa/softpipe/sp_state.h b/src/mesa/softpipe/sp_state.h
index f7d904bffe..634b9e9868 100644
--- a/src/mesa/softpipe/sp_state.h
+++ b/src/mesa/softpipe/sp_state.h
@@ -100,6 +100,15 @@ struct softpipe_constant_buffer {
};
+struct softpipe_depth_state
+{
+ GLuint enabled:1; /**< depth test enabled? */
+ GLuint writemask:1; /**< allow depth buffer writes? */
+ GLuint func:3; /**< depth test func */
+ GLfloat clear; /**< Clear value in [0,1] (XXX correct place?) */
+};
+
+
struct softpipe_blend_state {
GLuint blend_enable:1;
diff --git a/src/mesa/softpipe/state_tracker/st_atom.h b/src/mesa/softpipe/state_tracker/st_atom.h
index 8dc7460d11..1d8da46336 100644
--- a/src/mesa/softpipe/state_tracker/st_atom.h
+++ b/src/mesa/softpipe/state_tracker/st_atom.h
@@ -46,6 +46,7 @@ void st_validate_state( struct st_context *st );
const struct st_tracked_state st_update_cbuf;
const struct st_tracked_state st_update_clip;
+const struct st_tracked_state st_update_depth;
const struct st_tracked_state st_update_fs;
const struct st_tracked_state st_update_setup;
const struct st_tracked_state st_update_viewport;
diff --git a/src/mesa/softpipe/state_tracker/st_context.h b/src/mesa/softpipe/state_tracker/st_context.h
index 5ff10c1b1f..317d377371 100644
--- a/src/mesa/softpipe/state_tracker/st_context.h
+++ b/src/mesa/softpipe/state_tracker/st_context.h
@@ -71,6 +71,7 @@ struct st_context
struct softpipe_blend_state blend;
struct softpipe_surface cbuf;
struct softpipe_clip_state clip;
+ struct softpipe_depth_state depth;
struct softpipe_scissor_rect scissor;
struct softpipe_poly_stipple poly_stipple;
struct softpipe_stencil_state stencil;