aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2019-03-25 15:38:18 +1000
committerDave Airlie <[email protected]>2019-03-27 07:52:28 +1000
commit7f7c9425a870af2bcb8b4c3149810bd1b32b8ddc (patch)
tree3141096d13ada70bcd7de52dbcf39b3c60b3ffc9 /src/gallium/auxiliary/draw
parente16ac33f374bb23e4f2e9a2cb87261e0939ab0c7 (diff)
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 <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/draw')
-rw-r--r--src/gallium/auxiliary/draw/draw_vs_exec.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/draw/draw_vs_exec.c b/src/gallium/auxiliary/draw/draw_vs_exec.c
index 4f11ac7506c..dbd7aa551eb 100644
--- a/src/gallium/auxiliary/draw/draw_vs_exec.c
+++ b/src/gallium/auxiliary/draw/draw_vs_exec.c
@@ -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];