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

rsx: Shader emitter fixups [ 3 of 3] #6818

Merged
merged 4 commits into from Oct 22, 2019
Merged

rsx: Shader emitter fixups [ 3 of 3] #6818

merged 4 commits into from Oct 22, 2019

Conversation

kd-11
Copy link
Contributor

@kd-11 kd-11 commented Oct 21, 2019

  • Implements integer renormalization at 8 bits to mimic NVIDIA hardware implementation. All NVIDIA cards seem to normalize small-width integers smaller than 8 bits to 8 bits internally which causes an arithmetic error of around 1 part in 255. This error is small, but when used as for texture lookups, the error can be magnified greatly due to the relatively large texture sizes, causing unexpected errors. This option is enabled for AMD (which is too precise) and Intel (which is untested but expected to not follow NVIDIA's unorthodox implementation).
  • Refactors fragment shaders a bit to make debugging easier. Declares a useful struct to hold texture parameters and also the explicit types avoid senseless OpBitCast that were emitted all over the place.
  • Implement optional delayed discard. On some AMD hardware, edge texels (samples?) can sometimes "contribute" to the discardedness of a fragment, even when the visible fragments should not have triggered the discard. FIxes a rare diagonal line glitch on AMD cards. This option is also enabled by default for intel hardware since I am not able to extensively test its behavior.

- Renormalizes arbitrary N-bit values as 8-bit normalized.
- NV hardware performs integer normalization at 8 bits if the size is less than 8.
- This can cause significant arithmetic drift because the error is multiplied by a huge number when sampling.
- Use a struct instead to improve readability and remove pointless OpBitCast
- Noticed a glitch on AMD hw and windows drivers where discard seems to affect entire 4x4 cells.
- Dead fragments (outside the primitive boundary) could have their discards trigger as they do not have proper access to variables.
- This introduces dead fragments along triangle edges, causing a diagonal line pattern across the screen that is very annoying.
@SKYMEE1
Copy link

SKYMEE1 commented Oct 22, 2019

Before this I had to relaunch Gran Turismo 5 multiple times because it hung up with no response while trying to render any scene. Now that is fixed and everything is loading as it should first time! Very good work!

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.

None yet

2 participants