summaryrefslogtreecommitdiffstats
path: root/src/mesa/pipe/draw/draw_private.h
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2007-08-14 15:44:41 +0100
committerKeith Whitwell <[email protected]>2007-08-14 15:57:30 +0100
commit4bb213423941fb12801a734ad2d952a6d8f2347e (patch)
treefbe96362eee2c39636cbeac442afd6fa8d61c17b /src/mesa/pipe/draw/draw_private.h
parent8269bc48d8fafaa432b58f4adf5e0dddd81d979d (diff)
Beginnings of a demand-filled post-tnl vertex cache.
Probably breaks a bit of stuff, eg unfilled clipping, edgeflags, etc.
Diffstat (limited to 'src/mesa/pipe/draw/draw_private.h')
-rw-r--r--src/mesa/pipe/draw/draw_private.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/mesa/pipe/draw/draw_private.h b/src/mesa/pipe/draw/draw_private.h
index 3dfaa0581db..597393afdc9 100644
--- a/src/mesa/pipe/draw/draw_private.h
+++ b/src/mesa/pipe/draw/draw_private.h
@@ -61,12 +61,18 @@ struct vertex_header {
GLfloat data[][4]; /* Note variable size */
};
+#define MAX_VERTEX_SIZE ((2 + FRAG_ATTRIB_MAX) * 4 * sizeof(GLfloat))
+
+
/**
* Basic info for a point/line/triangle primitive.
*/
struct prim_header {
GLfloat det; /**< front/back face determinant */
+ GLuint reset_line_stipple:1;
+ GLuint edgeflags:3;
+ GLuint pad:28;
struct vertex_header *v[3]; /**< 1 to 3 vertex pointers */
};
@@ -103,6 +109,12 @@ struct draw_stage
};
+#define PRIM_QUEUE_LENGTH 16
+#define VCACHE_SIZE 32
+#define VCACHE_OVERFLOW 4
+#define VS_QUEUE_LENGTH (VCACHE_SIZE + VCACHE_OVERFLOW + 1) /* can never fill up */
+
+
/**
* Private context for the drawing module.
*/
@@ -141,7 +153,45 @@ struct draw_context
GLuint nr_vertices;
GLboolean in_vb;
+ void *elts;
+
+ struct vertex_header *(*get_vertex)( struct draw_context *draw,
+ GLuint i );
+
+ /* Post-tnl vertex cache:
+ */
+ struct {
+ GLuint referenced;
+ GLuint idx[VCACHE_SIZE + VCACHE_OVERFLOW];
+ struct vertex_header *vertex[VCACHE_SIZE + VCACHE_OVERFLOW];
+ GLuint overflow;
+ } vcache;
+
+ /* Vertex shader queue:
+ */
+ struct {
+ struct {
+ GLuint elt;
+ struct vertex_header *dest;
+ } queue[VS_QUEUE_LENGTH];
+ GLuint queue_nr;
+ } vs;
+
+ /* Prim pipeline queue:
+ */
+ struct {
+
+ /* Need to queue up primitives until their vertices have been
+ * transformed by a vs queue flush.
+ */
+ struct prim_header queue[PRIM_QUEUE_LENGTH];
+ GLuint queue_nr;
+ } pq;
+
+
+
GLenum prim; /**< GL_POINTS, GL_LINE_STRIP, GL_QUADS, etc */
+ unsigned reduced_prim;
/* Helper for tnl:
*/