#ifndef LP_RAST_H
#define LP_RAST_H
+#include "pipe/p_compiler.h"
#include "lp_jit.h"
/* Initially create and program a single rasterizer directly. Later
*/
const struct lp_rast_state *state;
- /* Attribute interpolation: FIXME: reduce memory waste!
+ /* Attribute interpolation:
+ *
+ * First coefficient is position.
+ *
+ * FIXME: reduce memory waste!
*/
- float a0[PIPE_MAX_ATTRIBS][4];
- float dadx[PIPE_MAX_ATTRIBS][4];
- float dady[PIPE_MAX_ATTRIBS][4];
+ float a0[1 + PIPE_MAX_SHADER_INPUTS][4];
+ float dadx[1 + PIPE_MAX_SHADER_INPUTS][4];
+ float dady[1 + PIPE_MAX_SHADER_INPUTS][4];
};
float dx23;
float dx31;
- /* State to run the shader: */
- struct lp_rast_shader_inputs inputs;
-};
+ /* XXX: these are only used inside lp_setup_tri.c, don't really
+ * need to bin them:
+ */
+ float oneoverarea;
-struct clear_tile {
- boolean do_color;
- boolean do_depth_stencil;
- unsigned rgba;
- unsigned depth_stencil;
+ /* inputs for the shader */
+ struct lp_rast_shader_inputs inputs;
};
-struct load_tile {
- boolean do_color;
- boolean do_depth_stencil;
-};
struct lp_rasterizer *lp_rast_create( void );
-void lp_rast_bind_surfaces( struct lp_rasterizer *,
- struct pipe_surface *color,
- struct pipe_surface *zstencil,
- const float *clear_color,
- double clear_depth,
- unsigned clear_stencil);
+void lp_rast_begin( struct lp_rasterizer *,
+ unsigned width,
+ unsigned height);
+
+void lp_rast_bind_color( struct lp_rasterizer *,
+ struct pipe_surface *cbuf,
+ boolean write_when_done );
+
+void lp_rast_bind_zstencil( struct lp_rasterizer *,
+ struct pipe_surface *zsbuf,
+ boolean write_when_done );
/* Begining of each tile:
*/
const struct lp_rast_shader_inputs *shade_tile;
const struct lp_rast_triangle *triangle;
const struct lp_rast_state *set_state;
+ const uint8_t clear_color[4];
+ unsigned clear_zstencil;
};
const union lp_rast_cmd_arg * );
void lp_rast_shade_tile( struct lp_rasterizer *,
- const union lp_rast_cmd_arg * );
+ const union lp_rast_cmd_arg *,
+ const struct lp_rast_shader_inputs *);
-void lp_rast_store_color( struct lp_rasterizer *,
- const union lp_rast_cmd_arg *);
-void lp_rast_store_zstencil( struct lp_rasterizer *,
- const union lp_rast_cmd_arg *);
+/* End of tile:
+ */
+void lp_rast_end_tile( struct lp_rasterizer *rast );
/* Shutdown:
*/