2017-03-16 20:22 GMT+01:00 Paul Gofman gofmanp@gmail.com:
On 03/16/2017 10:12 PM, Matteo Bruni wrote:
Actually regstore_reset_table() call along with ultimate TRUE for update_all parameter in set_constants() call here is redundant. I added it just to make things a bit more robuts and more robust checking of unitialized input in preshader in case of some bugs in their update logic, which got more complicated with selective constants update. It should actually work (without updating constants from unchanged parameters) if change set_constants(rs, &pres->inputs, TRUE); to set_constants(rs, &pres->inputs, update_all); and remove regstore_reset_table(). Maybe I should do it like this?
Right, that's a good idea I think. If that breaks the tests it means there is some bug somewhere in the update logic. Do you need to remove regstore_reset_table() though?
No, it does not break the tests I have now. It may become more tricky in shared parameters update logic, but I don't have enough tests for that part yet so probably some possible problems there should be addressed later. But removing regstore_reset_table() is necessary in this case, because otherwise if some preshader uses both updated and non-updated parameter, the input for non-updated parameter will be zeroed after previous (full) update and not initialized by update logic (in the current version of the patch all preshaders input are initialized due to 'TRUE' ultimately passed as update_all to constant set function, so it can bear table reset).
It makes sense. Yes, I'd go with the set_constants(..., update_all) change for the time being since it looks like it should work. If later on something problematic comes up we can always go back on that. Hopefully that won't be necessary though.