Commit Graph

1524 Commits

Author SHA1 Message Date
Henrik Rydgård
3d949b080d Prepare VulkanDescSetPool for block allocation 2023-10-10 09:14:10 +02:00
Henrik Rydgård
9c1c09ff5c Remove commented out code 2023-10-10 09:02:35 +02:00
Henrik Rydgård
ba4d1668ce Don't forget to update descCount in tess mode 2023-10-10 09:02:35 +02:00
Henrik Rydgård
af47ad035d Also use the new descriptor mechanism for in-game 2023-10-10 09:00:29 +02:00
Henrik Rydgård
ced821169e Bump shader cache versions 2023-10-09 19:39:25 +02:00
Henrik Rydgård
bb38210cfb We somehow lost the usage_ counter increment in VulkanDescSetPool, fix that 2023-10-09 17:01:35 +02:00
Henrik Rydgård
a780d02c07 Minor reordering 2023-10-09 11:54:15 +02:00
Henrik Rydgård
316bc03ac9 Move the destroy function for VKRPipelineLayout to VulkanRenderManager 2023-10-09 11:54:13 +02:00
Henrik Rydgård
ae58fe3828 In GL and Vulkan soft-skin, we might not be fully done decoding when we reach flush. Take that into account. 2023-10-08 16:51:58 +02:00
Henrik Rydgård
c73e2351de Add checks for unused topology values when loading pipeline caches. 2023-10-08 13:39:04 +02:00
Henrik Rydgård
28ed12aa93 Simplify descriptor pool creation 2023-10-08 12:39:19 +02:00
Henrik Rydgård
b82a34539d Same as last commit, but in DrawEngineVulkan. 2023-10-08 12:39:19 +02:00
Henrik Rydgård
dbe395dd00 Add a wrapper around VKRPipelineLayout / descsetlayout 2023-10-08 12:39:18 +02:00
Henrik Rydgård
34fbbf2c2a Split out the descriptorset pool from VulkanMemory.cpp/h 2023-10-08 11:45:00 +02:00
Henrik Rydgård
10ccbfd68c Unify the clearing of variables after a draw call 2023-10-06 15:39:59 +02:00
Henrik Rydgård
d4703e9534 Decoded position format is always the same 2023-10-06 15:39:58 +02:00
Henrik Rydgård
e63bb0459c Add a new stat, so we can see per game if the optimization has an effect 2023-10-03 11:01:37 +02:00
Henrik Rydgård
92ffef2626 Remove some state from IndexGenerator, fix bugs. Mostly works except vertex cache. 2023-10-03 11:01:37 +02:00
Henrik Rydgård
9b411af1f5 It's running. 2023-10-03 11:01:37 +02:00
Henrik Rydgård
fb4a1fb7dd Simplify disk-cache-load on GLES as well, for the same reasons as #18216 2023-09-30 13:45:13 +02:00
Henrik Rydgård
abbd1c83bd Revert "Merge pull request #18184 from hrydgard/expand-lines-mem-fix"
This reverts commit 65b995ac6c, reversing
changes made to 01c3c3638f.
2023-09-27 20:04:37 +02:00
Henrik Rydgård
48d3efc473 Bump shader cache versions again, just because. 2023-09-27 17:38:15 +02:00
Henrik Rydgård
f2cfbe1bcf Vulkan: Add the same shutdown logic to stop async shader compiles to DeviceLost 2023-09-26 01:28:59 +02:00
Henrik Rydgård
01035f48a4 Fix for crash when changing backends in-game 2023-09-26 00:13:53 +02:00
Henrik Rydgård
6e303e8f1d Vulkan: Simplify GetShaders and DirtyLastShader, making them internally consistent. 2023-09-24 11:55:15 +02:00
Henrik Rydgård
d31ba393af Don't load the shader cache on a separate thread - all it does is already async 2023-09-24 10:53:23 +02:00
Henrik Rydgård
964f606a9c Fix some issues around geometry shaders - like, loading them from shader cache while disabled 2023-09-24 01:29:38 +02:00
Henrik Rydgård
dbd3045f87 Join the shader cache load thread on exit 2023-09-24 01:07:08 +02:00
Henrik Rydgård
9a515c851f Vulkan: Extend the cacheLock usage in GetShaders (was unsafe, though mildly) 2023-09-24 00:58:45 +02:00
Henrik Rydgård
6a8f65b566 Some assert paranoia, remove unused "failed_" variable 2023-09-23 10:09:32 +02:00
Henrik Rydgård
1aab1c4b09 Be a bit smarter when loading the shader cache, avoid duplicating work 2023-09-21 10:44:04 +02:00
Henrik Rydgård
2e171b22ec Vulkan: Remove an assert that didn't give much actionable information. Replace with reporting. 2023-09-20 22:50:38 +02:00
Henrik Rydgård
65b995ac6c
Merge pull request #18184 from hrydgard/expand-lines-mem-fix
Add memory bounds-check when expanding points, rects and lines to triangles
2023-09-20 20:39:16 +02:00
Henrik Rydgård
966144fa64 Bounds check writing to the index buffer when expanding lines/rects/points 2023-09-20 19:26:36 +02:00
Henrik Rydgård
3f2ef508c9 Make it easier to reason about space in the inds buffer by moving an offset instead of the pointer. 2023-09-20 19:23:24 +02:00
Henrik Rydgård
3783afd855 Fix a really bad race condition during game shutdown. 2023-09-20 18:47:32 +02:00
Henrik Rydgård
5c94b41dde Vulkan: If a createimageview failed, don't leak the image. Probably very rare. 2023-09-20 18:47:32 +02:00
Henrik Rydgård
0bfd166200 Try to prevent a weird shutdown race condition that I'm not sure can happen - but crash logs show it 2023-09-18 16:45:07 +02:00
Henrik Rydgård
f4b0cddda3 ShaderId: Safer way to check for backend. 2023-09-18 16:25:00 +02:00
Henrik Rydgård
b7d28cd10a Remove redundant fail state. Bail from shader cache load if a fragment shader fails to generate, too. 2023-09-18 14:38:22 +02:00
Henrik Rydgård
447b28d277 Vulkan DrawEngine: Reset bound secondary texture on clear.
Fixes a validation error hit in Beats
2023-09-12 17:15:26 +02:00
Henrik Rydgård
97404354ef More asserts and checks in pipeline manager 2023-09-11 17:38:17 +02:00
Henrik Rydgård
052747aa30 Add reporting of GLSL shader gen errors 2023-09-11 15:37:35 +02:00
Henrik Rydgård
10f93875c6 Fix the semantics of DenseHashMap to be consistent even when inserting nulls 2023-09-11 12:07:18 +02:00
Henrik Rydgård
162b363063 Bump shader cache version, just because. 2023-09-09 15:13:52 +02:00
Henrik Rydgård
f70d233511 Vulkan: Fix ordering issue in tex loading - decided on color swizzle too early 2023-09-06 22:48:11 +02:00
Henrik Rydgård
0aa67e5276 Add some texture loading safety checks
I hit a spurious, non-reproducible debug assert in Archer McLean's Mercury.
Just want to rule out some bad code paths.
2023-09-06 15:38:47 +02:00
Henrik Rydgård
a5117249bd Add a debug assert during texture loading. 2023-08-29 23:15:30 +02:00
Henrik Rydgård
8a6e288fcc Add checkboxes in developer tools to allow disabling ubershaders.
Might be helpful to diagnose performance problems on user devices.

