Commit graph

71 commits

Author SHA1 Message Date
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
Unknown W. Brackets
3d4c1548b6 softgpu: Allow tri -> rect in transform. 2022-02-12 12:03:55 -08:00
Unknown W. Brackets
259b10d42a softgpu: Turn more tri strips into rects.
This catches a common case in Valkyrie Profile.
Rotation is resolved by just always using tl/br.
2022-02-12 11:33:42 -08:00
Unknown W. Brackets
2381f355c2 softgpu: Combine tris to rects with ignored z too. 2022-02-12 11:33:36 -08:00
Unknown W. Brackets
2479d52202 Global: Reduce includes of common headers.
In many places, string, map, or Common.h were included but not needed.
2022-01-30 16:35:33 -08:00
Unknown W. Brackets
3010cd56d1 softgpu: Correct simple rectangles with mipmaps.
Might be used for fonts, we could potentially check for bias/slope, but
mipmaps are uncommon in direct through draws anyway.
2022-01-23 12:26:58 -08:00
Unknown W. Brackets
6896a7a64e softgpu: Use cached state for screen offset. 2022-01-15 18:20:25 -08:00
Unknown W. Brackets
02c5559393 softgpu: Remove z from DrawingCoords.
It's not really used much of anywhere, anyway.
2022-01-15 15:38:56 -08:00
Unknown W. Brackets
a228b2ab6c softgpu: Use cached sampler state outside jit. 2022-01-15 15:26:26 -08:00
Unknown W. Brackets
0b3f096c01 softgpu: Cache strides in draw pixel state. 2022-01-15 13:03:10 -08:00
Unknown W. Brackets
970e9c2f51 softgpu: Move threading into BinManager.
This threads much more effectively, across entire prim call.
2022-01-13 22:45:23 -08:00
Unknown W. Brackets
48ef4a18b1 softgpu: Handle scissor/range in BinManager. 2022-01-13 19:07:41 -08:00
Unknown W. Brackets
a0a9b1e89b softgpu: Add class to manage and enqueue for bins.
For now, just forwarding.
2022-01-13 09:26:59 -08:00
Unknown W. Brackets
6839aac109 Debugger: Cache list PC for softgpu tagging.
Still slow, but improved.
2022-01-12 21:23:49 -08:00
Unknown W. Brackets
d962fb35d3 softgpu: Centralize more prim drawing state. 2022-01-12 21:23:49 -08:00
Unknown W. Brackets
75ff3e44e6 softgpu: Move texture addresses to prim state. 2022-01-11 00:00:03 -08:00
Unknown W. Brackets
d5c5e9478e softgpu: Prepare more state per prim call. 2022-01-10 22:12:35 -08:00
Unknown W. Brackets
9ec7d65c49 softgpu: Use func IDs instead of gstate more. 2022-01-10 22:12:35 -08:00
Unknown W. Brackets
d7a82ab7b8 softgpu: Compute func IDs once per batch of verts.
This saves a decent chunk of time, especially when many verts are being
drawn.
2022-01-10 22:12:35 -08:00
Unknown W. Brackets
e2f8cf8bf2 softgpu: Correct mirroring in fastpath+nearest. 2022-01-04 23:42:31 -08:00
Henrik Rydgård
d3f0af7458
Merge pull request #15273 from unknownbrackets/softjit-bloom
Optimize software renderer handling of common bloom operations
2022-01-02 18:11:07 +01:00
Unknown W. Brackets
a259761262 samplerjit: Use nearest func in fast path too.
This uses the more optimal tex funcs.
2022-01-02 08:48:16 -08:00
Unknown W. Brackets
496545e55c softgpu: Add code for tracking GPU writes.
Unfortunately, it has a pretty noticeable speed impact, even at the basic
"assume everything's written" level.  Compiled off by default, but at
least it's there.

Doesn't account for tests (i.e. alpha test skipping write) so still not
perfectly accurate.
2022-01-02 08:28:30 -08:00
Unknown W. Brackets
06e954fe2a samplerjit: Create a separate fetch func.
This allows nearest to become more similar to linear, where it applies the
texture function.
2022-01-01 16:58:04 -08:00
Unknown W. Brackets
3bc6009158 samplerjit: Refactor sampler ID calculation.
Make it the same as pixel func IDs.
2022-01-01 16:58:04 -08:00
Unknown W. Brackets
154bb53744 softgpu: Correct accuracy on fast path modulate. 2021-12-05 13:10:18 -08:00
Unknown W. Brackets
823c4adb15 softgpu: Keep arguments in vectors for sampling. 2021-12-04 15:45:06 -08:00
Unknown W. Brackets
96a7554053 sofjit: Move common types to reg cache header.
This makes it easier to use vectors elsewhere.
2021-11-28 08:03:15 -08:00
Unknown W. Brackets
91787e63d9 softjit: Switch to the __vectorcall convention. 2021-11-26 08:21:11 -08:00
Unknown W. Brackets
876c8cd368 softgpu: Fix PixelFuncID size.
Oops, can't use unions in bitfields.  Also improve typesafety.
2021-11-21 09:40:13 -08:00