Commit graph

33 commits

Author SHA1 Message Date
Andrea Pappacoda
b2eb103829 chore: add missing SPDX tags
Follow-up to 2b87305d31
2022-04-28 18:24:11 +02:00
Morph
2b87305d31 general: Convert source file copyright comments over to SPDX
This formats all copyright comments according to SPDX formatting guidelines.
Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
2022-04-23 05:55:32 -04:00
bunnei
dcb17246d9 Revert "texture_cache/util: Remove unneeded ReadBlockUnsafe" 2022-04-04 16:26:53 -07:00
ameerj
ef60f353a8 texture_cache/util: Remove unneeded ReadBlockUnsafe
This call was reading GPU memory into the dst buffer, which is then overwritten by the SwizzleTexture call.
2022-04-04 15:57:54 -04:00
ameerj
5a7940c1f1 texture_cache/util: Fix s32 overflow when resolving overlaps 2021-12-31 20:03:22 -05:00
Fernando Sahmkow
fc91c0f51d Texture Cache: Redesigning the blitting system (again). 2021-11-27 11:22:16 +01:00
Fernando Sahmkow
81f52ea8fc Texture Cache: Fix issue with blitting 3D textures. 2021-11-22 06:07:21 +01:00
Fernando Sahmkow
df62d93979 TextureCache: Eliminate format deduction as full depth conversion has been supported. 2021-11-21 05:37:01 +01:00
Fernando Sahmkow
efe634608e TextureCache: Further fixes on resolve algorithm. 2021-11-19 23:02:04 +01:00
Fernando Sahmkow
37459e821b TextureCache: Fix regression caused by ART and improve blit detection algorithm to be smarter. 2021-11-19 03:17:54 +01:00
Fernando Sahmkow
ceace57320 Texture Cache: Fix blitting. 2021-11-16 22:11:32 +01:00
FernandoS27
564caa296b TextureCache: fix rescaling in aliases and overlap joins. 2021-11-16 22:11:31 +01:00
ReinUsesLisp
21932acf5f texture_cache/util: Fix size calculations of multisampled images
On the texture cache we handle multisampled images by keeping their real
size in samples (e.g. 1920x1080 with 4 samples is 3840x2160).

This works nicely with size matches and other comparisons, but the
calculation for guest sizes was not having this in mind, and the size
was being multiplied (again) by the number of samples per dimension.
For example a 3840x2160 texture cache image had its width and height
multiplied by 2, resulting in a much larger texture.

Fix this issue.

- Fixes performance regression on cooking related titles when an
  unrelated bug was fixed.
2021-07-18 01:15:48 -03:00
bunnei
661a0f6569 Merge pull request #6497 from FernandoS27/scotty-doesnt-know
GPU Memory Manager - Correct handling of non continuous backing memory.
2021-07-06 17:26:21 -07:00
Fernando Sahmkow
083e0527fd Texture Cache: Improve accuracy of sparse texture detection. 2021-07-04 22:32:35 +02:00
Fernando Sahmkow
5854ca4ff0 Texture Cache: Initial Implementation of Sparse Textures. 2021-07-04 22:32:03 +02:00
Morph
2986e26179 video_core: Silence signed/unsigned mismatch warnings 2021-06-28 09:21:42 -04:00
Mai M
7503ca436b Merge pull request #6465 from FernandoS27/sex-on-the-beach
GPU: Implement a garbage collector for GPU Caches (project Reaper+)
2021-06-23 08:03:01 -04:00
Ameer J
3b8508bf64 Merge pull request #6469 from ReinUsesLisp/blit-view-compat
texture_cache/util: Avoid relaxed image views on different bytes per block
2021-06-16 21:08:07 -04:00
Fernando Sahmkow
978aabb1d0 Reaper: Tune it up to be an smart GC. 2021-06-16 21:35:02 +02:00
ameerj
e5da434498 textures: Reintroduce CPU ASTC decoder
Users may want to fall back to the CPU ASTC texture decoder due to hangs
and crashes that may be caused by keeping the GPU under compute heavy
loads for extended periods of time. This is especially the case in games
such as Astral Chain which make extensive use of ASTC textures.
2021-06-15 20:19:00 -04:00
ReinUsesLisp
b458f73a61 texture_cache/util: Avoid relaxed image views on different bytes per pixel
Avoids API usage errors on UE4 titles leading to crashes.
2021-06-14 21:03:57 -03:00
Markus Wick
e7c2b054c1 Fix GCC undefined behavior sanitizer.
* Wrong alignment in u64 LOG_DEBUG -> memcpy.
* Huge shift exponent in stride calculation for linear buffer, unused result -> skipped.
* Large shift in buffer cache if word = 0, skip checking for set bits.

Non of those were critical, so this should not change any behavior.
At least with the assumption, that the last one used masking behavior, which always yield continuous_bits = 0.
2021-06-10 21:07:27 +02:00
Lioncash
c81f95a54b texture_cache/util: Fix src being used instead of dst within DeduceBlitImages
This line can only ever be reached if src is null, so dereferencing it
here is a logic bug that slipped through.

Instead, we dereference dst instead which is guaranteed to be valid.
2021-04-19 13:01:50 -04:00
Lioncash
c9fb2b3404 texure_cache/util: Resolve implicit sign conversions with std::reduce
Amends implicit sign conversions occurring with usages of std::reduce
and also relocates it to its own utility function to reduce verbosity a
little bit.
2021-04-12 05:21:53 -04:00
ameerj
e0977af861 astc_decoder: Refactor for style and more efficient memory use 2021-03-25 16:53:51 -04:00
ameerj
fb79ff4cab texture_cache: Blacklist BGRA8 copies and views on OpenGL
In order to force the BGRA8 conversion on Nvidia using OpenGL, we need to forbid texture copies and views with other formats.

This commit also adds a boolean relating to this, as this needs to be done only for the OpenGL api, Vulkan must remain unchanged.
2021-03-04 14:14:49 -05:00
Lioncash
cb80206c8c texture_cache/util: Remove unused functions
Silences a few warnings on clang 12.
2021-02-09 17:30:20 -05:00
ReinUsesLisp
7afc85ba3a video_core: Silence -Wmissing-field-initializers warnings 2021-01-24 04:32:19 -03:00
Lioncash
bc509928d4 texture_cache/util: Resolve -Wsign-compare warning
Resolves a -Wsign-compare warning on Clang.
2021-01-17 02:47:48 -05:00
ReinUsesLisp
4e4056f581 common/alignment: Rename AlignBits to AlignUpLog2
AlignUpLog2 describes what the function does better than AlignBits.
2021-01-15 04:13:33 -03:00
ReinUsesLisp
d8569c3af4 gl_texture_cache: Avoid format views on Intel and AMD
Intel and AMD proprietary drivers are incapable of rendering to texture
views of different formats than the original texture. Avoid creating
these at a cache level. This will consume more memory, emulating them
with copies.
2021-01-04 02:06:40 -03:00
ReinUsesLisp
d25b097e84 video_core: Rewrite the texture cache
The current texture cache has several points that hurt maintainability
and performance. It's easy to break unrelated parts of the cache
when doing minor changes. The cache can easily forget valuable
information about the cached textures by CPU writes or simply by its
normal usage.The current texture cache has several points that hurt
maintainability and performance. It's easy to break unrelated parts
of the cache when doing minor changes. The cache can easily forget
valuable information about the cached textures by CPU writes or simply
by its normal usage.

This commit aims to address those issues.
2020-12-30 03:38:50 -03:00