-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Translation error when moving _bx2 to separate register #70
Comments
The issue is with this line and this line. I purposely kept the swizzle to try and preserve the original pixel shader functionality. Removing the swizzle has a possibility of changing the final register value, which could cause an issue. It is pretty easy to remove the swizzle here, but I would need to test many games to ensure that it does not cause any issues. It might be better if I remove the swizzle only in the case where there is a rear modifier, like Note: you cannot have both a rear modifier and a swizzle. |
As I thought, simply removing the swizzle caused issues with True Crime New York City. However I forgot that you can use a rear modifier with a swizzle as long as the swizzle comes last. So it should look like this: d3d8to9 output : mov r0.xyz, c0 /* added line */
dp3 r0.xyz, r0_bx2.xyz /* changed c0 to r0.xyz */, t0_bx2 Try with this file and see if it works. BTW: here is the check-in if you want to test with the source code instead. |
This still fails to compile - I had to change the input shader to use an intermediate register to avoid the swizzle; This problematic input :
Gets converted to this, which doesn't work :
The error is still:
But when I use this (manually altered) input :
... d3d8to9 doesn't even need to replace anything for this, as, the result is :
... which works as intended. PS: The DirectX 8 doc states that source register modifiers shouldn't be used on constants (because it will cause undefined results), which can be interpreted as : "it may be done, but it's just not advised". So, it's just bad luck I've encountered such a shader here. |
Pixel shader input :
d3d8to9 output :
This fails with :
The text was updated successfully, but these errors were encountered: