diff options
author | Zack Rusin <[email protected]> | 2008-04-14 12:27:24 -0400 |
---|---|---|
committer | Zack Rusin <[email protected]> | 2008-04-14 12:27:24 -0400 |
commit | e3309197855b5caf7c4c167d1e7beedf33ed2fdd (patch) | |
tree | 62da46cce8915788cc5a1370c717f9e85a30b4e4 /src/gallium/auxiliary/draw/draw_private.h | |
parent | 871d39ec8c168fa58d8758013e99da63fa58111d (diff) |
pass vertex size to shaders so that callee can decide on the size
of the vertices and not always have to use the maximum vertex
allocation size for them
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_private.h')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_private.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/draw/draw_private.h b/src/gallium/auxiliary/draw/draw_private.h index 3042d268479..c8cb96c8ba0 100644 --- a/src/gallium/auxiliary/draw/draw_private.h +++ b/src/gallium/auxiliary/draw/draw_private.h @@ -78,6 +78,7 @@ struct vertex_header { /* XXX This is too large */ #define MAX_VERTEX_SIZE ((2 + PIPE_MAX_SHADER_OUTPUTS) * 4 * sizeof(float)) +#define MAX_VERTEX_ALLOCATION ((MAX_VERTEX_SIZE + 0x0f) & ~0x0f) @@ -152,7 +153,8 @@ struct draw_vertex_shader { struct draw_context *draw, const unsigned *elts, unsigned count, - void *out ); + void *out, + unsigned vertex_size); void (*delete)( struct draw_vertex_shader * ); @@ -450,9 +452,8 @@ dot4(const float *a, const float *b) } static INLINE struct vertex_header * -draw_header_from_block(char *block, int num) +draw_header_from_block(char *block, int size, int num) { - static const unsigned size = (MAX_VERTEX_SIZE + 0x0f) & ~0x0f; return (struct vertex_header*)(block + num * size); } |