summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util/u_draw.h
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2011-03-31 14:40:25 +0100
committerJosé Fonseca <[email protected]>2011-04-01 20:18:18 +0100
commit3733da31e8b4405b65e1b6ca3b6599ecc5af5fe7 (patch)
tree48e13947e294409416ddfa27f0f3458bf8bb54f9 /src/gallium/auxiliary/util/u_draw.h
parent4a7f013f9db793dab8dbc9f71646dab49f12ed2f (diff)
draw: Prevent out-of-bounds vertex buffer access.
Based on some code and ideas from Keith Whitwell.
Diffstat (limited to 'src/gallium/auxiliary/util/u_draw.h')
-rw-r--r--src/gallium/auxiliary/util/u_draw.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_draw.h b/src/gallium/auxiliary/util/u_draw.h
index f06d09ef91d..fdb683ca8a2 100644
--- a/src/gallium/auxiliary/util/u_draw.h
+++ b/src/gallium/auxiliary/util/u_draw.h
@@ -34,6 +34,11 @@
#include "pipe/p_state.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
static INLINE void
util_draw_init_info(struct pipe_draw_info *info)
{
@@ -136,4 +141,18 @@ util_draw_range_elements(struct pipe_context *pipe,
pipe->draw_vbo(pipe, &info);
}
+
+unsigned
+util_draw_max_index(
+ const struct pipe_vertex_buffer *vertex_buffers,
+ unsigned nr_vertex_buffers,
+ const struct pipe_vertex_element *vertex_elements,
+ unsigned nr_vertex_elements,
+ const struct pipe_draw_info *info);
+
+
+#ifdef __cplusplus
+}
#endif
+
+#endif /* !U_DRAW_H */