Commit Graph

28359 Commits

Author SHA1 Message Date
Jordan Woyak 168a49c87f ControllerInterface: DSU InputBackend implementation. 2022-11-01 21:59:09 -05:00
Jordan Woyak 2e5cd5d519 ControllerInterface: evdev InputBackend implementation. 2022-11-01 21:59:08 -05:00
Jordan Woyak 44a4573303 ControllerInterface: Add InputBackend interface and SDL implementation. 2022-11-01 21:59:08 -05:00
Bram Speeckaert f25611f388 JitArm64: MultiplyImmediate - Handle 1
Multiplication by one is also trivial. Depending on the registers
involved, either a single MOV or no instructions will be generated.

Before:
0x52800038   mov    w24, #0x1
0x1b1a7f1b   mul    w27, w24, w26

After:
0x2a1a03fb   mov    w27, w26

Before:
0x52800039   mov    w25, #0x1
0x1b1a7f3a   mul    w26, w25, w26

After:
Nothing!
2022-11-01 21:13:45 +01:00
Bram Speeckaert 51cb918aa5 JitArm64: MultiplyImmediate - Handle 0
Multiplication by zero always gives zero.

Before:
0x52800019   mov    w25, #0x0
0x1b197f5b   mul    w27, w26, w25

After:
Nothing!
2022-11-01 21:13:38 +01:00
Bram Speeckaert 080513284c JitArm64: mullwx - Use MultiplyImmediate 2022-11-01 19:05:33 +01:00
Bram Speeckaert 53a8cd1563 JitArm64: mulli - Use MultiplyImmediate 2022-11-01 19:04:50 +01:00
Bram Speeckaert 4aa0c0133a JitArm64: Introduce MultiplyImmediate
Add a new function that will handle all the special cases regarding
multiplication. It does nothing for now, but will be expanded in
follow-up commits.
2022-11-01 19:01:38 +01:00
Bram Speeckaert d0de68c41b JitArm64: cmp - Optimize general case
We can merge an SXTW with the SUB, eliminating one instruction. In
addition, it is no longer necessary to allocate a temporary register,
reducing register pressure.

Before:
0x93407f59   sxtw   x25, w26
0x93407ebb   sxtw   x27, w21
0xcb1b033b   sub    x27, x25, x27

After:
0x93407f5b   sxtw   x27, w26
0xcb35c37b   sub    x27, x27, w21, sxtw
2022-11-01 12:21:24 +01:00
Bram Speeckaert ae6ce1df48 Arm64Emitter: Add ArithOption with ExtendSpecifier
ARM64 can do perform various types of sign and zero extension on a
register value before using it. The Arm64Emitter already had support for
this, but it was kinda hidden away.

This commit exposes the functionality by making the ExtendSpecifier enum
available everywhere and adding a new ArithOption constructor.
2022-11-01 12:15:56 +01:00
Bram Speeckaert 82f22cdfa1 JitArm64: cmp - Optimize a == -1 case
By explicitly handling this, we can avoid materializing -1 in a
register and generate more efficient code by taking advantage of -x ==
~x + 1.

Before:
0x12800015   mov    w21, #-0x1
0x93407eb9   sxtw   x25, w21
0x93407ef8   sxtw   x24, w23
0xcb180338   sub    x24, x25, x24

After:
0x2a3703f8   mvn    w24, w23
0x93407f18   sxtw   x24, w24
2022-11-01 12:00:32 +01:00
Bram Speeckaert 592ba31e22 JitArm64: cmp - Optimize a == 0 case
By explicitly handling this, we can avoid materializing zero in a
register and generate more efficient code altogether.

