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

Correct some alpha/stencil/blend issues in softgpu #15171

Merged
merged 8 commits into from
Nov 26, 2021

Conversation

unknownbrackets
Copy link
Collaborator

This fixes a few issues found while implementing and validating hardware operations for #15163.

  • Fixes stencil decrement on 5551 (decr means zero, not 0xFE swizzled to 1.)
  • Uses zero for dst alpha on 565, though it'd be a bit odd for any game to actually use this.
  • Cleanup warnings and force off a flag in PixelFuncID for invalid values.
  • Corrects off-by-one errors in alpha blending.
  • Returns vertexjit names for code pointers.

-[Unknown]

This just keeps the ID more consistent.
Oops, we need to subtract signed, but then clamp to unsigned.
@hrydgard
Copy link
Owner

Cool.

I see, by the way, that rewriting all this to do 4 pixels at a time (in this pixel processing code code, probably pack 2 pixels in each register and using twice the registers, or go AVX2) would make everything way harder to work with. So maybe sometime in the future, but not while this is all still being worked out.

Also, if it helps to exclude 32-bit x86 from the softjit, to get more registers or whatever, then that seems fine to me.

@hrydgard hrydgard enabled auto-merge November 26, 2021 08:04
@hrydgard hrydgard merged commit daae09b into hrydgard:master Nov 26, 2021
@unknownbrackets unknownbrackets deleted the softgpu-cleanup branch November 26, 2021 13:27
@unknownbrackets
Copy link
Collaborator Author

Yeah, I think making it do two pixels at once would be easier, but masked writes (including stencil) are also an annoying area. That said, it's still something I want to pursue, I just have to make it smart...

-[Unknown]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants