gallium: rename pipe_buffer_handle to pipe_buffer, rework pipebuffer/ code
[mesa.git] / src / mesa / pipe / draw / draw_context.h
index beba9429c910c134918f8ffc03f46269e42cf3b7..ddeb184497aeec4fa8d3b8ba6cd63804d66b4524 100644 (file)
 #define DRAW_CONTEXT_H
 
 
-#include "main/glheader.h"
 #include "pipe/p_state.h"
 
 
 struct vertex_buffer;
+struct vertex_info;
 struct draw_context;
 struct draw_stage;
+struct draw_vertex_shader;
+
+
+/**
+ * Clipmask flags
+ */
+/*@{*/
+#define CLIP_RIGHT_BIT   0x01
+#define CLIP_LEFT_BIT    0x02
+#define CLIP_TOP_BIT     0x04
+#define CLIP_BOTTOM_BIT  0x08
+#define CLIP_NEAR_BIT    0x10
+#define CLIP_FAR_BIT     0x20
+/*@}*/
+
+/**
+ * Bitshift for each clip flag
+ */
+/*@{*/
+#define CLIP_RIGHT_SHIFT       0
+#define CLIP_LEFT_SHIFT        1
+#define CLIP_TOP_SHIFT         2
+#define CLIP_BOTTOM_SHIFT       3
+#define CLIP_NEAR_SHIFT        4
+#define CLIP_FAR_SHIFT         5
+/*@}*/
 
 
 struct draw_context *draw_create( void );
@@ -57,33 +83,60 @@ void draw_set_viewport_state( struct draw_context *draw,
 void draw_set_clip_state( struct draw_context *pipe,
                           const struct pipe_clip_state *clip );
 
-void draw_set_setup_state( struct draw_context *draw,
-                           const struct pipe_setup_state *setup );
+void draw_set_rasterizer_state( struct draw_context *draw,
+                                const struct pipe_rasterizer_state *raster );
+
+void draw_set_rasterize_stage( struct draw_context *draw,
+                               struct draw_stage *stage );
+
+void draw_convert_wide_points(struct draw_context *draw, boolean enable);
+
+void draw_convert_wide_lines(struct draw_context *draw, boolean enable);
 
-void draw_set_setup_stage( struct draw_context *draw,
-                           struct draw_stage *stage );
 
-void draw_set_vertex_attributes( struct draw_context *draw,
-                                const GLuint *attrs,
-                                GLuint nr_attrs );
+struct draw_vertex_shader *
+draw_create_vertex_shader(struct draw_context *draw,
+                          const struct pipe_shader_state *shader);
+void draw_bind_vertex_shader(struct draw_context *draw,
+                             struct draw_vertex_shader *dvs);
+void draw_delete_vertex_shader(struct draw_context *draw,
+                               struct draw_vertex_shader *dvs);
 
-/* XXX temporary */
-void draw_set_vertex_attributes2( struct draw_context *draw,
-                                const GLuint *attrs,
-                                GLuint nr_attrs );
+boolean draw_use_sse(struct draw_context *draw);
 
-void draw_set_vertex_array_info(struct draw_context *draw,
-                                const struct pipe_vertex_buffer *buffers,
-                                const struct pipe_vertex_element *elements);
+void draw_set_vertex_buffer(struct draw_context *draw,
+                           unsigned attr,
+                           const struct pipe_vertex_buffer *buffer);
 
-/* XXX temporary */
-void draw_vb(struct draw_context *draw,
-            struct vertex_buffer *VB );
+void draw_set_vertex_element(struct draw_context *draw,
+                            unsigned attr,
+                            const struct pipe_vertex_element *element);
+
+void draw_set_mapped_element_buffer( struct draw_context *draw,
+                                     unsigned eltSize, void *elements );
+
+void draw_set_mapped_vertex_buffer(struct draw_context *draw,
+                                   unsigned attr, const void *buffer);
+
+void draw_set_mapped_constant_buffer(struct draw_context *draw,
+                                     const void *buffer);
+
+
+/***********************************************************************
+ * draw_prim.c 
+ */
+
+void draw_arrays(struct draw_context *draw, unsigned prim,
+                unsigned start, unsigned count);
+
+void draw_flush(struct draw_context *draw);
+
+/***********************************************************************
+ * draw_debug.c 
+ */
+boolean draw_validate_prim( unsigned prim, unsigned length );
+unsigned draw_trim_prim( unsigned mode, unsigned count );
 
-void draw_vertices(struct draw_context *draw,
-                   GLuint mode,
-                   GLuint numVertex, const GLfloat *verts,
-                   GLuint numAttribs, const GLuint attribs[]);
 
 
 #endif /* DRAW_CONTEXT_H */