Created by: vTurbine
The merge code is wrong since the get
method relies on the assumption of a sorted table. While adding a new constant the table gets modified which breaks std::lower_bound
logic.
The bug is silent and all you'll have is unexpected graphics artifacts.
It's tricky and had never struck because of merging order in pass compilation:
// r_Pass()
ctable.merge(&ps->constants);
ctable.merge(&vs->constants);
The PS usually has no crossings with VS constants and, even it does, this won't lead to adding a new one. The fun begins if the merge order has changed.