[WINED3D] Reorganize shaders code a bit

Ivan Gyurdiev ivg2 at cornell.edu
Tue Apr 11 13:44:03 CDT 2006

Move the D3DSIO_DCL and D3DSIO_DEF cases out of the switch statement, 
and into the if..else above.
There's two reasons to do that.

First, the structure of this file doesn't make any sense to begin with -
switch {
      cases A-F:
      cases G-Z:
more handling of A-F
yet another switch (opcode) { }

This is pretty confusing - I consider any removal of code from the 
switch statements an improvement.

Second, and more importantly, there's common properties to the 
instructions remaining behind -  they have format [inst] [dst] [src]*, 
which we can use to our advantage to pull some code out of those case 
statements and make it shared (modifiers, write masks, saturated, 
parameter handling).

Note that there's also the possibility of moving some of those things 
into the first pass (vertex shaders currently are 2-pass), but I don't 
understand the code sufficiently well to deal w/ that right now.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wine.shaders_reorganize.diff
Type: text/x-patch
Size: 10366 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20060411/3f1cf9a7/wine.shaders_reorganize-0001.diff

More information about the wine-patches mailing list