diff options
| author | Roland Scheidegger <sroland@vmware.com> | 2014-12-12 04:13:54 +0100 |
|---|---|---|
| committer | Roland Scheidegger <sroland@vmware.com> | 2014-12-16 04:23:00 +0100 |
| commit | 97dc3d826e0c04e747ff5dbecf3026b6a16737fd (patch) | |
| tree | e4463f3b55a5bb8ea114061be8324f8a238f832b /src/gallium/auxiliary/draw/draw_vs_exec.c | |
| parent | ade8b26bf515fa4f0cbf43e9df4885368e984277 (diff) | |
| download | external_mesa3d-97dc3d826e0c04e747ff5dbecf3026b6a16737fd.tar.gz external_mesa3d-97dc3d826e0c04e747ff5dbecf3026b6a16737fd.tar.bz2 external_mesa3d-97dc3d826e0c04e747ff5dbecf3026b6a16737fd.zip | |
draw: implement support for the VERTEXID_NOBASE and BASEVERTEX semantics.
This fixes 4 vertexid related piglit tests with llvmpipe due to switching
behavior of vertexid to the one gl expects.
(Won't fix non-llvm draw path since we don't get the basevertex currently.)
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_vs_exec.c')
| -rw-r--r-- | src/gallium/auxiliary/draw/draw_vs_exec.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/draw/draw_vs_exec.c b/src/gallium/auxiliary/draw/draw_vs_exec.c index 277d739e2c..17b54b6fe7 100644 --- a/src/gallium/auxiliary/draw/draw_vs_exec.c +++ b/src/gallium/auxiliary/draw/draw_vs_exec.c @@ -129,6 +129,18 @@ vs_exec_run_linear( struct draw_vertex_shader *shader, unsigned vid = machine->SysSemanticToIndex[TGSI_SEMANTIC_VERTEXID]; assert(vid < Elements(machine->SystemValue)); machine->SystemValue[vid].i[j] = i + j; + /* XXX this should include base vertex. Where to get it??? */ + } + if (shader->info.uses_basevertex) { + unsigned vid = machine->SysSemanticToIndex[TGSI_SEMANTIC_BASEVERTEX]; + assert(vid < Elements(machine->SystemValue)); + machine->SystemValue[vid].i[j] = 0; + /* XXX Where to get it??? */ + } + if (shader->info.uses_vertexid_nobase) { + unsigned vid = machine->SysSemanticToIndex[TGSI_SEMANTIC_VERTEXID_NOBASE]; + assert(vid < Elements(machine->SystemValue)); + machine->SystemValue[vid].i[j] = i + j; } for (slot = 0; slot < shader->info.num_inputs; slot++) { @@ -144,7 +156,7 @@ vs_exec_run_linear( struct draw_vertex_shader *shader, machine->Inputs[slot].xyzw[3].f[j] = input[slot][3]; } - input = (const float (*)[4])((const char *)input + input_stride); + input = (const float (*)[4])((const char *)input + input_stride); } tgsi_set_exec_mask(machine, |
