100 Commits

Author SHA1 Message Date
Unknown W. Brackets
c47d7eab38 softgpu: Simply 5551 blending fast path.
Since it only supports multiply and add, let's just stick with that.
2022-09-24 18:55:45 -07:00
Unknown W. Brackets
1eeb4f0bcf softpu: Refactor out 5551 fast path checks.
They were duplicated, and better to organize them according to state.
2022-09-24 18:55:45 -07:00
Unknown W. Brackets
f30b1d048d softgpu: Avoid fast path in another wrong case.
Seen in Kurohyo.  Missed that the alpha blend check essentially means only
standard blending can work.
2022-09-24 17:53:09 -07:00
Unknown W. Brackets
cefef3b4f9 softgpu: Narrow blend check for fast path further.
See #15756, frame was largely black because of a full screen blend
rectangle intended to brighten the screen slighty (I assume.)
2022-09-20 14:29:33 -07:00
Unknown W. Brackets
de080e2594 softgpu: Simplify vertex range culling.
The previous logic was harder to understand and easier to get wrong.
Just drop them when clipping the primitive.
2022-09-18 06:16:25 -07:00
Unknown W. Brackets
9b01fce5b5 softgpu: Run early Z tests in fast rect path.
Needed for some 2D games, like Criminal Girls.
2022-09-17 13:37:54 -07:00
Unknown W. Brackets
1be5f1670c softgpu: Remove mostly unused screen offset state.
This is now already cleaned up from coords, so no need to cache it.
2022-09-12 22:02:10 -07:00
Unknown W. Brackets
167213c746 softgpu: Cache texture bufws at 16 bit.
Reducing the size of state a bit.
2022-09-12 21:57:00 -07:00
Henrik Rydgård
2791ab3226 Merge pull request #16011 from unknownbrackets/softgpu-rect
Detect more triangles as rectangles in softgpu
2022-09-12 08:35:13 +02:00
Unknown W. Brackets
288d18447d softgpu: Detect full triangles as rectangles.
Seen in a dump from Infected, improves FPS ~25% there.
2022-09-11 22:39:32 -07:00
Unknown W. Brackets
8a6e8066bf softgpu: Store vertex colors as packed RGBA8.
No need to keep it expanded at 4x the space for both colors.
2022-09-11 18:41:06 -07:00
Unknown W. Brackets
2e3b73abaa softgpu: Restrict sprite fast path to throughmode.
Its UV checks already should have generally, but let's be safe.  It
doesn't validate state like fog, etc.
2022-09-11 08:22:37 -07:00
Henrik Rydgård
d86127ac5e Merge pull request #15999 from unknownbrackets/softgpu-texsize
softgpu: Clamp/wrap textures at 512 pixels
2022-09-11 10:12:38 +02:00
Unknown W. Brackets
90e009edb9 softgpu: Clamp/wrap textures at 512 pixels.
A texture larger than 512 is "valid", but simply wraps/clamps at 512.
Importantly, the texture coords are still calculated at the specified
size, which can be up to 32768.
2022-09-10 20:23:09 -07:00
Unknown W. Brackets
f5f5c9ea87 softgpu: Avoid calling unordered coords tl/br.
These are just corners, we don't know if they're top or not at this point.
2022-09-10 14:58:27 -07:00
Unknown W. Brackets
13ca08b235 softgpu: Avoid over-aggressive rect conversion.
The TL and BR have to match between UVs and pos, not enough for UV to be
in order.  This was causing an artifact on Chains of Olympus' title.
2022-09-10 14:56:13 -07:00
Unknown W. Brackets
e7d49cd7d0 softgpu: Allow almost flat rectangles to go fast.
Improves transform rectangles used in Chains of Olympus, for example on
the title screen.
2022-09-10 13:29:40 -07:00
Unknown W. Brackets
6004d4a459 softgpu: Refactor duplicate rectangle compat check.
This just moves the logic to a single place for changes.
2022-09-10 13:28:35 -07:00
Henrik Rydgård
a91219bebc The Darkstalkers subpixel check should be == 0. Fixes #14953 again 2022-09-05 19:12:45 +02:00
Unknown W. Brackets
15b73b56bb softgpu: Correct texture check in fastpath.
This is the no textures option, so we shouldn't check sampler state at
all.  Presumably this was failing and reading uninitialized data...
2022-09-03 11:21:14 -07:00
Unknown W. Brackets
af004dd53d softgpu: Validate alpha test properly for fastpath.
We don't want a weird LESS test being mishandled.
2022-09-03 11:19:24 -07:00
Unknown W. Brackets
ba1ced4992 softgpu: Avoid rect fast path with subpixel offset.
It doesn't handle it right, see #15876.  We still handle these with
DrawRectangle(), which gets it right.
2022-09-03 11:08:11 -07:00
Unknown W. Brackets
6737d69f0a softgpu: Cleanup some now unused state. 2022-02-20 09:19:48 -08:00
Unknown W. Brackets
1bc3acf2ed softgpu: Use a const for subpixel screenpos factor. 2022-02-19 21:03:49 -08:00
Unknown W. Brackets
a66377fdf1 softgpu: Remove offset from screenpos.
This simplifies tighter calculations, and reduces the common magnitudes
we'll be dealing with.
2022-02-19 20:38:44 -08:00