Commit graph

497 commits

Author SHA1 Message Date
Henrik Rydgård
8ce7982d8b Increase the bad texture size threshold.
Fixes #19116
2024-05-10 13:58:03 +02:00
Henrik Rydgård
768520dd0e Separate out the checks for save vs replace textures more, fixing some issues 2024-01-23 01:07:31 +01:00
Henrik Rydgård
103d8b1019 Don't apply smart 2d texture filter to video. 2024-01-18 23:38:44 +01:00
Henrik Rydgård
09d8bc5c43 Don't override "Linear"-forced texture filtering 2024-01-11 12:56:03 +01:00
Henrik Rydgård
341fe04f4b Apply nearest filter for pixel-mapped draws 2024-01-11 12:56:03 +01:00
Herman Semenov
ca94de8d4b [GPU/Common/DX9/GLES/Software] Object out of scope optimization for better codegeneration (lower level scope) 2023-12-20 12:34:34 +03:00
Henrik Rydgård
a8b8e44de1 Increase texture size limit to 1024. It's actually used by FF3. 2023-12-13 22:18:54 +01:00
Henrik Rydgård
3902c85f7f Enable texture replacement filtering overrides even if file is missing 2023-12-11 20:20:35 +01:00
Henrik Rydgård
8dab823936
Merge pull request #18484 from hrydgard/mlb-fix
Fix frozen pitch meters in MLB series games - we were not hashing enough texture data
2023-12-07 12:12:35 +01:00
Henrik Rydgård
443a882041 Fix the size calculation when hashing small swizzled textures 2023-12-07 10:45:31 +01:00
Henrik Rydgård
36a2174ac0 Vulkan: Add indicator of swizzle mode to texture debug names 2023-12-07 10:35:04 +01:00
Henrik Rydgård
7bf8023dce Don't do the texture size check for the built-in font texture.
Fixes #18483
Fixes #18479
2023-12-07 09:01:24 +01:00
Henrik Rydgård
5373b8c5b3 Fix double-free problem in "low-memory" texture fallback (Vulkan) 2023-12-04 19:47:20 +01:00
Henrik Rydgård
d9365a6df1 FramebufferCopy: New framebuffer candidate sorting, similar to block transfer detection.
The previous attempt was simply flawed.
2023-12-01 00:10:16 +01:00
Henrik Rydgård
69b43ab734 Extend the Test Drive color ramp smoother to detect up to 3 ramps in a texture.
Note that we also offset the lookup slightly to miss the wrap-around
points. The existing 31 scale factor instead of 32, together with that
half-texel, are enough to avoid that problem.

Fixes #18300
2023-10-03 23:30:18 +02:00
Unknown W. Brackets
3c7b05c3e8 PPGe: Use texture windows for atlas text.
This makes it software rendering, which correctly applies clamp/wrap
limits at 512x512, still has readable text.  Other textures may still be
wrong.
2023-09-10 23:54:55 -07:00
Henrik Rydgård
05d8752a64 Vulkan: Correct the calculation for max possible mip levels 2023-09-07 15:20:16 +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
62c9041060
Merge pull request #18011 from hrydgard/collapse-degenerate-volume-textures
Detect the simplest Tactics Ogre case (US/EU) early
2023-08-31 08:45:11 +02:00
Henrik Rydgård
7e0e9a6d2b Shrink TexCacheEntry by 4 bytes and clean up a naming issue
Was a little confused by the "/2". It's not really useful to cache this
value anyway.
2023-08-30 16:37:38 +02:00
Henrik Rydgård
0d0c11a1ed Remove unnecessary check, add comment. 2023-08-30 10:29:14 +02:00
Henrik Rydgård
30a165b1dd Detect the simplest Tactics Ogre case (US/EU) early
Removes the need for the compat.ini flag for these versions, since we
can just treat the texture exactly as a regular 2D texture.
2023-08-30 10:27:19 +02:00
Henrik Rydgård
de679e2761 Generalize the odd/even mip level check 2023-08-29 10:44:18 +02:00
Henrik Rydgård
0cdfaffb48 Enable the FakeMipmapChange flag for US/EU Tactics Ogre, fixing replacement problem.
For correct lookups, without our texture replacement actually supporting
volume textures, we need to use this mechanism here too.

