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

softgpu: Refactor imm prim handling to support fog/color1 #16042

Merged
merged 9 commits into from
Sep 18, 2022

Conversation

unknownbrackets
Copy link
Collaborator

@unknownbrackets unknownbrackets commented Sep 18, 2022

This accurately handles what I've reproduced for immediate-mode primitives, stuffing them a bit later in the pipeline so they bypass vertex decode. There's still some ugliness for viewport (due to screenpos calculation after clipping), but it's not that terrible.

Ah, well, I'm not sure about the vertex Q, actually. Maybe texgen isn't right still...

The hardware renderers still don't support fog/color1, but I'm hoping this makes it easier for us to tell if some other game is using them unexpectedly. Anyway, I also want the software renderer to be a more accurate way to test graphics that might be used in PSP game patches.

This also means my imm fog test can be shown to pass and added to test.py (I think I forgot to ever push it...)

Also fixes a crash hardware renderers had if anything but rectangles were used in transform mode.

-[Unknown]

Copy link
Owner

@hrydgard hrydgard left a comment

Choose a reason for hiding this comment

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

nitpick about a comment :)

Otherwise looks fine, tested with Thrillville with no issues.

@@ -1138,6 +1145,18 @@ void SoftGPU::FinishDeferred() {
drawEngine_->transformUnit.Flush("finish");
}

int SoftGPU::ListSync(int listid, int mode) {
// Take this as a queue that we need to finish drawing.
Copy link
Owner

Choose a reason for hiding this comment

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

cue, not queue :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

D'oh, I type queue way more often than cue, this happens with several words heh.

-[Unknown]

We could in theory skip flush on FinishDeferred, and allow some CPU/GPU
overlap.  If we did, we'd still want to flush at these times.
The previous logic was harder to understand and easier to get wrong.
Just drop them when clipping the primitive.
Only with through set, and we have to ignore position.
Was crashing because the frag and vert shaders didn't match up.
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