Before:
0x52800016   mov    w22, #0x0
0xb94093b5   ldr    w21, [x29, #0x90]
0x93407ed7   sxtw   x23, w22
0x93407eb9   sxtw   x25, w21
0xcb1902f9   sub    x25, x23, x25

After:
0xb94093b7   ldr    w23, [x29, #0x90]
0x4b1703f9   neg    w25, w23
0x93407f39   sxtw   x25, w25
2022-11-01 11:52:00 +01:00
Bram Speeckaert f5e7e70cc5 JitArm64: cmp - Refactor 2022-11-01 11:47:17 +01:00
Bram Speeckaert dbb8f588c7 JitArm64: cmpl - Optimize a == 0 case
By explicitly handling this, we can avoid materializing zero in a
register.

Before:
0x52800019   mov    w25, #0x0
0xb94087b6   ldr    w22, [x29, #0x84]
0xcb16033b   sub    x27, x25, x22

After:
0xb94087b9   ldr    w25, [x29, #0x84]
0xcb1903fb   neg    x27, x25
2022-11-01 11:27:45 +01:00
Dentomologist 7cd08fde75 Updater: Add/clarify error messages 2022-10-31 23:36:07 -07:00
Dentomologist 2808db7f2f FileUtil: Return success bool from CopyDir 2022-10-31 23:33:02 -07:00
shuffle2 111e965c7e
Revert "MacUpdater: test that os version check is working" 2022-10-31 18:53:22 -07:00
Tilka b182abe0ae
Merge pull request #11234 from shuffle2/updater
MacUpdater: test that os version check is working
2022-11-01 01:28:20 +00:00
Tillmann Karras 22eb7e6645 OGL: use already known object label lengths
Passing -1 means the driver has to call strlen().
2022-11-01 01:10:03 +00:00
Tillmann Karras 4b8fe959d4 OGL: fix compute shader labels
This fixes GL_INVALID_VALUE errors when using GPU texture decoding.
2022-11-01 01:04:46 +00:00
Robin Kertels f5fecaf964
VideoBackends:Vulkan: Fix 0 size descriptor pools
[ VUID-VkDescriptorPoolCreateInfo-maxSets-00301 ] Object 0:
handle = 0x7f1,b8d,3cd,e70, type = VK_OBJECT_TYPE_DEVICE; |
MessageID = 0xa1,70e,236 | vkCreateDescriptorPool():
pCreateInfo->maxSets is not greater than 0.
The Vulkan spec states: maxSets must be greater than 0
2022-10-31 22:41:16 +01:00
Shawn Hoffman 7cc8e37aee MacUpdater: test that os version check is working
Adds a key to Info.plist with default value to test
Updater - this commit is intended to be reverted
2022-10-30 13:19:43 -07:00
JMC47 969309c457
Merge pull request #11220 from shuffle2/macversion
MacUpdater: check os version
2022-10-30 15:19:55 -04:00
Shawn Hoffman 089886a6f8 MacUpdater: check os version 2022-10-30 12:04:57 -07:00
JMC47 f277a921a9
Merge pull request #11231 from shuffle2/updater
windows: Rename: use std::filesystem::rename for posix behavior
2022-10-30 13:32:10 -04:00
JMC47 950e1f94dc
Merge pull request #11185 from TryTwo/PR_MemoryWidget_Address_Input_History
MemoryWidget: Make search address a combobox that holds address history.
2022-10-30 04:21:14 -04:00
TryTwo 053320b7cf MemoryWidget: Make search address a combobox that holds address history.
Always update the combobox when a new target address is sent.
2022-10-29 22:41:30 -07:00
Shawn Hoffman 68875dc06b MacUpdater: add version info to Updater.app too 2022-10-29 20:32:59 -07:00
Shawn Hoffman 836bc74b2d windows: Rename: use std::filesystem::rename for posix behavior 2022-10-29 19:57:26 -07:00
Pokechu22 fe559f3ed3 VideoCommon/Statistics: Require semicolons after statistics macros
This is clearer and reduces IntelliSense problems.
2022-10-29 15:39:41 -07:00
Admiral H. Curtiss 0628794cb6
Merge pull request #11226 from K0bin/d3d12-fix
VideoBackends:D3D12: Fix hang in Twilight Princess
2022-10-30 00:24:16 +02:00
Robin Kertels a07ee729e5
VideoBackends:D3D12: Defer binding framebuffer in SetAndDiscardFramebuffer
BindFramebuffer depends on the pipeline which might not be set yet.
That's why the framebuffer dirty flag exists in the first place.
I assume BindFramebuffer was called directly here, in order to handle
the texture state transitions necessary for DiscardResource.
The state is tracked anyway, so we can just issue those transitions there
too and defer binding the actual framebuffer.

Fixes an issue in Zelda Twilight Princess with EFB depth peeks.
Dolphin would bind a frame buffer which doesn't have an integer format
descriptor for the color target before binding the new pipeline.
So it would accidentally use the 0 descriptor.

Debug layer error:
D3D12 ERROR: ID3D12CommandList::OMSetRenderTargets:
Specified CPU descriptor handle ptr=0x0000000000000000 does not refer to
a location in a descriptor heap. pRenderTargetDescriptors[0] is the issue.
[ EXECUTION ERROR #646: INVALID_DESCRIPTOR_HANDLE]
2022-10-29 23:41:32 +02:00
Robin Kertels a6aa651291
VideoBackends:D3D12: Use COMMON as initial state for default heap buffer
Fixes the following error in the D3D12 debug layer:

D3D12 WARNING: ID3D12Device::CreateCommittedResource:
Ignoring InitialState D3D12_RESOURCE_STATE_UNORDERED_ACCESS.
Buffers are effectively created in state D3D12_RESOURCE_STATE_COMMON.
[ STATE_CREATION WARNING #1328: CREATERESOURCE_STATE_IGNORED]
2022-10-29 23:39:32 +02:00
Robin Kertels 22fecb41fc
VideoBackends:D3D12: Don't query GPU descriptor handle for non-shader visible heap
Fixes the following error in the D3D12 debug layer:

D3D12 ERROR: ID3D12DescriptorHeap::GetGPUDescriptorHandleForHeapStart:
GetGPUDescriptorHandleForHeapStart is invalid to call on a descriptor
heap that does not have DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE set.
If the heap is not supposed to be shader visible, then
GetCPUDescriptorHandleForHeapStart would be the appropriate method
to call. That call is valid both for shader visible and non shader
visible descriptor heaps.
[ STATE_GETTING ERROR #1315: DESCRIPTOR_HEAP_NOT_SHADER_VISIBLE]
2022-10-29 23:39:27 +02:00
Tillmann Karras cacdd18ca0 VolumeVerifier: fix bogus "serial/version missing" error
When searching for a disc where the revision doesn't match any disc in
the datfile, the loop would never get to the part where serials_exist is
set to true, leading to a bogus error message.
2022-10-29 21:32:57 +01:00
Pokechu22 6dcf8a6fc9
Merge pull request #11201 from JoshuaMKW/fix-instruction-patches
MemoryPatches: Fix instruction patches
2022-10-29 12:34:00 -07:00
JosJuice 431ee1c48a JitArm64: Improve register handling for MMIO loadstores
Because of the previous commit, `regs_in_use` must not include `dest_reg`
when calling MMIOLoadToReg. There are also some other registers we can
skip including in regs_in_use just for efficiency's sake.

The `addr_reg_set = false` statements that I've added in this commit are
technically redundant – if `mmio_address` is non-zero then `addr_reg_set`
is already false – but it's just a coincidence that that's the case.
2022-10-29 14:16:53 +02:00
JosJuice 0660f12da4 JitArm64: Move MMIO handler result before popping stack
Otherwise we might throw the result away.
Fixes https://bugs.dolphin-emu.org/issues/13083.
2022-10-29 14:16:43 +02:00
iwubcode ea3e133200 VideoCommon: call texture load graphics mod hook when Dolphin loads a texture 2022-10-28 19:24:43 -05:00
iwubcode 0e1ffe009a VideoBackends: fix d3d12 subresource calculation 2022-10-28 19:07:08 -05:00
Admiral H. Curtiss 8efd7833e5
Merge pull request #11150 from jordan-woyak/all-devices-less-confusing
DolphinQt: Make "All Devices" mapping hopefully less confusing.
2022-10-29 00:53:19 +02:00
Admiral H. Curtiss 8001535d12
Merge pull request #11211 from jordan-woyak/fix-focus-resume-after-manual-pause
DolphinQt: Fix window focus from unpausing after a manual pause.
2022-10-29 00:35:50 +02:00
JoshuaMK e2f4400f49 Make SetPatch responsible for overwriting old patches 2022-10-26 22:46:49 -05:00
Pokechu22 2f3805e1b4 GraphicsSettings: Remove unused FreelookControlType enum forward declaration 2022-10-26 16:23:13 -07:00
Jordan Woyak 4fc05dd025 DolphinQt: Fix window focus from unpausing after a manual pause. 2022-10-25 19:39:41 -05:00
Pokechu22 581a575042 VertexLoader: Remove "too many initializer values" workaround functions
I originally added these in 2b1d1038a6, for both the TPipelineFunction and the size. The size was moved into the header in fdcd2b7d00 (making the size functions obsolete), but it seems that the functions themselves are no longer needed now.

I think I didn't use this approach before because it would have required ComponentFormatTable and ComponentCountRow to be templated, which would end up resulting in lines that were too long and thus wrapped in awkward places. (I *think* they didn't get inferred properly.) Now that we only need TPipelineFunction, the templating is not needed, and this ends up being a more readable version of the version with the wrapper functions.
2022-10-25 15:29:09 -07:00
JMC47 027e10460a
Merge pull request #10977 from tellowkrinkle/FixBackendMultithreading
VideoBackends:Vulkan: Improve backend multithreading
2022-10-25 04:14:01 -04:00
JMC47 9ef7a3b44c
Merge pull request #11207 from Pokechu22/invalid-normal-count
VideoCommon: Treat invalid normal count as NormalTangentBinormal
2022-10-25 03:17:19 -04:00
Pokechu22 574939b683 VideoCommon: Treat invalid normal count as NormalTangentBinormal
See https://bugs.dolphin-emu.org/issues/13070.
2022-10-24 22:36:43 -07:00
JMC47 b66793194e
Merge pull request #11028 from tellowkrinkle/MetalFixes
Various Metal renderer improvements
2022-10-24 15:22:37 -04:00
JMC47 4787b25a7f
Merge pull request #10741 from Pokechu22/audio-dma-one-block-at-a-time
DSP: Copy audio dma samples one block at a time
2022-10-24 01:43:22 -04:00
JoshuaMK 2594447c25 Have UnsetPatch only unset the argument address 2022-10-23 18:42:34 -05:00
JoshuaMK e10b3308c2 Fix patch corruption using find_if instead of remove_if 2022-10-23 18:41:15 -05:00
JMC47 33733ff81c
Merge pull request #11199 from JosJuice/translation-fixes
WiimoteEmu: Change Shinkansen Start/Select to START/SELECT
2022-10-23 16:07:11 -04:00
JosJuice 7437d2d9ad WiimoteEmu: Change Shinkansen Start/Select to START/SELECT
For consistency with GameCube controllers and GBAs. I missed this
when reviewing the PR.

Also adding some i18n comments while I'm at it.
2022-10-23 21:50:54 +02:00
JosJuice 063c2739b3
Merge pull request #11135 from AdmiralCurtiss/ppcanalyst-unused-stats
PPCAnalyst: Remove unused variables and methods in BlockStats and BlockRegStats.
2022-10-23 21:22:54 +02:00
TryTwo e2df81b0c1 Add logging and error reporting to Breakpoint Conditionals. 2022-10-23 08:22:35 -07:00
Shawn Hoffman 4705fb7588 Updater: clarify a string 2022-10-23 01:47:02 -07:00
Shawn Hoffman 08c019608d WinUpdater: fix renaming of Updater 2022-10-23 01:34:04 -07:00
Shawn Hoffman f952c3dbbe this is a test commit for WinUpdater 2022-10-23 00:19:46 -07:00
JMC47 34de2b85f3
Merge pull request #11189 from shuffle2/updater-elevation
WinUpdater: Defer modifying any files until Updater.exe
2022-10-23 02:20:56 -04:00
JMC47 cdcbe51b2a
Merge pull request #10890 from tellowkrinkle/VertexLineExpand
VideoCommon: Add vertex shader point/line expansion
2022-10-23 01:49:26 -04:00
JMC47 06bd0a9086
Merge pull request #11132 from K0bin/vma
Vulkan: Use VMA for memory allocations
2022-10-23 01:18:47 -04:00
Robin Kertels aa1679f2c7
VideoBackends:Vulkan: Clean up unused memory allocation code 2022-10-23 03:21:29 +02:00
Robin Kertels 1ba58e83ca
VideoBackends:Vulkan: Use VMA for stream buffer 2022-10-23 03:21:29 +02:00
Robin Kertels 0e1b7a7b35
VideoBackends:Vulkan: Use VMA for bounding box 2022-10-23 03:21:29 +02:00
Robin Kertels 0532f4a05a
VideoBackends:Vulkan: Use VMA for staging buffers 2022-10-23 03:21:14 +02:00
TellowKrinkle 1e9b6f88e4 VideoCommon: Support hot reloading of VS expand 2022-10-22 20:18:02 -05:00
TellowKrinkle 3912fa7a2e VideoCommon: Add reasons for disabled VS expand 2022-10-22 20:18:02 -05:00
TellowKrinkle b567f3afcf VideoCommon: Move repeated point/line expansion code to ShaderGenCommon 2022-10-22 20:13:24 -05:00
TellowKrinkle 0a42c534c3 VideoCommon: Add configuration to prefer VS for line/point expansion 2022-10-22 20:13:24 -05:00
TellowKrinkle 1eeba6dcca VideoBackends:D3D12: Add support for vertex shader point and line expansion 2022-10-22 20:13:24 -05:00
TellowKrinkle 9624479933 VideoBackends:OGL: Add support for vertex shader point and line expansion 2022-10-22 20:13:24 -05:00
TellowKrinkle 3a5901d12e VideoBackends:Vulkan: Add support for vertex shader point and line expansion 2022-10-22 20:13:24 -05:00
TellowKrinkle 678ee48bfc VideoBackends:Metal: Add support for vertex shader point and line expansion 2022-10-22 20:13:24 -05:00
TellowKrinkle 68f49df0f8 VideoCommon: Add vertex shader point and line expansion 2022-10-22 20:13:24 -05:00
Robin Kertels 3ffbf94b2a
VideoBackends:Vulkan: Set up VMA
Co-authored-by: iwubcode <iwubcode@users.noreply.github.com>
2022-10-23 02:54:35 +02:00
TryTwo 6f4f4e057e MemoryViewWidget refactor memory table.
Don't re-create the table on every update.
2022-10-22 17:52:39 -07:00
Pokechu22 bac75de79c Fifo recorder: Fix incorrect calculation of the size of an array
The old calculation was stride * (max_index + 1), which fails if stride is less than the size of a component (for instance, if float XYZ positions are used, and the stride was set to 4 (i.e. sizeof(float)) instead of 12 (i.e. 3 * sizeof(float)), it would be missing the last 8 bytes of the final element in the array.  Or, if stride was set to 0, then no bytes would be recorded at all (though that's not a useful configuration so it's unlikely to actually exist).

I'm not aware of any games affected by this issue.
2022-10-22 13:36:16 -07:00
Pokechu22 c9ff2a9b3d Fifo recorder: Fix NormalIndex3
This should fix recording the wall in the staircase leading to the basement in Luigi's Mansion (though I haven't tested it, as I don't own a copy of Luigi's Mansion).  This uses NormalIndex3, and the index for the normal vector (generally 0x02XX or 0x01XX) there is always lower than the tangent or binormal (generally 0x07XX).  Other games seem to usually have a similar range of indices for the normal, tangent, and binormal, so this issue wouldn't affect them.
2022-10-22 13:36:16 -07:00
Pokechu22 24b761acda Fifo recorder: Fix position's type being used for normals/colors/texture coords
In most cases, games will use the same type for all vertex components (either Index8 or Index16 or Direct).  However, RS2's deflection towers use Index16 for the texture coordinate and Index8 for everything else, meaning the texture coordinates were recorded incorrectly (the first byte was used, so only indices 0 and 1 were recorded instead of 0 through 0x0192).  Worse still, some background elements in RS2 use direct positions but indexed normals or texture coordinates, and those would not be recorded at all.

This is a regression from b5fd35f951.
2022-10-22 13:36:16 -07:00
JMC47 804e42150e
Merge pull request #11188 from GaryOderNichts/feature/vwii_ancast
Support for loading vWii System Menu
2022-10-22 15:57:55 -04:00
Pokechu22 6de55e416b WaveFile: Fix size check
`count` is the number of stereo samples to write (where each stereo sample is two shorts), while `BUFFER_SIZE` is the size of the buffer in shorts.  So `count` needs to be multiplied by `2`, not `BUFFER_SIZE`.  Also, when this check was failed, the previous code just clobbered whatever was past the end of the buffer after logging the warning, which corrupted `basename`, eventually resulting in Dolphin crashing.

This affected Datel's Wii-compatible Action Replay, which uses a block size of 2298, or 18384 stereo samples, which is 36768 shorts, which is bigger than the buffer size of 32768. (However, the previous commit means that only one block is transfered at a time, eliminating this issue; fixing the bounds check is just a general safety thing instead of an actual bugfix now.)
2022-10-22 11:44:38 -07:00
Pokechu22 2a83b17ffb DSP: Copy audio dma samples one block at a time
Reverts 9f8e1e2a0d, but keeps the changes from e4e44909d5.

This fixes missing audio in Datel titles; see https://bugs.dolphin-emu.org/issues/12281.
2022-10-22 11:44:38 -07:00
GaryOderNichts 88c57a00a3 Show vWii System Menu version in Menu Bar 2022-10-22 13:36:55 +02:00
GaryOderNichts 82d20ce352 Support for loading Ancast images 2022-10-22 13:35:49 +02:00
JMC47 5b69c67b3a
Merge pull request #11147 from JosJuice/jitarm64-arith-org
JitArm64: Merge ps_mulsX, ps_maddXX, and parts of fp_arith
2022-10-22 06:37:27 -04:00
JMC47 b7310a180f
Merge pull request #11170 from JosJuice/jit64-dispatcher-no-check
Jit64: Add dispatcher_no_timing_check jump target
2022-10-22 06:19:00 -04:00
JMC47 55d269c9e0
Merge pull request #11190 from jordan-woyak/shinkansen-ui-button-order
WiimoteEmu: Shinkansen Tweaks
2022-10-22 05:21:00 -04:00
JosJuice 812067ab7c JitArm64: Move ps instructions from fp_arith to ps_arith
This lets us simplify fp_arith without making ps_arith much more
complicated.

No behavior change.
2022-10-22 11:15:41 +02:00
JosJuice 554a2fd332 JitArm64: Merge ps_mulsX and ps_maddXX
They have a lot of shared code, most notably the code for rounding c.

No behavior change.
2022-10-22 11:12:19 +02:00
JMC47 2153276ab9
Merge pull request #10046 from JosJuice/jitarm64-improve-const-stores
JitArm64: FIFO optimization improvements
2022-10-22 05:03:43 -04:00
JMC47 bc4d08047d
Merge pull request #10979 from tellowkrinkle/QuartzWindowSpeed
InputCommon:QuartzKB&M: Use KVO to watch window position
2022-10-22 04:55:12 -04:00
Markus Wick 7a2256469e
Merge pull request #11127 from JosJuice/aarch64-jitasm-macro-op
JitAsm64: Reorder instructions in routines to allow macro-op fusion
2022-10-22 10:31:54 +02:00
Markus Wick 583c2b8a0c
Merge pull request #11181 from JosJuice/jitarm64-25-bit-urshr
JitArm64: Reimplement Force25BitPrecision
2022-10-22 10:26:07 +02:00
Markus Wick 5c7b5514ed
Merge pull request #11148 from JosJuice/jitarm64-remove-cdts-inst
JitArm64: Remove unnecessary instruction from ConvertDoubleToSingle
2022-10-22 10:10:23 +02:00
JosJuice 4dbf0b8e90 JitArm64: Reimplement Force25BitPrecision
The previous implementation of Force25BitPrecision was essentially a
translation of the x86-64 implementation. It worked, but we can make a
more efficient implementation by using an AArch64 instruction I don't
believe x86-64 has an equivalent of: URSHR. The latency is the same as
before, but the instruction count and register count are both reduced.
2022-10-22 10:03:52 +02:00
Jordan Woyak d9d6428189 WiimoteEmu: Replace shinkansen MixedTriggers with Triggers. 2022-10-22 02:42:40 -05:00
Jordan Woyak d705b8d4b8 WiimoteEmu: Reorder shinkansen buttons in UI. 2022-10-22 02:37:28 -05:00
Markus Wick bba38a3642
Merge pull request #11182 from JosJuice/aarch64-emit-shift-imm
Arm64Emitter: Combine immh and immb for Emit(Scalar)ShiftImm
2022-10-22 09:23:06 +02:00