crosire / d3d8to9

A D3D8 pseudo-driver which converts API calls and bytecode shaders to equivalent D3D9 ones.
BSD 2-Clause "Simplified" License
881 stars 78 forks source link

Fix shader translation for Star Wars Republic Commando #30

Closed elishacloud closed 7 years ago

elishacloud commented 7 years ago

Added (?![0-9]) to ensure that all the numbers get picked up in a multi-digit register name when translating vector and pixel shaders.

This fixes the issue reported in #28.

elishacloud commented 7 years ago

Made some changes to the pull request. This fixes the first 4 issues listed on this comment here.

I also noticed that only one line in CreateVertexShader needed to be updated because these two here and here don't have any issues. So I reverted the changes on these lines

This basically fixes six things:

  1. An issue with vertex shader with Star Wars Republic Commando listed here. Fixed in this line.
  2. Missing (not removing of) modifiers. This is fixed in this line here.
  3. Missed modifiers when swizzles are used. This is also fixed in this line here.
  4. Dangling Swizzles when removing modifiers from constants. This is fixed in this line here.
  5. Possible dangling modifiers when removing modifiers from constants. This is fixed by moving this line up in front of the other regex lines.
  6. Fixing of the simple modifier - when add is used to prevent certain graphic glitches in games like Star Wars Republic Commando and Silent hill 2. Added this line for that.
crosire commented 7 years ago

Great work!