aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Common/Utilities/OsUtils.cs
diff options
context:
space:
mode:
authorriperiperi <rhy3756547@hotmail.com>2024-09-02 01:28:16 +0100
committerGitHub <noreply@github.com>2024-09-01 21:28:16 -0300
commitca59c3f4998e2d1beb3b0d0214611e3332238557 (patch)
tree38d1a2e2c0b4a906b258ee2e988256299e3e866d /src/Ryujinx.Common/Utilities/OsUtils.cs
parentfdd7ee791cd37546390856f38eab16ea78451742 (diff)
Vulkan: Feedback loop detection and barriers (#7226)
* Vulkan: Feedback loop improvements This PR allows the Vulkan backend to detect attachment feedback loops. These are currently used in the following ways: - Partial use of VK_EXT_attachment_feedback_loop_layout - All renderable textures have AttachmentFeedbackLoopBitExt - Compile pipelines with Color/DepthStencil feedback loop flags when present - Support using FragmentBarrier for feedback loops (fixes regressions from https://github.com/Ryujinx/Ryujinx/pull/7012 ) TODO: - AMD GPUs may need layout transitions for it to properly allow textures to be used in feedback loops. - Use dynamic state for feedback loops. The background pipeline will always miss since feedback loop state isn't known on the GPU project. - How is the barrier dependency flag used? (DXVK just ignores it, there's no vulkan validation...) - Improve subpass dependencies to fix validation errors * Mark field readonly * Add feedback loop dynamic state * fix: add MoltenVK resolver workaround fix: add MoltenVK resolver workaround * Formatting * Fix more complaints * RADV dcc workaround * Use dynamic state properly, cleanup. * Use aspects flags in more places
Diffstat (limited to 'src/Ryujinx.Common/Utilities/OsUtils.cs')
-rw-r--r--src/Ryujinx.Common/Utilities/OsUtils.cs24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/Ryujinx.Common/Utilities/OsUtils.cs b/src/Ryujinx.Common/Utilities/OsUtils.cs
new file mode 100644
index 00000000..a0791b09
--- /dev/null
+++ b/src/Ryujinx.Common/Utilities/OsUtils.cs
@@ -0,0 +1,24 @@
+using System;
+using System.Diagnostics;
+using System.Runtime.InteropServices;
+
+namespace Ryujinx.Common.Utilities
+{
+ public partial class OsUtils
+ {
+ [LibraryImport("libc", SetLastError = true)]
+ private static partial int setenv([MarshalAs(UnmanagedType.LPStr)] string name, [MarshalAs(UnmanagedType.LPStr)] string value, int overwrite);
+
+ public static void SetEnvironmentVariableNoCaching(string key, string value)
+ {
+ // Set the value in the cached environment variables, too.
+ Environment.SetEnvironmentVariable(key, value);
+
+ if (!OperatingSystem.IsWindows())
+ {
+ int res = setenv(key, value, 1);
+ Debug.Assert(res != -1);
+ }
+ }
+ }
+}