* Cpu: Implement Vpadal and Vrintr instructions
This PR superseed last instructions left in #2242.
Since I'm not a CPU guy I've just ported the code and nothing more.
Please be precise during review if there are some changes to be done.
It should fixes#1781
Co-Authored-By: Piyachet Kanda <piyachetk@gmail.com>
* Addresses gdkchan's feedback
* Addresses gdkchan's feedback 2
* Apply suggestions from code review
Co-authored-by: gdkchan <gab.dark.100@gmail.com>
* another fix
* Update InstEmitSimdHelper32.cs
* Correct fix
* Addresses gdkchan's feedback
* Update CpuTestSimdCvt32.cs
---------
Co-authored-by: Piyachet Kanda <piyachetk@gmail.com>
Co-authored-by: gdkchan <gab.dark.100@gmail.com>
Updates `Avalonia.Svg` from 11.0.0.10 to 11.0.0.13
Updates `Avalonia.Svg.Skia` from 11.0.0.10 to 11.0.0.13
And reflect update changes as dependabot can't do it.
Superseed #6209
* Migrate friends service to new IPC
* Add a note that the pointer buffer size and domain counts are wrong
* Wrong length
* Format whitespace
* PR feedback
* Fill in structs from PR feedback
* Missed that one
* Somehow forgot to save that one
* Fill in enums from PR review
* Language enum, NotificationTime
* Format whitespace
* Fix the warning
* Remove GetBaseApplicationDirectory() & Move logs directory to user base path
We should assume the application directory might be write-protected.
* Use Ryujinx.sh in Ryujinx.desktop
This desktop file isn't really used right now,
so this changes effectively nothing.
* Use properties in ReleaseInformation.cs and add ConfigName property
* Configure config filename in Github workflows
* Add a separate config step for macOS
Because they use BSD sed instead of GNU sed
* Keep log directory at the old location for dev environments
* Add FileSystemUtils since Directory.Move() doesn't work across filesystems
Steal CopyDirectory code from https://learn.microsoft.com/en-us/dotnet/standard/io/how-to-copy-directories
* Fix "Open Logs folder" button pointing to the wrong directory
* Add execute permissions to Ryujinx.sh
* Fix missing newlines
* AppDataManager: Use FileSystemUtils.MoveDirectory()
* Make dotnet format happy
* Add a fallback for the logging directory
* Mod: Do LayeredFs loading Parallel to improve speed
This fixes and superseed #5672 due to inactivity, nothing more.
(See original PR for description)
Testing are welcome.
Close#5661
* Addresses gdkchan's feedback
* commit to test mako change
* Revert "commit to test mako change"
This reverts commit 8b0caa8a21.
* Allow skipping draws with broken pipeline variants on Vulkan
* Move IsLinked check to CreatePipeline
* Restore throw on error behaviour for background compile
* Can't remove SetAlphaTest pragmas yet
* Double new line
* Fs: Log when Commit fails due to PathAlreadyInUse
This fixes and superseed #5418, nothing more.
(See original PR for description)
Co-Authored-By: James R T <jamestiotio@gmail.com>
* Update IFileSystem.cs
---------
Co-authored-by: James R T <jamestiotio@gmail.com>
* Replace vendor id lookup with driver name
* Create separate field for driver name, handle OpenGL
* Document changes in VulkanPhysicalDevice.cs
* Always display driver over vendor
* Replace Vulkan 1.2 requirement with VK_KHR_driver_properties
* Remove empty line
* Remove redundant unsafe block
* Apply suggestions from code review
---------
Co-authored-by: Ac_K <Acoustik666@gmail.com>
* ssl: Retrieve remote hostnames if the provided hostname is empty
This avoids crashing with an AuthenticationException.
* ssl: Remove unused variable from RetrieveHostName
* Vulkan: Use staging buffer for temporary constants
Helper shaders and post processing effects typically need some parameters to tell them what to do, which we pass via constant buffers that are created and destroyed each time.
This can vary in cost between different Vulkan drivers. It shows up on profiles on mesa and MoltenVK, so it's worth avoiding. Some games only do it once (BlitColor for present), others multiple times. It's also done for post processing filters and FSR upscaling, which creates two buffers.
For mirrors, I added the ability to reserve a range on the staging buffer for use as any type of binding. This PR allows these constant buffers to be instead temporarily allocated on the staging buffer, skipping allocation and buffer management costs entirely.
Two temporary allocations do remain:
- DrawTexture, because it doesn't have access to the command buffer scope
- Index buffer indirect conversion, because one of them is a storage buffer and thus is a little more complicated.
There's a small cost in that the uniform buffer takes up more space due to alignment requirements. At worst that's 256 bytes (on a GTX 1070) but more modern GPUs should have a better time.
Worth testing across different games and post effects to make sure they still work.
* Use temporary buffer for ConvertIndexBufferIndirect
* Simplify alignment passing for now
* Fix shader params length for CopyIncompatibleFormats
* Set data for helpershaders without overlap checks
The data is in the staging buffer, so its usage range is guarded using that.
Turns out that ElementAt for Queue<T> runs the default implementation as it doesn't implement IList, which enumerates elements of the queue up to the given index. This code was creating `count` enumerators and iterating way more queue items than it needed to at higher counts. The solution is just to use one enumerator and break out of the loop when we get the count that we need.
3.5% of backend time was being spent _just_ enumerating at the usual spot in SMO.
* Fix architecture preference for MacOS game shortcuts
* Detect arch and then pass it to script
Co-authored-by: jcm <john.moody@coloradocollege.edu>
* Remove old script write call in `CreateShortcutMacos`
* Turn launch script into EmbeddedResource
* Added final newline
---------
Co-authored-by: jcm <john.moody@coloradocollege.edu>
* Add a separate device memory manager
* Still need this
* Device writes are always tracked
* Device writes are always tracked (2)
* Rename more instances of gmm to mm
* Input: Improve controller identification
Controllers were identified before by a combination of their _global_ index in the list of controllers and their GUID. The problem is, disconnecting and reconnecting a controller can change its global index; the controller can appear at the end. This would give it another ID, and the controller would need to be reconfigured.
This happened to me a lot with a switch pro controller and a USB game controller, it was essentially random which appeared first. Now, it consistently detects them.
This PR changes the controller identification to be a combination of an index of controllers with the same GUID (generally 0), and its GUID. It also reworks managing the list of controllers to properly consider instance IDs.
This also changes the NpadManager to attempt to reuse old controllers when refreshing input configuration, which can prevent input from going dead for seconds whenever a controller connects or disconnects (and the switch pro controller just entirely dying).
Testing with different controller types, OS and Avalonia is welcome. Remember that the target is connecting a ton of controllers, and pulling/reconnecting them.
* Remove double empty line
* Implement a new JIT for Arm devices
* Auto-format
* Make a lot of Assembler members read-only
* More read-only
* Fix more warnings
* ObjectDisposedException.ThrowIf
* New JIT cache for platforms that enforce W^X, currently unused
* Remove unused using
* Fix assert
* Pass memory manager type around
* Safe memory manager mode support + other improvements
* Actual safe memory manager mode masking support
* PR feedback
* Move most of signal handling to Ryujinx.Cpu project
* Format whitespace
* Remove unused member
* Format whitespace
* This does not need to be public anymore
This prevents a small allocation each time this method is called. This is a top 3 SOH allocation during gameplay in most games, and eliminating it is pretty free.
* Remove redundant code and fix small issues
* Log amiibo exceptions
* Add more checks when getting Amiibo data
* Fall back to online data if local file is inaccessible
* Make dotnet format happy
* Add Hebrew locale files to ItemGroups
* Align all windows RTL for testing
This should be controlled with a binding that selects the appropriate layout based on current language
* Update FlowDirection as Locale changes
* Fix Settings NavigationViewItem FlowDirection
* Fix remaining text
* Fix input menu directionality
* Fix RTL not rendering
* Fix rebase errors
* Local Amiibo.json should be used if connection failed
Currently Ryujinx is not loading any Amiibo if connection fails, even if the Amiibo.json exists.
This fix will use the local file and show a Dialog if connection fails.
* using local Amiibo.json & fixed Amiibo.json date comparison
Using local Amiibo.json when connection fails and comparison without milliseconds for LastModified that comes from https://amiibo.ryujinx.org/ and the local one (The JSON file has milliseconds on it, those will cause an error when comparing the date from the header because the header one doesn't has milliseconds on it). Both changes made for Avalonia UI.
* Fixed date comparison
Same date comparison fix, but made for normal UI (Not for AvaloniaUI).
This error can be prevented if the file in https://amiibo.ryujinx.org/ did not have the date with milliseconds.
* Securely trying to get a list of Amiibo (For normal UI)
* Securely trying to get a list of Amiibo (Change for AvaloniaUI)
* Date comparison reverted
* Apply suggestions from code review
* Use fallback amiibo.json if remote file is not valid (Normal UI)
* Use fallback amiibo.json if remote file is not valid (Avalonia UI)
* Code styles corrected.
* Code styles corrected in AmiiboWindowViewModel.
* Readded Ryujinx.Common.Logging using.
* Fixed using order.
---------
Co-authored-by: Ac_K <Acoustik666@gmail.com>
* Pass MultiRange to BufferManager
* Implement support for multi-range buffers using Vulkan sparse mappings
* Use multi-range for remaining buffers, delete old methods
* Assume that more buffers are contiguous
* Dispose multi-range buffers after they are removed from the list
* Properly init BufferBounds for constant and storage buffers
* Do not try reading zero bytes data from an unmapped address on the shader cache + PR feedback
* Fix misaligned sparse buffer offsets
* Null check can be simplified
* PR feedback
* Improve indication of emulation being paused by the User
* Use localised for Paused
* Backup original title - PR comments fix
* Add common helper method to assemble App title
* feat: add nanosleep for linux and macos
* Add Windows 0.5ms sleep
- Imprecise waits for longer waits with clock alignment
- 1/4 the spin time on vsync timer
* Remove old experiment
* Fix event leak
* Tweaking for MacOS
* Linux tweaks, nanosleep vsync improvement
* Fix overbias
* Cleanup
* Fix realignment
* Add some docs and some cleanup
NanosleepPool needs more, Nanosleep has some benchmark code that needs removed.
* Rename "Microsleep" to "PreciseSleep"
Might have been confused with "microseconds", which no measurement is performed in.
* Remove nanosleep measurement
* Remove unused debug logging
* Nanosleep Pool Documentation
* More cleanup
* Whitespace
* Formatting
* Address Feedback
* Allow SleepUntilTimePoint to take EventWaitHandle
* Remove `_chrono` stopwatch in SurfaceFlinger
* Move spinwaiting logic to PreciseSleepHelper
Technically, these achieve different things, but having them here makes them easier to reuse or tune.
* Enable copy dependency between RGBA8 and RGBA32 formats
* Take packed flag into account for texture formats
* Account for widths not being a multiple of each other
* Don't try to alias depth textures as color, fix log condition
* PR feedback
* Change TargetFramework to net8.0
* Disable info messages
* Fix warings
* Disable additional analyzer messages
* Fix typo
* Add whitespace
* Fix ref vs in warnings
* Use explicit [In] on array parameters
* No need to guard Remove with Contains
* Use 'ArgumentOutOfRangeException.ThrowIf...' instead of explicitly throwing a new exception instance
* Bump .NET SDK version
* Enable JsonSerializerIsReflectionEnabledByDefault
* Use 8.0.100 GA release
* Bump System package versions
---------
Co-authored-by: Zoltan Csizmadia <Zoltan.Csizmadia@vericast.com>
* Add default values to ApplicationData directly
* Refactor application loading
It should now be possible to load multi game XCIs.
Included updates won't be detected for now.
Opening a game from the command line currently only opens the first one.
* Only include program NCAs where at least one tuple item is not null
* Get application data by title id and add programIndex check back
* Refactor application loading again and remove duplicate code
* Actually use patch ncas for updates
* Fix number of applications found with multi game xcis
* Don't load bundled updates from multi game xcis
* Change ApplicationData.TitleId type to ulong & Add TitleIdString property
* Use cnmt files and ContentCollection to load programs
* Ava: Add updates and DLCs from gamecarts
* Get the cnmt file from its NCA
* Ava: Identify bundled updates in updater window
* Fix the (hopefully) last few bugs
* Add idOffset parameter to GetNcaByType
* Handle missing file for dlc.json
* Ava: Shorten error message for invalid files
* Gtk: Add additional string for bundled updates in TitleUpdateWindow
* Hopefully fix DLC issues
* Apply formatting
* Finally fix DLC issues
* Adjust property names and fileSize field
* Read the correct update file
* Fix wrong casing for application id strings
* Rename TitleId to ApplicationId
* Address review comments
* Fix formatting issues
* Apply suggestions from code review
Co-authored-by: gdkchan <gab.dark.100@gmail.com>
* Gracefully fail when loading pfs for update and dlc window
* Fix applications with multiple programs
* Fix DLCWindow crash on GTK
* Fix some GUI issues
* Remove IsXci again
---------
Co-authored-by: gdkchan <gab.dark.100@gmail.com>
* remove duplicate basePath arg, add --fullscreen arg
* Changing FriendlyName to set "Ryujinx" text
* Fix GetArgsString using the base path
* Change desktop path to the Applications folder when creating shortcut on Mac
Co-authored-by: Nicko Anastassiu <134955950+nickoanastassiu@users.noreply.github.com>
* Move Create Shortcut button to top of context menu
---------
Co-authored-by: TSR Berry <20988865+TSRBerry@users.noreply.github.com>
Co-authored-by: Nicko Anastassiu <134955950+nickoanastassiu@users.noreply.github.com>
* Implement reprotect method on virtual memory manager (currently stubbed)
* Force all exclusive memory accesses to be ordered on AppleHv
* Format whitespace
* Fix test build
* Fix comment copy/paste
* Fix wrong bit for isLoad
* Update src/Ryujinx.Cpu/AppleHv/HvMemoryManager.cs
Co-authored-by: riperiperi <rhy3756547@hotmail.com>
---------
Co-authored-by: riperiperi <rhy3756547@hotmail.com>
* Fixed formatting/parsing issues with ApplicationData properties TimePlayed, LastPlayed, and FileSize
Replaced double-based TimePlayed property with TimeSpan?-based one in ApplicationData and ApplicationMetadata
Added a migration for TimePlayed, just like in #4861
Consolidated ApplicationData's FileSize* properties into one FileSize property
Added a formatting/parsing helper class ValueFormatUtils for TimeSpans, DateTimes, and file sizes
Added new value converters for TimeSpans and file sizes for the Avalonia UI
Added TimePlayedSortComparer
Fixed sort order in LastPlayedSortComparer
Fixed sort order for ApplicationData fields TimePlayed, LastPlayed, and FileSize
Fixed crashes caused by SortHelper
Replaced SystemInfo.ToMiBString with ToGiBString backed by ValueFormatUtils
Replaced SaveModel.GetSizeString() with ValueFormatUtils
* Additional ApplicationLibrary changes that got lost in the last commit
* Removed unneeded usings
* Removed converters as they are no longer needed
* Updated comment on FormatDateTime
* Removed base10 parameter from ValueFormatUtils
FormatFileSize now always returns base 2 values with base 10 units
Made ParseFileSize capable of parsing both base 2 and base 10 units
* Removed nullable attribute from TimePlayed property
Centralized TimePlayed update code into ApplicationMetadata
* Changed UpdateTimePlayed() to use TimeSpan logic
* Removed JsonIgnore attributes from ApplicationData
* Implemented requested format changes
* Fixed mistakes in method documentation comments
* Made it so the Last Played value "Never" is localized in the Avalonia UI
* Implemented suggestions
* Remove unused import
* Did a comment refinement pass in ValueFormatUtils.cs
* Reordered ValueFormatUtils methods and sorted them into #regions
* Integrated functionality from #5056
Also removed Logger print from last_played migration code
* Implemented suggestions
* Moved ValueFormatUtils and SystemInfo to namespace Ryujinx.Ui.Common
* common: Respect proper value format convention and use base10 by default
This could be discuss again in another issue/PR, for now revert to the previous behavior.
Signed-off-by: Mary Guillemard <mary@mary.zone>
---------
Signed-off-by: Mary Guillemard <mary@mary.zone>
Co-authored-by: TSR Berry <20988865+TSRBerry@users.noreply.github.com>
Co-authored-by: Mary Guillemard <mary@mary.zone>
Added a KEvent for each ServerBase which signals whenever a session is added to the _sessions list, which allows it to rerun the ReplyAndReceive with the new session handle.
This greatly reduces the presence of ServerBase on profiles, especially of games that aren't particularly busy. It should also increase responsiveness when adding session objects, as it doesn't take at most 1ms for them to start working.
It also reduces the load on KTimeManager, which could allow it to spin less often. I have noticed that a bunch of games still do 1ms waits (they actually request a bit less than 1ms), so they still end up spinning to the next millisecond. Maybe for waits like this, it could attempt to nudge the timepoints to snap to each other when they're close enough, and also snap to whole millisecond waits when close enough.
* Add relevant files from private repo
Hopefully I didn't miss anything.
JsonHelper.cs is a debug only change
I only added line 810-812 in IUserLocalCommunicationService.cs
for the new Spacemeowx2Ldn case.
* Add a small README.md
just for fun
* Add note about NetCoreServer update to 5.1.0
* Fix a few issues
Fix usage of wrong broadcast address
Log warning if empty userstring was received
and don't add them to outNetworkInfo
* Add warning about incompatibility with public LDN version
* Add missing changes from old_master
* Adjust ldn_mitm for Ryujinx/Ryujinx#3805
* ldn: Adapt to changes from #4582
* ldn_mitm: First cleanup iteration
* ldn_mitm: Second cleanup iteration
* Credit spacemeowx2 in README.md
* Address first review comments by AcK
Adhere to Ryujinx coding style
Remove leftover log calls
Change category of a few log calls
Remove leftover debug notes
* Replace return type with void for methods always returning true
* Address first review comments by riperiperi
Purely stylistic changes:
- Adhere to naming style for internal fields
- Improve code formatting
* Throw InvalidOperationException when calling wrong ldn proxy methods
* Add missing newlines in LanDiscovery.Scan()
* Fix Linux not receiving broadcast packets
* Remove ILdnUdpSocket
It's very unlikely that we will ever need a udp client.
Thus we should simplify LanDiscovery initialization
and remove the parameter of InitUdp().
* ldn_mitm: Improve formatting
* fixup! Fix Linux not receiving broadcast packets
By opening the udp server on 'LocalBroadcastAddr'
Linux refused to answer packets going to LocalAddr.
So in order to fix this problem, Linux now opens two LdnProxyUdpServers.
* ldn_mitm: Fix assigning incorrect NodeIds
This just made connecting a lot more reliable! Thanks @riperiperi
* Fix node ids when leaving/joining
* Change NodeId behaviour to work like RyuLdn
* Change timing for accept and network info being reported.
* Wait for connection before sending anything.
* Remove ConnectAsync() from ILdnTcpSocket
* Only broadcast scan responses if we're hosting a network.
* Fix some filters, scan network duplication.
* Fix silly mistake
* Don't die on duplicates, just replace.
* Lock around node updates
These can happen from multiple threads.
* ldn_mitm: Fix namespaces for Types
Improve formatting
Add warning if compression failed
* Add quicker scan, forgetting networks that disappear.
* Always force a network sync when updating AdvertiseData
* Fix TCP frame size being too large for compressed frames
* Allow ldn_mitm to pass -1 id for room localcommunicationids.
* ldn_mitm: Match server socket options
* ldn_mitm: Use correct socket options
* ldn_mitm: Remove TCP broadcast socket options
* config: Rename Spacemeowx2Ldn to LdnMitm
* ldn_mitm: Generate random fake SSID
* ldn_mitm: Adjust logging statements/levels
* ldn_mitm: Add missing Stop() call for udp2
* ldn_mitm: Adjust formatting
* ldn_mitm: Add stub comments and adjust existing ones
* ldn: Add LdnConst class & set tx/rx buffer sizes correctly
* Move LdnConst out of UserServiceCreator
Replace a few values with LdnConsts
* ldn: Adjust namespaces and client names
* ldn_mitm: Adjust formatting
* ldn: Rename RyuLdn to LdnRyu
* Replace LanProtocol.Read() refs with scoped refs
* Add MIT license for ldn_mitm
* Clarify that network interface is also used for LDN
Although it's currently only used by ldn_mitm,
it would probably be more confusing to exclude RyuLdn there.
* Fix giving a station node id 0
* Update Nuget packages
* Remove LdnHelper
* Add update functions for EnableInternetAccess setting
* ldn: Log MultiplayerMode and DisableP2P
* ldn: Adjust namespaces
* Apply formatting
* Conform to Ryujinx code style
* Remove ldn_mitm from THIRDPARTY.md
It shouldn't have been there in the first place.
* Improve formatting
---------
Co-authored-by: riperiperi <rhy3756547@hotmail.com>
Co-authored-by: Ac_K <Acoustik666@gmail.com>
* Update to LibHac v0.19.0
- PartitionFileSystem classes now fully match Nintendo's implementation. Current code creating a PartitionFileSystem now need to use the Initialize method.
- Implementing nn::gcsrv and nn::sdmmcsrv now means the FS server now uses that abstraction instead of the old one where we passed in an IDeviceOperator.
* Add GetFileSystemAttribute
* So much boilerplate
* Slow and steady
* Restructure + Ack suggestions
* Restructure + Ack suggestions
* Restructure
* Clean
* Propogate those fields i forgot about
* It builds
* Progress
* Almost there
* Fix stupid mistake
* Fix more stupid mistakes
* Actually fix fuck ups
* Start localising
* r/therestofthefuckingowl
* Localise ButtonKeyAssigner
* Are you feeling it now mr krabs
* We’re done at last
* Crimes against code
* Try me in the Hague
* Please be quiet
* Crimes are here to stay
* Dispose stuff
* Cleanup a couple things
* Visual fixes and improvements
One weird bug
* Fix rebase errors
* Fixes
* Ack Suggestions
Remaining ack suggestions
Update src/Ryujinx.Ava/UI/Models/Input/ControllerInputConfig.cs
Co-authored-by: Ac_K <Acoustik666@gmail.com>
Update src/Ryujinx.Ava/UI/Models/Input/ControllerInputConfig.cs
Co-authored-by: Ac_K <Acoustik666@gmail.com>
* Formatting and error
More Ava 11-ness
Whoops
* Code style fixes
* Style fixes
* Analyzer fix
* Remove all ReflectionBindings
* Remove ambigious object
* Remove redundant property
* Old man yells at formatter
* r e a d o n l y
* Fix profiles
* Use new Sliders
---------
Co-authored-by: Ac_K <Acoustik666@gmail.com>
* Added basic implementation for shortcut creation
Currently bitmaps (.bmp) are used as the source file, colours are good (unlike .ico rn) but are scaled poorly on desktop.
* Icons display properly in shortcut
* code cleanup
* Moved shortcut logic to specific file, added Ava UI for shortcuts
* Added linux .desktop shortcut creation
* fixes to .shortcut data
* code issue fixes
* Added basic implementation for shortcut creation
Currently bitmaps (.bmp) are used as the source file, colours are good (unlike .ico rn) but are scaled poorly on desktop.
* Icons display properly in shortcut
* code cleanup
* Moved shortcut logic to specific file, added Ava UI for shortcuts
* Added linux .desktop shortcut creation
* fixes to .shortcut data
* code issue fixes
* added back shortcut to new contextmenu file
* Replaced COM reference with ComImport for shortcut functionality
* remove specific platform values and regions
* Move ShortcutHelper to Ryujinx.Ui.Common.Helpers
* Adjust styling and structure
* code feedback changes
* Added MacOS support using .app folder
* Added basic implementation for shortcut creation
Currently bitmaps (.bmp) are used as the source file, colours are good (unlike .ico rn) but are scaled poorly on desktop.
* Icons display properly in shortcut
* code cleanup
* Moved shortcut logic to specific file, added Ava UI for shortcuts
* Added linux .desktop shortcut creation
* fixes to .shortcut data
* code issue fixes
* Added basic implementation for shortcut creation
Currently bitmaps (.bmp) are used as the source file, colours are good (unlike .ico rn) but are scaled poorly on desktop.
* Icons display properly in shortcut
* code cleanup
* Moved shortcut logic to specific file, added Ava UI for shortcuts
* Added linux .desktop shortcut creation
* fixes to .shortcut data
* code issue fixes
* Replaced COM reference with ComImport for shortcut functionality
* remove specific platform values and regions
* Move ShortcutHelper to Ryujinx.Ui.Common.Helpers
* Adjust styling and structure
* code feedback changes
* adjust tooltip message
* added shortcut-template.desktop file
* set shortcut icon location to .local/share/icons
* Linux code feedback changes
* change InteropServices to new securifybv.ShellLink Package
* added ShellLink to readme, updated shortcut comment
* Code feedback changes
* Added MacOS Support (As per Jose Estrada's PR)
* dotnet format
* Small restructuring
* Embed template files into Ryujinx.Ui.Common
* Disable "CreateShortcut" option for flatpak builds
---------
Co-authored-by: TSR Berry <20988865+TSRBerry@users.noreply.github.com>
Co-authored-by: Jose Estrada <joseestradacobo@gmail.com>
* Add scrollable custom control based on TickFrequency
* Use custom slider to update value when pointer wheel scrolled
* Remove extra xaml file
* Address formatting issues
* Only scroll one element at a time
* Add OnPointerWheelChanged event to VolumeStatus button
Co-authored-by: Ahmad Tantowi <ahmadtantowi@outlook.com>
---------
Co-authored-by: TSR Berry <20988865+TSRBerry@users.noreply.github.com>
* GPU: Add fallback when textureGatherOffsets is not supported.
This PR adds a fallback for GPUs or APIs that don't support an equivalent to the method `textureGatherOffsets`, where each of the 4 gathered texels has an individual offset. This is done by reusing the existing code to handle non-const offsets for texture instructions, though it has also been corrected as there were a few implementation issues.
MoltenVK reports support for this capability, and it didn't error when we initially released the MacOS build, but that has since changed. MVK still reports support, but spirv-cross has been fixed in a way that it _attempts_ to use this capability, but the metal compiler errors since it doesn't exist.
Some other fixes:
- textureGatherOffsets emulation has been changed significantly. It now uses 4 texture sample instructions (not gather), calculates a base texel (i=0 j=0) and adds the offsets onto it before converting into a tex coord. The final result is offset into a texel center, so it shouldn't be subject to interpolation, though this isn't perfect and could have some error with floating point formats with linear sampling. It is subject to texture wrap mode as it should be, which is why texelFetch was not used.
- Maybe gather should be used here with component `w` (i=0, j=0), though this multiplies number of texels fetched by 4... The way it was doing this before _was_ wrong_, but doing it right would avoid issues with texel center precision.
- textureGatherOffset (singular) now performs textureGather with the offset applied to the coords, rather than the slower fallback where each texel is fetched individually.
* Increment shader cache version, remove unused arg
* Use base texture size for gather coord offset.
Implicit LOD for gather is not supported.
* Use 4 texture gathers for offsets emulation
Avoids issues with interpolation at cost of performance
(not sure how bad this is)
* Address Feedback
* GPU: Add HLE macros for popular NVN macros
* Remove non-vector equality check
The case where it's not hardware accelerated will do the check integer-wise anyways.
* Whitespace 😔
* Address Feedback
* HLE: Fix Mii crc generation
Validating CRCs for data and device involves calculating the crc of all data including the crc being checked, which should then be 0.
The crc should be _generated_ on all data _before_ the crc in the struct. It shouldn't include the crcs themselves.
This fixes all generated miis (eg. default) having invalid crcs. This does not affect mii maker, as that generates its own charinfo.
Does not fix MK8D crash.
* Fix other mii issues
* Fully define all fields for Nickname and Ver3StoreData
Fixes an issue where the nickname for a mii would only have the first character on some method calls.
* Add Array96 type
* Strings should not be concatenated using '+' in a loop
* fix IDE0090
* undo GenerateLoadOrStore
* prefer string interpolation
* Update src/Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGen.cs
Co-authored-by: Mary <thog@protonmail.com>
---------
Co-authored-by: Mary <thog@protonmail.com>
* Delete DecibelToLinearExtended and fix Log10 function
* Fix CopyBuffer and ClearBuffer
* Change effect states from class to struct + formatting
* Formatting
* Make UpdateLowPassFilter readonly
* More compressor fixes
* Implement NGC service
* Use raw byte arrays instead of string for _wordSeparators
* Silence IDE0230 for _wordSeparators
* Try to silence warning about _rangeValuesCount not being read on SparseSet
* Make AcType enum private
* Add abstract methods and one TODO that I forgot
* PR feedback
* More PR feedback
* More PR feedback
* GPU: Don't create tracking handles for buffer textures
Buffer texture memory is handled by the buffer cache - the texture shouldn't create any tracking handles as they aren't used. This change simply makes them create and iterate 0 tracking handles, while keeping the rest of the texture group around.
This prevents a possible issue where many buffer textures are created as views of overlapping buffer ranges, and virtual regions have many dependant textures that don't actually contribute anything to handle state.
Should improve performance in Mortal Kombat 1, possibly certain UE4 games when FIFO raises to 100%.
* Fix interval tree bug
* Don't check view compatibility for buffer textures
* Reduce the amount of descriptor pool allocations on Vulkan
* Formatting
* Slice can be simplified
* Make GetDescriptorPoolSizes static
* Adjust CanFit calculation so that TryAllocateDescriptorSets never fails
* Remove unused field
* Impl first attempt to LDN
* Make this work.
- Endianness swap on all IPs.
- Use local network IP for connections, rather than 127.0.0.1. This is to be changed when tunnelling or whatever.
- Mac addresses are now randomly assigned on the server. (fixes joining lobbies)
- Fixed the "connected" handler for stations to actually find a
- Added info retrieval when connected to a station.
- Users that disconnect are now removed from rooms they were in. (still need to broadcast tho)
- The communication service does a bit better with being closed now.
- Some locking around the game instance dictionary.
* We may just be "initialized". Ignore this for now.
* Lots of WIP
* Add Disconnect packet
* Improve signalling of internal events.
* Fix scan.
* Fix some more stupid things.
* Enable NoDelay on all sockets.
* Add station accept policy, disconnect function.
* Limit max number of games.
* Split out networking stuff from HLE, so it can be swapped.
* Update logging calls.
* Missed a spot.
* Call SignalDisconnect instead of SetState
* Add comment to GetNetworkInfo
* Update configuration + UI
Now has its own tab, more options.
* Refactoring IUserLocalCommunicationService
( Expected new issues :'( )
* some cleanup
* More fix
* Correctly handle errors when connecting.
* Disable *Private call and clean symbols
* Structs cleanup
* Big cleanup
* Fix InvalidHandle (in MK8D and other games)
* Add Reject and Private Network support (v1)
RyuLdn Version bumped to 1.
* Add Initialize Packet
Allows users to keep Mac Addresses assigned by the server.
* Add SetWirelessControllerRestriction and some cleanup
* LDN-2 Initial Rebase
Make this work.
- Endianness swap on all IPs.
- Use local network IP for connections, rather than 127.0.0.1. This is to be changed when tunnelling or whatever.
- Fixed the "connected" handler for stations to actually find a
- The communication service does a bit better with being closed now.
- Some locking around the game instance dictionary.
We may just be "initialized". Ignore this for now.
Lots of WIP
Implement scan filter.
Improve signalling of internal events.
Fix scan.
Fix 0 width data, scan reply end delay removed.
Fix some more stupid things.
Enable NoDelay on all sockets.
Add station accept policy, disconnect function.
Limit max number of games.
Split out networking stuff from HLE, so it can be swapped.
Update logging calls.
Missed a spot.
SetAdvertiseData when open, don't return games that have accept policy 1
Update configuration + UI
Now has its own tab, more options.
Don't Keepalive, it causes problems.
Refactoring IUserLocalCommunicationService
( Expected new issues :'( )
some cleanup
More fix
Correctly handle errors when connecting.
Disable *Private call and clean symbols
Structs cleanup
Big cleanup
Fix InvalidHandle (in MK8D and other games)
Add Reject and Private Network support (v1)
Disable TcpNoDelay option on linux.
Add SetWirelessControllerRestriction and some cleanup
Misc cleanup, implement broadcast flag.
* Misc Changes
* Fix GetNetworkInfo
* Fix some small issues
* Implement GetNetworkInfoLatestUpdate
* Hotfix when LocalCommunicationId = 0xFFFFFFFFFFFFFFFF
* Fix ARMS Scan (and other games using wrong LocalCommunicationId
* Fix latest update when host leaves
* Revert "Fix ARMS Scan (and other games using wrong LocalCommunicationId"
This reverts commit 519c283d3993e2fdfafb8ac6b4e0a98231f6fb75.
* Fix the localCommunicationId = -1
* Don't set Connect flag for nodes already in the room before joining.
* Make IUserLocalCommunicationService disposable
* Don't dispose if there's no client.
* LDN-2-2 Rebase
Make this work.
- Endianness swap on all IPs.
- Use local network IP for connections, rather than 127.0.0.1. This is to be changed when tunnelling or whatever.
- Fixed the "connected" handler for stations to actually find a
- The communication service does a bit better with being closed now.
- Some locking around the game instance dictionary.
We may just be "initialized". Ignore this for now.
Put sockets behind an interface, so that they can be swapped for something proxyable
Lots of WIP
Implement scan filter.
Improve signalling of internal events.
Fix scan.
Fix 0 width data, scan reply end delay removed.
Fix some more stupid things.
Enable NoDelay on all sockets.
Add station accept policy, disconnect function.
Limit max number of games.
Split out networking stuff from HLE, so it can be swapped.
Update logging calls.
Missed a spot.
SetAdvertiseData when open, don't return games that have accept policy 1
Update configuration + UI
Now has its own tab, more options.
Don't Keepalive, it causes problems.
Refactoring IUserLocalCommunicationService
( Expected new issues :'( )
some cleanup
More fix
Correctly handle errors when connecting.
Disable *Private call and clean symbols
Structs cleanup
Big cleanup
Fix InvalidHandle (in MK8D and other games)
Add Reject and Private Network support (v1)
Disable TcpNoDelay option on linux.
Add SetWirelessControllerRestriction and some cleanup
Misc cleanup, implement broadcast flag.
Misc Changes
Fix GetNetworkInfo
Fix some small issues
Disable LAN by default til the config is added.
Fix Splatoon 2
- Stub nfp IUser::StartDetection / IUser::StopDetection.
- Stub ntc IEnsureNetworkClockAvailabilityService and needed calls.
Cleanup previous fixes
Stub IAudioInManager/IAudioIn for Splatoon 2 LAN
Add LAN settings to multiplayer tab
LAN Play > LAN Mode
Implement GetNetworkInfoLatestUpdate
Hotfix when LocalCommunicationId = 0xFFFFFFFFFFFFFFFF
Fix ARMS Scan (and other games using wrong LocalCommunicationId
Fix latest update when host leaves
Revert "Fix ARMS Scan (and other games using wrong LocalCommunicationId"
This reverts commit 519c283d3993e2fdfafb8ac6b4e0a98231f6fb75.
Fix the localCommunicationId = -1
Don't set Connect flag for nodes already in the room before joining.
Make IUserLocalCommunicationService disposable
Fix crash when using LAN mode on linux.
Actually use that call
Don't dispose if there's no client.
Fix the settings window crash
Fix configurationFileUpdated
* Make LDN compatible with Ryujinx/Ryujinx#3805
* Ava: Add Ldn options to SettingsNetworkTab
* Ava: Add update events for multiplayer options
* Apply formatting
* Remove LdnHelper
* ldn: Fix hardcoded /24 subnet mask
* Fix naming rule violations
* Add missing summary doc tag
* Remove NetCoreServer dependency
* Address code style issues and typos
Co-authored-by: gdkchan <gab.dark.100@gmail.com>
* Call CloseStation/CloseAccessPoint to reduce code duplication
* Fix typo
Co-authored-by: gdkchan <gab.dark.100@gmail.com>
* Fix missing trailing commas
* Extract AddressList from AddressEntry
* Use AcceptPolicy as a type for LdnNetworkInfo.StationAcceptPolicy
* Add Flags attribute to ScanFilterFlag
* Rename struct members for LdnNetworkInfo
* Remove extra line
Co-authored-by: Ac_K <Acoustik666@gmail.com>
* Extract NetworkErrorMessage from NetworkError
* Fix missing trailing commas
---------
Co-authored-by: Ac_K <Acoustik666@gmail.com>
Co-authored-by: riperiperi <rhy3756547@hotmail.com>
Co-authored-by: gdkchan <gab.dark.100@gmail.com>
* Horizon: Migrate wlan and stubs latest services
This PR migrate empty wlan services, values are found by RE.
Latest firmwares added some other services which are now stubbed and up-to-date.
* Fix imports ordering
* Replace image barriers inside render pass with more generic memory barrier
* Remove forceStorage since it was creating images with storage bit for formats that are not StorageImage compatible
* Add missing flags on subpass dependency
* Don't call vkCmdSetScissor with a scissor count of 0
* One semaphore per swapchain image
* Remove compute stage from read to write barriers
* Try to improve Pipeline.Barrier nonsense
* Set PipelineStateFlags based on supported stages
Just some simple changes to the buffer conversion shaders. (stride conversion, D32S8 to D24S8)
The first change is using a device local buffer for converted vertex buffers, since they're only read/written on the GPU. These paths don't trigger on NVIDIA, but if you force them to use it demonstrates the full extent writing to host owned memory from compute absolutely destroys them. AMD GPUs are less heavily affected by this issue, but since the game in question was writing 230MB from compute, I imagine it should have some effect.
The second change is allowing the buffer conversion shaders to scale their work group count. While dividing the work between 32 invocations works OK for M1 macs, it's not so great for anything with more cores like AMD GPUs, which should be able to do a lot more parallel copies. Now, it scales by roughly 100 elements per invocation.
Some stride change cases could be improved further by either limiting vertex buffer size somehow (reading the index buffer could help, but is always risky) or only updating regions that changed, rather than invalidating the whole thing.
* Implement vertex and geometry shader conversion to compute
* Call InitializeReservedCounts for compute too
* PR feedback
* Set clip distance mask for geometry and tessellation shaders too
* Transform feedback emulation only for vertex
#5576 changed where the position was declared, but forgot to add the Invariant declaration to position when the ReducedPrecision flag was enabled. This was causing weird graphical bugs in a bunch of games, mostly to do with mismatching depth between multiple draws of the same geometry.
Maybe the attempt to add it to Position in DeclareInputOrOutput can be removed now, assuming that path is never used.
* mm: Migrate service in Horizon project
This PR migrate the `mm:u` service to the Horizon project, things were checked by some RE aswell, that's why some vars are renamed, the logic should be the same as before.
Tests are welcome.
* Lock _sessionList instead
* Fix comment
* Fix Session fields order
* Move shuffle handling out of the backend to a transform pass
* Handle subgroup sizes higher than 32
* Stop using the subgroup size control extension
* Make GenerateShuffleFunction static
* Shader cache version bump
* Vulkan: Periodically free regions of the staging buffer
There was an edge case where a game could submit tens of thousands of small copies over the course of over half a minute to unique fences. This could result in a large stutter when the staging buffer became full and it tried to check and free thousands of completed fences.
This became visible with some games and mirrors on Windows, as they don't submit any buffer data via the staging buffer, but may submit copies of the support buffer.
This change makes the Vulkan backend check for staging buffer completion on each command buffer submit, so it can't get backed up with 1000s of copies to check.
* Add comment
* Initial implementation of buffer mirrors
Generally slower right now, goal is to reduce render passes in games that do inline updates
Fix support buffer mirrors
Reintroduce vertex buffer mirror
Add storage buffer support
Optimisation part 1
More optimisation
Avoid useless data copies.
Remove unused cbIndex stuff
Properly set write flag for storage buffers.
Fix minor issues
Not sure why this was here.
Fix BufferRangeList
Fix some big issues
Align storage buffers rather than getting full buffer as a range
Improves mirrorability of read-only storage buffers
Increase staging buffer size, as it now contains mirrors
Fix some issues with buffers not updating
Fix buffer SetDataUnchecked offset for one of the paths when using mirrors
Fix buffer mirrors interaction with buffer textures
Fix mirror rebinding
Move GetBuffer calls on indirect draws before BeginRenderPass to avoid draws without render pass
Fix mirrors rebase
Fix rebase 2023
* Fix crash when using stale vertex buffer
Similar to `Get` with a size that's too large, just treat it as a clamp.
* Explicitly set support buffer as mirrorable
* Address feedback
* Remove unused fragment of MVK workaround
* Replace logging for staging buffer OOM
* Address format issues
* Address more format issues
* Mini cleanup
* Address more things
* Rename BufferRangeList
* Support bounding range for ClearMirrors and UploadPendingData
* Add maximum size for vertex buffer mirrors
* Enable index buffer mirrors
Enabled on all platforms for the IbStreamer.
* Feedback
* Remove mystery BufferCache change
Probably macos related?
* Fix mirrors not creating when staging buffer is empty.
* Change log level to debug
This branch changes the buffer copy fast path to notify memory tracking for all resources that aren't buffers. This fixes cases where games would copy buffer data directly into texture memory, which before would only work if the texture did not already exist. I imagine this happens when the guest driver is moving data between allocations or uploading it.
Since this only affects the fast path, cases where the source data has been modified from GPU (fast path copy destination doesn't count) will still fail to notify the texture, though I don't imagine games will do this. This should be resolved in future.
This should fix some texture issues with guest OpenGL games on switch, such as Dragon Quest Builders.
This may also be useful in future for games that move shader data around memory, if we end up using memory tracking for those.
* Move some properties out of ShaderConfig
* Stop using ShaderConfig on backends
* Replace ShaderConfig usages on Translator and passes
* Move remaining properties out of ShaderConfig and delete ShaderConfig
* Remove ResourceManager property from TranslatorContext
* Move Rewriter passes to separate transform pass files
* Fix TransformPasses.RunPass on cases where a node is removed
* Move remaining ClipDistancePrimitivesWritten and UsedFeatures updates to decode stage
* Reduce excessive parameter passing a bit by using structs more
* Remove binding parameter from ShaderProperties methods since it is redundant
* Replace decoder instruction checks with switch statement
* Put GLSL on the same plan as SPIR-V for input/output declaration
* Stop mutating TranslatorContext state when Translate is called
* Pass most of the graphics state using a struct instead of individual query methods
* Auto-format
* Auto-format
* Add backend logging interface
* Auto-format
* Remove unnecessary use of interpolated strings
* Remove more modifications of AttributeUsage after decode
* PR feedback
* gl_Layer is not supported on compute