Additionally, moves the texture replacement controls to the top. They
should probably be moved somewhere else entirely...

See #17918
2023-08-17 20:16:04 +02:00
Henrik Rydgård
ff6e118fff Get rid of a lot of ifdefs around presentation mode. Instead, set things dynamically. 2023-08-14 11:02:29 +02:00
Henrik Rydgård
be63ce3a4a Minor refactor allowing getting the GPU profile string outside games 2023-08-03 16:31:20 +02:00
Henrik Rydgård
eb21a2e6c9 Break out the OSD data holder from Common/System/System.h, into OSD.cpp/h 2023-06-30 17:15:49 +02:00
Henrik Rydgård
7cc8c6cea4 OSD: Add semantics, move the the OSD state to common (while keeping the renderer in the UI). 2023-06-20 14:40:46 +02:00
Henrik Rydgård
6d8069dfd1 Vulkan: Remove the remains of the input attachment experiment
Haven't been using these for a while.

I've come to the conclusion here that I think it's better to try to
deal with the issues using safe workarounds like copies, instead of
relying on features with somewhat iffy driver support that are not
universal across APIs anyway.
2023-06-13 20:46:27 +02:00
Henrik Rydgård
f5516d3248 Actually switch away from XXH to a custom hash, to de-risk 2023-06-12 14:24:20 +02:00
Henrik Rydgård
2f90ec6093 Breakout the vertex caching (just code cleanup) 2023-06-12 13:16:14 +02:00
Henrik Rydgård
d90671e877 Add some comments. 2023-06-12 13:16:13 +02:00
Henrik Rydgård
186b0f105c Simplify the vertex cache ID handling 2023-06-12 13:16:13 +02:00
Henrik Rydgård
f54f905be5 Vulkan: Remove support for other index types than 16-bit.
We don't have any use for them anyway.
2023-05-30 10:15:34 +02:00
Henrik Rydgård
80e47b7bd3 Only dirty the uniform UVSCALEOFFSET when really needed
Broken out from #17479

