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

softjit: Fix dst blend shift #16132

Merged
merged 4 commits into from
Sep 30, 2022
Merged

Conversation

unknownbrackets
Copy link
Collaborator

Silly mistake in a recent change, fixes the ocean in #16131.

Also, while I was looking at it I optimized a case of 0, 0, 0, 1 matrix values for q a bit. While so doing, I realized we don't actually dirty matrix uniforms in gstate.Restore(). Initially I went to change this to setting cmds for shared dirty handling, but I figured it's safer to just dirty in ResetMatrices() due to currentList access.

Also noticed that tgen wasn't properly dirtying the fragment shader ID, so this also fixes that.

Not sure how many games use the save/restore of contexts for matrix state, but better to be safe.

-[Unknown]

Without this, it's possible we might not notice or apply a change
whether in uniforms or etc.
Several games appear to intentionally set the matrix flat.
Example: src * dst.a + dst * one, still requires a shift back.
@unknownbrackets unknownbrackets added Software Rasterizer GE emulation Backend-independent GPU issues labels Sep 30, 2022
@unknownbrackets unknownbrackets added this to the v1.14.0 milestone Sep 30, 2022
@hrydgard
Copy link
Owner

Nice catches with the dirtying.

Hm, surprised that no-op texture projection is common, we could optimize that in the hardware renderer too. Although it's not exactly expensive so probably won't make much difference...

@hrydgard hrydgard enabled auto-merge September 30, 2022 06:39
@hrydgard hrydgard merged commit 89dab44 into hrydgard:master Sep 30, 2022
@unknownbrackets
Copy link
Collaborator Author

Hm, surprised that no-op texture projection is common, we could optimize that in the hardware renderer too. Although it's not exactly expensive so probably won't make much difference...

In fact, it already is (see MatrixNeedsProjection() in ShaderId.) That's what the tgen dirtying fix was about.

-[Unknown]

@unknownbrackets unknownbrackets deleted the softgpu-blend branch September 30, 2022 06:41
@hrydgard
Copy link
Owner

Oh duh. Right :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GE emulation Backend-independent GPU issues Software Rasterizer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants