aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-05-29Add multi-level function table (#2228)FICTURE7
* Add AddressTable<T> * Use AddressTable<T> for dispatch * Remove JumpTable & co. * Add fallback for out of range addresses * Add PPTC support * Add documentation to `AddressTable<T>` * Make AddressTable<T> configurable * Fix table walk * Fix IsMapped check * Remove CountTableCapacity * Add PPTC support for fast path * Rename IsMapped to IsValid * Remove stale comment * Change format of address in exception message * Add TranslatorStubs * Split DispatchStub Avoids recompilation of stubs during tests. * Add hint for 64bit or 32bit * Add documentation to `Symbol` * Add documentation to `TranslatorStubs` Make `TranslatorStubs` disposable as well. * Add documentation to `SymbolType` * Add `AddressTableEventSource` to monitor function table size Add an EventSource which measures the amount of unmanaged bytes allocated by AddressTable<T> instances. dotnet-counters monitor -n Ryujinx --counters ARMeilleure * Add `AllowLcqInFunctionTable` optimization toggle This is to reduce the impact this change has on the test duration. Before everytime a test was ran, the FunctionTable would be initialized and populated so that the newly compiled test would get registered to it. * Implement unmanaged dispatcher Uses the DispatchStub to dispatch into the next translation, which allows execution to stay in unmanaged for longer and skips a ConcurrentDictionary look up when the target translation has been registered to the FunctionTable. * Remove redundant null check * Tune levels of FunctionTable Uses 5 levels instead of 4 and change unit of AddressTableEventSource from KB to MB. * Use 64-bit function table Improves codegen for direct branches: mov qword [rax+0x408],0x10603560 - mov rcx,sub_10603560_OFFSET - mov ecx,[rcx] - mov ecx,ecx - mov rdx,JIT_CACHE_BASE - add rdx,rcx + mov rcx,sub_10603560 + mov rdx,[rcx] mov rcx,rax Improves codegen for dispatch stub: and rax,byte +0x1f - mov eax,[rcx+rax*4] - mov eax,eax - mov rcx,JIT_CACHE_BASE - lea rax,[rcx+rax] + mov rax,[rcx+rax*8] mov rcx,rbx * Remove `JitCacheSymbol` & `JitCache.Offset` * Turn `Translator.Translate` into an instance method We do not have to add more parameter to this method and related ones as new structures are added & needed for translation. * Add symbol only when PTC is enabled Address LDj3SNuD's feedback * Change `NativeContext.Running` to a 32-bit integer * Fix PageTable symbol for host mapped
2021-05-25amadeus: Update to REV9 (#2309)Mary
* amadeus: Update to REV9 This implements all the changes made with REV9 on 12.0.0. * Address Ac_k's comments
2021-05-24POWER - Performance Optimizations With Extensive Ramifications (#2286)riperiperi
* Refactoring of KMemoryManager class * Replace some trivial uses of DRAM address with VA * Get rid of GetDramAddressFromVa * Abstracting more operations on derived page table class * Run auto-format on KPageTableBase * Managed to make TryConvertVaToPa private, few uses remains now * Implement guest physical pages ref counting, remove manual freeing * Make DoMmuOperation private and call new abstract methods only from the base class * Pass pages count rather than size on Map/UnmapMemory * Change memory managers to take host pointers * Fix a guest memory leak and simplify KPageTable * Expose new methods for host range query and mapping * Some refactoring of MapPagesFromClientProcess to allow proper page ref counting and mapping without KPageLists * Remove more uses of AddVaRangeToPageList, now only one remains (shared memory page checking) * Add a SharedMemoryStorage class, will be useful for host mapping * Sayonara AddVaRangeToPageList, you served us well * Start to implement host memory mapping (WIP) * Support memory tracking through host exception handling * Fix some access violations from HLE service guest memory access and CPU * Fix memory tracking * Fix mapping list bugs, including a race and a error adding mapping ranges * Simple page table for memory tracking * Simple "volatile" region handle mode * Update UBOs directly (experimental, rough) * Fix the overlap check * Only set non-modified buffers as volatile * Fix some memory tracking issues * Fix possible race in MapBufferFromClientProcess (block list updates were not locked) * Write uniform update to memory immediately, only defer the buffer set. * Fix some memory tracking issues * Pass correct pages count on shared memory unmap * Armeilleure Signal Handler v1 + Unix changes Unix currently behaves like windows, rather than remapping physical * Actually check if the host platform is unix * Fix decommit on linux. * Implement windows 10 placeholder shared memory, fix a buffer issue. * Make PTC version something that will never match with master * Remove testing variable for block count * Add reference count for memory manager, fix dispose Can still deadlock with OpenAL * Add address validation, use page table for mapped check, add docs Might clean up the page table traversing routines. * Implement batched mapping/tracking. * Move documentation, fix tests. * Cleanup uniform buffer update stuff. * Remove unnecessary assignment. * Add unsafe host mapped memory switch On by default. Would be good to turn this off for untrusted code (homebrew, exefs mods) and give the user the option to turn it on manually, though that requires some UI work. * Remove C# exception handlers They have issues due to current .NET limitations, so the meilleure one fully replaces them for now. * Fix MapPhysicalMemory on the software MemoryManager. * Null check for GetHostAddress, docs * Add configuration for setting memory manager mode (not in UI yet) * Add config to UI * Fix type mismatch on Unix signal handler code emit * Fix 6GB DRAM mode. The size can be greater than `uint.MaxValue` when the DRAM is >4GB. * Address some feedback. * More detailed error if backing memory cannot be mapped. * SetLastError on all OS functions for consistency * Force pages dirty with UBO update instead of setting them directly. Seems to be much faster across a few games. Need retesting. * Rebase, configuration rework, fix mem tracking regression * Fix race in FreePages * Set memory managers null after decrementing ref count * Remove readonly keyword, as this is now modified. * Use a local variable for the signal handler rather than a register. * Fix bug with buffer resize, and index/uniform buffer binding. Should fix flickering in games. * Add InvalidAccessHandler to MemoryTracking Doesn't do anything yet * Call invalid access handler on unmapped read/write. Same rules as the regular memory manager. * Make unsafe mapped memory its own MemoryManagerType * Move FlushUboDirty into UpdateState. * Buffer dirty cache, rather than ubo cache Much cleaner, may be reusable for Inline2Memory updates. * This doesn't return anything anymore. * Add sigaction remove methods, correct a few function signatures. * Return empty list of physical regions for size 0. * Also on AddressSpaceManager Co-authored-by: gdkchan <gab.dark.100@gmail.com>
2021-05-24Improve accuracy of reciprocal step instructions (#2305)gdkchan
* Improve accuracy of reciprocal step instructions * Fix small mistake on RECPE rounding, nits, PTC version bump
2021-05-24Fix value of constant vertex attributes (#2307)gdkchan
2021-05-24Compare aligned size for largest mip level when considering sampler resize ↵riperiperi
(#2306) * Compare aligned size for largest mip level when considering sampler resize When selecting a texture that's a view for a sampler resize, we should take care that resizing it doesn't change the aligned size of any larger mip levels. This PR covers two cases: - When creating a view of the texture, we check that the aligned size of the view shifted up to level 0 still matches the aligned size of the container. If it does not, a copy dependency is created rather than resizing. - When searching for a texture for sampler, textures that do _not_ match our aligned size when both are shifted up by its base level are not considered an exact match, as resizing the found texture will cause the mip 0 aligned size to change. It will create a copy dependency view instead. Fixes graphical errors and crashes (on flush) in various Unity games that use render-to-texture. * Move shared code to its own method.
2021-05-22Use a different method for out of bounds blit (#2302)gdkchan
* Use a different method for out of bounds blit * This is not needed
2021-05-22Add another Depth32F texture format (#2304)gdkchan
2021-05-22Fix non-independent blend state not being updated (#2303)gdkchan
* Fix non-independent blend state not being updated * Actually, this is not needed
2021-05-21Extend info printed when guest crashes/breaks execution (#1845)Somebody Whoisbored
* Add CPU register printout when guest crashes/breaks execution * Print out registers when undefined instruction is hit * Apply suggestions from code review Co-authored-by: Ac_K <Acoustik666@gmail.com> * Fixes after rebase * Address gdkchan's comments Co-authored-by: Ac_K <Acoustik666@gmail.com> Co-authored-by: Mary <me@thog.eu>
2021-05-21input: Implement a SDL2 keyboard backend (#2277)Mary
* input: Implement a SDL2 keyboard backend Add a new keyboard backend to the Ryujinx.Input.SDL2 project. This is currently unused. * Address Ac_k's comments * Address gdkchan's comments
2021-05-21Fix dimensions check for scale eligibility (#2301)riperiperi
2021-05-20Fix buffer and texture uses not being propagated for vertex A/B shaders (#2300)gdkchan
* Fix buffer and texture uses not being propagated for vertex A/B shaders * Shader cache version bump
2021-05-20Fix constant buffer array size when indexing is used and other buffer ↵gdkchan
descriptor and resolution scale regressions (#2298) * Fix constant buffer array size when indexing is used * Change default QueryConstantBufferUse value * Fix more regressions * Ensure proper order
2021-05-20ffmpeg: Attempt to fix RootPath on some linux distributions (#2292)Ac_K
* fix ffmpeg lib path * Check if ffmpeg isn't found * Move code to FFmpegContext * Call it in static constructor * revert static instance * rollback * lazy initialization * Revert "lazy initialization" This reverts commit f675d26a5d15ade72e41a5ba899ba80aed3c396d.
2021-05-20Assign _backgroundContext before starting its worker thread. (#2299)riperiperi
Fixes a random crash when starting an embedded game.
2021-05-20Use branch instead of tailcall for recursive calls (#2282)FICTURE7
* Use branch instead of tailcall for recursive calls Use a branch instead of doing a tailcall for recursive calls. This avoids having to store the dispatch address, setting up the epilogue and keeps guest registers in host registers for longer. The rejit check is moved down into the entry block so that the rejit behaviour remains the same as before. * Set PTC version Co-authored-by: gdkchan <gab.dark.100@gmail.com>
2021-05-20Add `BIC/ORR Vd.T, #imm` fast path (#2279)FICTURE7
* Add fast path for BIC Vd.T, #imm * Add fast path for ORR Vd.T, #imm * Set PTC version * Fixup Exception to InvalidOperationException
2021-05-19Move shader resource descriptor creation out of the backend (#2290)gdkchan
* Move shader resource descriptor creation out of the backend * Remove now unused code, and other nits * Shader cache version bump * Nits * Set format for bindless image load/store * Fix buffer write flag
2021-05-19Merge pull request #2177 from riperiperi/feature/parallel-shader-cacheEmulationFanatic
Allow parallel shader compilation when loading a shader cache
2021-05-19Remove ForceDedicatedGpu, as the driver utilities will now do that.riperiperi
2021-05-19Pass CbufSlot when getting info from the texture descriptor (#2291)riperiperi
* Pass CbufSlot when getting info from the texture descriptor Fixes some issues with bindless textures, when CbufSlot is not equal to the current TextureBufferIndex. Specifically fixes a random chance of full screen colour flickering in Super Mario Party. * Apply suggestions from code review Oops Co-authored-by: gdkchan <gab.dark.100@gmail.com> Co-authored-by: gdkchan <gab.dark.100@gmail.com>
2021-05-17Allow `LocalVariable` to be assigned more than once (#2288)FICTURE7
* Allow `LocalVariable` to be assigned more than once This allows us to write flow controls like loops and if-elses with LocalVariables participating in phi nodes. * Add `GetLocalNumber` to operand
2021-05-16Use copy dependencies for the Intel/AMD view format workaround (#2144)riperiperi
* This might help AMD a bit * Removal of old workaround.
2021-05-16misc: Move configuration management to the Ryujinx project (#2269)Mary
* Decouple configuration from Ryujinx.HLE and Ryujinx.Input * Move Configuration to the Ryujinx project
2021-05-14ci: Do not enforce userid on nightly PR commentMary
This avoid issues when two different users work on a single PR.
2021-05-13Fold constant offsets and group constant addresses (#2285)gdkchan
* Fold constant offsets and group constant addresses * PPTC version bump
2021-05-13PPTC meets ExeFS Patching. (#1865)LDj3SNuD
* PPTC meets ExeFS Patching. * InternalVersion = 1865 * Ready! * Optimized the PtcProfiler Load/Save methods.
2021-05-12Fix race in SM initialization (#2280)gdkchan
2021-05-11Fix a specific core migration bug on the scheduler (#2271)gdkchan
2021-05-08Miria: Fix GTK3 keyboard mapping (#2273)Mary
I found some mistake I made back when I first wrote the mapping for Miria. This fix: - an offset by one after the tilde key in the mapping. - F30 being mapped to F29.
2021-05-07Fix embedded game rendering (#2275)Mary
This fix an issue when after a relaunch of a game containing other games (embedded games), the renderer window size would be 1x1. This bug was introduced by #2260.
2021-05-07misc: Fix default value for GraphicsConfig.MaxAnisotropy (#2274)Mary
As title say. Doesn't change anything as the Ryujinx project set it.
2021-05-05SM instance & TIPC fixes (#2241)Mary
This PR addresses the following issues: - SM was previously instancied once and reused on all sessions. This could cause inconsistency on the service initialization. - TIPC replies were not matching what is generated on hardware.
2021-05-05audio: Implement a SDL2 backend (#2258)Mary
* audio: Implement a SDL2 backend This adds support to SDL2 as an audio backend. It has the same compatibility level as OpenAL without its issues. I also took the liberty of restructuring the SDL2 code to have one shared project between audio and input. The configuration version was also incremented. * Address gdkchan's comments * Fix update logic * Add an heuristic to pick the correct target sample count wanted by the game * Address gdkchan's comments * Address Ac_k's comments * Fix audren output * Address gdkchan's comments
2021-05-05ffmpeg: Redirect log output (#2266)Ac_K
* ffmpeg: Redirect log output * Remove leftover delegate * Logging -> Log
2021-05-05nsd: Cleanup the service and implement some calls (#2250)Ac_K
* nim: Cleanup the service and implement some calls * Fix symbol typo * add ApplicationServerEnvironmentType enum * Change condition
2021-05-04gtk3: Add base for future Vulkan integration (#2260)Mary
* gtk3: Add base for future Vulkan integration This PR puts in place the fondation for the future Vulkan integration on the GTK3 UI. This also updated SPB to 0.0.3-build14 that fixed a use after free on XErrorHandler on Linux. * Address rip's comments * Merge GLWidget inside GLRenderer * Clean up and deduplicate renderer implementations * Address shahil's comments * Address Ac_K's comments * Address gdkchan's comments
2021-05-03Set FFmpeg.AutoGen library search path on LinuxMary
This fix FFmpeg.AutoGen being unable to find system ffmpeg libraries on Linux.
2021-05-02misc: Cleanup Discord Presence (#2262)Ac_K
* ui: Cleanup Discord Presence * Clean Timestamps
2021-05-02Update to FFmpeg 4.4.0 (#2259)Mary
* Update to FFmpeg 4.4.0 As the title say * Fix warning from 4.4.0
2021-05-02hid: Rewrite shared memory management (#2257)Mary
* hid: Rewrite shared memory management This entirely rewrite our ancient (and original) HID shared memory interface to be more usable and accurate. HID update logics were updated to reflect those changes but should work still the same way it previously did. This need heavy testing just in case to avoid possible regressions. * Silence warnings * Address gdkchan's comments * Address Ac_K's comments * Address one missing nit
2021-05-01Fix shader buffer write flag on atomic instructions (#2261)gdkchan
* Fix shader buffer write flag on atomic instructions * Shader cache version bump
2021-04-30Changes ordering of config.json and configuration files (#2253)Mark Araujo
This allows configuration values to be written to log file for analysis
2021-04-30nfp: Increase Amiibo scanning delay (#2256)Ac_K
2021-04-26Fix GetClockSnapshot not writing steady clock timepoint (#2249)gdkchan
2021-04-26Initialize hid inputs on activation (#2246)Caian Benedicto
2021-04-25Fix uint -> int typo. (#2245)EmulationFanatic
2021-04-25Fix IsRegionInUse check on NV memory allocator (#2243)gdkchan
2021-04-24HLE: Fix integer sign inconcistency accross the codebase (#2222)Mary
* Make all title id instances unsigned * Replace address and size with ulong instead of signed types Long overdue change. Also change some logics here and there to optimize with the new memory manager. * Address Ac_K's comments * Remove uneeded cast all around * Fixes some others misalignment