i965: Add support for gl_VertexID and gl_InstanceID.
authorEric Anholt <eric@anholt.net>
Wed, 9 Nov 2011 02:50:09 +0000 (18:50 -0800)
committerEric Anholt <eric@anholt.net>
Fri, 11 Nov 2011 16:27:59 +0000 (08:27 -0800)
commit1c65abb211e6a3df8c46180ae3242486ee97dc8d
tree89e4d0955f49f0cd841c9d0f7efd933f6d7fdd4a
parent9472f6677672ac89d6addba025b33287670da9e9
i965: Add support for gl_VertexID and gl_InstanceID.

The compiler setup for these VF-uploaded attributes looks a little
cheesy with mixing system values and real VBO-sourced attributes.  It
would be nice if we could just compute the ATTR[] map to GRF index up
front and use it at visit time instead of using ir->location in the
ATTR file.  However, we don't know the reg_offset at
visit(ir_variable *) time, so we can't do the mapping that early.

Fixes piglit vertexid test.

Reviewed-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_emit.cpp
src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp