Commit Graph
113 Commits
Author SHA1 Message Date
Henrik RydgårdandClaude Opus 5.5 75c017295e SoftGPU: Only draw 1:1 textured triangle rectangles as sprites
Two triangles forming a rectangle each have their own UV planes. Scaled, a
sample can land right on a texel edge, where the plane's anchor decides the
side: Tokiden's (NPJH50878) 480x33 bar over 280x20 texels took the row
above in its second triangle (gpu/probe exp167). 1:1 samples are half a
texel from any edge.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-02 15:09:43 -06:00
Henrik RydgårdandClaude Opus 5.5 d1b4f435d4 SoftGPU: Don't join bilinear-filtered through-mode sprites
The GE sets up UV planes per sprite, and their gradient is only exact for a
power of two area, so a 49 wide 1:1 sprite samples just below the texel
centers while the 128 wide sprite it was joined into hit them (gpu/probe
exp163, the ULJM05302 track map). Nearest sampling picks the same texels
either way.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-02 15:09:43 -06:00
Henrik RydgårdandClaude Opus 5.5 e03f6b80cd SoftGPU: Keep textured rectangles as triangles unless they'd match
Each triangle of a quad has its own UV planes, which a sprite built from the
corners doesn't reproduce. Textured triangle rectangles now only become
sprites in through mode with nearest filtering. Gears of Destiny's text boxes
become bit exact against the PSP, and no dump compared gets worse.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-02 15:09:42 -06:00
Henrik RydgårdandClaude Opus 5.5 01c879be14 SoftGPU: Only take the 1:1 sprite shortcut with nearest filtering
DrawSprite samples texel centers, but the GE's sprite UV planes usually land
slightly off them, which bilinear filtering shows: on most sprite sizes every
pixel blends its neighbors (gpu/probe exp87). Bilinear sprites now go through
the plane path. Gallery Fake's dump becomes bit exact.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-02 15:09:42 -06:00
Henrik RydgårdandClaude Opus 5.5 497f5628fd SoftGPU: Keep rectangles as triangles where sprite coverage differs
Strips, fans and triangle pairs that form rectangles are drawn as sprites,
but a sprite's first column is (x + 6) >> 4 and a triangle's (x + 7) >> 4.
For a left edge 9/16 into a pixel, draw them as triangles (NBA 2K13's menu
boxes, now 99.99% exact against the PSP).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-02 15:09:42 -06:00
Henrik RydgårdandClaude Opus 5.5 f651a0abf8 SoftGPU: Don't skip color doubling in the sprite fast path
A white vertex color still gets doubled, and so does replace. Found with
gpu/probe exp53.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-02 15:09:42 -06:00
Henrik RydgårdandClaude Opus 5.5 70d138804f SoftGPU: Take the 1:1 sprite fast path's texels at pixel centers
The GE samples a pixel's texture coordinates at its center, so a 1:1 sprite
starting at u0 shows texel floor(u0 + 0.5) first (floor(u0 - 0.5) when
mirrored). The fast path truncated u0, half a texel off for fractional UVs.
Measured with gpu/probe; integer UVs are unaffected.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-02 15:09:42 -06:00
Henrik RydgårdandClaude Opus 5.5 9d3022642b SoftGPU: Fix bin queue bookkeeping and dependency tracking
- Flush() on an empty queue now trims the state and CLUT rings, since its
  callers flush because one is full and push right after.
- BinQueue::Full() uses >=, so an overshoot can't go unnoticed.
- IsExactSelfRender compares against the target the queued draws were
  binned for, not gstate, which already has the next one during a flush.
