Commit Graph
147 Commits
Author SHA1 Message Date
Henrik Rydgård 092bbf5eaa Fix saving of textures 2023-03-09 10:51:15 +01:00
Henrik Rydgård 03df5b7831 Fix fileref memory leak 2023-03-09 00:33:37 +01:00
Henrik Rydgård ef14f28099 Fix logspam 2023-03-09 00:26:45 +01:00
Henrik Rydgård 4752e20ad4 Don't reuse the ReplacedTexture struct in "saved cache". 2023-03-09 00:24:30 +01:00
Henrik Rydgård bda09be109 Texture color format doesn't belong as a per-level property, that's not supported.
All levels of a texture must have the same format.
2023-03-09 00:10:46 +01:00
Henrik Rydgård 4ba2001479 Replacer: Make the cache data model texture-centric instead of level-centric 2023-03-09 00:10:46 +01:00
Henrik Rydgård 226197f30f Replace "none_" with nullptr. 2023-03-08 13:17:10 +01:00
Henrik Rydgård 81351056f4 Move file identification to the top of the file 2023-03-08 11:06:29 +01:00
Henrik Rydgård bfddd04c11 Simplify GenerateIni using raw strings 2023-03-08 10:57:44 +01:00
Henrik Rydgård 306fdde9d0 Correct error handling for missing ini (only accept it in directories, not zip) 2023-03-08 09:29:19 +01:00
Henrik Rydgård e277db63c0 Optimize away those extra GetFileInfo, since both backends can get the size during Open efficiently. 2023-03-08 09:11:25 +01:00
Henrik Rydgård ce9000e7e0 Address most of the feedback 2023-03-08 09:04:08 +01:00
Henrik Rydgård 41fcb7a79f Add necessary check 2023-03-08 09:04:08 +01:00
Henrik Rydgård 10ecc4afbd Use the VFS in the replacer to remove duplicated code 2023-03-08 09:04:06 +01:00
Henrik Rydgård c4652d30e2 Address feedback 2023-03-08 08:29:23 +01:00
Henrik Rydgård 76c6058abe Texture replacer: Faster way to get width/height from a png 2023-03-07 22:20:56 +01:00
Henrik Rydgård 3d5526a175 Allow specifying the VFS when loading INI files.
Will be useful in the tex replacer.
2023-03-07 10:04:10 +01:00
Unknown W. Brackets d2d854b8ea Replacement: Fix JNI attach for texture save. 2023-02-02 17:08:24 -08:00
Unknown W. Brackets 88ba003f46 ThreadManager: Add a simple priority field.
Currently, not actually respected.
2023-02-02 17:08:24 -08:00
Unknown W. Brackets 6af6ccc1cf Global: Fix some format warnings. 2023-01-18 21:42:19 -08:00
Henrik Rydgård e1a48d74c4 A bit more GetPointer cleanup.
Probably not worth it for performance reasons, but some semantic cleanup
is good, especially the accidental GetPointer -> writable casts without
using GetPointerWrite.

