static boolean failover_draw_elements( struct pipe_context *pipe,
struct pipe_buffer_handle *indexBuffer,
- unsigned indexSize, unsigned indexOffset,
+ unsigned indexSize,
unsigned prim, unsigned start, unsigned count)
{
struct failover_context *failover = failover_context( pipe );
if (!failover->hw->draw_elements( failover->hw,
indexBuffer,
indexSize,
- indexOffset,
prim,
start,
count )) {
failover->sw->draw_elements( failover->sw,
indexBuffer,
indexSize,
- indexOffset,
prim,
start,
count );
static boolean failover_draw_arrays( struct pipe_context *pipe,
unsigned prim, unsigned start, unsigned count)
{
- return failover_draw_elements(pipe, NULL, 0, 0, prim, start, count);
+ return failover_draw_elements(pipe, NULL, 0, prim, start, count);
}
static boolean
i915_draw_elements( struct pipe_context *pipe,
struct pipe_buffer_handle *indexBuffer,
- unsigned indexSize, unsigned indexOffset,
+ unsigned indexSize,
unsigned prim, unsigned start, unsigned count)
{
struct i915_context *i915 = i915_context( pipe );
}
/* Map index buffer, if present */
if (indexBuffer) {
- ubyte *mapped_indexes
+ void *mapped_indexes
= pipe->winsys->buffer_map(pipe->winsys, indexBuffer,
PIPE_BUFFER_FLAG_READ);
- mapped_indexes += indexOffset;
draw_set_mapped_element_buffer(draw, indexSize, mapped_indexes);
}
else {
static boolean i915_draw_arrays( struct pipe_context *pipe,
unsigned prim, unsigned start, unsigned count)
{
- return i915_draw_elements(pipe, NULL, 0, 0, prim, start, count);
+ return i915_draw_elements(pipe, NULL, 0, prim, start, count);
}
boolean (*draw_elements)( struct pipe_context *pipe,
struct pipe_buffer_handle *indexBuffer,
- unsigned indexSize, unsigned indexOffset,
+ unsigned indexSize,
unsigned mode, unsigned start, unsigned count);
/** Clear a surface to given value (no scissor; clear whole surface) */
softpipe_draw_arrays(struct pipe_context *pipe, unsigned mode,
unsigned start, unsigned count)
{
- return softpipe_draw_elements(pipe, NULL, 0, 0, mode, start, count);
+ return softpipe_draw_elements(pipe, NULL, 0, mode, start, count);
}
boolean
softpipe_draw_elements(struct pipe_context *pipe,
struct pipe_buffer_handle *indexBuffer,
- unsigned indexSize, unsigned indexOffset,
+ unsigned indexSize,
unsigned mode, unsigned start, unsigned count)
{
struct softpipe_context *sp = softpipe_context(pipe);
}
/* Map index buffer, if present */
if (indexBuffer) {
- ubyte *mapped_indexes
+ void *mapped_indexes
= pipe->winsys->buffer_map(pipe->winsys, indexBuffer,
PIPE_BUFFER_FLAG_READ);
- mapped_indexes += indexOffset;
draw_set_mapped_element_buffer(draw, indexSize, mapped_indexes);
}
else {
boolean softpipe_draw_elements(struct pipe_context *pipe,
struct pipe_buffer_handle *indexBuffer,
- unsigned indexSize, unsigned indexOffset,
+ unsigned indexSize,
unsigned mode, unsigned start, unsigned count);
/* indexed primitive */
struct gl_buffer_object *bufobj = ib->obj;
struct pipe_buffer_handle *indexBuf = NULL;
- unsigned indexSize, indexOffset, i;
+ unsigned indexSize, i;
switch (ib->type) {
case GL_UNSIGNED_INT:
/* elements/indexes are in a real VBO */
struct st_buffer_object *stobj = st_buffer_object(bufobj);
winsys->buffer_reference(winsys, &indexBuf, stobj->buffer);
- indexOffset = (unsigned) ib->ptr;
}
else {
/* element/indicies are in user space memory */
indexBuf = winsys->user_buffer_create(winsys,
(void *) ib->ptr,
ib->count * indexSize);
- indexOffset = 0;
}
/* draw */
for (i = 0; i < nr_prims; i++) {
- pipe->draw_elements(pipe, indexBuf, indexSize, indexOffset,
+ pipe->draw_elements(pipe, indexBuf, indexSize,
prims[i].mode, prims[i].start, prims[i].count);
}