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

Another workaround for NVIDIA driver 496.13 shader bug #2750

Merged
merged 5 commits into from
Oct 18, 2021

Conversation

riperiperi
Copy link
Member

@riperiperi riperiperi commented Oct 18, 2021

This might work better than the other one. Give this a test to see if it fixes/doesn't fix issues with the other one.

The problem seems to be when any variable assignment happens with a negation. temp_1 = -temp_0; seems to trigger weird behaviour, but temp_1 = 0.0 - temp_0; does not. This also might extend towards integer types?

This might work better than the other one. Give this a test to see if it fixes/doesn't fix issues with the other one.

The problem seems to be when any variable assignment happens with a negation. `temp_1 = -temp_0;` seems to trigger weird behaviour, but `temp_1 = 0.0 - temp_0;` does not. This also might to extend towards integer types?
@riperiperi riperiperi added gpu Related to Ryujinx.Graphics fix Fix something labels Oct 18, 2021
@@ -180,6 +193,9 @@ private static string GetExpression(CodeGenContext context, AstOperation operati

case Instruction.UnpackHalf2x16:
return UnpackHalf2x16(context, operation);

case Instruction.Negate:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other cases are sorted by instruction name, would be nice to do the same for this one too.

@@ -27,6 +27,19 @@ public static string GetExpression(CodeGenContext context, IAstNode node)
throw new ArgumentException($"Invalid node type \"{node?.GetType().Name ?? "null"}\".");
}

public static string Negate(CodeGenContext context, AstOperation operation, InstInfo info)
{
IAstNode src = operation.GetSource(0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe put a comment somewhere saying this is done due to a bug on newer NVIDIA drivers (496.13)?

@MutantAura
Copy link
Collaborator

System:
Ryzen 5 5600X
RTX 3070 FE (493.16)
32GB DDR4
Win10

Games tested:

MK8D (text no longer flipped)
image

SSBU (text no longer superimposed)
image

LoZ:BoTW (haze artifacts no longer present)
image

LoZ:SSHD (no previous issue)

PKMN: Shield (general rendering)
image

FE:TH (general rendering)
image

SMO (general rendering)
image

MHR
image

All work great 👍 any issues from the older workaround are also solved such as the text bug in SSBU.

@riperiperi
Copy link
Member Author

Feedback addressed.

Copy link
Member

@gdkchan gdkchan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks. Very unfortunate bug.

@gdkchan gdkchan merged commit 052deeb into Ryujinx:master Oct 18, 2021
@meisiek
Copy link

meisiek commented Oct 19, 2021

Looks great! Every game I've checked looks identically to the old driver.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Fix something gpu Related to Ryujinx.Graphics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants