Henrik Rydgård
ffb8a9be47
Fix another subtle NEON type mismatch.
...
Fixes #16777
2023-01-10 14:56:30 +01:00
Unknown W. Brackets
e0ed080d8b
softgpu: Use NEON more in triangle rasterization.
...
Some of these places weren't getting converted well.
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
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
Henrik Rydgård
e969f9cf8b
Merge pull request #16502 from unknownbrackets/softgpu-opt
...
A few more softgpu optimizations for alpha blend/test
2022-12-05 09:35:36 +01:00
Unknown W. Brackets
07c276c32d
softgpu: Fix double rectangle drawing at halfpixel.
...
There seems to be some odd behavior with the X start pos, but at least the
end pos should not be drawn twice when using 0.5 - 0.5.
2022-12-04 17:47: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
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
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
a1f6a40d10
softgpu: Interpolate Z for 3D lines.
...
Important for Me & My Katamari, see #16131 .
2022-12-01 14:39:19 -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
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
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
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
Unknown W. Brackets
9d6de98ed9
softgpu: Correct drawing outside TL of rectangle.
...
If the start coordinate was something like 51.75, we were incorrectly
drawing to 51. This can be seen in the Metal Slug intro (#15755.)
2022-10-16 18:46:38 -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
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
b3c0f177e2
softgpu: Save last tc/normal in vertex reading.
...
Matches PSP behavior, reusing last set values.
2022-09-26 15:11:11 -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
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
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
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
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
b2e6a086dc
softgpu: Reduce size of VertexData texture coords.
...
There's no real benefit to this with only two values.
Not much of a gain perf wise, but still good to transfer less data.
2022-09-12 21:10:46 -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
b90fc7137f
softgpu: Correct accuracy of fog calculation.
...
This matches values from a PSP exactly, with the help of immediate mode
vertex values (since this directly allows specifying the fog factor
without any floating point math.)
2022-09-11 08:24:40 -07:00
Henrik Rydgård
d86127ac5e
Merge pull request #15999 from unknownbrackets/softgpu-texsize
...
softgpu: Clamp/wrap textures at 512 pixels
2022-09-11 10:12:38 +02:00
Unknown W. Brackets
15d5fa48f7
softgpu: Check depth test early on simple stencil.
...
If we don't need to write stencil on sfail/zfail, we can do the depthtest
early, which allows us to more often skip texture sampling.
This gives a good improvement in Chains of Olympus.
2022-09-10 21:24:19 -07:00
Unknown W. Brackets
18c9a4d9c9
GE Debugger: Fix crash stepping with large tex.
...
Some math was overflowing in allocations, and it would allocate zero
bytes. Let's just refuse textures more actively.
2022-09-10 19:31:53 -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
3d52b445f1
softgpu: Restrict CLUT to proper size.
...
We had 15 KB more space than needed before.
2022-08-20 17:36:15 -07:00
Henrik Rydgård
e6403d7157
Split GetPointer into two versions, to help with const correctness
2022-07-24 13:26:19 +02:00
Unknown W. Brackets
7389a36fad
softgpu: Avoid unnecessary clearMode checks.
...
Already baked into the flag.
2022-03-20 12:05:31 -07:00
Unknown W. Brackets
da4b9e82f3
softgpu: Fix build with basic logging.
2022-03-05 00:08:09 -08: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