From ba5975dd3274a3cc760e79dabaf9c11b96673f4a Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Mon, 31 May 2010 20:41:18 -0400 Subject: gallium: add interface for DrawAuto and implement it in softpipe --- src/gallium/drivers/softpipe/sp_state_so.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/gallium/drivers/softpipe/sp_state_so.c') diff --git a/src/gallium/drivers/softpipe/sp_state_so.c b/src/gallium/drivers/softpipe/sp_state_so.c index 49bde22e97..8bd20cd2ac 100644 --- a/src/gallium/drivers/softpipe/sp_state_so.c +++ b/src/gallium/drivers/softpipe/sp_state_so.c @@ -93,7 +93,14 @@ softpipe_set_stream_output_buffers(struct pipe_context *pipe, softpipe->dirty |= SP_NEW_SO_BUFFERS; for (i = 0; i < num_buffers; ++i) { - void *mapped = softpipe_resource(buffers[i])->data; + void *mapped; + struct softpipe_resource *res = softpipe_resource(buffers[i]); + + softpipe->so_target.buffer[i] = res; + softpipe->so_target.offset[i] = offsets[i]; + softpipe->so_target.so_count[i] = 0; + + mapped = res->data; if (offsets[i] >= 0) map_buffers[i] = ((char*)mapped) + offsets[i]; else { @@ -102,5 +109,7 @@ softpipe_set_stream_output_buffers(struct pipe_context *pipe, map_buffers[i] = mapped; } } + softpipe->so_target.num_buffers = num_buffers; + draw_set_mapped_so_buffers(softpipe->draw, map_buffers, num_buffers); } -- cgit v1.2.3