Commit graph

21347 commits

Author SHA1 Message Date
Wunkolo
14618c0e98 cpu_detect: Update array-types to span and array
Update some uses of `int` into some more explicitly sized types as well
2022-03-09 13:57:47 -08:00
Wunkolo
609c64196b cpu_detect: Utilize Bit<N> utility function 2022-03-09 13:57:47 -08:00
Wunkolo
31f8d6f0cf cpu_detect: Compact capability fields
As this structure gets more explicit, bools can be bitfields and
small enums can use smaller types for their span of values.
2022-03-09 13:57:47 -08:00
Wunkolo
fbf00e7fbc bit_util: Add bit utility function
Extracts a singular bit, as a bool, from the specified compile-time index.
2022-03-09 13:57:47 -08:00
bunnei
685526c857 Merge pull request #7975 from bunnei/ldr-fix
hle: service: ldr: Use deterministic addresses when mapping NROs.
2022-03-08 17:39:03 -08:00
bunnei
86eaedbf19 hle: service: ldr: Use deterministic addresses when mapping NROs.
- Instead of randomization, choose in-order addresses for where to map NROs into memory.
- This results in predictable behavior when debugging and consistent behavior when reproducing issues.
2022-03-08 17:38:20 -08:00
bunnei
d1aae938a9 Merge pull request #7986 from lat9nq/vk-callback
core, video_core: Fix two crashes when failing to create the emulated GPU instance
2022-03-08 12:36:57 -08:00
Fernando S
b50dd6199e Merge pull request #7989 from degasus/maxwell_LUT3
shader_recompiler/LOP3: Use brute force python results within switch/case.
2022-03-08 15:40:31 +01:00
Markus Wick
062d95753f shader_recompiler/LOP3: Use brute force python results within switch/case.
Thanks to @asLody for optimizing this function. This raised the focus that this function should be optimized more.

The current table assumes that the host GPU is able to invert for free, so only AND,OR,XOR are accumulated in the performance metrik.

Performance results:

Instructions
0: 8
1: 30
2: 114
3: 80
4: 24

Latency
0: 8
1: 30
2: 194
3: 24
2022-03-08 09:44:28 +01:00
bunnei
0e203d30f9 Merge pull request #7974 from bunnei/improve-code-mem
Kernel Memory Updates (Part 5): Revamp MapCodeMemory and UnmapCodeMemory.
2022-03-07 20:28:39 -08:00
bunnei
9dd48f8f89 hle: kernel: KPageTable: Improve implementations of MapCodeMemory and UnmapCodeMemory.
- This makes these functions more accurate to the real HOS implementations.
- Fixes memory access issues in Super Smash Bros. Ultimate that occur when un/mapping NROs.
2022-03-07 17:18:20 -08:00
lat9nq
173ddc9e6b video_core: Cancel Scoped's exit call on GPU failure
When CreateRenderer fails, the GraphicsContext that was std::move'd into
it is destroyed before the Scoped that was created to manage its
currency. In that case, the GraphicsContext::Scoped will still call its
destructor at the ending of the function. And because the context is
destroyed, the Scoped will cause a crash as it attempts to call a
destroyed object's DoneCurrent function.

Since we know when the call would be invalid, call the Scoped's Cancel
method. This prevents it from calling a method on a destroyed object.
2022-03-07 18:21:56 -05:00
lat9nq
e3f8340bec emu_window: Create a way to Cancel the exit of a Scoped
If a GraphicsContext is destroyed before its Scoped is destroyed, this
causes a crash as the Scoped tries to call a method in the destroyed
context on exit.

Add a way to Cancel the call when we know that calling the
GraphicsContext will not work.
2022-03-07 18:21:56 -05:00
Fernando S
3e2bc9e813 Merge pull request #7930 from asLody/dma-semaphore
MaxwellDMA: Implement semaphore operations
2022-03-07 21:53:38 +01:00
lat9nq
7df809b8b1 core: Don't shutdown a null GPU
When CreateGPU fails, yuzu would try and shutdown the GPU instance
regardless of whether any instance was actually created.

