[1/4] [wined3d] move creation of NP2 fixup uniforms into separate loop
Liquid.Acid at gmx.net
Tue Jun 16 05:38:23 CDT 2009
> Actually that comment was about the state change trouble NP2 fixups cause
> since we can ignore the additional state handlers needed to adjust the TF2
> matrices and call the NP2 constant load code, the NP2 code doesn't add
> burden if its not used.
OK, I see. But the same reason should apply to generating shader code.
> I for one am not really worrying about one loop more or less in
> shader_generate_glsl_declarations. That code isn't part of the general
> rendering loop, its only called once per compiled GL shader. Yes, I should
> still be worrying about it - long GL shader compile times cause real
> at the moment - but one if condition more or less doesn't hurt, if it
> the code cleaner.
Erm, I think I have to make myself even more clear here. Moving the code inside a seperate loop is actually REDUCING the amount of branching.
Currently for each 2D texture we do this check here:
if (pshader && ps_args->np2_fixup & (1 << i))
Perhaps with 99% of the hardware/driver configs wine never actually uses the np2fixup code.
With the seperate loop we reduce this to a single branch, which will mostly just skip the code. In the unusual case that the hardware/driver needs the fixup this adds one more branch. Again THIS is the unlikely case.
Another thing: The old code just created a vec2 for each texture that needed fixup. That integrated quite well with the already existing loop that created the sampler uniforms. This is no longer true with the new code.
To appease Henri I'm going to merge the first patch into patch 3. ;)
GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate und Telefonanschluss
für nur 17,95 Euro/mtl.!* http://portal.gmx.net/de/go/dsl02
More information about the wine-devel