- A depth test without depth writes marks the depth buffer as read.
- The DarkStalkers untextured sprite recomputes the binner state around it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-29 13:16:40 -06:00
sum2012 5954db188e Remove 2 cases for fast path for soft gpu by Deekseek
Fix #21363
https://chat.deepseek.com/share/980xe4c2ue35te8cy2
Performance impact is minimal because sprites that require depth/fog are relatively rare, and the fallback still uses the per-pixel rectangle loop (not the full triangle rasterizer)
2026-05-07 00:26:06 +08:00
Henrik Rydgård 3e62157487 Fix some assorted static analysis warnings 2025-08-25 10:14:15 +02:00
Henrik Rydgård 2e0ca023ae Build warning fixes 2025-04-17 11:05:52 +02:00
Henrik Rydgård 5326d87f9c Rename CrossSIMD to SIMDHeader, but also keep CrossSIMD.h (will have a future use) 2024-12-19 15:15:43 +01:00
Henrik Rydgård 3e198c53b2 More include cleanup 2024-12-18 13:57:26 +01:00
Henrik Rydgård 3af961f3ba Revert DrawPixel changes 2023-04-02 16:41:29 +02:00
Герман Семенов 122b63b9a8 GPU: using if constexpr C++17 optimization 2023-04-02 16:36:37 +02:00
Unknown W. Brackets a88b8a14f6 softgpu: Fix over-optimization of alpha test.
When alpha blend is off, was previously skipping the alpha test if only it
was enabled.  See #17213.
2023-03-31 23:53:37 -07:00
Unknown W. Brackets 2c5b0999e8 softgpu: Make debug-only optim more consistent.
Of course it doesn't matter when optimizations are enabled in any compiler
that can build PPSSPP...
2023-03-31 23:52:23 -07:00
Henrik Rydgård ee3618290b Typo fix in NEON code.
Fixes #16772
2023-01-10 12:32:33 +01:00
Unknown W. Brackets 62fe03dcb4 softgpu: Use NEON for texture blending. 2023-01-07 19:06:35 -08:00
Unknown W. Brackets 587a322207 softgpu: Use NEON SIMD for alpha blending, etc. 2023-01-07 19:06:34 -08:00
Unknown W. Brackets 49f6c461ad Reporting: Fix some header includes.
Particularly in Common, avoid including Core/Reporting.h.
2022-12-27 14:58:20 -08:00
Unknown W. Brackets 77c98441f4 softgpu: Expand fast path to all fb formats.
This should speed up 2D games not using 5551, and make it mroe likely any
regression is caught for Darkstalkers.
2022-12-06 18:43:21 -08:00
Henrik Rydgård 49f8f96a98 Couple more microoptimizations 2022-12-07 02:08:48 +01:00
Henrik Rydgård 50fdf67fd0 Software rect raster: Speed up memory tracking in debug mode (ztag unused, remove allocations) 2022-12-07 01:51:20 +01:00
Henrik Rydgård b51422c18b Ordering fix, should fix elimination of the DarkStalkers software blit 2022-12-07 01:50:48 +01:00
Henrik Rydgård 70b6733d0a Minor alpha bit optimization in Darkstalkers rectangle code 2022-12-07 01:50:29 +01:00
Unknown W. Brackets 51fa931e46 softgpu: Allow no alpha blend in 5551 fast path. 2022-12-06 06:37:51 -08:00
Unknown W. Brackets 60c129c52f softgpu: Use no-modulate fast path for REPLACE. 2022-12-06 06:31:30 -08:00
Unknown W. Brackets c291bd78ef softgpu: Use a template for 5551 fast path.
Just refactoring here, should be the same.
2022-12-06 06:29:19 -08:00
Unknown W. Brackets 264a81913d softgpu: Avoid checking UVs for sprites w/o tex. 2022-12-06 06:11:38 -08:00
Unknown W. Brackets 5d6b213fa7 softgpu: Avoid tri combine to rect if clipping. 2022-12-05 23:24:26 -08:00
Unknown W. Brackets d9501cb0ad softgpu: Fix w culling of triangle rects. 2022-12-05 23:09:55 -08: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
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 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 1931fa2f5f softgpu: Make triangle fan rect detection generic. 2022-10-16 16:01:09 -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 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 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 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 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 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
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 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 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 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