[4/5] wined3d: Use a bitmask to store which bool and int constants are set.
hverbeet at gmail.com
Wed Dec 3 02:49:21 CST 2008
2008/12/3 Ivan Gyurdiev <ivg231 at gmail.com>:
>> Re: [4/5] wined3d: Use a bitmask to store which bool and int constants
>> are set.
> 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.
We could always extend the number of possible constants by using an
array. However, when we need more constants we'll probably need a
scheme more like what's used for float constants anyway. The reduced
memory usage is significant, not so much because we can't spare the
memory, but because it allows the compiler to just keep the entire
thing in a register. Perhaps even more importantly, when an
application starts using constants from zero and goes up from there
(which is not an unreasonable thing to do), we only have to go through
the loop the amount of times as there are constants set. If the
application doesn't use int or bool constants at all, we don't have to
go through the loop at all either.
More information about the wine-devel