draw: fix vertex id offset bug

The vertex_id_offset value needs to be used both for the elt and
linear cases.  As it was, if a long primitive was split, the vertex id
seen in the VS was also getting to reset to zero for each batch of the
split prim's vertices.

This fixes at least five VMware test cases (dx11-dxsdk-FluidCS11,
dx11-amd-TressFX-v1.0, dx10-win7-dxsdk-samples-nbodygravity,
dx10-win7-dxsdk-samples-gpuboids, dx10-wide-points).

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19039>
This commit is contained in:
Brian Paul
2022-10-10 14:13:10 -06:00
committed by Marge Bot
parent 3395b40b37
commit 4314949277
+3 -1
View File
@@ -2298,9 +2298,11 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant)
*/
LLVMValueRef base_vertex = lp_build_select(&bld, have_elts, vertex_id_offset, lp_build_const_int32(gallivm, 0));
system_values.basevertex = lp_build_broadcast_scalar(&blduivec, base_vertex);
/* first vertex is for Vulkan base vertex support */
LLVMValueRef first_vertex = lp_build_select(&bld, have_elts, vertex_id_offset, start);
LLVMValueRef first_vertex = vertex_id_offset;
system_values.firstvertex = lp_build_broadcast_scalar(&blduivec, first_vertex);
system_values.vertex_id = true_index_array;
system_values.vertex_id_nobase = LLVMBuildSub(builder, true_index_array,
lp_build_broadcast_scalar(&blduivec, vertex_id_offset), "");