aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga/svga_swtnl_draw.c
diff options
context:
space:
mode:
authorYounes Manton <[email protected]>2010-04-30 20:42:30 -0400
committerYounes Manton <[email protected]>2010-04-30 20:42:30 -0400
commita8ea1dacc63ac567498049e5756c247b9fec6cd9 (patch)
tree4031e2e2b6166bd926b43fa4bbb3aab773a30ee5 /src/gallium/drivers/svga/svga_swtnl_draw.c
parent404fb63b4649f58fce443615e49337d42b8ddece (diff)
parent35d960cc744c374ccaad48c3d80559b59c74e28a (diff)
Merge branch 'master' of ssh://git.freedesktop.org/git/mesa/mesa into pipe-video
Conflicts: src/gallium/auxiliary/Makefile src/gallium/auxiliary/SConscript src/gallium/auxiliary/util/u_format.csv src/gallium/auxiliary/vl/vl_compositor.c src/gallium/auxiliary/vl/vl_compositor.h src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.h src/gallium/drivers/identity/id_objects.c src/gallium/drivers/identity/id_objects.h src/gallium/drivers/identity/id_screen.c src/gallium/drivers/nv40/Makefile src/gallium/drivers/nv40/nv40_screen.c src/gallium/drivers/softpipe/sp_texture.c src/gallium/drivers/softpipe/sp_texture.h src/gallium/drivers/softpipe/sp_video_context.c src/gallium/drivers/softpipe/sp_video_context.h src/gallium/include/pipe/p_format.h src/gallium/include/pipe/p_screen.h src/gallium/include/pipe/p_video_context.h src/gallium/include/pipe/p_video_state.h src/gallium/include/state_tracker/dri1_api.h src/gallium/include/state_tracker/drm_api.h src/gallium/state_trackers/dri/common/dri_context.c src/gallium/state_trackers/xorg/xvmc/attributes.c src/gallium/state_trackers/xorg/xvmc/block.c src/gallium/state_trackers/xorg/xvmc/context.c src/gallium/state_trackers/xorg/xvmc/subpicture.c src/gallium/state_trackers/xorg/xvmc/surface.c src/gallium/state_trackers/xorg/xvmc/tests/.gitignore src/gallium/state_trackers/xorg/xvmc/tests/Makefile src/gallium/state_trackers/xorg/xvmc/xvmc_private.h src/gallium/winsys/drm/radeon/core/radeon_drm.c src/gallium/winsys/g3dvl/vl_winsys.h src/gallium/winsys/g3dvl/xlib/xsp_winsys.c src/gallium/winsys/sw/Makefile
Diffstat (limited to 'src/gallium/drivers/svga/svga_swtnl_draw.c')
-rw-r--r--src/gallium/drivers/svga/svga_swtnl_draw.c39
1 files changed, 24 insertions, 15 deletions
diff --git a/src/gallium/drivers/svga/svga_swtnl_draw.c b/src/gallium/drivers/svga/svga_swtnl_draw.c
index da15be155c8..eb71c23195b 100644
--- a/src/gallium/drivers/svga/svga_swtnl_draw.c
+++ b/src/gallium/drivers/svga/svga_swtnl_draw.c
@@ -37,12 +37,16 @@
enum pipe_error
svga_swtnl_draw_range_elements(struct svga_context *svga,
- struct pipe_buffer *indexBuffer,
+ struct pipe_resource *indexBuffer,
unsigned indexSize,
+ int indexBias,
unsigned min_index,
unsigned max_index,
unsigned prim, unsigned start, unsigned count)
{
+ struct pipe_transfer *vb_transfer[PIPE_MAX_ATTRIBS];
+ struct pipe_transfer *ib_transfer = NULL;
+ struct pipe_transfer *cb_transfer = NULL;
struct draw_context *draw = svga->swtnl.draw;
unsigned i;
const void *map;
@@ -64,34 +68,37 @@ svga_swtnl_draw_range_elements(struct svga_context *svga,
* Map vertex buffers
*/
for (i = 0; i < svga->curr.num_vertex_buffers; i++) {
- map = pipe_buffer_map(svga->pipe.screen,
+ map = pipe_buffer_map(&svga->pipe,
svga->curr.vb[i].buffer,
- PIPE_BUFFER_USAGE_CPU_READ);
+ PIPE_TRANSFER_READ,
+ &vb_transfer[i]);
draw_set_mapped_vertex_buffer(draw, i, map);
}
/* Map index buffer, if present */
if (indexBuffer) {
- map = pipe_buffer_map(svga->pipe.screen, indexBuffer,
- PIPE_BUFFER_USAGE_CPU_READ);
+ map = pipe_buffer_map(&svga->pipe, indexBuffer,
+ PIPE_TRANSFER_READ,
+ &ib_transfer);
draw_set_mapped_element_buffer_range(draw,
- indexSize,
+ indexSize, indexBias,
min_index,
max_index,
map);
}
if (svga->curr.cb[PIPE_SHADER_VERTEX]) {
- map = pipe_buffer_map(svga->pipe.screen,
+ map = pipe_buffer_map(&svga->pipe,
svga->curr.cb[PIPE_SHADER_VERTEX],
- PIPE_BUFFER_USAGE_CPU_READ);
+ PIPE_TRANSFER_READ,
+ &cb_transfer);
assert(map);
draw_set_mapped_constant_buffer(
draw, PIPE_SHADER_VERTEX, 0,
map,
- svga->curr.cb[PIPE_SHADER_VERTEX]->size);
+ svga->curr.cb[PIPE_SHADER_VERTEX]->width0);
}
draw_arrays(svga->swtnl.draw, prim, start, count);
@@ -105,18 +112,20 @@ svga_swtnl_draw_range_elements(struct svga_context *svga,
* unmap vertex/index buffers
*/
for (i = 0; i < svga->curr.num_vertex_buffers; i++) {
- pipe_buffer_unmap(svga->pipe.screen, svga->curr.vb[i].buffer);
+ pipe_buffer_unmap(&svga->pipe, svga->curr.vb[i].buffer,
+ vb_transfer[i]);
draw_set_mapped_vertex_buffer(draw, i, NULL);
}
if (indexBuffer) {
- pipe_buffer_unmap(svga->pipe.screen, indexBuffer);
- draw_set_mapped_element_buffer(draw, 0, NULL);
+ pipe_buffer_unmap(&svga->pipe, indexBuffer, ib_transfer);
+ draw_set_mapped_element_buffer(draw, 0, 0, NULL);
}
if (svga->curr.cb[PIPE_SHADER_VERTEX]) {
- pipe_buffer_unmap(svga->pipe.screen,
- svga->curr.cb[PIPE_SHADER_VERTEX]);
+ pipe_buffer_unmap(&svga->pipe,
+ svga->curr.cb[PIPE_SHADER_VERTEX],
+ cb_transfer);
}
return ret;
@@ -134,7 +143,7 @@ boolean svga_init_swtnl( struct svga_context *svga )
/*
* Create drawing context and plug our rendering stage into it.
*/
- svga->swtnl.draw = draw_create();
+ svga->swtnl.draw = draw_create(&svga->pipe);
if (svga->swtnl.draw == NULL)
goto fail;