2 #include "pipe/p_context.h"
3 #include "pipe/p_state.h"
4 #include "util/u_inlines.h"
5 #include "util/u_format.h"
6 #include "translate/translate.h"
8 #include "nvc0/nvc0_context.h"
9 #include "nvc0/nvc0_resource.h"
11 #include "nvc0/nvc0_3d.xml.h"
14 struct nouveau_pushbuf
*push
;
16 struct translate
*translate
;
21 uint32_t restart_index
;
36 static void nvc0_push_upload_vertex_ids(struct push_context
*,
37 struct nvc0_context
*,
38 const struct pipe_draw_info
*);
41 nvc0_push_context_init(struct nvc0_context
*nvc0
, struct push_context
*ctx
)
43 ctx
->push
= nvc0
->base
.pushbuf
;
45 ctx
->translate
= nvc0
->vertex
->translate
;
46 ctx
->vertex_size
= nvc0
->vertex
->size
;
49 nvc0
->vertprog
->vp
.need_vertex_id
&& (nvc0
->vertex
->num_elements
< 32);
51 ctx
->edgeflag
.value
= true;
52 ctx
->edgeflag
.enabled
= nvc0
->vertprog
->vp
.edgeflag
< PIPE_MAX_ATTRIBS
;
54 /* silence warnings */
55 ctx
->edgeflag
.data
= NULL
;
56 ctx
->edgeflag
.stride
= 0;
57 ctx
->edgeflag
.width
= 0;
61 nvc0_vertex_configure_translate(struct nvc0_context
*nvc0
, int32_t index_bias
)
63 struct translate
*translate
= nvc0
->vertex
->translate
;
66 for (i
= 0; i
< nvc0
->num_vtxbufs
; ++i
) {
68 const struct pipe_vertex_buffer
*vb
= &nvc0
->vtxbuf
[i
];
70 if (likely(!vb
->buffer
))
71 map
= (const uint8_t *)vb
->user_buffer
;
73 map
= nouveau_resource_map_offset(&nvc0
->base
,
74 nv04_resource(vb
->buffer
), vb
->buffer_offset
, NOUVEAU_BO_RD
);
76 if (index_bias
&& !unlikely(nvc0
->vertex
->instance_bufs
& (1 << i
)))
77 map
+= (intptr_t)index_bias
* vb
->stride
;
79 translate
->set_buffer(translate
, i
, map
, vb
->stride
, ~0);
84 nvc0_push_map_idxbuf(struct push_context
*ctx
, struct nvc0_context
*nvc0
)
86 if (nvc0
->idxbuf
.buffer
) {
87 struct nv04_resource
*buf
= nv04_resource(nvc0
->idxbuf
.buffer
);
88 ctx
->idxbuf
= nouveau_resource_map_offset(&nvc0
->base
,
89 buf
, nvc0
->idxbuf
.offset
, NOUVEAU_BO_RD
);
91 ctx
->idxbuf
= nvc0
->idxbuf
.user_buffer
;
96 nvc0_push_map_edgeflag(struct push_context
*ctx
, struct nvc0_context
*nvc0
,
99 unsigned attr
= nvc0
->vertprog
->vp
.edgeflag
;
100 struct pipe_vertex_element
*ve
= &nvc0
->vertex
->element
[attr
].pipe
;
101 struct pipe_vertex_buffer
*vb
= &nvc0
->vtxbuf
[ve
->vertex_buffer_index
];
102 struct nv04_resource
*buf
= nv04_resource(vb
->buffer
);
104 ctx
->edgeflag
.stride
= vb
->stride
;
105 ctx
->edgeflag
.width
= util_format_get_blocksize(ve
->src_format
);
107 unsigned offset
= vb
->buffer_offset
+ ve
->src_offset
;
108 ctx
->edgeflag
.data
= nouveau_resource_map_offset(&nvc0
->base
,
109 buf
, offset
, NOUVEAU_BO_RD
);
111 ctx
->edgeflag
.data
= (const uint8_t *)vb
->user_buffer
+ ve
->src_offset
;
115 ctx
->edgeflag
.data
+= (intptr_t)index_bias
* vb
->stride
;
118 static inline unsigned
119 prim_restart_search_i08(const uint8_t *elts
, unsigned push
, uint8_t index
)
122 for (i
= 0; i
< push
&& elts
[i
] != index
; ++i
);
126 static inline unsigned
127 prim_restart_search_i16(const uint16_t *elts
, unsigned push
, uint16_t index
)
130 for (i
= 0; i
< push
&& elts
[i
] != index
; ++i
);
134 static inline unsigned
135 prim_restart_search_i32(const uint32_t *elts
, unsigned push
, uint32_t index
)
138 for (i
= 0; i
< push
&& elts
[i
] != index
; ++i
);
143 ef_value_8(const struct push_context
*ctx
, uint32_t index
)
145 uint8_t *pf
= (uint8_t *)&ctx
->edgeflag
.data
[index
* ctx
->edgeflag
.stride
];
150 ef_value_32(const struct push_context
*ctx
, uint32_t index
)
152 uint32_t *pf
= (uint32_t *)&ctx
->edgeflag
.data
[index
* ctx
->edgeflag
.stride
];
157 ef_toggle(struct push_context
*ctx
)
159 ctx
->edgeflag
.value
= !ctx
->edgeflag
.value
;
160 return ctx
->edgeflag
.value
;
163 static inline unsigned
164 ef_toggle_search_i08(struct push_context
*ctx
, const uint8_t *elts
, unsigned n
)
167 bool ef
= ctx
->edgeflag
.value
;
168 if (ctx
->edgeflag
.width
== 1)
169 for (i
= 0; i
< n
&& ef_value_8(ctx
, elts
[i
]) == ef
; ++i
);
171 for (i
= 0; i
< n
&& ef_value_32(ctx
, elts
[i
]) == ef
; ++i
);
175 static inline unsigned
176 ef_toggle_search_i16(struct push_context
*ctx
, const uint16_t *elts
, unsigned n
)
179 bool ef
= ctx
->edgeflag
.value
;
180 if (ctx
->edgeflag
.width
== 1)
181 for (i
= 0; i
< n
&& ef_value_8(ctx
, elts
[i
]) == ef
; ++i
);
183 for (i
= 0; i
< n
&& ef_value_32(ctx
, elts
[i
]) == ef
; ++i
);
187 static inline unsigned
188 ef_toggle_search_i32(struct push_context
*ctx
, const uint32_t *elts
, unsigned n
)
191 bool ef
= ctx
->edgeflag
.value
;
192 if (ctx
->edgeflag
.width
== 1)
193 for (i
= 0; i
< n
&& ef_value_8(ctx
, elts
[i
]) == ef
; ++i
);
195 for (i
= 0; i
< n
&& ef_value_32(ctx
, elts
[i
]) == ef
; ++i
);
199 static inline unsigned
200 ef_toggle_search_seq(struct push_context
*ctx
, unsigned start
, unsigned n
)
203 bool ef
= ctx
->edgeflag
.value
;
204 if (ctx
->edgeflag
.width
== 1)
205 for (i
= 0; i
< n
&& ef_value_8(ctx
, start
++) == ef
; ++i
);
207 for (i
= 0; i
< n
&& ef_value_32(ctx
, start
++) == ef
; ++i
);
212 nvc0_push_setup_vertex_array(struct nvc0_context
*nvc0
, const unsigned count
)
214 struct nouveau_pushbuf
*push
= nvc0
->base
.pushbuf
;
215 struct nouveau_bo
*bo
;
217 const unsigned size
= count
* nvc0
->vertex
->size
;
219 void *const dest
= nouveau_scratch_get(&nvc0
->base
, size
, &va
, &bo
);
221 BEGIN_NVC0(push
, NVC0_3D(VERTEX_ARRAY_START_HIGH(0)), 2);
222 PUSH_DATAh(push
, va
);
223 PUSH_DATA (push
, va
);
224 BEGIN_NVC0(push
, NVC0_3D(VERTEX_ARRAY_LIMIT_HIGH(0)), 2);
225 PUSH_DATAh(push
, va
+ size
- 1);
226 PUSH_DATA (push
, va
+ size
- 1);
228 BCTX_REFN_bo(nvc0
->bufctx_3d
, VTX_TMP
, NOUVEAU_BO_GART
| NOUVEAU_BO_RD
,
230 nouveau_pushbuf_validate(push
);
236 disp_vertices_i08(struct push_context
*ctx
, unsigned start
, unsigned count
)
238 struct nouveau_pushbuf
*push
= ctx
->push
;
239 struct translate
*translate
= ctx
->translate
;
240 const uint8_t *restrict elts
= (uint8_t *)ctx
->idxbuf
+ start
;
246 if (unlikely(ctx
->prim_restart
))
247 nR
= prim_restart_search_i08(elts
, nR
, ctx
->restart_index
);
249 translate
->run_elts8(translate
, elts
, nR
, 0, ctx
->instance_id
, ctx
->dest
);
251 ctx
->dest
+= nR
* ctx
->vertex_size
;
256 if (unlikely(ctx
->edgeflag
.enabled
))
257 nE
= ef_toggle_search_i08(ctx
, elts
, nR
);
260 if (likely(nE
>= 2)) {
261 BEGIN_NVC0(push
, NVC0_3D(VERTEX_BUFFER_FIRST
), 2);
262 PUSH_DATA (push
, pos
);
263 PUSH_DATA (push
, nE
);
267 IMMED_NVC0(push
, NVC0_3D(VB_ELEMENT_U32
), pos
);
269 BEGIN_NVC0(push
, NVC0_3D(VB_ELEMENT_U32
), 1);
270 PUSH_DATA (push
, pos
);
273 if (unlikely(nE
!= nR
))
274 IMMED_NVC0(push
, NVC0_3D(EDGEFLAG
), ef_toggle(ctx
));
281 BEGIN_NVC0(push
, NVC0_3D(VB_ELEMENT_U32
), 1);
282 PUSH_DATA (push
, 0xffffffff);
284 ctx
->dest
+= ctx
->vertex_size
;
292 disp_vertices_i16(struct push_context
*ctx
, unsigned start
, unsigned count
)
294 struct nouveau_pushbuf
*push
= ctx
->push
;
295 struct translate
*translate
= ctx
->translate
;
296 const uint16_t *restrict elts
= (uint16_t *)ctx
->idxbuf
+ start
;
302 if (unlikely(ctx
->prim_restart
))
303 nR
= prim_restart_search_i16(elts
, nR
, ctx
->restart_index
);
305 translate
->run_elts16(translate
, elts
, nR
, 0, ctx
->instance_id
, ctx
->dest
);
307 ctx
->dest
+= nR
* ctx
->vertex_size
;
312 if (unlikely(ctx
->edgeflag
.enabled
))
313 nE
= ef_toggle_search_i16(ctx
, elts
, nR
);
316 if (likely(nE
>= 2)) {
317 BEGIN_NVC0(push
, NVC0_3D(VERTEX_BUFFER_FIRST
), 2);
318 PUSH_DATA (push
, pos
);
319 PUSH_DATA (push
, nE
);
323 IMMED_NVC0(push
, NVC0_3D(VB_ELEMENT_U32
), pos
);
325 BEGIN_NVC0(push
, NVC0_3D(VB_ELEMENT_U32
), 1);
326 PUSH_DATA (push
, pos
);
329 if (unlikely(nE
!= nR
))
330 IMMED_NVC0(push
, NVC0_3D(EDGEFLAG
), ef_toggle(ctx
));
337 BEGIN_NVC0(push
, NVC0_3D(VB_ELEMENT_U32
), 1);
338 PUSH_DATA (push
, 0xffffffff);
340 ctx
->dest
+= ctx
->vertex_size
;
348 disp_vertices_i32(struct push_context
*ctx
, unsigned start
, unsigned count
)
350 struct nouveau_pushbuf
*push
= ctx
->push
;
351 struct translate
*translate
= ctx
->translate
;
352 const uint32_t *restrict elts
= (uint32_t *)ctx
->idxbuf
+ start
;
358 if (unlikely(ctx
->prim_restart
))
359 nR
= prim_restart_search_i32(elts
, nR
, ctx
->restart_index
);
361 translate
->run_elts(translate
, elts
, nR
, 0, ctx
->instance_id
, ctx
->dest
);
363 ctx
->dest
+= nR
* ctx
->vertex_size
;
368 if (unlikely(ctx
->edgeflag
.enabled
))
369 nE
= ef_toggle_search_i32(ctx
, elts
, nR
);
372 if (likely(nE
>= 2)) {
373 BEGIN_NVC0(push
, NVC0_3D(VERTEX_BUFFER_FIRST
), 2);
374 PUSH_DATA (push
, pos
);
375 PUSH_DATA (push
, nE
);
379 IMMED_NVC0(push
, NVC0_3D(VB_ELEMENT_U32
), pos
);
381 BEGIN_NVC0(push
, NVC0_3D(VB_ELEMENT_U32
), 1);
382 PUSH_DATA (push
, pos
);
385 if (unlikely(nE
!= nR
))
386 IMMED_NVC0(push
, NVC0_3D(EDGEFLAG
), ef_toggle(ctx
));
393 BEGIN_NVC0(push
, NVC0_3D(VB_ELEMENT_U32
), 1);
394 PUSH_DATA (push
, 0xffffffff);
396 ctx
->dest
+= ctx
->vertex_size
;
404 disp_vertices_seq(struct push_context
*ctx
, unsigned start
, unsigned count
)
406 struct nouveau_pushbuf
*push
= ctx
->push
;
407 struct translate
*translate
= ctx
->translate
;
410 /* XXX: This will read the data corresponding to the primitive restart index,
411 * maybe we should avoid that ?
413 translate
->run(translate
, start
, count
, 0, ctx
->instance_id
, ctx
->dest
);
417 if (unlikely(ctx
->edgeflag
.enabled
))
418 nr
= ef_toggle_search_seq(ctx
, start
+ pos
, nr
);
422 BEGIN_NVC0(push
, NVC0_3D(VERTEX_BUFFER_FIRST
), 2);
423 PUSH_DATA (push
, pos
);
424 PUSH_DATA (push
, nr
);
426 if (unlikely(nr
!= count
))
427 IMMED_NVC0(push
, NVC0_3D(EDGEFLAG
), ef_toggle(ctx
));
435 #define NVC0_PRIM_GL_CASE(n) \
436 case PIPE_PRIM_##n: return NVC0_3D_VERTEX_BEGIN_GL_PRIMITIVE_##n
438 static inline unsigned
439 nvc0_prim_gl(unsigned prim
)
442 NVC0_PRIM_GL_CASE(POINTS
);
443 NVC0_PRIM_GL_CASE(LINES
);
444 NVC0_PRIM_GL_CASE(LINE_LOOP
);
445 NVC0_PRIM_GL_CASE(LINE_STRIP
);
446 NVC0_PRIM_GL_CASE(TRIANGLES
);
447 NVC0_PRIM_GL_CASE(TRIANGLE_STRIP
);
448 NVC0_PRIM_GL_CASE(TRIANGLE_FAN
);
449 NVC0_PRIM_GL_CASE(QUADS
);
450 NVC0_PRIM_GL_CASE(QUAD_STRIP
);
451 NVC0_PRIM_GL_CASE(POLYGON
);
452 NVC0_PRIM_GL_CASE(LINES_ADJACENCY
);
453 NVC0_PRIM_GL_CASE(LINE_STRIP_ADJACENCY
);
454 NVC0_PRIM_GL_CASE(TRIANGLES_ADJACENCY
);
455 NVC0_PRIM_GL_CASE(TRIANGLE_STRIP_ADJACENCY
);
456 NVC0_PRIM_GL_CASE(PATCHES
);
458 return NVC0_3D_VERTEX_BEGIN_GL_PRIMITIVE_POINTS
;
463 nvc0_push_vbo(struct nvc0_context
*nvc0
, const struct pipe_draw_info
*info
)
465 struct push_context ctx
;
466 unsigned i
, index_size
;
467 unsigned inst_count
= info
->instance_count
;
468 unsigned vert_count
= info
->count
;
471 nvc0_push_context_init(nvc0
, &ctx
);
473 nvc0_vertex_configure_translate(nvc0
, info
->index_bias
);
475 if (nvc0
->state
.index_bias
) {
476 /* this is already taken care of by translate */
477 IMMED_NVC0(ctx
.push
, NVC0_3D(VB_ELEMENT_BASE
), 0);
478 nvc0
->state
.index_bias
= 0;
481 if (unlikely(ctx
.edgeflag
.enabled
))
482 nvc0_push_map_edgeflag(&ctx
, nvc0
, info
->index_bias
);
484 ctx
.prim_restart
= info
->primitive_restart
;
485 ctx
.restart_index
= info
->restart_index
;
487 if (info
->primitive_restart
) {
488 /* NOTE: I hope we won't ever need that last index (~0).
489 * If we do, we have to disable primitive restart here always and
490 * use END,BEGIN to restart. (XXX: would that affect PrimitiveID ?)
491 * We could also deactive PRIM_RESTART_WITH_DRAW_ARRAYS temporarily,
492 * and add manual restart to disp_vertices_seq.
494 BEGIN_NVC0(ctx
.push
, NVC0_3D(PRIM_RESTART_ENABLE
), 2);
495 PUSH_DATA (ctx
.push
, 1);
496 PUSH_DATA (ctx
.push
, info
->indexed
? 0xffffffff : info
->restart_index
);
498 if (nvc0
->state
.prim_restart
) {
499 IMMED_NVC0(ctx
.push
, NVC0_3D(PRIM_RESTART_ENABLE
), 0);
501 nvc0
->state
.prim_restart
= info
->primitive_restart
;
504 nvc0_push_map_idxbuf(&ctx
, nvc0
);
505 index_size
= nvc0
->idxbuf
.index_size
;
507 if (unlikely(info
->count_from_stream_output
)) {
508 struct pipe_context
*pipe
= &nvc0
->base
.pipe
;
509 struct nvc0_so_target
*targ
;
510 targ
= nvc0_so_target(info
->count_from_stream_output
);
511 pipe
->get_query_result(pipe
, targ
->pq
, true, (void *)&vert_count
);
512 vert_count
/= targ
->stride
;
514 ctx
.idxbuf
= NULL
; /* shut up warnings */
518 ctx
.instance_id
= info
->start_instance
;
520 prim
= nvc0_prim_gl(info
->mode
);
522 PUSH_SPACE(ctx
.push
, 9);
524 ctx
.dest
= nvc0_push_setup_vertex_array(nvc0
, vert_count
);
525 if (unlikely(!ctx
.dest
))
528 if (unlikely(ctx
.need_vertex_id
))
529 nvc0_push_upload_vertex_ids(&ctx
, nvc0
, info
);
531 if (nvc0
->screen
->eng3d
->oclass
< GM107_3D_CLASS
)
532 IMMED_NVC0(ctx
.push
, NVC0_3D(VERTEX_ARRAY_FLUSH
), 0);
533 BEGIN_NVC0(ctx
.push
, NVC0_3D(VERTEX_BEGIN_GL
), 1);
534 PUSH_DATA (ctx
.push
, prim
);
535 switch (index_size
) {
537 disp_vertices_i08(&ctx
, info
->start
, vert_count
);
540 disp_vertices_i16(&ctx
, info
->start
, vert_count
);
543 disp_vertices_i32(&ctx
, info
->start
, vert_count
);
546 assert(index_size
== 0);
547 disp_vertices_seq(&ctx
, info
->start
, vert_count
);
550 PUSH_SPACE(ctx
.push
, 1);
551 IMMED_NVC0(ctx
.push
, NVC0_3D(VERTEX_END_GL
), 0);
554 prim
|= NVC0_3D_VERTEX_BEGIN_GL_INSTANCE_NEXT
;
557 nouveau_bufctx_reset(nvc0
->bufctx_3d
, NVC0_BIND_VTX_TMP
);
558 nouveau_scratch_done(&nvc0
->base
);
559 } while (inst_count
);
562 /* reset state and unmap buffers (no-op) */
564 if (unlikely(!ctx
.edgeflag
.value
)) {
565 PUSH_SPACE(ctx
.push
, 1);
566 IMMED_NVC0(ctx
.push
, NVC0_3D(EDGEFLAG
), 1);
569 if (unlikely(ctx
.need_vertex_id
)) {
570 PUSH_SPACE(ctx
.push
, 4);
571 IMMED_NVC0(ctx
.push
, NVC0_3D(VERTEX_ID_REPLACE
), 0);
572 BEGIN_NVC0(ctx
.push
, NVC0_3D(VERTEX_ATTRIB_FORMAT(1)), 1);
574 NVC0_3D_VERTEX_ATTRIB_FORMAT_CONST
|
575 NVC0_3D_VERTEX_ATTRIB_FORMAT_TYPE_FLOAT
|
576 NVC0_3D_VERTEX_ATTRIB_FORMAT_SIZE_32
);
577 IMMED_NVC0(ctx
.push
, NVC0_3D(VERTEX_ARRAY_FETCH(1)), 0);
581 nouveau_resource_unmap(nv04_resource(nvc0
->idxbuf
.buffer
));
582 for (i
= 0; i
< nvc0
->num_vtxbufs
; ++i
)
583 nouveau_resource_unmap(nv04_resource(nvc0
->vtxbuf
[i
].buffer
));
585 NOUVEAU_DRV_STAT(&nvc0
->screen
->base
, draw_calls_fallback_count
, 1);
589 copy_indices_u8(uint32_t *dst
, const uint8_t *elts
, uint32_t bias
, unsigned n
)
592 for (i
= 0; i
< n
; ++i
)
593 dst
[i
] = elts
[i
] + bias
;
597 copy_indices_u16(uint32_t *dst
, const uint16_t *elts
, uint32_t bias
, unsigned n
)
600 for (i
= 0; i
< n
; ++i
)
601 dst
[i
] = elts
[i
] + bias
;
605 copy_indices_u32(uint32_t *dst
, const uint32_t *elts
, uint32_t bias
, unsigned n
)
608 for (i
= 0; i
< n
; ++i
)
609 dst
[i
] = elts
[i
] + bias
;
613 nvc0_push_upload_vertex_ids(struct push_context
*ctx
,
614 struct nvc0_context
*nvc0
,
615 const struct pipe_draw_info
*info
)
618 struct nouveau_pushbuf
*push
= ctx
->push
;
619 struct nouveau_bo
*bo
;
623 unsigned index_size
= nvc0
->idxbuf
.index_size
;
625 unsigned a
= nvc0
->vertex
->num_elements
;
627 if (!index_size
|| info
->index_bias
)
629 data
= (uint32_t *)nouveau_scratch_get(&nvc0
->base
,
630 info
->count
* index_size
, &va
, &bo
);
632 BCTX_REFN_bo(nvc0
->bufctx_3d
, VTX_TMP
, NOUVEAU_BO_GART
| NOUVEAU_BO_RD
,
634 nouveau_pushbuf_validate(push
);
637 if (!info
->index_bias
) {
638 memcpy(data
, ctx
->idxbuf
, info
->count
* index_size
);
640 switch (nvc0
->idxbuf
.index_size
) {
642 copy_indices_u8(data
, ctx
->idxbuf
, info
->index_bias
, info
->count
);
645 copy_indices_u16(data
, ctx
->idxbuf
, info
->index_bias
, info
->count
);
648 copy_indices_u32(data
, ctx
->idxbuf
, info
->index_bias
, info
->count
);
653 for (i
= 0; i
< info
->count
; ++i
)
654 data
[i
] = i
+ (info
->start
+ info
->index_bias
);
657 format
= (1 << NVC0_3D_VERTEX_ATTRIB_FORMAT_BUFFER__SHIFT
) |
658 NVC0_3D_VERTEX_ATTRIB_FORMAT_TYPE_UINT
;
660 switch (index_size
) {
662 format
|= NVC0_3D_VERTEX_ATTRIB_FORMAT_SIZE_8
;
665 format
|= NVC0_3D_VERTEX_ATTRIB_FORMAT_SIZE_16
;
668 format
|= NVC0_3D_VERTEX_ATTRIB_FORMAT_SIZE_32
;
672 PUSH_SPACE(push
, 12);
674 if (unlikely(nvc0
->state
.instance_elts
& 2)) {
675 nvc0
->state
.instance_elts
&= ~2;
676 IMMED_NVC0(push
, NVC0_3D(VERTEX_ARRAY_PER_INSTANCE(1)), 0);
679 BEGIN_NVC0(push
, NVC0_3D(VERTEX_ATTRIB_FORMAT(a
)), 1);
680 PUSH_DATA (push
, format
);
682 BEGIN_NVC0(push
, NVC0_3D(VERTEX_ARRAY_FETCH(1)), 3);
683 PUSH_DATA (push
, NVC0_3D_VERTEX_ARRAY_FETCH_ENABLE
| index_size
);
684 PUSH_DATAh(push
, va
);
685 PUSH_DATA (push
, va
);
686 BEGIN_NVC0(push
, NVC0_3D(VERTEX_ARRAY_LIMIT_HIGH(1)), 2);
687 PUSH_DATAh(push
, va
+ info
->count
* index_size
- 1);
688 PUSH_DATA (push
, va
+ info
->count
* index_size
- 1);
690 #define NVC0_3D_VERTEX_ID_REPLACE_SOURCE_ATTR_X(a) \
691 (((0x80 + (a) * 0x10) / 4) << NVC0_3D_VERTEX_ID_REPLACE_SOURCE__SHIFT)
693 BEGIN_NVC0(push
, NVC0_3D(VERTEX_ID_REPLACE
), 1);
694 PUSH_DATA (push
, NVC0_3D_VERTEX_ID_REPLACE_SOURCE_ATTR_X(a
) | 1);