i965: allocate a SGVS element when VertexID or InstanceID are read
authorIago Toral Quiroga <itoral@igalia.com>
Thu, 4 Jan 2018 02:55:13 +0000 (03:55 +0100)
committerIago Toral Quiroga <itoral@igalia.com>
Wed, 7 Feb 2018 10:11:16 +0000 (11:11 +0100)
commitf474b19875a7c51ced6bb986e5733379b2780dcf
treef2387da87036e585298eb296ece1c19e7f53c842
parentc74719cf4adae2fa142e154bff56716427d3d992
i965: allocate a SGVS element when VertexID or InstanceID are read

Although on gen8+ platforms we can in theory use 3DSTATE_VF_SGVS
to put these beyond the last vertex element it seems that we still
need to allocate the SVGS element, otherwise we have observed cases
where we end up reading garbage. Specifically, the CTS test mentioned
below was flaky with a fail rate of ~1% on some gen9+ platforms caused
by reading garbage for the gl_InstanceID value. The flakyness goes
away as soon as we start allocating the SVGS element.

v2:
  - Do this for gen8+, not just gen9+, and pull the boolean
    outside the #if block (Jason)

Fixes flaky test:
KHR-GL45.vertex_attrib_64bit.limits_test

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104335
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/mesa/drivers/dri/i965/genX_state_upload.c