Home | History | Annotate | Download | only in nv30

Lines Matching refs:ctx

86 emit_vertices_i08(struct push_context *ctx, unsigned start, unsigned count)
88 uint8_t *elts = (uint8_t *)ctx->idxbuf + start;
91 unsigned push = MIN2(count, ctx->packet_vertex_limit);
95 if (ctx->primitive_restart)
96 nr = prim_restart_search_i08(elts, push, ctx->restart_index);
98 size = ctx->vertex_words * nr;
100 BEGIN_NI04(ctx->push, NV30_3D(VERTEX_DATA), size);
102 ctx->translate->run_elts8(ctx->translate, elts, nr, 0, ctx->push->cur);
104 ctx->push->cur += size;
109 BEGIN_NV04(ctx->push, NV30_3D(VB_ELEMENT_U32), 1);
110 PUSH_DATA (ctx->push, ctx->restart_index);
118 emit_vertices_i16(struct push_context *ctx, unsigned start, unsigned count)
120 uint16_t *elts = (uint16_t *)ctx->idxbuf + start;
123 unsigned push = MIN2(count, ctx->packet_vertex_limit);
127 if (ctx->primitive_restart)
128 nr = prim_restart_search_i16(elts, push, ctx->restart_index);
130 size = ctx->vertex_words * nr;
132 BEGIN_NI04(ctx->push, NV30_3D(VERTEX_DATA), size);
134 ctx->translate->run_elts16(ctx->translate, elts, nr, 0, ctx->push->cur);
136 ctx->push->cur += size;
141 BEGIN_NV04(ctx->push, NV30_3D(VB_ELEMENT_U32), 1);
142 PUSH_DATA (ctx->push, ctx->restart_index);
150 emit_vertices_i32(struct push_context *ctx, unsigned start, unsigned count)
152 uint32_t *elts = (uint32_t *)ctx->idxbuf + start;
155 unsigned push = MIN2(count, ctx->packet_vertex_limit);
159 if (ctx->primitive_restart)
160 nr = prim_restart_search_i32(elts, push, ctx->restart_index);
162 size = ctx->vertex_words * nr;
164 BEGIN_NI04(ctx->push, NV30_3D(VERTEX_DATA), size);
166 ctx->translate->run_elts(ctx->translate, elts, nr, 0, ctx->push->cur);
168 ctx->push->cur += size;
173 BEGIN_NV04(ctx->push, NV30_3D(VB_ELEMENT_U32), 1);
174 PUSH_DATA (ctx->push, ctx->restart_index);
182 emit_vertices_seq(struct push_context *ctx, unsigned start, unsigned count)
185 unsigned push = MIN2(count, ctx->packet_vertex_limit);
186 unsigned size = ctx->vertex_words * push;
188 BEGIN_NI04(ctx->push, NV30_3D(VERTEX_DATA), size);
190 ctx->translate->run(ctx->translate, start, push, 0, ctx->push->cur);
191 ctx->push->cur += size;
200 struct push_context ctx;
204 ctx.push = nv30->base.pushbuf;
205 ctx.translate = nv30->vertex->translate;
206 ctx.packet_vertex_limit = nv30->vertex->vtx_per_packet_max;
207 ctx.vertex_words = nv30->vertex->vtx_size;
220 ctx.translate->set_buffer(ctx.translate, i, data, vb->stride, ~0);
225 ctx.idxbuf = nouveau_resource_map_offset(&nv30->base,
229 ctx.idxbuf = nv30->idxbuf.user_buffer;
230 if (!ctx.idxbuf) {
235 ctx.primitive_restart = info->primitive_restart;
236 ctx.restart_index = info->restart_index;
238 ctx.idxbuf = NULL;
240 ctx.primitive_restart = FALSE;
241 ctx.restart_index = 0;
245 BEGIN_NV04(ctx.push, NV40_3D(PRIM_RESTART_ENABLE), 2);
246 PUSH_DATA (ctx.push, info->primitive_restart);
247 PUSH_DATA (ctx.push, info->restart_index);
251 ctx.prim = nv30_prim_gl(info->mode);
253 PUSH_RESET(ctx.push, BUFCTX_IDXBUF);
254 BEGIN_NV04(ctx.push, NV30_3D(VERTEX_BEGIN_END), 1);
255 PUSH_DATA (ctx.push, ctx.prim);
258 emit_vertices_seq(&ctx, info->start, info->count);
261 emit_vertices_i08(&ctx, info->start, info->count);
264 emit_vertices_i16(&ctx, info->start, info->count);
267 emit_vertices_i32(&ctx, info->start, info->count);
273 BEGIN_NV04(ctx.push, NV30_3D(VERTEX_BEGIN_END), 1);
274 PUSH_DATA (ctx.push, NV30_3D_VERTEX_BEGIN_END_STOP);