"Henri Verbeet" hverbeet@gmail.com writes:
2008/12/3 Juan Lang juan.lang@gmail.com:
Why is this a good thing - this just artificially caps your constants at 32. If I remember correctly I had to change shaders to do the exact opposite change, because newer versions introduced more than 32 constants.
I agree with you, this is a questionable change. The benefit in reduced data results in a gain of code size and runtime cost. --Juan
Perhaps setting constants becomes slightly more expensive this way, but I'm not convinced it's very significant. The more performance critical code that applies the constants becomes significantly cheaper though.
I expect most operations will become faster, because the data is more likely to be kept in cache and in registers. It could probably be made even more efficient by getting rid of most of the remaining loops. I think it's a very reasonable change, using array of BOOLs is really wasteful.