Using Unchecked on already checked pointers, or when we'd crash anyway
if it returned nullptr, is good for clarity.
2023-01-10 12:13:47 +01:00
Henrik RydgårdandGitHub 71deec1d02 Merge pull request #16685 from unknownbrackets/replace-crash
Replacement: Verify out stride
2022-12-31 16:11:47 +01:00
Unknown W. Brackets 152c82e6d0 Replacement: Verify out stride. 2022-12-31 06:31:45 -08:00
Unknown W. Brackets b1f0c44e8a Replacement: Lock libzip file access.
We can't have two threads seeking on the same fd at the same time.
2022-12-30 20:25:58 -08:00
Unknown W. Brackets 15645ca480 Replacement: Avoid issues with c++14 data(). 2022-10-31 20:17:18 -07:00
Unknown W. Brackets a1a484163f Replacement: Don't double count memory usage. 2022-10-30 10:57:41 -07:00
Unknown W. Brackets c89823ce92 Replacement: Allow use of textures.zip for Android.
Will work on all platforms, but intended for situations like Android where
random access to files on storage is horribly slow.
2022-10-30 10:57:41 -07:00
Unknown W. Brackets b1a087345a Replacement: Lock around shared data access. 2022-10-30 10:39:50 -07:00
Unknown W. Brackets 0048dc2bb8 Replacement: Cache file data across cache keys. 2022-10-30 09:02:08 -07:00
Unknown W. Brackets b78c310b47 Replacement: Log only missing explicit filenames. 2022-10-30 09:02:08 -07:00
Unknown W. Brackets 0db48c956c Replacement: Decimate aggressively with high usage. 2022-10-30 08:15:37 -07:00
Unknown W. Brackets 11d0be1fd2 Replacement: Reduce IO checks on startup. 2022-10-30 07:56:35 -07:00
Unknown W. Brackets e504f0db8f Replacement: Avoid needless exists check per tex. 2022-10-30 07:55:05 -07:00
Unknown W. Brackets cbeb6c1477 Replacement: Fix reload of replaced textures.
Were showing as ready before they were ready after decimate, causing
flickering.
2022-09-01 19:17:04 -07:00
Henrik Rydgård f2e0f7611c Display paths with backslashes on Windows. Show texture path when saving. 2022-09-01 15:04:59 +02:00
Unknown W. Brackets e473eb9f5e Replacement: Read files only within time budget.
When delayed texture load is enabled.  Intended to reduce IO delays on
Android.
2022-08-21 22:07:05 -07:00
Henrik Rydgård d0d53091a8 Change from maxLevel to levelsToLoad, for better readability. Cleanup. 2022-07-30 10:45:02 +02:00
Henrik Rydgård c41b780c8c Remove the ReplacedTextureFormat enum 2022-07-30 08:52:24 +02:00
Henrik Rydgård ef4a6cf873 Remove support for 16-bit replacement texture formats 2022-07-30 08:52:24 +02:00
Unknown W. Brackets 3e0b324e58 Replacement: Cleanup leak on replacement reload.
If it was previously lazy-loaded and purged, we might leak a waitable.
2022-07-27 20:29:24 -07:00
Unknown W. Brackets acc248164f Replacement: Clear cache on disable.
When lazy loading, let's clear cached replacement data on disable.
This is purges memory immediately, and also allows force-reloading
textures by toggling the setting.
2022-07-27 20:27:56 -07:00
Henrik Rydgård 18f828d74b Some zero init, add a null check in TextureReplacer. See #15730 2022-07-26 23:48:39 +02:00
Henrik RydgårdandGitHub a831cab14c Remove unmotivated check preventing texture ini creation on mobile. (#15647)
* Remove unmotivated check preventing  texture ini creation on mobile.

Fixes #15644

* Show a "toast" message on platforms that don't support opening a text editor, when you try to create/open a texture ini file.

* Avoid the need to ifdef around calls to SystemToast

* UWP buildfix (and some warning fixes).

And possibly libretro fix

* Rename for a bit more consistency
2022-07-10 22:34:44 +02:00
Henrik Rydgård 73452b4743 Minor cleanups 2022-04-23 22:52:28 +02:00
Unknown W. Brackets 34d0acac4e Vulkan: Save textures using a memory copy. 2022-04-17 20:55:39 -07:00
Unknown W. Brackets cc119c923c Replacement: Avoid recheck saving within 5s.
This does mean an actively saved texture won't recheck, but it's close to
the old behavior where you could delete a new texture and it'd soon be
resaved.  This was convenient sometimes.
2022-04-17 20:52:26 -07:00
Unknown W. Brackets e0e3223c19 Replacement: Move IO checks to saving thread.
This will spin up more threads that might not actually save, but it will
remember this in savedCache.
2022-04-17 20:25:41 -07:00
Henrik Rydgård b1af940d8e Save textures on background tasks when texture dumping is enabled.
Should help #15478, at least a bit.
2022-04-18 00:26:35 +02:00
Henrik Rydgård c4dfbf4f1a Delete a lot of specialized alpha checking code.
This was now only used to check alpha in CLUTs, and the generic functions will not actually be any slower.
2022-04-15 12:34:50 +02:00
Unknown W. Brackets 3c3e397215 Replacement: Avoid potential destructor crash. 2022-04-09 09:41:49 -07:00