Commit Graph

66 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
909f3feaea softgpu: Allow inversions when w >= -1.0.
This seems to match desired cases well, see #16131.  Likely still
inaccurate to what hardware actually does.
2022-11-26 12:11:56 -08:00
Unknown W. Brackets
71b4407889 softgpu: Throw away all inverted polygons.
This is actually incorrect in some cases, but there are a number of games
affected by inversions, and they're practically always undesired.
2022-11-19 20:30:49 -08:00
Unknown W. Brackets
a66056217f softgpu: Avoid splitting rectangles for fog.
If the fog factor would result in the same amount of fog, we're just
adding more work for no reason.
2022-11-13 09:23:06 -08:00
Unknown W. Brackets
21064edfca softgpu: Correct tex on fogged rectangles. 2022-11-13 09:17:29 -08:00
Unknown W. Brackets
d33986a5ad softgpu: Cull a triangle with all negative w.
Per tests, this seems to happen but only when all points are below zero.
2022-10-15 11:49:28 -07:00
Unknown W. Brackets
23af9be9f4 softgpu: Handle rectangle texture projection. 2022-09-26 18:44:39 -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
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
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
cc6491342e softgpu: Prepare dedicated rectangle path.
We're still sometimes using the slow rect-as-triangles path, let's do
something faster.  As a first step, just handle binning.
2022-02-20 09:38:51 -08:00
Unknown W. Brackets
8e7bc80e4b softgpu: Avoid modifying source vertex data.
This was dangerous for strips and fans, which reuse the verts for
subsequent primitives.
2022-02-12 10:39:25 -08:00
Henrik Rydgård
eba93f2ee0 Merge pull request #15340 from unknownbrackets/softgpu-textures
Correct UV rotation and through mipmaps, optimize texenv blend a bit
2022-01-24 08:19:34 +01:00
Unknown W. Brackets
818d17183b softgpu: Correct clear mode dither.
It does apply, but have to be careful about alpha.
2022-01-23 12:39:50 -08:00
Unknown W. Brackets
648b71616e softgpu: Correct UV rotation for transformed rects. 2022-01-23 08:15:15 -08:00
Unknown W. Brackets
abef17caca softgpu: Simplify mask check.
This performs a bit better.
2022-01-16 23:40:57 -08:00
Unknown W. Brackets
89bc87a388 softgpu: Reduce copying during clipping.
Common case is nothing needs to be clipped.
2022-01-16 23:33:46 -08:00
Unknown W. Brackets
cf3384c993 softgpu: Avoid double calculating screenpos. 2022-01-15 11:22:36 -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
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
Unknown W. Brackets
6367d5dc8f softgpu: Draw top left of rectangles first.
This helps when things do self-rendering, since this way we won't read
from things we've just written to when scaling down.  See #11623.
2022-01-08 20:53:01 -08:00
Unknown W. Brackets
8db2d37e64 softgpu: Fix depth cull in softgpu.
Was improperly skipping cull for positive Z.
2021-11-05 21:38:13 -07:00
Unknown W. Brackets
121c56e6db softgpu: Clip only on -Z, cull if entirely outside.
This is important for several issues, like #12058 or #12060, where
something is drawn entirely outside valid Z, and should be culled.
2021-09-09 20:13:42 -07:00
Unknown W. Brackets
f32f89dd90 Global: Remove some unused variables. 2021-02-15 11:59:45 -08:00