Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Minor) Added argument to set VROverlay GPU to index #433

Merged
merged 2 commits into from
Nov 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static class Program
public static string ConfigLocation;
public static string Version { get; private set; }
public static bool LaunchDebug;

public static bool GPUFix;
static Program()
{
BaseDirectory = AppDomain.CurrentDomain.BaseDirectory;
Expand Down
1 change: 1 addition & 0 deletions StartupArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public static void ArgsCheck()

foreach (string arg in args)
{
if (arg.Contains("--gpufix")) Program.GPUFix = true;
if (arg.Length > 12 && arg.Substring(0, 12) == "/uri=vrcx://")
LaunchCommand = arg.Substring(12);

Expand Down
10 changes: 6 additions & 4 deletions VRCXVR.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,13 @@ private void ThreadLoop()

// REMOVE THIS
// nextOverlay = DateTime.MaxValue;
// https://stackoverflow.com/questions/38312597/how-to-choose-a-specific-graphics-device-in-sharpdx-directx-11/38596725#38596725
Factory f = new Factory1();
Adapter a = f.GetAdapter(1);

DeviceCreationFlags flags = DeviceCreationFlags.BgraSupport;

_device = new Device(
DriverType.Hardware,
DeviceCreationFlags.SingleThreaded | DeviceCreationFlags.BgraSupport
);
_device = Program.GPUFix ? new Device(a, flags) : new Device(DriverType.Hardware, DeviceCreationFlags.SingleThreaded | DeviceCreationFlags.BgraSupport);

_texture1 = new Texture2D(
_device,
Expand Down