Commit graph

1220 commits

Author SHA1 Message Date
Unknown W. Brackets
204789a27f softgpu: Skip fog when no verts have fog. 2022-12-02 21:55:49 -08:00
Unknown W. Brackets
0c42e45e92 softgpu: Cleanup reapply logic.
This makes more sense to read.
2022-12-02 21:42:57 -08:00
Unknown W. Brackets
4d92533907 softgpu: Apply optimizations to states generically.
This is for optimizations we can only do when we know the vertex values.
2022-12-02 21:30:53 -08:00
Unknown W. Brackets
6bd0eec54d softgpu: Calc flags on state as we queue verts.
Might be some other ways, like doing this directly in a vertex reader.
Also am thinking about doing things regarding UVs or positions.

Flags not yet used, keeping separate for perf checks.
2022-12-02 21:28:50 -08:00
Unknown W. Brackets
a04b7cf3b3 softgpu: Force shading flag off in clearMode.
Probably fixes a line shading bug, and clearer anyway.
2022-12-02 21:20:59 -08:00
Unknown W. Brackets
778a0487cb softjit: Switch to DenseHashMap. 2022-12-02 20:59:13 -08:00
Henrik Rydgård
116bc9d59a
Merge pull request #16485 from unknownbrackets/softgpu-fog-nan
softgpu: Handle infnan fog coefficients better
2022-12-02 19:49:32 +01:00
Unknown W. Brackets
1121a6fb68 softgpu: Handle inf-end + negative constant slope. 2022-12-02 10:20:30 -08:00
Unknown W. Brackets
38de2f11af softgpu: Handle infnan fog coefficients better.
If we ended up with a dot product that had opposing inf signs, the add
would result in NAN and cause problems.
2022-12-02 10:15:15 -08:00
Lubos
b41a782fcd Revert "Centralize ClearCacheNextFrame"
This reverts commit cbfa4bfc8e.
2022-12-02 14:32:27 +01:00
Henrik Rydgård
a349e2b85b
Merge pull request #16481 from unknownbrackets/gedebugger
Cleanup some GE debugger logspam, small texture proj optimization
2022-12-02 11:10:49 +01:00
Unknown W. Brackets
33abbca464 softgpu: Optimize out texture proj for UVs.
Seen in NFS Most Wanted 5-1-0.
2022-12-01 23:13:20 -08:00
Unknown W. Brackets
c5a98e62dd softgpu: Cull verts outside post-viewport Z.
Shouldn't have removed this before, points are still culled when depth
clamp is off and throughmode is off.

Fixes Crazy Taxi graphics glitches.
2022-12-01 21:57:48 -08:00
Unknown W. Brackets
a1f6a40d10 softgpu: Interpolate Z for 3D lines.
Important for Me & My Katamari, see #16131.
2022-12-01 14:39:19 -08:00
Henrik Rydgård
e6f0f84a45 SSE optimize Float4ToUint8x4, some uses 2022-12-01 16:32:23 +01:00
Unknown W. Brackets
73489349cc GPU: Oops, simplify an expression. 2022-12-01 01:34:48 -08:00
Unknown W. Brackets
cbe96d3774 GPU: Use common block transfer logic in all cases. 2022-12-01 01:34:16 -08:00
Unknown W. Brackets
3589c1e826 softgpu: Handle block transfer VRAM wrapping.
Note: mirrors still act as mirrors, swizzle and all.
2022-12-01 01:31:44 -08:00
Unknown W. Brackets
1c5f0d575c softgpu: Improve meminfo detail on block transfer.
Gaps are useful to understand.
2022-12-01 01:31:44 -08:00
Unknown W. Brackets
68515aaee2 softgpu: Account for width!=stride in xfer checks. 2022-12-01 01:31:43 -08:00
Unknown W. Brackets
2adc18cfba softgpu: Correct src/dst overlap in block transfer.
If dest is inside src, it seems to consistently copy in blocks of 64
bytes.
2022-12-01 01:31:43 -08:00
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
Henrik Rydgård
3246baec4b SoftGPU: Range check block copies.
Needs testing to verify if we should copy zeroes instead if the src range is
partial, etc, quite a few possible edge cases.

