* GAL: Dispose Renderer after running deferred actions
Deferred actions from disposing physical memory instances always dispose the resources in their caches. The renderer can't be disposed before these resources get disposed, otherwise the dispose actions will not actually run, and the ThreadedRenderer may get stuck trying to enqueue too many commands when there is nothing consuming them.
This should fix most instances of the emulator freezing on close.
* Wait for main render commands to finish, but keep RenderThread alive til dispose
* Address some feedback.
* No parameterize needed
* Set thread name as part of constructor
* Port to Ava and SDL2
* memory: Check results of pinvoke calls
* Increase vm.max_map_count when running Ryujinx
* Add SupportedOSPlatform attribute for WindowsApiException
* Revert increasing vm.max_map_count via script
* Add LinuxHelper to detect and increase vm.max_map_count
With GUI dialogs, this should be a bit more user-friendly.
* Supply arguments as a list to RunPkExec
* Add error logging in case RunPkExec() fails
* Prevent Gtk from crashing
* Linux: Detect if gamemode is installed and start it when launching Ryujinx.
When using the Ryujinx.sh script to start the emulator check if gamemoderun exists and use it if it does.
Gamemode mode on Linux changes some system settings to make performance during gaming more consistent mainly by changing the CPU governor to performance.
https://github.com/FeralInteractive/gamemode
* Removed if statement.
* Fix due to wrong assumption about the output of which.
Checks if the which output contains a no match response, otherwise use gamemoderun.
Using a case statement because it makes substring matching possible in sh and also it turns out that adding an empty string after env throws an error because env attempts to parse it as a paramater.
* Missed a couple semicolons.
* Different approach for checking if gamemode is available.
Should hopefully work across all implementations of which.
* Remove unneeded which command.
* Change code to keep launch command to a single line.
* Add support for VK_EXT_depth_clip_control.
* Code review feedback
Minor formatting
Co-authored-by: gdkchan <gab.dark.100@gmail.com>
* Check .DepthClipControl to make sure the host actually supports the feature.
* Review feedback: remove Vulkan platform switch, relying on QueryHostSupportsDepthClipControl to drive the behaviour - OpenGL returns true, and any future platforms that don't support the [-1, 1] depth mode can return false for the transformation.
---------
Co-authored-by: gdkchan <gab.dark.100@gmail.com>
* Attempt at fixing hang on exit by ending the WindowNotificationManager notification loop, so that the Thread running it can exit.
* explicitly apply the NotificationManager template to allow the notification loop to begin
* NotificationHelper - remove explicity call to ApplyTemplate(). Change to ManualResetEventSlim so we can cancel the Wait on it.
* add a timeout to AudioRenderSystem.Stop()'s waiting for the termination signal, log a warning if this timeout occurs, and continue execution
* NotifiationHelper - cancel first, the CompleteAdding()
* Remove AudioRenderSystem._terminationEvent, redundant
* NotificationHelper - use host.Closing event to trigger cancellation instead of _notifationManager.DetachedFromLogicalTree
* Change NotificationHelper to use an explicit Thread for background work. Wait on the cancellationToken's WaitHandle so the Thread doesn't have to deal with async. Wrap foreach in try/catch (OperationCanceledException) to swallow the escaping exception from the GetConsumingEnumerable().
* adjust formatting of AsyncWorkQueue constructor to use object initializers consistently
* use AsyncWorkQueue to do everything I added in SetNotificationManager()
* Revert "use AsyncWorkQueue to do everything I added in SetNotificationManager()"
This reverts commit f0e78366b8776ec8e2fef8ab023c0db1833155d3.
* use AsyncWorkQueue to handle the Thread-related changes previously made to NotificationHelper.SetNotificationHelper(). Wrap it in Lazy<T> and force instantiation in the TemplateApplied event handler to accomodate for the fact that AsyncWorkQueue starts immediately, and the notification dispatch loop was being delayed by _templateAppliedEvent.
* impl changes suggested by AcK77
* impl changes suggested by AcK77 (more)
* Generate scaling helper functions on IR
* Delete unused code
* Split RewriteTextureSample and move gather bias add to an earlier pass
* Remove using
* Shader cache version bump
* Truncate vertex attribute format if it exceeds stride on MoltenVK
* Fix BGR format
* Move vertex attribute check to pipeline creation to avoid costs
* No need for this to be public
* fix crash when Vulkan isn't available
* add VulkanRenderer.GetPhysicalDevices() overload that provides its own Vk API object and logs on failure
* adjustments per AcK77
* Add guard against ServerBase.Dispose() being called multiple times. Add reset event to avoid Dispose() being called while the ServerLoop is still running.
* remove unused usings
* rework ServerBase to use one collection each for sessions and ports, and make all accesses thread-safe.
* fix Logger call
* use GetSessionObj(int) instead of using _sessions directly
* move _threadStopped check inside "dispose once" test
* - Replace _threadStopped event with attempt to Join() the ending thread (if that isn't the current thread) instead.
- Use the instance-local _selfProcess and (new) _selfThread variables to avoid suggesting that the current KProcess and KThread could change. Per gdkchan, they can't currently, and this old IPC system will be removed before that changes.
- Re-order Dispose() so that the Interlocked _isDisposed check is the last check before disposing, to increase the likelihood that multiple callers will result in one of them succeeding.
* code style suggestions per AcK77
* add infinite wait for thread termination
* Introduce ResourceLayout
* Part 1: Use new ResourceSegments array on UpdateAndBind
* Part 2: Use ResourceLayout to build PipelineLayout
* Delete old code
* XML docs
* Fix shader cache load NRE
* Fix typo