i965: Separate gl_InstanceID and gl_VertexID uploading.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 10 Sep 2014 22:41:40 +0000 (15:41 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 12 Sep 2014 23:35:35 +0000 (16:35 -0700)
commit6b6145204dd4a1112f6e1fe10162636141495b79
tree30809a5f9ef2d22f67b7a3677e75c2025b81ee4f
parente980fe607155c79ccba56ef78854093b7730bef6
i965: Separate gl_InstanceID and gl_VertexID uploading.

We always uploaded them together, mostly out of laziness - both required
an additional vertex element.  However, gl_VertexID now also requires an
additional vertex buffer for storing gl_BaseVertex; for non-indirect
draws this also means uploading (a small amount of) data.  This is extra
overhead we don't need if the shader only uses gl_InstanceID.

In particular, our clear shaders currently use gl_InstanceID for doing
layered clears, but don't need gl_VertexID.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/brw_draw_upload.c
src/mesa/drivers/dri/i965/brw_vec4.cpp
src/mesa/drivers/dri/i965/brw_vec4_vs_visitor.cpp
src/mesa/drivers/dri/i965/gen8_draw_upload.c