Though on its own, this probably fixes the crash in #16427.

Still don't understand why that one has issues in hardware renderers
though since they do bounds-check the copies.
2022-11-28 10:39:46 +01: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
Henrik Rydgård
cbfa4bfc8e Centralize ClearCacheNextFrame 2022-11-21 18:13:13 +01:00
Henrik Rydgård
d73196c7d6 Split up the GPU config change notifications 2022-11-21 15:14:20 +01:00
Henrik Rydgård
7596713059 Refactor: Split up updating the display and render size. 2022-11-21 14:35:12 +01:00
Henrik Rydgård
f67ef7ab99
Merge pull request #16404 from hrydgard/transparent-pause-screen
Make the pause screen "transparent"
2022-11-21 14:27:59 +01:00
Henrik Rydgård
fd110ef6a9
Merge pull request #16408 from unknownbrackets/jit-wx
softgpu: Fix compile hazard while running
2022-11-20 21:42:10 +01:00
Unknown W. Brackets
4d06400548 softgpu: Fix compile hazard while running.
This prevents any clearing of cache while other threads may be using
previously cached funcs, and avoids wx exclusive hazards.
2022-11-20 12:04:02 -08:00
Henrik Rydgård
250ea5e592
Merge pull request #16407 from unknownbrackets/jit-wx
In jits, protect and unprotect using better estimates
2022-11-20 20:39:04 +01:00
Unknown W. Brackets
ce51942508 softgpu: Correct WX-exclusive platform hazards.
Should mainly affect BSD at this point.
2022-11-20 10:55:35 -08:00
Unknown W. Brackets
b2798c7ada jit: Add more reasonable estimates for RX protect. 2022-11-20 10:55:35 -08:00
Henrik Rydgård
37ec31dedd Fix resizing issue. Took some refactoring. 2022-11-20 12:57:32 +01:00
Henrik Rydgård
a3874ebcef
Merge pull request #16402 from unknownbrackets/softgpu-inversion
softgpu: Throw away all inverted polygons
2022-11-20 09:55:49 +01: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
7e7eabf86a softgpu: Use threads on self-render if safe.
Some games, such as Prince of Persia, self-render 1:1 to colorize, rather
than to scale or blur.  We can still use threads in these cases.
2022-11-13 12:34:31 -08:00
Unknown W. Brackets
d8716b5d90 softgpu: Fix off-by-one rendering after half-pixel.
If the X is after a half-pixel offset, the first pixel we draw is the next
one.  This wasn't being accounted for properly in one place.
2022-11-13 10:22:09 -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
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
1e1c75d552 GE Debugger: Correct UV display with prescale.
Sometimes these weren't flushed yet, and it made the texture preview and
vertices confusing and wrong (using old factors, not just no factors.)
2022-10-25 22:14:16 -07:00
Unknown W. Brackets
79b1d1d35f
softgpu: Better approximate slope mip level mode (#16276)
* samplerjit: Remove unused x/y parameters.

Still need to tune the accuracy of filtering, but those were not the
right way.

* softgpu: Better approximate slope mip level mode.

This isn't exactly right, but it's closer.

* softgpu: Calculate auto from largest difference.

Direction shouldn't matter.
2022-10-23 10:15:43 +02:00
Unknown W. Brackets
813bfded92
x86jit: Correct vh2f NAN handling (#16275)
* x86jit: Correct vh2f NAN handling.

Allows another test to pass.

* x86jit: Reuse MAccessibleDisp().
2022-10-23 10:09:29 +02: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
7eb7bd5141 softgpu: Correct linear interp for uneven positions.
Can't round to the pixel when calculating the S/T deltas.
This fixes issues in Wipeout (#16131) and Call of Duty bloom.
2022-10-16 18:57:55 -07:00