1 /**************************************************************************
3 * Copyright 2004 Tungsten Graphics, Inc., Cedar Park, Texas.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **************************************************************************/
30 * Keith Whitwell <keith@tungstengraphics.com>
37 #include "main/compiler.h"
38 #include "main/glheader.h"
40 struct _mesa_index_buffer
;
42 struct gl_client_array
;
46 void st_init_draw( struct st_context
*st
);
48 void st_destroy_draw( struct st_context
*st
);
51 st_draw_vbo(struct gl_context
*ctx
,
52 const struct gl_client_array
**arrays
,
53 const struct _mesa_prim
*prims
,
55 const struct _mesa_index_buffer
*ib
,
56 GLboolean index_bounds_valid
,
61 st_feedback_draw_vbo(struct gl_context
*ctx
,
62 const struct gl_client_array
**arrays
,
63 const struct _mesa_prim
*prims
,
65 const struct _mesa_index_buffer
*ib
,
66 GLboolean index_bounds_valid
,
72 extern enum pipe_format
73 st_pipe_vertex_format(GLenum type
, GLuint size
, GLenum format
,
74 GLboolean normalized
);
78 * When drawing with VBOs, the addresses specified with
79 * glVertex/Color/TexCoordPointer() are really offsets into the VBO, not real
80 * addresses. At some point we need to convert those pointers to offsets.
81 * This function is basically a cast wrapper to avoid warnings when building
84 static INLINE
unsigned
85 pointer_to_offset(const void *ptr
)
87 return (unsigned) (((unsigned long) ptr
) & 0xffffffffUL
);