-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Another workaround for NVIDIA driver 496.13 shader bug #2750
Conversation
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?
Download the artifacts for this pull request: |
@@ -180,6 +193,9 @@ private static string GetExpression(CodeGenContext context, AstOperation operati | |||
|
|||
case Instruction.UnpackHalf2x16: | |||
return UnpackHalf2x16(context, operation); | |||
|
|||
case Instruction.Negate: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other case
s 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); |
There was a problem hiding this comment.
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)?
Feedback addressed. |
There was a problem hiding this 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.
Looks great! Every game I've checked looks identically to the old driver. |
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, buttemp_1 = 0.0 - temp_0;
does not. This also might extend towards integer types?