summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nv50/nv50_push.c
diff options
context:
space:
mode:
authorChristoph Bumiller <[email protected]>2011-03-02 20:48:20 +0100
committerChristoph Bumiller <[email protected]>2011-03-02 20:59:54 +0100
commit47a62b1ca1357ea1f60ae60dd0cfd72f8e5fa1b3 (patch)
tree66f11666a7e8196b440225597229e8eb27860748 /src/gallium/drivers/nv50/nv50_push.c
parentb8646bc2af87f4b2cde50980da878b89d09cdf96 (diff)
nv50: primitive restart trick for vertex data through FIFO mode
Also, on nv50 the VERTEX_BEGIN method doesn't follow VERTEX_END, which was erroneously taken over from nvc0 and is fixed now.
Diffstat (limited to 'src/gallium/drivers/nv50/nv50_push.c')
-rw-r--r--src/gallium/drivers/nv50/nv50_push.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/gallium/drivers/nv50/nv50_push.c b/src/gallium/drivers/nv50/nv50_push.c
index 71b5995a4f8..e8ad1ddd38a 100644
--- a/src/gallium/drivers/nv50/nv50_push.c
+++ b/src/gallium/drivers/nv50/nv50_push.c
@@ -86,10 +86,8 @@ emit_vertices_i08(struct push_context *ctx, unsigned start, unsigned count)
if (nr != push) {
count--;
elts++;
- BEGIN_RING(ctx->chan, RING_3D(VERTEX_END_GL), 2);
- OUT_RING (ctx->chan, 0);
- OUT_RING (ctx->chan, NVA0_3D_VERTEX_BEGIN_GL_INSTANCE_CONT |
- (ctx->prim & ~NV50_3D_VERTEX_BEGIN_GL_INSTANCE_NEXT));
+ BEGIN_RING(ctx->chan, RING_3D(VB_ELEMENT_U32), 1);
+ OUT_RING (ctx->chan, ctx->restart_index);
}
}
}
@@ -121,10 +119,8 @@ emit_vertices_i16(struct push_context *ctx, unsigned start, unsigned count)
if (nr != push) {
count--;
elts++;
- BEGIN_RING(ctx->chan, RING_3D(VERTEX_END_GL), 2);
- OUT_RING (ctx->chan, 0);
- OUT_RING (ctx->chan, NVA0_3D_VERTEX_BEGIN_GL_INSTANCE_CONT |
- (ctx->prim & ~NV50_3D_VERTEX_BEGIN_GL_INSTANCE_NEXT));
+ BEGIN_RING(ctx->chan, RING_3D(VB_ELEMENT_U32), 1);
+ OUT_RING (ctx->chan, ctx->restart_index);
}
}
}
@@ -156,10 +152,8 @@ emit_vertices_i32(struct push_context *ctx, unsigned start, unsigned count)
if (nr != push) {
count--;
elts++;
- BEGIN_RING(ctx->chan, RING_3D(VERTEX_END_GL), 2);
- OUT_RING (ctx->chan, 0);
- OUT_RING (ctx->chan, NVA0_3D_VERTEX_BEGIN_GL_INSTANCE_CONT |
- (ctx->prim & ~NV50_3D_VERTEX_BEGIN_GL_INSTANCE_NEXT));
+ BEGIN_RING(ctx->chan, RING_3D(VB_ELEMENT_U32), 1);
+ OUT_RING (ctx->chan, ctx->restart_index);
}
}
}
@@ -257,6 +251,17 @@ nv50_push_vbo(struct nv50_context *nv50, const struct pipe_draw_info *info)
ctx.instance_id = info->start_instance;
ctx.prim = nv50_prim_gl(info->mode);
+ if (info->primitive_restart) {
+ BEGIN_RING(ctx.chan, RING_3D(PRIM_RESTART_ENABLE), 2);
+ OUT_RING (ctx.chan, 1);
+ OUT_RING (ctx.chan, info->restart_index);
+ } else
+ if (nv50->state.prim_restart) {
+ BEGIN_RING(ctx.chan, RING_3D(PRIM_RESTART_ENABLE), 1);
+ OUT_RING (ctx.chan, 0);
+ }
+ nv50->state.prim_restart = info->primitive_restart;
+
while (inst--) {
BEGIN_RING(ctx.chan, RING_3D(VERTEX_BEGIN_GL), 1);
OUT_RING (ctx.chan, ctx.prim);