summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/r600/r600_draw.c
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2010-05-10 03:27:58 +0200
committerJerome Glisse <jglisse@redhat.com>2010-05-27 23:24:02 +0200
commitb8fb1d75ce95fe5d404b301ab31ca0c323967d14 (patch)
tree78b648b638f7ed1560c569877c2c0c3b8b1dd81e /src/gallium/drivers/r600/r600_draw.c
parent72128962d640846472c1b0dc22cf4ac6ce875dc9 (diff)
r600g: adapt to latest interfaces changes
- Wrapped the buffer and texture create/destroy/transfer/... functions using u_resource, which is then used to implement the resource functions. - Implemented texture transfers. I left the buffer and texture transfers separate because one day we'll need a special codepath for textures. - Added index_bias to the draw_*elements functions. - Removed nonexistent *REP and *FOR instructions. - Some pipe formats have changed channel ordering, so I've removed/fixed nonexistent ones. - Added stubs for create/set/destroy sampler views. - Added a naive implementation of vertex elements state (new CSO). - Reworked {texture,buffer}_{from,to}_handle. - Reorganized winsys files, removed dri,egl,python directories. - Added a new build target dri-r600.
Diffstat (limited to 'src/gallium/drivers/r600/r600_draw.c')
-rw-r--r--src/gallium/drivers/r600/r600_draw.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gallium/drivers/r600/r600_draw.c b/src/gallium/drivers/r600/r600_draw.c
index b903796311..aa254faf15 100644
--- a/src/gallium/drivers/r600/r600_draw.c
+++ b/src/gallium/drivers/r600/r600_draw.c
@@ -51,7 +51,7 @@ static int r600_draw_common(struct r600_draw *draw)
struct r600_context *rctx = (struct r600_context*)draw->ctx;
struct r600_screen *rscreen = (struct r600_screen*)draw->ctx->screen;
struct radeon_state *vs_resource;
- struct r600_pipe_buffer *rbuffer;
+ struct r600_buffer *rbuffer;
unsigned i, j, offset, format, prim;
u32 vgt_dma_index_type, vgt_draw_initiator;
int r;
@@ -101,7 +101,7 @@ static int r600_draw_common(struct r600_draw *draw)
for (i = 0 ; i < rctx->nvertex_element; i++) {
j = rctx->vertex_element[i].vertex_buffer_index;
- rbuffer = (struct r600_pipe_buffer*)rctx->vertex_buffer[j].buffer;
+ rbuffer = (struct r600_buffer*)rctx->vertex_buffer[j].buffer;
offset = rctx->vertex_element[i].src_offset + rctx->vertex_buffer[j].buffer_offset;
r = r600_conv_pipe_format(rctx->vertex_element[i].src_format, &format);
if (r)
@@ -132,7 +132,7 @@ static int r600_draw_common(struct r600_draw *draw)
draw->draw->states[R600_DRAW__VGT_NUM_INDICES] = draw->count;
draw->draw->states[R600_DRAW__VGT_DRAW_INITIATOR] = vgt_draw_initiator;
if (draw->index_buffer) {
- rbuffer = (struct r600_pipe_buffer*)draw->index_buffer;
+ rbuffer = (struct r600_buffer*)draw->index_buffer;
draw->draw->bo[0] = radeon_bo_incref(rscreen->rw, rbuffer->bo);
draw->draw->placement[0] = RADEON_GEM_DOMAIN_GTT;
draw->draw->placement[1] = RADEON_GEM_DOMAIN_GTT;
@@ -168,11 +168,12 @@ static int r600_draw_common(struct r600_draw *draw)
void r600_draw_range_elements(struct pipe_context *ctx,
struct pipe_buffer *index_buffer,
- unsigned index_size, unsigned min_index,
+ unsigned index_size, unsigned index_bias, unsigned min_index,
unsigned max_index, unsigned mode,
unsigned start, unsigned count)
{
struct r600_draw draw;
+ assert(index_bias == 0);
draw.ctx = ctx;
draw.mode = mode;
@@ -186,10 +187,11 @@ printf("index_size %d min %d max %d start %d count %d\n", index_size, min_inde
void r600_draw_elements(struct pipe_context *ctx,
struct pipe_buffer *index_buffer,
- unsigned index_size, unsigned mode,
+ unsigned index_size, unsigned index_bias, unsigned mode,
unsigned start, unsigned count)
{
struct r600_draw draw;
+ assert(index_bias == 0);
draw.ctx = ctx;
draw.mode = mode;