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/gallivm | |
parent | ade8b26bf515fa4f0cbf43e9df4885368e984277 (diff) |
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/gallivm')
-rw-r--r-- | src/gallium/auxiliary/gallivm/lp_bld_tgsi.h | 2 | ||||
-rw-r--r-- | src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c | 10 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h b/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h index 029ca3c841..b411f05674 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h +++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h @@ -162,7 +162,9 @@ struct lp_tgsi_info struct lp_bld_tgsi_system_values { LLVMValueRef instance_id; LLVMValueRef vertex_id; + LLVMValueRef vertex_id_nobase; LLVMValueRef prim_id; + LLVMValueRef basevertex; }; diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c index 76b9d69264..3dfff05c22 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c @@ -1538,6 +1538,16 @@ emit_fetch_system_value( atype = TGSI_TYPE_UNSIGNED; break; + case TGSI_SEMANTIC_VERTEXID_NOBASE: + res = bld->system_values.vertex_id_nobase; + atype = TGSI_TYPE_UNSIGNED; + break; + + case TGSI_SEMANTIC_BASEVERTEX: + res = bld->system_values.basevertex; + atype = TGSI_TYPE_UNSIGNED; + break; + case TGSI_SEMANTIC_PRIMID: res = bld->system_values.prim_id; atype = TGSI_TYPE_UNSIGNED; |