summaryrefslogtreecommitdiffstats
path: root/src/mesa/pipe
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/pipe')
-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
5 files changed, 14 insertions, 10 deletions
diff --git a/src/mesa/pipe/failover/fo_context.c b/src/mesa/pipe/failover/fo_context.c
index 076d5165833..b836ef29f30 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 indexSize, unsigned indexOffset,
unsigned prim, unsigned start, unsigned count)
{
struct failover_context *failover = failover_context( pipe );
@@ -65,6 +65,7 @@ static boolean failover_draw_elements( struct pipe_context *pipe,
if (!failover->hw->draw_elements( failover->hw,
indexBuffer,
indexSize,
+ indexOffset,
prim,
start,
count )) {
@@ -84,6 +85,7 @@ static boolean failover_draw_elements( struct pipe_context *pipe,
failover->sw->draw_elements( failover->sw,
indexBuffer,
indexSize,
+ indexOffset,
prim,
start,
count );
@@ -102,7 +104,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, prim, start, count);
+ return failover_draw_elements(pipe, NULL, 0, 0, prim, start, count);
}
diff --git a/src/mesa/pipe/i915simple/i915_context.c b/src/mesa/pipe/i915simple/i915_context.c
index 161f8ce6972..adc91fb4736 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 indexSize, unsigned indexOffset,
unsigned prim, unsigned start, unsigned count)
{
struct i915_context *i915 = i915_context( pipe );
@@ -202,9 +202,10 @@ i915_draw_elements( struct pipe_context *pipe,
}
/* Map index buffer, if present */
if (indexBuffer) {
- void *mapped_indexes
+ ubyte *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 {
@@ -262,7 +263,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, prim, start, count);
+ return i915_draw_elements(pipe, NULL, 0, 0, prim, start, count);
}
diff --git a/src/mesa/pipe/p_context.h b/src/mesa/pipe/p_context.h
index 2558a6341ce..08082f9367f 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 indexSize, unsigned indexOffset,
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 64a4fbe333e..d5cd6beae89 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, mode, start, count);
+ return softpipe_draw_elements(pipe, NULL, 0, 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 indexSize, unsigned indexOffset,
unsigned mode, unsigned start, unsigned count)
{
struct softpipe_context *sp = softpipe_context(pipe);
@@ -130,9 +130,10 @@ softpipe_draw_elements(struct pipe_context *pipe,
}
/* Map index buffer, if present */
if (indexBuffer) {
- void *mapped_indexes
+ ubyte *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 c194f0ea0db..8747f34cdd9 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 indexSize, unsigned indexOffset,
unsigned mode, unsigned start, unsigned count);