X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fstate_tracker%2Fst_draw.h;h=5d3c278228f6e352d2baad513ec37f7c7a80451c;hb=2ecb73379e4d88873cbe1cafdd056f7f687ea743;hp=c81f2b25dadba8fc19c03cd4ca138b251ccf0d41;hpb=a22d865f93a1db7f72e0bfe216810f67bf4c2f2c;p=mesa.git diff --git a/src/mesa/state_tracker/st_draw.h b/src/mesa/state_tracker/st_draw.h index c81f2b25dad..5d3c278228f 100644 --- a/src/mesa/state_tracker/st_draw.h +++ b/src/mesa/state_tracker/st_draw.h @@ -34,29 +34,58 @@ #ifndef ST_DRAW_H #define ST_DRAW_H -struct _mesa_prim; +#include "main/compiler.h" +#include "main/glheader.h" + struct _mesa_index_buffer; +struct _mesa_prim; +struct gl_client_array; +struct gl_context; +struct st_context; void st_init_draw( struct st_context *st ); void st_destroy_draw( struct st_context *st ); extern void -st_draw_vbo(GLcontext *ctx, +st_draw_vbo(struct gl_context *ctx, const struct gl_client_array **arrays, const struct _mesa_prim *prims, GLuint nr_prims, const struct _mesa_index_buffer *ib, + GLboolean index_bounds_valid, GLuint min_index, GLuint max_index); extern void -st_feedback_draw_vbo(GLcontext *ctx, +st_feedback_draw_vbo(struct gl_context *ctx, const struct gl_client_array **arrays, const struct _mesa_prim *prims, GLuint nr_prims, const struct _mesa_index_buffer *ib, + GLboolean index_bounds_valid, GLuint min_index, GLuint max_index); +/* Internal function: + */ +extern GLuint +st_pipe_vertex_format(GLenum type, GLuint size, GLenum format, + GLboolean normalized); + + +/** + * When drawing with VBOs, the addresses specified with + * glVertex/Color/TexCoordPointer() are really offsets into the VBO, not real + * addresses. At some point we need to convert those pointers to offsets. + * This function is basically a cast wrapper to avoid warnings when building + * in 64-bit mode. + */ +static INLINE unsigned +pointer_to_offset(const void *ptr) +{ + return (unsigned) (((unsigned long) ptr) & 0xffffffffUL); +} + + #endif