With OpenGL, greatly reduces the amount of glUniform4fv calls in many games (and
similar in the other backends).
2023-05-25 15:00:57 +02:00
Henrik Rydgård
72cf531759 Bump shader cache version 2023-05-25 10:19:01 +02:00
Henrik Rydgård
7178c0cd42 Restore fragmentshader ID flags double and texalpha. Add a ubershader mode that uses dynamic state. 2023-05-25 10:19:01 +02:00
Henrik Rydgård
dfb446f89d Allow other backends than Vulkan to have GPU memory stats. Implement for GL. 2023-05-24 14:33:01 +02:00
Henrik Rydgård
f16f879b41 Some renaming to follow the standard of appending _ to member vars 2023-05-23 18:00:50 +02:00
Henrik Rydgård
d51d1413a3 DrawEngineCommon: Rename decoded to decoded_ 2023-05-23 16:46:43 +02:00
Henrik Rydgård
a4baed4c0c Minor GLPushBuffer cleanup (now same API as the VK one) 2023-05-23 08:41:09 +02:00
Henrik Rydgård
05b6bbdc56 Add a trivial profiling tool to the OpenGL backend - meaasure the time it takes to run a frame of commands.
Accessed from the in-game dev menu just like the Vulkan frame profiler.

With this we can easily see that actually submitting the GL commands is often the bottleneck on old
devices like a Galaxy S3.
2023-05-17 14:38:11 +02:00
Henrik Rydgård
9512bc6174 Don't cache render target copies for shader blending, only cache copies for overlap
Fixes #17451, while also keeping the Dante performance fix from #17032.

Of course, it's possible that something else could slow down now... But
hopefully not. This could also fix other problems.
2023-05-11 12:04:29 +02:00
Henrik Rydgård
b42670cf59 Manually revert the rest of the lmode optimization 2023-05-09 18:44:24 +02:00
Henrik Rydgård
f42c682d34 Revert "Merge pull request #16628 from hrydgard/remove-fog-fshader-flag"
This reverts commit 10dee90c83, reversing
changes made to 34c11c8acf.
2023-05-08 22:01:38 +02:00
Henrik Rydgård
14887d6b04 Bump shader cache version (should have done it in the release) 2023-05-06 16:15:32 +02:00
Henrik Rydgård
d56e27aa2c Let's have DispatchFlush check for drawcalls before calling DoFlush, too. 2023-05-03 23:49:41 +02:00
Henrik Rydgård
c9b7c815a1 ~GPU_Vulkan: Check that we still have a draw_ pointer before trying to drain the compile queue. 2023-05-03 22:33:34 +02:00
Henrik Rydgård
2cca0b265e Vulkan: Turn off the ubershader on T880, T860 and T830 on old driver versions. 2023-05-03 11:53:32 +02:00
Henrik Rydgård
97488c0a79 Vulkan: Before cleaning the shader managers, drain the shader compile queue.
Mainly paranoia, but might help with the mutex crash from #17364
2023-05-02 22:05:28 +02:00
Henrik Rydgård
16b243b007 Centralize allocation of vertex decode buffers 2023-04-24 12:11:58 +02:00
Henrik Rydgård
ccab375ddb
Merge pull request #17246 from hrydgard/i18n-indexing
I18N: Switch to getting categories by index instead of by string lookup
2023-04-08 09:20:51 +02:00
Henrik Rydgård
3616e0fb3c Revert "Turn off light ubershader generation on Broadcom GPUs."
See #16824

This reverts commit 1374fb040c.
2023-04-07 16:43:50 +02:00
Henrik Rydgård
ee6234ecb6 I18N: Switch to getting categories by index instead of by string lookup
Also gets rid of the shared_ptr usage, and generally makes things nicer.

