Commit Graph

48 Commits

Author SHA1 Message Date
Unknown W. Brackets 87fb9eef37 softgpu: Remove std::function usage.
Wanted to avoid coupling these, but don't like the std::function
construct/destructs showing in profiles...
2022-12-06 19:15:57 -08:00
Unknown W. Brackets d6750993d7 softgpu: Force alpha test when it could skip blend.
Blending is slow, and often games do effects like smoke, sun, etc. that
has a lot of zero alpha in them.  Many games do this with alpha testing
off, which is cheap compared to blending.
2022-12-04 16:36:45 -08:00
Unknown W. Brackets 2c90dafe64 softgpu: Force alpha test off in more scenarios.
Since we're already checking the CLUT, we can tell if it doesn't contain
zero alpha, in which case a != 0 test will never fail.  This is actually
pretty common, even when texture alpha is not always FF.
2022-12-04 16:30:12 -08:00
Unknown W. Brackets 00e76b11b6 softgpu: Optimize > non-zero alpha tests as well.
These are fairly common, especially in 3D games.
2022-12-03 12:55:38 -08:00
Unknown W. Brackets eb19e24399 softgpu: Skip non-zero alpha test if impossible. 2022-12-03 12:54:53 -08:00
Unknown W. Brackets adc94b1950 softgpu: Use CLUT to optimize out blending more.
This actually happens relatively often.
2022-12-03 12:44:02 -08:00
Unknown W. Brackets 204789a27f softgpu: Skip fog when no verts have fog. 2022-12-02 21:55:49 -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 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 faa6c2d461 softgpu: Implement triangle texture projection. 2022-09-26 18:12:20 -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 596b07bd2e softgpu: Support fog and color1 on imm verts. 2022-09-18 06:16:26 -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
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
Henrik Rydgård e6403d7157 Split GetPointer into two versions, to help with const correctness 2022-07-24 13:26:19 +02:00
Henrik Rydgård eb765a80f8 Merge pull request #15411 from unknownbrackets/softgpu-range
softgpu: Apply region x2/y2 as a scissor
2022-02-20 21:42:00 +01:00
Unknown W. Brackets 1d0936ea79 Debugger: Improve drawing range in softgpu.
We don't always want all of region, particularly if scissor is a regular
screen size.  This improves debugging in GoW.
2022-02-20 12:21:48 -08: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 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 c0c3f7284a softgpu: Avoid flush texturing from stride.
This generally detects overlap more accurately using a dirty rectangles
approach.  Also detects render to self much more accurately, including
with depth.
2022-01-20 18:39:01 -08:00
Unknown W. Brackets 6896a7a64e softgpu: Use cached state for screen offset. 2022-01-15 18:20:25 -08:00
Unknown W. Brackets bf2e060735 softgpu: Move c++ tex func to sampler.
It's not used anywhere else now.
2022-01-15 15:28:07 -08:00
Unknown W. Brackets a228b2ab6c softgpu: Use cached sampler state outside jit. 2022-01-15 15:26:26 -08:00
Unknown W. Brackets a2abf9402b softgpu: Cache line drawing state. 2022-01-15 13:17:40 -08:00
Unknown W. Brackets 48ef4a18b1 softgpu: Handle scissor/range in BinManager. 2022-01-13 19:07:41 -08:00
Unknown W. Brackets 6839aac109 Debugger: Cache list PC for softgpu tagging.
Still slow, but improved.
2022-01-12 21:23:49 -08:00
Unknown W. Brackets d962fb35d3 softgpu: Centralize more prim drawing state. 2022-01-12 21:23:49 -08:00
Unknown W. Brackets 75ff3e44e6 softgpu: Move texture addresses to prim state. 2022-01-11 00:00:03 -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 496545e55c softgpu: Add code for tracking GPU writes.
Unfortunately, it has a pretty noticeable speed impact, even at the basic
"assume everything's written" level.  Compiled off by default, but at
least it's there.

Doesn't account for tests (i.e. alpha test skipping write) so still not
perfectly accurate.
2022-01-02 08:28:30 -08:00
Unknown W. Brackets 823c4adb15 softgpu: Keep arguments in vectors for sampling. 2021-12-04 15:45:06 -08:00
Unknown W. Brackets 09dc38080a softgpu: Move draw pixel code to separate file.
This separates things better anyway.  No major perf impact.
2021-11-21 08:23:32 -08:00
Unknown W. Brackets f7a31c992d softgpu: Use pixel func ID to draw pixels.
This just reduces reliance on gstate directly, and should help keep things
consistent.
2021-11-20 15:27:04 -08:00
Henrik Rydgård 970adfbcc9 Isolate most of the softgpu specialization code to RasterizerRectangle.
See comments.
2019-10-28 09:33:30 +01:00
Henrik Rydgård 290e9971a7 More specialization work. 2019-10-27 20:54:36 +01:00
Henrik Rydgård c7f6724f7e Detect sprite drawing (1:1 texture mapping), run a simpler function without the triangle state tracking.
This will allow further simplification and specialization.
2019-10-27 20:54:36 +01:00
Unknown W. Brackets ed34cf06b8 SoftGPU: Add a clear mode fast path.
This skips a lot of extra work for clears, which are pretty common.
2017-11-11 21:04:32 -08:00
Unknown W. Brackets eaf3288304 Add debug interface for non-L0 texture preview. 2014-06-15 09:30:37 -07:00
Henrik Rydgård 68b08ffb9f SoftGPU: Quick and dirty lines and points implementation
No line/point texturing support yet.
2013-12-09 12:43:49 +01:00
Unknown W. Brackets b9811c7c97 Use the slow way to get the softgpu texture.
So that it actually shows what the softgpu is using.
2013-10-07 01:26:48 -07:00
Unknown W. Brackets 5c2d418d95 Read softgpu stencil using existing funcs.
Slower but at least it's the same.
2013-10-07 01:02:58 -07:00
Tony Wasserka b22a82d350 softgpu: Optimization, part 2. 2013-08-16 23:49:11 +02:00
Tony Wasserka f270d3bd98 softgpu: Simplify Rasterizer::DrawTriangle by passing individual vertices instead of a vertex array. 2013-08-16 23:49:03 +02:00
Tony Wasserka 7899a9b9c9 softgpu: Texture coordinate support and something like ARGB4444 texture support. 2013-08-16 23:48:55 +02:00
Tony Wasserka 142f2a3688 softgpu: Move triangle rasterization code to a new file. 2013-08-16 23:48:54 +02:00