Check for nullptr before calling its methods to prevent a crash.
2022-03-07 15:25:20 -05:00
Lody
3ec2e46e15 MaxwellDMA: Implement semaphore operations 2022-03-07 13:46:18 +08:00
Ameer J
7d636e10d7 gl_graphics_pipeline: Improve shader builder synchronization using fences (#7969)
* gl_graphics_pipeline: Improve shader builder synchronization

Make use of GLsync objects to ensure better synchronization between shader builder threads and the main context

* gl_graphics_pipeline: Make built_fence access threadsafe

* gl_graphics_pipeline: Use GLsync objects only when building in parallel

* gl_graphics_pipeline: Replace GetSync calls with non-blocking waits

The spec states that a ClientWait on a Fence object ensures the changes propagate to the calling context
2022-03-06 16:46:49 +01:00
BytesGalore
f2ef0fede2 build(cmake): fix missing Qt5::DBus link target 2022-03-06 12:21:46 +01:00
BytesGalore
d97faa768c Merge branch 'yuzu-emu:master' into master 2022-03-06 11:38:18 +01:00
Fernando S
bc96f67ce1 Merge pull request #7973 from Morph1984/debug-crash
host_memory: Fix fastmem crashes in debug builds
2022-03-06 04:49:27 +01:00
BytesGalore
8f530cbb09 loader: log the type of mismatching file-extension 2022-03-03 06:45:13 +01:00
bunnei
9d25f5409d Merge pull request #7935 from Wunkolo/logging-join-fix
logging: Convert `backend_thread` into an `std::jthread`
2022-03-02 19:09:26 -08:00
bunnei
ae301a650e Merge pull request #7956 from bunnei/improve-mem-manager
Kernel Memory Updates (Part 4): Revamp KMemoryManager & other fixes
2022-03-02 17:55:51 -08:00
Morph
5ea520a149 host_memory: Fix fastmem crashes in debug builds
It is possible for virtual_offset to not be 0 when the iterator is at the beginning, and thus, std::prev(it) may be evaluated, leading to a crash in debug mode.

Co-Authored-By: Fernando S. <1731197+FernandoS27@users.noreply.github.com>
2022-03-02 18:36:59 -05:00
Fernando S
a4a6aa4b33 Merge pull request #7959 from merryhime/cmpxchg
dynarmic: Inline exclusive memory accesses
2022-03-01 22:50:52 +01:00
Mai M
079400000c Merge pull request #7967 from zhaobot/tx-update-20220301023432
Update translations (2022-03-01)
2022-03-01 00:50:28 -05:00
The yuzu Community
e274042d12 Update translations (2022-03-01) 2022-03-01 02:34:54 +00:00
german77
9188dfafc4 applet: mii: Simple implementation of mii applet 2022-02-28 18:53:41 -06:00
Mai M
7b55338788 Merge pull request #7963 from ameerj/gl_fence_nit
gl_fence_manager: Minor optimization to signal querying
2022-02-28 19:53:24 -05:00
Mai M
91f78954f1 Merge pull request #7966 from merryhime/cmake-ffmpeg-endif
ffmpeg: Fix mis-maching argument warning for endif
2022-02-28 19:51:10 -05:00
Merry
da236f22b3 ffmpeg: Fix mis-maching argument warning for endif 2022-02-28 21:08:12 +00:00
merry
4b709cce07 dynarmic: Update to latest master 2022-02-28 20:10:13 +00:00
bunnei
82ca8230ad hle: kernel: Re-create memory layout at initialization.
- As this can only be derived once.
2022-02-27 18:00:09 -08:00
bunnei
41c9c93736 hle: kernel: Remove unused pool locals. 2022-02-27 18:00:09 -08:00
bunnei
939707cf75 hle: kernel: k_memory_manager: Rework for latest kernel behavior.
- Updates the KMemoryManager implementation against latest documentation.
- Reworks KMemoryLayout to be accessed throughout the kernel.
- Fixes an issue with pool sizes being incorrectly reported.
2022-02-27 18:00:09 -08:00
Wunkolo
8da42d8235 logging: Convert backend_thread into an std::jthread
Was getting an unhandled `invalid_argument` [exception](https://en.cppreference.com/w/cpp/thread/thread/join) during
shutdown on my linux machine. This removes the need for a `StopBackendThread` function entirely since `jthread`
[automatically handles both checking if the thread is joinable and stopping the token before attempting to join](https://en.cppreference.com/w/cpp/thread/jthread/~jthread) in the case that `StartBackendThread` was never called.
2022-02-27 16:23:52 -08:00
ameerj
51d9a43dad gl_fence_manager: Minor optimization to signal querying
Per the spec, bufSize is the number of integers that will be written, in this case, 1.

Also, the length argument is optional if the information of the number of elements written is not needed.
2022-02-27 17:57:33 -05:00
merry
3fe2c2d40d dynarmic: Inline exclusive memory accesses
Inlines implementation of exclusive instructions into JITted code,
improving performance of applications relying heavily on these
instructions.

We also fastmem these instructions for additional speed, with
support for appropriate recompilation on fastmem failure.

An unsafe optimization to disable the intercore global_monitor is also
provided, should one wish to rely solely on cmpxchg semantics for
safety.

See also: merryhime/dynarmic#664
2022-02-27 19:40:05 +00:00
bunnei
d780096c3c hle: kernel: k_page_heap: GetPhysicalAddr can be const. 2022-02-27 10:34:02 -08:00
bunnei
00d395c330 hle: kernel: k_page_heap: Remove superfluous consexpr. 2022-02-27 10:34:02 -08:00
bunnei
3f129b2700 hle: kernel: k_page_heap: Various updates and improvements.
- KPageHeap tracks physical addresses, not virtual addresses.
- Various updates and improvements to match latest documentation for this type.
2022-02-27 10:34:02 -08:00
bunnei
8ef7b10f92 hle: kernel: Add initial_process.h header. 2022-02-27 10:34:02 -08:00
bunnei
75b111b6de hle: kernel: board: nx: Add k_memory_layout.h header. 2022-02-27 10:34:02 -08:00
bunnei
99acfba11f hle: kernel: k_system_control: Add GetRealMemorySize and update GetKernelPhysicalBaseAddress. 2022-02-27 10:34:02 -08:00
bunnei
f562f3780e hle: kernel: k_memory_layout: Add GetPhysicalLinearRegion. 2022-02-27 10:34:02 -08:00
bunnei
a48d756692 hle: kernel: k_memory_region_types: Update for new regions. 2022-02-27 10:34:02 -08:00
bunnei
b05068b092 Merge pull request #7955 from bunnei/update-dynarmic
externals: Dynarmic: Update to latest rev.
2022-02-26 10:52:47 -08:00
bunnei
de0c647109 externals: Dynarmic: Update to latest rev.
- Fixes inaccurate size reporting in SpaceRemaining, which caused crashes in yuzu with SSBU.
2022-02-26 09:51:41 -08:00
bunnei
2bbcc3d1c4 Merge pull request #7932 from bunnei/extended-mem-layout
Add extended memory layout (6GB) support and improve KResourceLimit management
2022-02-26 01:41:08 -08:00
bunnei
254c8f1736 Merge pull request #7953 from ameerj/radv-rdna2-crash
vulkan_device: Blacklist RADV on RDNA2 from VK_EXT_vertex_input_dynamic_state
2022-02-26 01:19:13 -08:00