Merge branch 'gallium-newclear'
[mesa.git] / src / gallium / drivers / llvmpipe / lp_rast.h
index dc5fc5fc7d645a16592fdfdd50267b1c1cdd4fbc..80ca68f5a2f5161cfe38d676fbf7d75900c5efd1 100644 (file)
@@ -66,13 +66,9 @@ struct lp_rast_state {
    struct lp_jit_context jit_context;
    
    /* The shader itself.  Probably we also need to pass a pointer to
-    * the tile color/z/stencil data somehow:
-    * jit_function[0] skips the triangle in/out test code
-    * jit_function[1] does triangle in/out testing
+    * the tile color/z/stencil data somehow
      */
-   lp_jit_frag_func jit_function[2];
-
-   boolean opaque;
+   struct lp_fragment_shader_variant *variant;
 };
 
 
@@ -82,6 +78,8 @@ struct lp_rast_state {
  * These pointers point into the bin data buffer.
  */
 struct lp_rast_shader_inputs {
+   float facing;     /** Positive for front-facing, negative for back-facing */
+
    float (*a0)[4];
    float (*dadx)[4];
    float (*dady)[4];
@@ -90,12 +88,17 @@ struct lp_rast_shader_inputs {
    PIPE_ALIGN_VAR(16) int step[3][16];
 };
 
+struct lp_rast_clearzs {
+   unsigned clearzs_value;
+   unsigned clearzs_mask;
+};
+
 
 /**
  * Rasterization information for a triangle known to be in this bin,
  * plus inputs to run the shader:
  * These fields are tile- and bin-independent.
- * Objects of this type are put into the setup_context::data buffer.
+ * Objects of this type are put into the lp_setup_context::data buffer.
  */
 struct lp_rast_triangle {
 #ifdef DEBUG
@@ -132,7 +135,7 @@ struct lp_rast_triangle {
 
 
 struct lp_rasterizer *
-lp_rast_create( void );
+lp_rast_create( unsigned num_threads );
 
 void
 lp_rast_destroy( struct lp_rasterizer * );
@@ -153,8 +156,9 @@ union lp_rast_cmd_arg {
    const struct lp_rast_triangle *triangle;
    const struct lp_rast_state *set_state;
    uint8_t clear_color[4];
-   unsigned clear_zstencil;
+   const struct lp_rast_clearzs *clear_zstencil;
    struct lp_fence *fence;
+   struct llvmpipe_query *query_obj;
 };
 
 
@@ -193,6 +197,14 @@ lp_rast_arg_fence( struct lp_fence *fence )
 }
 
 
+static INLINE union lp_rast_cmd_arg
+lp_rast_arg_clearzs( const struct lp_rast_clearzs *clearzs )
+{
+   union lp_rast_cmd_arg arg;
+   arg.clear_zstencil = clearzs;
+   return arg;
+}
+
 static INLINE union lp_rast_cmd_arg
 lp_rast_arg_null( void )
 {
@@ -202,7 +214,6 @@ lp_rast_arg_null( void )
 }
 
 
-
 /**
  * Binnable Commands.
  * These get put into bins by the setup code and are called when
@@ -215,9 +226,6 @@ void lp_rast_clear_color( struct lp_rasterizer_task *,
 void lp_rast_clear_zstencil( struct lp_rasterizer_task *, 
                              const union lp_rast_cmd_arg );
 
-void lp_rast_load_color( struct lp_rasterizer_task *, 
-                         const union lp_rast_cmd_arg );
-
 void lp_rast_set_state( struct lp_rasterizer_task *, 
                         const union lp_rast_cmd_arg );
 
@@ -230,4 +238,15 @@ void lp_rast_shade_tile( struct lp_rasterizer_task *,
 void lp_rast_fence( struct lp_rasterizer_task *,
                     const union lp_rast_cmd_arg );
 
+void lp_rast_store_color( struct lp_rasterizer_task *,
+                          const union lp_rast_cmd_arg );
+
+
+void lp_rast_begin_query(struct lp_rasterizer_task *,
+                         const union lp_rast_cmd_arg );
+
+void lp_rast_end_query(struct lp_rasterizer_task *,
+                       const union lp_rast_cmd_arg );
+
+
 #endif