Commit graph

8398 commits

Author SHA1 Message Date
Unknown W. Brackets
400f6abf9a softgpu: Optimize lookup of last jit func.
This is common (for example, maybe a pixel state is updated but sampler is
not), and reduces time spent in ComputeRasterizerState() quite a bit in
Darkstalkers, where jits are available (i.e. Intel currently.)
2022-12-06 19:16:19 -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
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
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
Henrik Rydgård
e44e9b651f
Merge pull request #16503 from unknownbrackets/softgpu-halfpos
softgpu: Fix double rectangle drawing at halfpixel
2022-12-05 09:34:33 +01:00
Unknown W. Brackets
77e510bd90 GPU: Use accurate depth for depth range hack.
This should be easier to ensure stays well tested.
2022-12-04 19:27:23 -08: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
Lubos
d0e6f480a9 Merge branch 'master' into config_openxr_update 2022-12-04 18:04:08 +01:00
Henrik Rydgård
5de3a7c252
Merge pull request #16500 from unknownbrackets/warnings
Fixes to recently introduced warnings and a couple older ones
2022-12-04 17:40:30 +01:00
Unknown W. Brackets
3342d5ecb3 softgpu: Remove an unused case. 2022-12-04 08:17:05 -08:00
Unknown W. Brackets
8c378c4557 GPU: Avoid an override warning. 2022-12-04 07:57:45 -08:00
Henrik Rydgård
a8939f456a Remove dead code, validation fix in GE debugger
See #16490
2022-12-04 00:49:48 +01:00
Unknown W. Brackets
59431de823
Merge pull request #16494 from hrydgard/force-lower-res-for-effects-off
Force "Lower resolution for effects" off in Ratchet & Clank and a few other games
2022-12-03 15:25:57 -08:00
Henrik Rydgård
7e97ce1760
Merge pull request #16495 from unknownbrackets/vulkan-shutdown
Cleanup shader module lifetime handling for Vulkan
2022-12-04 00:16:58 +01:00
Unknown W. Brackets
78ed8d45a7 Vulkan: Defer deletion of shader module promises. 2022-12-03 14:53:10 -08:00
Unknown W. Brackets
53eedf06e3 Vulkan: Track pipeline desc using a refcount.
Not very safe to not allow deletes, and don't want to force Draw objects
on the deleter (this is referenced by them.)
2022-12-03 14:52:06 -08:00
Henrik Rydgård
8567416be6 Force "Lower resolution for effects" off in Ratchet & Clank and a few other games
It breaks or just makes things look terrible in these games, so no
reason to allow it.

An alternative for this would be to remove the option entirely, and only
use it though the ForceLowerResolutionForEffectsOn flag instead.
2022-12-03 23:35:54 +01:00
Henrik Rydgård
c310d1471e
Merge pull request #16493 from unknownbrackets/softgpu-opt
softgpu: Check CLUT alpha to optimize out blend/alpha test
2022-12-03 22:55:53 +01: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
0aba5ff3c1 TexCache: Correct alpha mask checks for SSE2.
Should have been shifts by byte (4/8), but let's just switch to shuffles
anyway.  These were always shifting in zeros and failing.
2022-12-03 12:38:01 -08:00
Unknown W. Brackets
38eb0a7a82 softgpu: Check for queued compile.
Rarely, we could have queued compiling the same one, which would crash on
a double insert.
2022-12-03 12:15:58 -08:00
Henrik Rydgård
6acbd1f9e3 Fix loading of texture shaders 2022-12-03 20:37:58 +01:00
Henrik Rydgård
f3ba8fb334 Address feedback, also sort texture shaders 2022-12-03 19:30:50 +01:00
Henrik Rydgård
f5c0dc717a Sort post-shaders alphabetically in the list. 2022-12-03 18:58:47 +01:00
Henrik Rydgård
238c9439e3
Merge pull request #16491 from unknownbrackets/cleanup
Quick cleanup
2022-12-03 16:38:32 +01:00
Unknown W. Brackets
e50eae1bfb GPU: Cleanup some bounds checks, assignments. 2022-12-03 07:17:12 -08:00
Henrik Rydgård
0f12d44e59 Remove some unused/unnecessary code 2022-12-03 12:05:10 +01:00
Henrik Rydgård
92df6b832c Safer and simpler alternative to cbfa4bf.
See #16483
2022-12-03 12:05:08 +01:00
Henrik Rydgård
02b8bf33fb
Merge pull request #16458 from hrydgard/desktop-friendly-msaa
Implement MSAA support for desktop GPUs in Vulkan
2022-12-03 11:22:41 +01:00
Henrik Rydgård
4589473231
Merge pull request #16486 from unknownbrackets/softgpu-opt
softgpu: Apply optimizations to states generically
2022-12-03 11:08:10 +01:00
Henrik Rydgård
d6b9f39215
Merge pull request #16483 from lvonasek/hotfix_simpsons_crash
Simpsons crash on GLES fixed
2022-12-03 10:40:02 +01: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