Fix two issues related to non-treelike (diamond) effect graphs.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 15 Jan 2013 21:44:22 +0000 (22:44 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 15 Jan 2013 21:44:22 +0000 (22:44 +0100)
commit0b13d5089c5967a7a5706f20c1fbb6e98ca40f72
tree67bdb43f9ec234cf67a55e8a3f736742fb7bf93e
parent7f7069a0392bf5a5815e2a7452f5879b25959155
Fix two issues related to non-treelike (diamond) effect graphs.

First of all, we could have an assert failure when an input was used twice.
Work around it by simply ignoring the input the second time.

This, however, would expose an issue where effects could be emitted in the
.glsl file out-of-order. Refactor the topological sort code so that it can
be reused for arbitrary subgraphs, and then use it to topologically sort
the list of effects in each pass.

Add a unit test to verify that all of this works.
add.frag [new file with mode: 0644]
effect_chain.cpp
effect_chain.h
effect_chain_test.cpp
multiply.frag [new file with mode: 0644]