st/glsl_to_tgsi: Use SecondaryOutputsWritten to determine dual-source fragment outputs.
authorFrancisco Jerez <currojerez@riseup.net>
Tue, 23 Aug 2016 18:18:19 +0000 (11:18 -0700)
committerFrancisco Jerez <currojerez@riseup.net>
Tue, 30 Aug 2016 23:54:19 +0000 (16:54 -0700)
commit342f945b1320d588e61e4efe1ccc7852a3c8ad9f
treef26bb75996fe9aeecdcaf24e52ab28612c02d7b9
parentcb4b38af41952c2e5ee77253592f0d0833aefd28
st/glsl_to_tgsi: Use SecondaryOutputsWritten to determine dual-source fragment outputs.

Currently the mesa state tracker relies on there being two bits set
per dual-source output in the gl_program::OutputsWritten bitset, but
that only worked due to a GLSL front-end bug that caused it to set the
OutputsWritten bit for both location and location+1 even though at the
GLSL level the primary and secondary color outputs used for
dual-source blending have the same location.  Fix it by extending
outputMapping[] to 2*FRAG_RESULT_MAX elements in order to represent a
mapping from a (location, index) pair to its TGSI output, which should
also make it slightly easier to add support for dual-source blending
in combination with multiple render targets in the long run.

No Piglit regressions on llvmpipe.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/mesa/state_tracker/st_glsl_to_tgsi.cpp
src/mesa/state_tracker/st_program.c