Skip to content

rsx/fp: Fix precision clamping on MAD instruction - #8243

Merged
kd-11 merged 1 commit into
RPCS3:masterfrom
kd-11:rsx_volatile
May 17, 2020
Merged

rsx/fp: Fix precision clamping on MAD instruction#8243
kd-11 merged 1 commit into
RPCS3:masterfrom
kd-11:rsx_volatile

Conversation

@kd-11

@kd-11 kd-11 commented May 16, 2020

Copy link
Copy Markdown
Contributor

RSX MAD instruction appears to be broken. Unlike other instructions, for this one only arg0 has clamping applied to it. However, when neg flag is set, the precision clamping works correctly. For example, consider this set of inputs (input clamping is set to [0,1] for all cases):
a) 1 * 100 + 0 = 100
b) 100 * 1 + 0 = 1
c) 1 * -100 + 0 = -1
d) 1* 1 + 100 = 101
etc

This fixes some rare graphical glitches such as the sea in one piece pirate warriors and the sky in GTA V. Also fixes post-processing in Crysis.

Fixes #2262

Comment thread rpcs3/Emu/RSX/Common/FragmentProgramDecompiler.cpp
@MarioSonic2987

MarioSonic2987 commented May 16, 2020

Copy link
Copy Markdown
Contributor

Fixes these graphical issues in the following games:

Grand Theft Auto V - Grey sky

image
image

One Piece: Pirate Warriors - Broken water effects

image
image

Comment thread rpcs3/Emu/RSX/Common/FragmentProgramDecompiler.cpp
Comment thread rpcs3/Emu/RSX/Common/FragmentProgramDecompiler.cpp
@jackie1218

jackie1218 commented May 17, 2020

Copy link
Copy Markdown
Contributor

The sky is now blue in MLB The Show 14, but other problems (unrelated to this pr) are still present.

https://cdn.discordapp.com/attachments/485204327800242177/711437885575921704/unknown.png

@i2puni

i2puni commented May 20, 2020

Copy link
Copy Markdown

Previously version ->
The game is fully playable. 2D versions plays perfectly. 3d version has missing graphics. For example, your default beam is not visible while you shoot in 3d mode. Full charge beam is visible.

this version ->
FIX!!!!!!! Good!!!!!!!!!!!
irem

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

Successfully merging this pull request may close these issues.

GL/Vulkan: One Piece: Pirate Warriors graphical issues

6 participants