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

Implement IMUL, PCNT and CONT shader instructions, fix FFMA32I and HFMA32I #2972

Merged
merged 5 commits into from
Jan 10, 2022

Conversation

gdkchan
Copy link
Member

@gdkchan gdkchan commented Jan 4, 2022

A bunch of shader fixes here:

  • Implement the IMUL (integer multiply) shader instruction. Used by MelonDS Switch port and possible other homebrew. Not sure if commercial games uses this shader instruction.
  • Implement PCNT and CONT shader instructions. Those are similar to existing PBK/BRK and SSY/SYNC pairs. Also used by MelonDS Switch port and possibly other homebrew, AFAIK the NVIDIA compiler never uses this instruction.
  • Fix FMUL32I instruction implementation. Third operand should use the destination register, not "SrcC" as it does not exist for this instruction. (Regression from Rewrite shader decoding stage #2698).
  • Fix a issue similar to the above one for HFMA32I aswell, but this one was also missing from the instruciton table so I have added it too. (Technically not a regression as this instruction was not implemented before).

Testing on games is welcome. MelonDS is tricky to test right now as it requires other changes to work, plus only the newer version uses GPU rendering, the older ones are software rendered and won't be affected by those changes.

@gdkchan gdkchan added gpu Related to Ryujinx.Graphics fix Fix something labels Jan 4, 2022
Copy link
Member

@riperiperi riperiperi left a comment

Choose a reason for hiding this comment

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

Looking good, nice work.

@gdkchan gdkchan merged commit 7f6b3d2 into Ryujinx:master Jan 10, 2022
@gdkchan gdkchan deleted the fix-mul branch January 10, 2022 15:08
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.

3 participants