i965: Use SURF_INDEX_DRAW() for drawbuffer binding table indices.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 15 Aug 2013 02:43:09 +0000 (19:43 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 19 Aug 2013 20:17:00 +0000 (13:17 -0700)
commit7c717690b5594c768a18cc2a00364e5ec7bc20ab
tree3c05b3a61ea6cf9f6c83e2d1d7238edeb4c71e45
parentc5fe7d063cc886ef1307f8ea58a301debed12fba
i965: Use SURF_INDEX_DRAW() for drawbuffer binding table indices.

SURF_INDEX_DRAW() has been the identity function since the dawn of time,
and both the shader code and binding table upload code relied on that,
simply using X rather than SURF_INDEX_DRAW(X).

Even if that continues to be true, using the macro clarifies the code.

The comment about draw buffers needing to be first in order for
headerless render target writes to work turned out to be wrong; with
this change, SURF_INDEX_DRAW can be changed to arbitrary indices and
everything continues working.

The confusion was over the "Render Target Index" field in the FB write
message header.  If it were a binding table index, then RT 0 would have
to be at index 0 for headerless FB writes to work.  However, it's
actually an index into the blend state table, so there's no problem.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Paul Berry <stereotype441@gmail.com>
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/brw_fs_emit.cpp
src/mesa/drivers/dri/i965/brw_wm_surface_state.c
src/mesa/drivers/dri/i965/gen7_wm_surface_state.c