aboutsummaryrefslogtreecommitdiff
path: root/src/common/scratch_buffer.h
Commit message (Collapse)AuthorAgeFilesLines
* texture_cache: re-decode only the written layers of large ASTC arraysTakoroka4 days1-0/+7
| | | | | | | | | | | | | | | | | | | Any write into an image marked all of it CPU-modified, so each terrain tile Mario Kart World streams into its 8192x8192x68 ASTC arrays re-read and re-decoded the whole 1.45 GB array: a 2 GiB staging buffer and a full GPU wait each time, 15-16 GB of uploads per 600 frames. Large layered images on the accelerated ASTC path (64 MiB and up) now record the layers written since their last upload and stay tracked; a refresh reads and decodes only those layers, one dispatch per layer and level into a single-layer storage view. The texture cache's 600-frame report counts uploads from guest memory, their size and how many went by layer. Upload scratch buffers grown past 64 MiB for one huge image (341 MiB for the terrain layer pools) are freed at the next frame instead of kept for the session. Mario Kart World, 180 s: after loading, uploads drop from 15-16 GB to 0.2-0.5 GB per 600 frames, the largest from 1453 MiB to 2-15 MiB.
* [common] Use `std::make_unique_for_overwrite<T>` in ScratchBuffer, remove ↵lizzie2026-09-251-6/+6
| | | | | | | | | | | | | | | | | | | | polyfill (#4432) Original `make_unique_for_overwrite.h` is well defined acc. to standard https://en.cppreference.com/cpp/memory/unique_ptr/make_unique, but by now most libc++ supports the function, so no need for polyfill. Test that this didn't break anything (for example, Megaman game that has video at the start), or anything using VIC/IPC. Signed-off-by: lizzie <lizzie@eden-emu.dev> - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4432 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
* [cmake] Fix some macOS compilation errors (#4350)lizzie2026-09-051-1/+5
| | | | | | | | | | | | | | | | | | | | Don't compile GLSL/GLASM backends without OpenGL enabled. These codepaths are unused on non-OpenGL platforms. Fixes other miscellaneous errors that pop up on Clang 23 as well. Signed-off-by: Lizzie lizzie@eden-emu.dev Signed-off-by: crueter crueter@eden-emu.dev - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Co-authored-by: crueter <crueter@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4350 Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
* Fix ScratchBuffer movesKelebek12023-07-041-2/+15
|
* scratch_buffer: Add member types to ScratchBufferMorph2023-06-301-20/+26
| | | | Allows for implicit conversion to std::span<T>.
* Remove memory allocations in some hot pathsKelebek12023-06-221-0/+9
|
* Allow Fermi blit accelerate to add src/dst to the cache if they don't exist ↵Kelebek12023-05-111-0/+9
| | | | already. Use ScratchBuffers in the software blit path.
* texture_cache: Add async texture decodingameerj2023-02-221-0/+1
|
* scratch_buffer: Explicitly defing resize and resize_destructive functionsameerj2022-12-191-0/+17
| | | | | resize keeps previous data intact when the buffer grows resize_destructive destroys the previous data when the buffer grows
* tests: Add ScratchBuffer testsameerj2022-12-191-5/+9
|
* common: Add ScratchBuffer classameerj2022-12-191-0/+74
This class creates a default initialized heap allocated buffer for cases where value initializing members during allocation or resize is redundant.