The game actually uses two mipmaps, but they're identical and point to
the same memory, so we treat them as a regular 2D texture instead for
purposes of both texturing and replacement. This is presumably legacy
from the initial Japanese version that needs to use multiple texture
layers. Similarly it does in in pairs.

This does actually not fully fix texture replacement for the Japanese
version, unfortunately. For that we need more proper support for these
weird textures in the texture replacement code - when I refactored it
before for more natural handling of regular mipmapping, this kinda got
lost.
2023-08-28 20:58:57 +02:00
Henrik Rydgård
5c42aa07fc Minor log improvement 2023-08-28 16:11:47 +02:00
Henrik Rydgård
a529a9c408 Improve the logging in the CLUT load path 2023-08-28 14:39:24 +02:00
Henrik Rydgård
16d073c4ad Add compat flag to not load CLUTs from old framebuffers 2023-08-24 10:30:37 +02:00
Henrik Rydgård
714558853c Enable anisotropic filtering for replacement textures with mipmaps 2023-08-18 15:21:07 +02:00
Henrik Rydgård
a32249a3cf Move DebugOverlay rendering to the overlay screen, allowing drawing it on top of the menu 2023-08-03 16:19:18 +02:00
Henrik Rydgård
fc6879674e Refactor overlays into an enum 2023-08-02 13:03:04 +02:00
Henrik Rydgård
def09bf575 Update the uvscale uniform a bit more conservatively on framebuffer changes
Plus fixes a few minor oversights

Fixes #17581 and possibly #17522
2023-06-15 11:57:30 +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
bdd0eeb7c3 Avoid double texture cache load.
Texture packs are loaded from NotifyConfigChanged which is called
anyway.

Fixes #17381
2023-05-01 23:52:39 +02:00
Henrik Rydgård
484f2c5954 Fix texcoord issue with SOCOM post effect 2023-04-25 23:02:12 +02:00
Henrik Rydgård
9a3ff69091 Workaround for some SOCOM game's misuse of CLUT8 textures.
Emulating this correctly would be possible too but would only work at 1x
rendering resolution.
2023-04-17 09:34:26 +02:00
Henrik Rydgård
b90833a462 OpenGL texture filtering: enforce key.mipEnable when we're forcing mips.
Fixes #17268, but I feel we could possibly get rid of the bool entirely
since we have maxlevel. Only GL and D3D even looks at this flag.

Oh well, that's for later.
2023-04-14 14:36:07 +02:00
Герман Семенов
122b63b9a8 GPU: using if constexpr C++17 optimization 2023-04-02 16:36:37 +02:00
Henrik Rydgård
5332850b00 More accurate check for LoadCLUT from framebuffer margins.
Fixes #16819
2023-03-31 21:24:21 +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
f5e8d39e42 Force mipmapping on when drawing using replacement textures that contain mipmaps. 2023-03-18 15:01:53 +01:00
Henrik Rydgård
3302e6a76b Lookup filtering overrides at texture load time instead of at runtime. 2023-03-18 13:03:05 +01:00
Henrik Rydgård
9a228b1f23 Avoid calling FindReplacement unnecessarily. 2023-03-18 12:03:32 +01:00
Henrik Rydgård
97c9b9e4f7 Break out PollReplacement from TextureCacheCommon::FindReplacement 2023-03-18 12:01:24 +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
1b0d5ec3aa Remove a unused state from ReplacedTexture, rename POPULATED to UNLOADED 2023-03-17 00:52:38 +01:00
Henrik Rydgård
35f46ec161 Rework the replacement cache. No more duplicate ReplacedTexture objects. 2023-03-16 11:46:05 +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
21a0a91818 Remove a misplaced ForgetLastTexture.
Fixes #17115
2023-03-14 15:49:35 +01:00