nir: Handle FB fetch outputs correctly in nir_lower_io_to_temporaries.
authorFrancisco Jerez <currojerez@riseup.net>
Wed, 20 Jul 2016 03:35:26 +0000 (20:35 -0700)
committerFrancisco Jerez <currojerez@riseup.net>
Fri, 26 Aug 2016 01:33:29 +0000 (18:33 -0700)
commitaee3d8f0d940a87dba7eae86c9462a3cb3a7d702
tree5cce8b0be6675e7d841f183dc12f64fb674d4040
parent97ac3eba58a7d11e171475f4a209cfdb3578b21d
nir: Handle FB fetch outputs correctly in nir_lower_io_to_temporaries.

This requires emitting a series of copies at the top of the program
from each output variable to the corresponding temporary.  The initial
copy can be skipped for non-framebuffer fetch outputs whose initial
value is undefined, and the final copy needs to be skipped for
read-only outputs (i.e. gl_LastFragData), since it would be illegal to
emit a store output intrinsic for it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/compiler/nir/nir_lower_io_to_temporaries.c