mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
draw/vs: partly fix basevertex/vertex id
This gets the basevertex from the draw depending on whether it's an indexed or non-indexed draw. We still fail a transform feedback test for vertex id, as the vertex id actually an index id, and isn't getting translated properly to a vertex id, suggestions on how/where to fix that welcome. Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
parent
e16ac33f37
commit
7f7c9425a8
1 changed files with 3 additions and 4 deletions
|
|
@ -128,18 +128,17 @@ vs_exec_run_linear(struct draw_vertex_shader *shader,
|
|||
input[slot][3]);
|
||||
}
|
||||
#endif
|
||||
int basevertex = shader->draw->pt.user.eltSize ? shader->draw->pt.user.eltBias : shader->draw->start_index;
|
||||
|
||||
if (shader->info.uses_vertexid) {
|
||||
unsigned vid = machine->SysSemanticToIndex[TGSI_SEMANTIC_VERTEXID];
|
||||
assert(vid < ARRAY_SIZE(machine->SystemValue));
|
||||
machine->SystemValue[vid].xyzw[0].i[j] = i + j;
|
||||
/* XXX this should include base vertex. Where to get it??? */
|
||||
machine->SystemValue[vid].xyzw[0].i[j] = i + j + basevertex;
|
||||
}
|
||||
if (shader->info.uses_basevertex) {
|
||||
unsigned vid = machine->SysSemanticToIndex[TGSI_SEMANTIC_BASEVERTEX];
|
||||
assert(vid < ARRAY_SIZE(machine->SystemValue));
|
||||
machine->SystemValue[vid].xyzw[0].i[j] = 0;
|
||||
/* XXX Where to get it??? */
|
||||
machine->SystemValue[vid].xyzw[0].i[j] = basevertex;
|
||||
}
|
||||
if (shader->info.uses_vertexid_nobase) {
|
||||
unsigned vid = machine->SysSemanticToIndex[TGSI_SEMANTIC_VERTEXID_NOBASE];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue