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
028a341cc8
softgpu: Explicitly flush on sync and output.
...
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.
2022-09-18 06:16:25 -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
151727ee01
softgpu: Detect longer strips of rectangles.
...
Could maybe even combine these into one large rectangle, but the main
benefit is avoiding triangles.
2022-09-11 22:39:32 -07: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
ce4fee7373
softgpu: Refactor triangle cull processing.
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
8c55e18ea8
softgpu: Switch vert continue buffer to members.
...
Better this than static. May be easier to handle imm prims correctly.
2022-09-11 08:54:34 -07:00
Unknown W. Brackets
7a83f8bab5
softgpu: Use vertType prim override for flags.
...
These parameters are a real shame, was so clean before...
2022-09-06 22:20:45 -07:00
Unknown W. Brackets
f274267143
GPU: Allow usage of texturing in immediate verts.
...
And respect the other flags that I can reproduce working in a test.
I can't seem to get the fog to work at all, or the shading mode, or the
secondary color. Maybe depends on other flags or bits in other regs...
2022-09-06 22:20:45 -07:00
Unknown W. Brackets
88e8f95293
softgpu: Flush on transfer to pending tex read.
...
Potentially could use these for self-render, but so far we should be
detecting that so leaving it alone.
2022-08-20 23:22:21 -07:00
Unknown W. Brackets
daaf448d22
GE Debugger: Fix crash on 0 count prim.
2022-08-14 16:17:04 -07:00
Unknown W. Brackets
482dbb66ea
softgpu: Ensure TCs are initialized.
...
Even if they're not read, we want consistent behavior.
2022-08-12 23:58:57 -07:00
Unknown W. Brackets
49b98de97a
softgpu: Correct bad munmap() size.
2022-08-12 23:48:25 -07:00
Henrik Rydgård
e6403d7157
Split GetPointer into two versions, to help with const correctness
2022-07-24 13:26:19 +02: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
e82b54e4b6
softgpu: Cull no-pos and through s8 pos verts.
...
Seems like these just don't draw anything, ever.
2022-01-25 19:29:11 -08:00
Unknown W. Brackets
61e30e8f8b
softgpu: Fix cull in throughmode.
...
Was only an issue for triangles used to draw rectangles, but caused our
test to fail.
Also move a test that was failing due to an outdated prx to passing.
2022-01-25 19:07:33 -08:00
Unknown W. Brackets
d74001f4fa
softgpu: Reuse transform state.
2022-01-23 08:08:41 -08:00
Unknown W. Brackets
76f9103e97
softgpu: Add a table and initial dirty flags.
...
Not actually using the dirty flags to skip state, but have moved to
Execute_* functions and everything else like other graphics backends.
2022-01-23 08:08:40 -08:00
Unknown W. Brackets
eb95b99523
GE Debugger: Add option to auto flush.
...
This makes it easier to see what's happening in each draw.
2022-01-22 13:12:59 -08:00
Unknown W. Brackets
c0c3f7284a
softgpu: Avoid flush texturing from stride.
...
This generally detects overlap more accurately using a dirty rectangles
approach. Also detects render to self much more accurately, including
with depth.
2022-01-20 18:39:01 -08:00
Henrik Rydgård
128e2fa14e
Merge pull request #15318 from unknownbrackets/softgpu-opt
...
softgpu: Heuristic to avoid over-draining
2022-01-17 07:43:34 +01:00
Unknown W. Brackets
73c143c44c
softgpu: Precompute some of screen space multiply.
...
This at least avoids the shifts and makes it easier to vectorize.
Only helps a little.
2022-01-16 21:31:53 -08:00
Unknown W. Brackets
31745110e8
softpu: Premultiply matrix transforms.
...
Where possible, we can skip some multiplies per vertex.
2022-01-16 21:31:52 -08:00
Unknown W. Brackets
12a4c63fc7
softgpu: Precompute state for vertex transform.
...
Doesn't help a ton, but with lots of verts can improve a percent or two.
2022-01-16 21:31:52 -08:00
Unknown W. Brackets
83adc44c2b
softgpu: Heuristic to avoid over-draining.
...
Some games (i.e. VC3) benefit from an early drain, since they get more
done while processing more verts. Others finish the draw quickly, and
then cause significant overhead in queueing new threads.
This attempts to balance the two, and improves Call of Duty and Blade
Dancer.
2022-01-16 21:09:28 -08:00
Henrik Rydgård
bdc69f5171
Merge pull request #15317 from unknownbrackets/softgpu-lighting
...
softgpu: Precompute lighting parameters
2022-01-17 01:06:35 +01:00
Unknown W. Brackets
2797e035df
softgpu: Precompute lighting parameters.
...
In many cases, games use lighting just for diffuse or something, this
helps skip what's not needed too. Good improvement in a scene from a
Naruto game.
2022-01-16 11:27:53 -08:00
Unknown W. Brackets
d95475e021
softgpu: Expose flush reasons/times in debug stats.
2022-01-16 11:27:42 -08:00
Unknown W. Brackets
2de7993dc5
softgpu: Decorate some stats for flushes.
2022-01-16 08:23:15 -08:00
Unknown W. Brackets
cc155ec460
softgpu: Avoid texture/CLUT flush unless overlap.
...
Only need to flush here if there's some overlap in the target.
2022-01-16 08:22:13 -08:00
Unknown W. Brackets
d6fa301ab1
softgpu: Track CLUTs as states for binning.
...
This way we can have multiple CLUTs in process at once, which helps.
2022-01-16 08:14:09 -08:00
Unknown W. Brackets
18f2a45a6a
softgpu: Allow binning across prim calls.
2022-01-16 00:49:49 -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
f091225572
softgpu: Stop storing model pos.
...
We don't even use this anywhere else. Also skip needless Lerp on clip.
2022-01-14 20:36:09 -08:00
Unknown W. Brackets
d6a8cb2a0e
softgpu: Stop storing normal/worldnormal/worldpos.
...
This is only needed for lighting, which is applied right away.
This improves perf just simply from less data being copied.
2022-01-14 20:32:18 -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
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
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