Commit graph

1160 commits

Author SHA1 Message Date
Unknown W. Brackets
0be891c7ff softgpu: Minor opt, ignore unused z_stride. 2022-10-02 21:31:07 -07:00
Unknown W. Brackets
58a4376998 GPU: Normalize framebuf addresses.
In VRAM, always store without mirror.  In RAM, always store without
cache/kernel bits.
2022-10-02 21:28:53 -07:00
Unknown W. Brackets
80cccd7abb Build: Fix debug build on Windows 32-bit. 2022-10-01 17:07:27 -07:00
lainon
b304551747 Code readability, vec reserve() and remove excess c_str() 2022-09-30 12:31:32 +03: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
6468e0f03e softjit: Fix dst blend shift.
Example: src * dst.a + dst * one, still requires a shift back.
2022-09-29 22:31:50 -07:00
Unknown W. Brackets
dc90a5a851 softgpu: Avoid projecting textures in common case.
Several games appear to intentionally set the matrix flat.
2022-09-29 22:31:49 -07:00
Unknown W. Brackets
904fb38003 GPU: Restore matrices with dirtying.
Without this, it's possible we might not notice or apply a change
whether in uniforms or etc.
2022-09-29 22:31:02 -07:00
Unknown W. Brackets
6b20c0318d softgpu: Correct matrix value update wrapping.
The values read back when saving a context or getting matrix data are set
differently than the actual values used for rendering.

This implements the wrapping and bleeding between matrices within softgpu,
but leaves hardware rendering to only use the rendering registers for
speed.
2022-09-27 22:29:55 -07:00
Unknown W. Brackets
23af9be9f4 softgpu: Handle rectangle texture projection. 2022-09-26 18:44:39 -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
Henrik Rydgård
a26a353c25
Merge pull request #16102 from unknownbrackets/softgpu-bin-tweaks
softgpu: Avoid waiting for a thread to drain
2022-09-25 10:01:44 +02:00
Unknown W. Brackets
24560eef5c softgpu: Avoid waiting for a thread to drain.
If we can, we want to keep the thread queues healthy, but not full.
Reduce the amount we push on a typical drain to avoid the Wait().
2022-09-24 20:01:00 -07:00
Unknown W. Brackets
1aa6841759 softgpu: Increase queued prims.
We made them smaller, so we can queue more of them in the same space.
Helps a little bit.
2022-09-24 20:01:00 -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
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
6e6535c263 softjit: Skip reading dst pixel where blended out.
Sometimes used by blends used purely to multiply the source color by
something, usually prep for bloom.
2022-09-24 02:00:03 -07:00
Unknown W. Brackets
a4c3718431 softgpu: Optimize rectangle sampling/blending.
Sometimes the vertex color or alpha can allow us to optimize away some
multiplication.
2022-09-24 02:00:03 -07:00
Unknown W. Brackets
794a5c07ad softgpu: Ignore a needless color test case.
This happens in Ridge Racer, and we can entirely skip the color test.
2022-09-24 02:00:03 -07:00
Henrik Rydgård
d743bfac93
Merge pull request #16085 from unknownbrackets/softgpu-vert
softgpu: Cache reused indexed verts
2022-09-24 00:00:26 +02:00
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
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
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