Lines Matching refs:ctx
63 emit_vertices_i08(struct push_context *ctx, unsigned start, unsigned count)
65 uint8_t *elts = (uint8_t *)ctx->idxbuf + start;
68 unsigned push = MIN2(count, ctx->packet_vertex_limit);
72 if (ctx->primitive_restart)
73 nr = prim_restart_search_i08(elts, push, ctx->restart_index);
75 size = ctx->vertex_words * nr;
77 BEGIN_NI04(ctx->push, NV50_3D(VERTEX_DATA), size);
79 ctx->translate->run_elts8(ctx->translate, elts, nr, ctx->instance_id,
80 ctx->push->cur);
82 ctx->push->cur += size;
89 BEGIN_NV04(ctx->push, NV50_3D(VB_ELEMENT_U32), 1);
90 PUSH_DATA (ctx->push, ctx->restart_index);
96 emit_vertices_i16(struct push_context *ctx, unsigned start, unsigned count)
98 uint16_t *elts = (uint16_t *)ctx->idxbuf + start;
101 unsigned push = MIN2(count, ctx->packet_vertex_limit);
105 if (ctx->primitive_restart)
106 nr = prim_restart_search_i16(elts, push, ctx->restart_index);
108 size = ctx->vertex_words * nr;
110 BEGIN_NI04(ctx->push, NV50_3D(VERTEX_DATA), size);
112 ctx->translate->run_elts16(ctx->translate, elts, nr, ctx->instance_id,
113 ctx->push->cur);
115 ctx->push->cur += size;
122 BEGIN_NV04(ctx->push, NV50_3D(VB_ELEMENT_U32), 1);
123 PUSH_DATA (ctx->push, ctx->restart_index);
129 emit_vertices_i32(struct push_context *ctx, unsigned start, unsigned count)
131 uint32_t *elts = (uint32_t *)ctx->idxbuf + start;
134 unsigned push = MIN2(count, ctx->packet_vertex_limit);
138 if (ctx->primitive_restart)
139 nr = prim_restart_search_i32(elts, push, ctx->restart_index);
141 size = ctx->vertex_words * nr;
143 BEGIN_NI04(ctx->push, NV50_3D(VERTEX_DATA), size);
145 ctx->translate->run_elts(ctx->translate, elts, nr, ctx->instance_id,
146 ctx->push->cur);
148 ctx->push->cur += size;
155 BEGIN_NV04(ctx->push, NV50_3D(VB_ELEMENT_U32), 1);
156 PUSH_DATA (ctx->push, ctx->restart_index);
162 emit_vertices_seq(struct push_context *ctx, unsigned start, unsigned count)
165 unsigned push = MIN2(count, ctx->packet_vertex_limit);
166 unsigned size = ctx->vertex_words * push;
168 BEGIN_NI04(ctx->push, NV50_3D(VERTEX_DATA), size);
170 ctx->translate->run(ctx->translate, start, push, ctx->instance_id,
171 ctx->push->cur);
172 ctx->push->cur += size;
211 struct push_context ctx;
217 ctx.push = nv50->base.pushbuf;
218 ctx.translate = nv50->vertex->translate;
219 ctx.packet_vertex_limit = nv50->vertex->packet_vertex_limit;
220 ctx.vertex_words = nv50->vertex->vertex_size;
235 ctx.translate->set_buffer(ctx.translate, i, data, vb->stride, ~0);
240 ctx.idxbuf = nouveau_resource_map_offset(&nv50->base,
244 ctx.idxbuf = nv50->idxbuf.user_buffer;
246 if (!ctx.idxbuf)
249 ctx.primitive_restart = info->primitive_restart;
250 ctx.restart_index = info->restart_index;
263 ctx.idxbuf = NULL;
265 ctx.primitive_restart = FALSE;
266 ctx.restart_index = 0;
269 ctx.instance_id = info->start_instance;
270 ctx.prim = nv50_prim_gl(info->mode);
273 BEGIN_NV04(ctx.push, NV50_3D(PRIM_RESTART_ENABLE), 2);
274 PUSH_DATA (ctx.push, 1);
275 PUSH_DATA (ctx.push, info->restart_index);
278 BEGIN_NV04(ctx.push, NV50_3D(PRIM_RESTART_ENABLE), 1);
279 PUSH_DATA (ctx.push, 0);
284 BEGIN_NV04(ctx.push, NV50_3D(VERTEX_BEGIN_GL), 1);
285 PUSH_DATA (ctx.push, ctx.prim);
288 emit_vertices_seq(&ctx, info->start, vert_count);
291 emit_vertices_i08(&ctx, info->start, vert_count);
294 emit_vertices_i16(&ctx, info->start, vert_count);
297 emit_vertices_i32(&ctx, info->start, vert_count);
303 BEGIN_NV04(ctx.push, NV50_3D(VERTEX_END_GL), 1);
304 PUSH_DATA (ctx.push, 0);
306 ctx.instance_id++;
307 ctx.prim |= NV50_3D_VERTEX_BEGIN_GL_INSTANCE_NEXT;