aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-10-24 14:35:40 -0600
committerBrian <[email protected]>2007-10-24 14:35:40 -0600
commit40a0b053f78acd0a08f6876518b8e9301480431f (patch)
tree6ca70655441fd94a8518880d6d1da19eee7634a6
parent11ce6244a79106c592364b30434b6ddade3fd6bb (diff)
Revert "Undo indexOffset change (I think, git???)"
This reverts commit 11ce6244a79106c592364b30434b6ddade3fd6bb.
-rw-r--r--src/mesa/pipe/failover/fo_context.c6
-rw-r--r--src/mesa/pipe/i915simple/i915_context.c7
-rw-r--r--src/mesa/pipe/p_context.h2
-rw-r--r--src/mesa/pipe/softpipe/sp_draw_arrays.c7
-rw-r--r--src/mesa/pipe/softpipe/sp_state.h2
-rw-r--r--src/mesa/state_tracker/st_draw.c6
6 files changed, 12 insertions, 18 deletions
diff --git a/src/mesa/pipe/failover/fo_context.c b/src/mesa/pipe/failover/fo_context.c
index b836ef29f30..076d5165833 100644
--- a/src/mesa/pipe/failover/fo_context.c
+++ b/src/mesa/pipe/failover/fo_context.c
@@ -47,7 +47,7 @@ static void failover_destroy( struct pipe_context *pipe )
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 );
@@ -65,7 +65,6 @@ static boolean failover_draw_elements( struct pipe_context *pipe,
if (!failover->hw->draw_elements( failover->hw,
indexBuffer,
indexSize,
- indexOffset,
prim,
start,
count )) {
@@ -85,7 +84,6 @@ static boolean failover_draw_elements( struct pipe_context *pipe,
failover->sw->draw_elements( failover->sw,
indexBuffer,
indexSize,
- indexOffset,
prim,
start,
count );
@@ -104,7 +102,7 @@ static boolean failover_draw_elements( struct pipe_context *pipe,
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);
}
diff --git a/src/mesa/pipe/i915simple/i915_context.c b/src/mesa/pipe/i915simple/i915_context.c
index adc91fb4736..161f8ce6972 100644
--- a/src/mesa/pipe/i915simple/i915_context.c
+++ b/src/mesa/pipe/i915simple/i915_context.c
@@ -178,7 +178,7 @@ i915_end_query(struct pipe_context *pipe, struct pipe_query_object *q)
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 );
@@ -202,10 +202,9 @@ i915_draw_elements( struct pipe_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 {
@@ -263,7 +262,7 @@ i915_draw_elements( struct pipe_context *pipe,
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);
}
diff --git a/src/mesa/pipe/p_context.h b/src/mesa/pipe/p_context.h
index 08082f9367f..2558a6341ce 100644
--- a/src/mesa/pipe/p_context.h
+++ b/src/mesa/pipe/p_context.h
@@ -71,7 +71,7 @@ struct pipe_context {
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) */
diff --git a/src/mesa/pipe/softpipe/sp_draw_arrays.c b/src/mesa/pipe/softpipe/sp_draw_arrays.c
index d5cd6beae89..64a4fbe333e 100644
--- a/src/mesa/pipe/softpipe/sp_draw_arrays.c
+++ b/src/mesa/pipe/softpipe/sp_draw_arrays.c
@@ -75,7 +75,7 @@ boolean
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);
}
@@ -90,7 +90,7 @@ softpipe_draw_arrays(struct pipe_context *pipe, unsigned mode,
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);
@@ -130,10 +130,9 @@ softpipe_draw_elements(struct pipe_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 {
diff --git a/src/mesa/pipe/softpipe/sp_state.h b/src/mesa/pipe/softpipe/sp_state.h
index 8747f34cdd9..c194f0ea0db 100644
--- a/src/mesa/pipe/softpipe/sp_state.h
+++ b/src/mesa/pipe/softpipe/sp_state.h
@@ -131,7 +131,7 @@ boolean softpipe_draw_arrays(struct pipe_context *pipe, unsigned mode,
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);
diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index 50251a816b8..fbf7713f58d 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -197,7 +197,7 @@ st_draw_vbo(GLcontext *ctx,
/* 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:
@@ -218,19 +218,17 @@ st_draw_vbo(GLcontext *ctx,
/* 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);
}