summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_draw.h
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-03-09 09:33:46 -0600
committerBrian Paul <brianp@vmware.com>2009-03-09 09:42:26 -0600
commit44af5a953f4189978f698b6a26b5f7b1c6298929 (patch)
tree041ad7b1e0454ee0b3f6052aff9cfeece9c591f0 /src/mesa/state_tracker/st_draw.h
parent9457d9ff4482f9b3796e2989e9ac3385d7d5404d (diff)
st: use pointer_to_offset() cast wrapper to convert pointers to uint
Silences warnings with 64-bit builds. See comments for details.
Diffstat (limited to 'src/mesa/state_tracker/st_draw.h')
-rw-r--r--src/mesa/state_tracker/st_draw.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_draw.h b/src/mesa/state_tracker/st_draw.h
index 659c3ac834..da04fce8e2 100644
--- a/src/mesa/state_tracker/st_draw.h
+++ b/src/mesa/state_tracker/st_draw.h
@@ -64,4 +64,19 @@ st_feedback_draw_vbo(GLcontext *ctx,
extern GLuint
st_pipe_vertex_format(GLenum type, GLuint size, 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