Commit graph

1031 commits

Author SHA1 Message Date
Unknown W. Brackets
66b6dfd0a5 softgpu: Fix self-render detect in Ridge Racer.
When we flush we mark all pending writes zero, but we rely on this being
set to detect self-render.

TRANSFORM_ALL was wrong as well, sometimes clearing BINNER_RANGE.
2022-09-22 20:36:15 -07:00
Unknown W. Brackets
fc39f042ae softgpu: Avoid unnecessary flushing for curves.
We don't need to flush all drawing between curves in softgpu, let them
queue up.
2022-09-22 00:08:38 -07:00
Henrik Rydgård
95ea0450fc
Merge pull request #16066 from unknownbrackets/softgpu-fastrect
softgpu: Narrow blend check for fast path further
2022-09-21 10:01:04 +02: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
78a3925198 softgpu: Fix display framebuffer read. 2022-09-20 13:43:19 -07:00
Unknown W. Brackets
7483923d07 softgpu: Correct clear rect off by one issues. 2022-09-20 12:57:05 -07:00
Henrik Rydgård
85d1f28997 Throw in assorted warning fixes 2022-09-20 18:04:08 +02:00
Henrik Rydgård
1ae7c0132c Start unifying setting of the GPU feature flags, now that thin3d has feature detection. 2022-09-20 10:07:01 +02:00
Unknown W. Brackets
e2929fb395 softgpu: Skip flushing on no change.
Minor tweak, we sometimes try to flush even without anything to flush, and
were previously rechecking a lot of things.
2022-09-19 08:38:11 -07:00
Unknown W. Brackets
259abf79dd softgpu: Skip more triangles with equal verts.
Even if X is not equal, if all Y are equal, we can still skip.
This seems to happen more often than I expected with far away objects.

Skipping here avoids filling up the queue.
2022-09-19 08:37:47 -07:00
Unknown W. Brackets
7d4aa3eb2d softgpu: Correct line early z checks.
Was looking at completely wrong pixels, hadn't removed subpixels yet.
2022-09-18 11:44:01 -07:00
Unknown W. Brackets
ca248e1201 softgpu: Fix s8 primitives in throughmode.
Also always cull no-position verts, hardware too.  Matches tests.
2022-09-18 07:46:18 -07:00
Unknown W. Brackets
97002692c4 softgpu: Correct secondary color on imm verts.
Only with through set, and we have to ignore position.
2022-09-18 06:16:26 -07:00
Unknown W. Brackets
6877ff1af2 softgpu: Fix state/continuation for imm prims. 2022-09-18 06:16:26 -07:00
Unknown W. Brackets
596b07bd2e softgpu: Support fog and color1 on imm verts. 2022-09-18 06:16:26 -07:00
Unknown W. Brackets
35ba01e01f softgpu: Refactor imm draws to bypass vert read. 2022-09-18 06:16:25 -07:00
Unknown W. Brackets
799a9ae95b softgpu: Simplify vertex reading. 2022-09-18 06:16:25 -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
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
Unknown W. Brackets
f740fcdbe7 GPU: Minor cleanup of unnecessary virtual. 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
8371091734 softgpu: Force correct alignment on 32-bit. 2022-09-12 22:15:02 -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
Unknown W. Brackets
b2e6a086dc softgpu: Reduce size of VertexData texture coords.
There's no real benefit to this with only two values.
Not much of a gain perf wise, but still good to transfer less data.
2022-09-12 21:10:46 -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
3c9372fb75 softgpu: Ignore stencil test mask in ALWAYS mode.
Small codegen improvement since we can directly use ref and avoid loading
the unmasked reference.
2022-09-11 22:39:56 -07:00
Unknown W. Brackets
1f6870798b softgpu: Include early Z in func description. 2022-09-11 22:39:32 -07: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
8a2115be46 softgpu: Enable early Z tests a bit more often.
This helps in cases where sfail doesn't matter.
2022-09-11 18:39:39 -07:00
Unknown W. Brackets
5f2e20d8ca softgpu: Reduce some minor bin item field sizes. 2022-09-11 18:39:14 -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
e72309745e softjit: Implement accurate fog color blending. 2022-09-11 08:50:07 -07:00
Unknown W. Brackets
b90fc7137f softgpu: Correct accuracy of fog calculation.
This matches values from a PSP exactly, with the help of immediate mode
vertex values (since this directly allows specifying the fog factor
without any floating point math.)
2022-09-11 08:24:40 -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
Henrik Rydgård
04c02340f1
Merge pull request #15998 from unknownbrackets/softgpu-rect
softgpu: Allow almost flat rectangles to go fast
2022-09-11 08:54:04 +02:00
Unknown W. Brackets
15d5fa48f7 softgpu: Check depth test early on simple stencil.
If we don't need to write stencil on sfail/zfail, we can do the depthtest
early, which allows us to more often skip texture sampling.

This gives a good improvement in Chains of Olympus.
2022-09-10 21:24:19 -07: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
18c9a4d9c9 GE Debugger: Fix crash stepping with large tex.
Some math was overflowing in allocations, and it would allocate zero
bytes.  Let's just refuse textures more actively.
2022-09-10 19:31:53 -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
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
ceb2af369c GPU: Handle immediate prims more accurately.
This allows for lines, points, textures, and similar things.  Also
corrects offset handling.  Still some flags on VAP that seemingly don't
work, and this doesn't consider the texture flag on it.
2022-09-06 22:20:45 -07:00