* 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
42 lines
1.2 KiB
C#
42 lines
1.2 KiB
C#
using Ryujinx.Common.Utilities;
|
|
using System;
|
|
|
|
namespace Ryujinx.Common.GraphicsDriver
|
|
{
|
|
public static class DriverUtilities
|
|
{
|
|
private static void AddMesaFlags(string envVar, string newFlags)
|
|
{
|
|
string existingFlags = Environment.GetEnvironmentVariable(envVar);
|
|
|
|
string flags = existingFlags == null ? newFlags : $"{existingFlags},{newFlags}";
|
|
|
|
OsUtils.SetEnvironmentVariableNoCaching(envVar, flags);
|
|
}
|
|
|
|
public static void InitDriverConfig(bool oglThreading)
|
|
{
|
|
if (OperatingSystem.IsLinux())
|
|
{
|
|
AddMesaFlags("RADV_DEBUG", "nodcc");
|
|
}
|
|
|
|
ToggleOGLThreading(oglThreading);
|
|
}
|
|
|
|
public static void ToggleOGLThreading(bool enabled)
|
|
{
|
|
OsUtils.SetEnvironmentVariableNoCaching("mesa_glthread", enabled.ToString().ToLower());
|
|
OsUtils.SetEnvironmentVariableNoCaching("__GL_THREADED_OPTIMIZATIONS", enabled ? "1" : "0");
|
|
|
|
try
|
|
{
|
|
NVThreadedOptimization.SetThreadedOptimization(enabled);
|
|
}
|
|
catch
|
|
{
|
|
// NVAPI is not available, or couldn't change the application profile.
|
|
}
|
|
}
|
|
}
|
|
}
|