glsl: Fix incorrect hard-coded location of the gl_SecondaryFragColorEXT built-in.
authorFrancisco Jerez <currojerez@riseup.net>
Thu, 23 Jun 2016 07:05:37 +0000 (00:05 -0700)
committerFrancisco Jerez <currojerez@riseup.net>
Tue, 30 Aug 2016 23:54:19 +0000 (16:54 -0700)
commit965934f38ab36b77672b70693b5b7b9c983f852b
tree5c0972394c09cc6cdfb9d1a1f8195fc544c4d371
parent342f945b1320d588e61e4efe1ccc7852a3c8ad9f
glsl: Fix incorrect hard-coded location of the gl_SecondaryFragColorEXT built-in.

gl_SecondaryFragColorEXT should have the same location as gl_FragColor
for the secondary fragment color to be replicated to all fragment
outputs.  The incorrect location of gl_SecondaryFragColorEXT would
cause the linker to mark both FRAG_RESULT_COLOR and FRAG_RESULT_DATA0
as being written to, which isn't allowed by the spec and would
ultimately lead to an assertion failure in
fs_visitor::emit_fb_writes() on my i965-fb-fetch branch.

This should also fix the code below for multiple dual-source-blended
render targets, which no driver currently supports but we have plans
to enable eventually in the i965 driver (the comment saying that no
hardware will ever support it seems rather hilarious).

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/compiler/glsl/builtin_variables.cpp