Needed for later config refactorings, good to get in early.
2023-04-07 10:35:01 +02:00
Henrik Rydgård
3a69569580 Don't use inaccurate depth with Vulkan on any GPU except some special-cased Mali drivers.
Fixes #17044
2023-04-03 22:36:13 +02:00
Henrik Rydgård
1374fb040c Turn off light ubershader generation on Broadcom GPUs.
Attempt at working around #16824
2023-04-02 17:39:28 +02:00
Henrik Rydgård
5e6d181eb6 Vulkan: Disable framebuffer fetch (through input attachments) for now.
This is a conceptually cool trick that just doesn't seem to be worth
it, compared to the old approach of copy + blend-in-shader. I haven't
found any game that benefits more than absolutely minimally, and having
two paths to test isn't great, when the win is so small.

So I'm disabling it. I'm keeping the code for now, but might clear it
out later.

Fixes #17069
2023-04-01 23:07:32 +02:00
Henrik Rydgård
4e41233bb7 Replacement: Save textures even if already replaced, if the png is missing.
Fixes #17182

Not exactly sure what behavior we really want, but I think this one is
OK, and at least more similar to the old one. Now we save
already-replaced textures if the named replacement texture is missing, and there
isn't already a hash-named one in new or the "root".
2023-03-27 15:43:18 +02:00
Henrik Rydgård
b13c5c2d1b Add compat setting to force using maximum depth resolution
Fixes #17014

Even if our depth-testing-equal heuristic believes that the game needs
lower depth resolution.

This removes some depth-fighting artifacts (that are present on the real
PSP, but nice to avoid) in Outrun, Split/Second and Cars: Race-o-Rama -
essentially reverting these to the behavior we had before the heuristic.

(The heuristic is good though - it means less compat.ini hacks going in
the other direction).

In the case of Outrun, this relies on two passes that pass exactly the
same vertex coordinates twice resulting in the exact same final
geometry. This is actually guaranteed by the spec if the vertex math is
exactly the same and "invariant" is set on the position output, though
I guess you never know.. Haven't seen any issues at least.

Also sneak in disabling some validation messages from using extra Vulkan
validation layers other than the default.
2023-03-26 00:27:58 +01:00
Henrik Rydgård
d586ec0d5e Don't create Host objects except in headless/unittest 2023-03-25 10:47:01 +01:00
Henrik Rydgård
9e125eeba7 Remove NotifyUserMessage from Host 2023-03-25 10:32:09 +01:00
Henrik Rydgård
75bcb9b10c Some renaming, flag updates 2023-03-18 11:46:22 +01:00
Henrik Rydgård
5f76fbe1ad Implement padding-on-copy for compressed textures as well. 2023-03-17 14:00:14 +01:00
Henrik Rydgård
cf6cce0744 Remove scaleFactor from struct ReplacedTextureDecodeInfo, instead pass in both unscaled and scaled dimensions 2023-03-16 10:21:57 +01:00
Henrik Rydgård
f2a5a5abe7 Avoid input/output arguments in the texture scaler too 2023-03-16 10:14:41 +01:00
Henrik Rydgård
87a16b0386 Fix the stats 2023-03-15 10:19:00 +01:00
Henrik Rydgård
089b63c22f Address feedback, except the stats. 2023-03-15 10:09:39 +01:00
Henrik Rydgård
2ac74e3d37 Remove the PushBufferType enum 2023-03-15 09:59:00 +01:00
Henrik Rydgård
181ddf8266 Change the API of the old VulkanPushBuffer to match VulkanPushPool. 2023-03-15 09:56:32 +01:00
Henrik Rydgård
6d3a25e81f Tweak some sizes. 2023-03-15 01:25:03 +01:00
Henrik Rydgård
c8b25e50b0 Better debug vis for push pools 2023-03-15 01:25:03 +01:00
Henrik Rydgård
9fcd6d6612 Use thin3d's push pool in the draw engine too. 2023-03-15 01:25:03 +01:00
Henrik Rydgård
700b1cd6a7 More conversion to pushPool 2023-03-15 01:25:03 +01:00
Henrik Rydgård
3d372400e1 Start converting over to it 2023-03-15 01:25:03 +01:00
Henrik Rydgård
56d792f422 Sketch the new VulkanPushPool 2023-03-15 01:25:00 +01:00