Commit graph

30720 commits

Author SHA1 Message Date
JMC47
6f4bbac528
Merge pull request #9956 from Pokechu22/non-power-of-2-wrap-2
VideoCommon: Manually handle texture wrapping and sampling
2021-11-18 13:08:23 -05:00
Pokechu22
95b9941044 Use Fast Texture Sampling by default
This commit changes the default value of Fast Texture Sampling to true, and also moves the setting that controls it to the experimental section of the advanced tab.  This is its own commit so that it can be easily reverted when we want to default to Manual Texture Sampling.

Co-authored-by: JosJuice <josjuice@gmail.com>
2021-11-17 21:29:57 -08:00
Pokechu22
1adff1c467 VideoCommon: Skip textureQueryLevels if it doesn't exist 2021-11-17 21:28:39 -08:00
Pokechu22
bdcfb31187 VideoCommon: Handle custom texture sizes correctly
Specifically, when using Manual Texture Sampling, if textures sizes don't match the size the game specifies, things previously broke.  That can happen with custom textures, and also with scaled EFB copies at non-native IRs.  It breaks most obviously by not scaling the texture coordinates (so only part of the texture shows up), but the hardware wrapping functionality also assumes texture sizes are a power of 2 (or else it will behave weirdly in a way that matches how hardware behaves weirdly).  The fix is to provide alternative texture wrapping logic when custom texture sizes are possible.
2021-11-17 21:28:36 -08:00
Pokechu22
93eea7cb13 VideoCommon: Add option to use old behavior (Fast Texture Sampling)
Co-authored-by: JosJuice <josjuice@gmail.com>
2021-11-17 21:27:32 -08:00
Pokechu22
ee80298ca4 VideoCommon: Implement diagonal LOD
Note that both GLSL and HLSL provide a fwidth (fragment width) function defined as `fwidth(p) = abs(dFdx(p)) + abs(dFdy(p))`.  However, it's easy enough to implement this ourselves (and it makes the code a bit more obvious).
2021-11-17 20:04:34 -08:00
Pokechu22
b9288212a0 Software: Adjust diagonal LOD implementation
This produces behavior matching the behavior on hardware (see Wario's Gold Mine in Mario Kart Wii).
2021-11-17 20:04:34 -08:00
Pokechu22
51e3334526 VideoCommon: Use coarse derivatives for Manual Texture Sampling if possible 2021-11-17 20:04:34 -08:00
Pokechu22
ddf2691395 VideoCommon: Manually handle texture wrapping and sampling 2021-11-17 20:04:34 -08:00
Pokechu22
4a9b26de86 VideoCommon: Expose SamplerState to shaders
The benefit to exposing this over the raw BP state is that adjustments Dolphin makes, such as LOD biases from arbitrary mipmap detection, will work properly.
2021-11-17 20:04:34 -08:00
Pokechu22
9ef228503a VideoCommon: Provide raw texdims to shaders 2021-11-17 20:04:34 -08:00
Pokechu22
a273b65566 RenderState: Use operator== for operator!= and adjust constructors 2021-11-17 20:04:34 -08:00
Pokechu22
6236a0d494 Eliminate SamplerCommon 2021-11-17 20:04:34 -08:00
Pokechu22
3096f77ba0 Eliminate SamplerCommon::AreBpTexMode0MipmapsEnabled
This was added in 0b9a72a62d but became irrelevant in 70f9fc4e75 as the check is now self-explanatory due to a rejiggering of the bitfields.
2021-11-17 20:04:34 -08:00
Pokechu22
d2041b4c2a VideoCommon: Add signed version of BitfieldExtract 2021-11-17 20:04:33 -08:00
Pokechu22
555a93057c VideoCommon: Allow BitfieldExtract in specialized shaders 2021-11-17 20:04:33 -08:00
JosJuice
2941cf8d94 Android: Make GameFileCacheManager use LiveData, part 2
Gets rid some uses of the deprecated LocalBroadcastManager.

One note about the changes in GameFileCacheManager itself:
The change from compareAndSet to getValue followed by
setValue is actually safe, because startLoad and startRescan
only run from the main thread, and only the main thread ever
sets the flags to true. So it's impossible for any other thread
to change the flag in between the getValue and the setValue.
2021-11-17 21:49:51 +01:00
JosJuice
857963b336 Android: Make GameFileCacheManager use LiveData, part 1 2021-11-17 21:29:11 +01:00
Mai M
b14d982d36
Merge pull request #10225 from JosJuice/android-game-settings-title
Android: Properly set game settings title when navigating backwards
2021-11-16 23:26:38 -05:00
Mai M
f10d95e2b2
Merge pull request #10224 from JosJuice/android-not-service
Android: Make GameFileCacheService not be a service
2021-11-16 23:22:22 -05:00
JosJuice
bb2ee279cd Android: Properly set game settings title when navigating backwards 2021-11-16 22:09:40 +01:00
JosJuice
ffd8cd059c Android: Make GameFileCacheService not be a service
The past few Android releases have been adding restrictions
to what services are allowed to do, for the sake of stopping
services from using up too much battery in the background.
The IntentService class, which GameFileCacheService uses,
was even deprecated in Android 11 in light of this.

Typically, the reason why you would want use a service instead of
using a simple thread or some other concurrency mechanism from the
Java standard library is if you want to be able to run code in the
background while the user isn't using your app. This isn't actually
something we care about for GameFileCacheService -- if Android wants
to kill Dolphin there's no reason to keep GameFileCacheService
running -- so let's make it not be a service.

I'm changing this mainly for the sake of future proofing, but there
is one immediate (minor) benefit: Previously, if you tried to launch
Dolphin from Android Studio while your phone was locked, the whole
app would fail to launch because launching GameFileCacheService
wasn't allowed because Dolphin wasn't considered a foreground app.
2021-11-16 21:45:06 +01:00
JosJuice
31bfbca923 Android: Split up GameFileCacheService.onHandleIntent 2021-11-16 21:15:49 +01:00
Shawn Hoffman
5e1fee7dbd msbuild: remove workaround for older winsdk 2021-11-15 16:23:33 -08:00
JosJuice
7292ac0ce5 Android: Remove DirectoryInitialization from AndroidManifest.xml
It isn't a service, so it shouldn't be listed as one.
2021-11-15 23:23:17 +01:00
JMC47
26fdc19c8d
Merge pull request #10204 from Pokechu22/efb-copy-filter
VideoCommon: Use the copy filter for EFB copies as well as XFB copies
2021-11-15 17:04:27 -05:00
Shawn Hoffman
a69adafdd8 msbuild: use /external:anglebrackets
Revert usage of ExternalIncludePath, as that var is specifically
for external includes which do not get scanned for changes.
2021-11-15 00:33:51 -08:00
JosJuice
da0be24b2f DSP: Reword inappropriate references to Global User Directory
These messages apply to the User directory regardless of
whether it's global or local, so we shouldn't specify "global".

Also changing "directory" to "folder", just for consistency
with "GC folder" in the same sentence.
2021-11-14 22:55:50 +01:00
Mai M
f19ed1be56
Merge pull request #10213 from JosJuice/android-ndk
Android: Bump NDK and CMake versions
2021-11-14 02:59:34 -05:00
OatmealDome
2209dc0355 MoltenVK: Use an external project instead of a pre-compiled dylib
Also, update MoltenVK to match Vulkan SDK 1.2.189.
2021-11-13 11:43:23 -08:00
JosJuice
5a23d5cedf Android: Bump NDK and CMake versions
This should make C++20 and std::filesystem work. (Not that
we really can use std::filesystem much on Android since
it doesn't work with scoped storage...)
2021-11-13 20:41:11 +01:00
JosJuice
3e84279919
Merge pull request #10208 from thatSteveFan/patch-1
Minor comment fix in Matrix.cpp
2021-11-13 15:09:28 +01:00
Pokechu22
868de78f16 VideoCommon: Use the copy filter for EFB copies as well as XFB copies
This fixes the pink screens in EA Sports Active.  See https://gist.github.com/Pokechu22/49455f9094ed0ff017da64e3f7aa0404 for details.
2021-11-11 17:22:50 -08:00
Shawn Hoffman
58dc9e7049 msvc: fix compile warning on arm64 2021-11-11 08:01:39 -08:00
Shawn Hoffman
4008188654 msvc: update to vs2022 and windows sdk 10.0.22000 2021-11-11 08:01:26 -08:00
thatSteveFan
834a59d89b
Minor comment fix in Matrix.cpp
Fix comment to say (NxM times MxP).
2021-11-08 15:30:39 -08:00
Merry
850d281cb8 Jit_Integer: Fix pure rotation rlwimix case
We are writing to a.
2021-11-07 14:10:19 +00:00
Mai M
6c72e6814d
Merge pull request #10169 from leoetlino/fmt-localtime
Use fmt::localtime instead of thread-unsafe std::localtime
2021-11-07 00:08:14 -04:00
Mai M
c89226cbd4
Merge pull request #10203 from merryhime/ctx_lr
MachineContext: Correct CTX_LR for Apple ARM64
2021-11-07 00:06:24 -04:00
Merry
c385e7e57b MachineContext: Correct CTX_LR for Apple ARM64 2021-11-06 21:46:35 +00:00
Merry
9c75957319 JitArm64_FloatingPoint: Implement fctiwx in ARM64 JIT
We implement this by first rounding to nearest integer using the current
rouding mode, then converting this value from floating point to an integral
value.
2021-11-06 20:54:26 +00:00
Merry
7c2b09e156 Arm64Emitter: Add FRINTI instruction 2021-11-06 19:15:26 +00:00
Léo Lam
2c5d11cace
Merge pull request #9721 from linkmauve/fix-warnings
Fix some warnings found with gcc 11 and ffmpeg master
2021-11-06 14:38:07 +01:00
Sintendo
dfb32040bf Jit64: divwx - Micro-optimize division by 2
Prefer using eax to isolate the sign bit. This saves a byte when the
destination ends up as r8-15, because those require a REX prefix.

Before:
41 8B C5             mov         eax,r13d
41 C1 ED 1F          shr         r13d,1Fh
44 03 E8             add         r13d,eax
41 D1 FD             sar         r13d,1

After:
41 8B C5             mov         eax,r13d
C1 E8 1F             shr         eax,1Fh
44 03 E8             add         r13d,eax
41 D1 FD             sar         r13d,1
2021-11-03 21:01:41 +01:00
Sintendo
f18f6cd0a2 Jit64: divwx - Improve comments 2021-11-02 21:50:28 +01:00
Emmanuel Gil Peyrot
5a1333026b VideoCommon: Add missing algorithm include for std::none_of
Otherwise this is an error on gcc/libstdc++, and there are no transitive
includes for this header.
2021-11-02 13:50:21 +01:00
Emmanuel Gil Peyrot
7590f07b80 FrameDump: Remove deprecated call to av_init_packet()
This function was deprecated in ffmpeg in January[1], while its
replacement got introduced in 2015[2], so now might be the time to start
using it in Dolphin. :)

[1] f7db77bd87
[2] a9a6010637
2021-11-02 13:50:21 +01:00
Emmanuel Gil Peyrot
24db6e467a DolphinQt: Fix a -Wunused-result in gcc 11
Also use the correct error check for other similar calls in the same
file, despite nothing being doable on error.
2021-11-02 13:50:21 +01:00
Emmanuel Gil Peyrot
25b136ac17 VideoCommon: Fix a -Wclass-memaccess in gcc 11 2021-11-02 13:50:21 +01:00
Emmanuel Gil Peyrot
7e39a0405b DolphinQt, VideoBackends: Fix all cases of -Wswitch in gcc 11 2021-11-02 13:50:21 +01:00