added depth(Z) state support
authorBrian <brian.paul@tungstengraphics.com>
Wed, 30 May 2007 22:07:39 +0000 (16:07 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Wed, 30 May 2007 22:07:39 +0000 (16:07 -0600)
src/mesa/softpipe/sp_context.h
src/mesa/softpipe/sp_defines.h
src/mesa/softpipe/sp_state.h
src/mesa/softpipe/state_tracker/st_atom.h
src/mesa/softpipe/state_tracker/st_context.h

index e047a93..e2b678f 100644 (file)
@@ -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 * );
 
index bc88e3d..e1c773a 100644 (file)
 #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
index f7d904b..634b9e9 100644 (file)
@@ -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; 
 
index 8dc7460..1d8da46 100644 (file)
@@ -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;
index 5ff10c1..317d377 100644 (file)
@@ -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;