i965/bdw: Fix 3DSTATE_VF_INSTANCING when the edge flag is used
authorNeil Roberts <neil@linux.intel.com>
Thu, 20 Aug 2015 01:55:44 +0000 (18:55 -0700)
committerBen Widawsky <benjamin.widawsky@intel.com>
Sun, 23 Aug 2015 05:25:39 +0000 (22:25 -0700)
commit3a1ab2348050fd32f41553b9febfd9972b5761aa
treef800cf1308e764ed3f8a311dd7f1da5c1b459d88
parentfb02b4ec482762ccf2a9fedf24fe6f50787932a9
i965/bdw: Fix 3DSTATE_VF_INSTANCING when the edge flag is used

When the edge flag element is enabled then the elements are slightly
reordered so that the edge flag is always the last one. This was
confusing the code to upload the 3DSTATE_VF_INSTANCING state because
that is uploaded with a separate loop which has an instruction for
each element. The indices used in these instructions weren't taking
into account the reordering so the state would be incorrect.

v2: Use nr_elements instead of brw->vb.nr_enabled so that it will cope
    when gl_VertexID is used.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91292
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Tested-by: Mark Janes <mark.a.janes@intel.com>
src/mesa/drivers/dri/i965/gen8_draw_upload.c