Skip to content
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

Failed vertex shader assembly (mad oFog) + solution #81

Closed
PatrickvL opened this issue Jun 1, 2018 · 4 comments
Closed

Failed vertex shader assembly (mad oFog) + solution #81

PatrickvL opened this issue Jun 1, 2018 · 4 comments

Comments

@PatrickvL
Copy link

The following vertex shader assembly line fails :

mad oFog /* removed swizzle */, -r3, c150.z, c150.w

It can be fixed by adding this regexp to Direct3DDevice8::CreateVertexShader() :

	SourceCode = std::regex_replace(SourceCode, std::regex("mad (oFog|oPts)(.*), (-?)([crv][0-9]+(?![\\.0-9])), (.+)\\n"), "mad $1$2, $3$4.x /* select single component */, $5\n");

The result is :

mad oFog /* removed swizzle */, -r3.x /* select single component */, c150.z, c150.w

..which succesfully compiles. (Not sure if the .x component is the right choice.)

Test-case : Cxbx-Reloaded, running Morrowind.

@crosire
Copy link
Owner

crosire commented Jun 3, 2018

Do you want to make this into a pull request?

@PatrickvL
Copy link
Author

No time, I'm sorry

@crosire crosire closed this as completed in 52a32ef Jun 3, 2018
@PatrickvL
Copy link
Author

You neither it seems ;)

@crosire
Copy link
Owner

crosire commented Jun 3, 2018

? It's fixed in 52a32ef?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants