enum pipe_prim_type prim, unsigned start,
unsigned count,
unsigned start_instance,
- unsigned instance_count)
+ unsigned instance_count,
+ ubyte vertices_per_patch)
{
SVGA3dPrimitiveRange range;
unsigned hw_prim;
unsigned hw_count;
unsigned index_offset = start * index_size;
- hw_prim = svga_translate_prim(prim, count, &hw_count);
+ hw_prim = svga_translate_prim(prim, count, &hw_count, vertices_per_patch);
if (hw_count == 0)
return PIPE_OK; /* nothing to draw */
return svga_hwtnl_prim(hwtnl, &range, count,
min_index, max_index, index_buffer,
- start_instance, instance_count);
+ start_instance, instance_count,
+ NULL, NULL);
}
&gen_size, &gen_nr, &gen_func);
}
else {
+ unsigned hw_pv;
+
+ /* There is no geometry ordering with PATCH, so no need to
+ * consider provoking vertex mode for the translation.
+ * So use the same api_pv as the hw_pv.
+ */
+ hw_pv = info->mode == PIPE_PRIM_PATCHES ? hwtnl->api_pv :
+ hwtnl->hw_pv;
gen_type = u_index_translator(svga_hw_prims,
info->mode,
info->index_size,
count,
hwtnl->api_pv,
- hwtnl->hw_pv,
+ hw_pv,
PR_DISABLE,
&gen_prim, &gen_size, &gen_nr, &gen_func);
}
info->max_index,
gen_prim, index_offset, count,
info->start_instance,
- info->instance_count);
+ info->instance_count,
+ info->vertices_per_patch);
pipe_resource_reference(&index_buffer, NULL);
}
else {
gen_prim, gen_offset,
gen_nr,
info->start_instance,
- info->instance_count);
+ info->instance_count,
+ info->vertices_per_patch);
}
if (gen_buf) {