summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/vl/vl_vertex_buffers.h
diff options
context:
space:
mode:
authorChristian König <deathsimple@vodafone.de>2011-01-10 19:15:42 +0100
committerChristian König <deathsimple@vodafone.de>2011-01-10 19:15:42 +0100
commitc8236aaf7056bd8645804e71596d2d6460e62d15 (patch)
tree2ae06db15a5f8d9b8e64d440de86447cbf5f9eb0 /src/gallium/auxiliary/vl/vl_vertex_buffers.h
parent4025958e1bfcd7fd75d476f8f5687b983e730b71 (diff)
[g3dvl] move to integer verticies
Diffstat (limited to 'src/gallium/auxiliary/vl/vl_vertex_buffers.h')
-rw-r--r--src/gallium/auxiliary/vl/vl_vertex_buffers.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/gallium/auxiliary/vl/vl_vertex_buffers.h b/src/gallium/auxiliary/vl/vl_vertex_buffers.h
index e312515dc3..b8e8766ec5 100644
--- a/src/gallium/auxiliary/vl/vl_vertex_buffers.h
+++ b/src/gallium/auxiliary/vl/vl_vertex_buffers.h
@@ -34,37 +34,37 @@
struct vl_vertex_buffer
{
unsigned num_verts;
- unsigned num_elements;
+ unsigned stride;
struct pipe_resource *resource;
struct pipe_transfer *transfer;
- float *vectors;
+ void *vectors;
};
struct pipe_vertex_buffer vl_vb_upload_quads(struct pipe_context *pipe, unsigned max_blocks);
-struct pipe_vertex_element vl_vb_get_quad_vertex_element();
+struct pipe_vertex_element vl_vb_get_quad_vertex_element(void);
unsigned vl_vb_element_helper(struct pipe_vertex_element* elements, unsigned num_elements,
unsigned vertex_buffer_index);
struct pipe_vertex_buffer vl_vb_init(struct vl_vertex_buffer *buffer,
struct pipe_context *pipe,
- unsigned max_blocks, unsigned num_elements,
- unsigned stride);
+ unsigned max_blocks, unsigned stride);
void vl_vb_map(struct vl_vertex_buffer *buffer, struct pipe_context *pipe);
static inline void
-vl_vb_add_block(struct vl_vertex_buffer *buffer, float *elements)
+vl_vb_add_block(struct vl_vertex_buffer *buffer, void *elements)
{
- float *pos;
+ void *pos;
unsigned i;
assert(buffer);
+ pos = buffer->vectors + buffer->num_verts * buffer->stride;
for(i = 0; i < 4; ++i) {
- pos = buffer->vectors + buffer->num_verts * buffer->num_elements;
- memcpy(pos, elements, sizeof(float) * buffer->num_elements);
+ memcpy(pos, elements, buffer->stride);
+ pos += buffer->stride;
buffer->num_verts++;
}
}