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

Draw rectangles always using a specialized path in softgpu #15389

Merged
merged 4 commits into from
Feb 20, 2022

Conversation

unknownbrackets
Copy link
Collaborator

For cases where textures aren't 1:1, there's rotation, or similar - this uses a rectangle path rather than sending triangles. This also tries to convert more triangle strips/fans/etc. into rectangles to take advantage of this.

While there, I also noticed that we could clip verts that were used for other triangles in fans/strips, which must've been wrong.

In some games, like Persona 3, Valkyria Chronicles 3, Naruto, or Vampire Chronicle, this gives around 6-9%. Valkyrie Profile gains around 14%. Other games like Kingdom Hearts, Call of Duty (even though it has bloom that's affected), or God of War gain almost nothing.

Found this opportunity using the GE debugger prim filter to try to narrow down the slowest draws.

-[Unknown]

@unknownbrackets
Copy link
Collaborator Author

Bah, I've got something off about pixel centers. Probably won't have time to look at this more for a bit.

There's also something wrong even before this, as I'm seeing Valkyrie Profile and Kingdom Hearts with rounding errors in some screens. I think the sampler code will need to be adjusted... will need to make these tests properly test those areas too.

Considering just disabling the tests for now as I don't want to include that in this pull, and some things seem to be better here. But I guess the better thing is to fix that separately and rebase this.

-[Unknown]

@hrydgard
Copy link
Owner

hrydgard commented Feb 10, 2022

I'm fine with either temp-disabling the tests, or to fix later. Though the triangle vertex reuse bit could be merged separately in the meantime, I guess. I'm gonna try Ridge Racer later which I suspect could be affected by that.

EDIT: Doesn't fix Ridge Racer.

@unknownbrackets
Copy link
Collaborator Author

Okay, I'm going to disable for now as I see other tests that have gotten better. I think I'm going to need to change the test to get to the bottom of the actual behavior.

Though, I don't like disabling passing tests in general, so hopefully I'm not setting a bad precedent.

-[Unknown]

We're still sometimes using the slow rect-as-triangles path, let's do
something faster.  As a first step, just handle binning.
Was not clamping to zero when negative.
Filtering is still not perfect but this makes different orientations
better.
@unknownbrackets unknownbrackets marked this pull request as ready for review February 20, 2022 18:58
@unknownbrackets
Copy link
Collaborator Author

This now also fixes a nearest filtering clamp issue. I do see Ridge Racer has the weird flicker artifacting still...

-[Unknown]

@hrydgard hrydgard merged commit 16b8bc1 into hrydgard:master Feb 20, 2022
@unknownbrackets unknownbrackets deleted the softgpu-rect branch February 20, 2022 20:22
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