Commit graph

199 commits

Author SHA1 Message Date
Unknown W. Brackets
dc962094f8 softgpu: Correctly fix inversions, matching tests.
Inversions are allowed just fine, but if clipping results in coordinates
outside range, the triangle should be culled.  Fixes more wanted
inversions.
2022-11-30 23:20:39 -08:00
Unknown W. Brackets
7880eb15c1 softgpu: Always use software skinning.
There's only software skinning, after all.
2022-11-06 08:44:22 -08:00
Unknown W. Brackets
6c36f03a0d GPU: Purify vertTypeIsSkinningEnabled(). 2022-11-06 08:40:54 -08:00
Unknown W. Brackets
66472c39ce GPU: Use skinned position always in bounding check.
Meanwhile, move to a flag on decoder options instead of global check.
2022-11-06 08:23:31 -08:00
Unknown W. Brackets
a5d3af9cb0 GPU: Cleanup GetVertTypeID() usage. 2022-11-06 08:01:57 -08:00
Unknown W. Brackets
6945604492 softgpu: Multiply prev normal by world matrix.
Even when it's not in the vertex data, we still must multiply by the world
matrix.  Fixes some lighting issues in Nayuta no Kiseki.
2022-10-20 23:14:54 -07:00
Unknown W. Brackets
d6a59be012 softgpu: Respect negate normal flag without norm.
Per tests, Z is still negated even when using the previous normal value.
2022-10-20 23:09:48 -07:00
Unknown W. Brackets
1931fa2f5f softgpu: Make triangle fan rect detection generic. 2022-10-16 16:01:09 -07:00
Unknown W. Brackets
77696573f4 GE Debugger: Correct rounded coords in vertex list.
Were previously rounding to pixel, not subpixel.  Also, show out of range
values for clarity on clamping/culling.
2022-09-30 00:19:21 -07:00
Unknown W. Brackets
faa6c2d461 softgpu: Implement triangle texture projection. 2022-09-26 18:12:20 -07:00
Unknown W. Brackets
6282f8b05f softgpu: Expand texture coords to include q.
We'll need this to correctly project.
2022-09-26 17:13:14 -07:00
Unknown W. Brackets
8376176b2f softgpu: Split clippos out of rasterization vert.
We don't use it, except w, at all in rasterization, so no need to keep it
in the bin queue.
2022-09-26 16:50:40 -07:00
Unknown W. Brackets
34a8056017 GPU: Correct normalized zero normal proj map.
Unlike lighting, this does not use 0, 0, 1.
2022-09-26 15:11:11 -07:00
Unknown W. Brackets
b3c0f177e2 softgpu: Save last tc/normal in vertex reading.
Matches PSP behavior, reusing last set values.
2022-09-26 15:11:11 -07:00
Unknown W. Brackets
444781c7b0 softgpu: Fix triangle strip with partial rects.
Seen in Wild Arms XF shop menu.
2022-09-24 18:55:45 -07:00
Unknown W. Brackets
88b3b26ed3 softgpu: Cache reused indexed verts.
This happens a lot for spline/bezier, so can significantly speed up curve
heavy scenes.  Isn't necessarily that common otherwise, though.
2022-09-22 18:27:59 -07:00
Unknown W. Brackets
067fac6817 softgpu: Skip matrix multiply for fog factor calc.
We can just use a dot product instead, and always skip viewpos.
2022-09-22 18:19:53 -07:00
Unknown W. Brackets
84a3f6de71 softgpu: Remove unnecessary state param.
Oops, meant to remove this when refactoring imm prims.
2022-09-22 18:18:49 -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
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
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