Skip to content

Commit

Permalink
extract gpu settings to helper
Browse files Browse the repository at this point in the history
  • Loading branch information
bitsandfoxes committed Jan 17, 2025
1 parent 8cee4a0 commit abe5b90
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions test/Scripts.Integration.Test/Editor/Builder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,28 +134,19 @@ public static void BuildMacIl2CPPPlayer()
public static void BuildLinuxIl2CPPPlayer()
{
Debug.Log("Builder: Building Linux IL2CPP Player");
PlayerSettings.SetUseDefaultGraphicsAPIs(BuildTarget.StandaloneLinux64, false);
PlayerSettings.SetGraphicsAPIs(BuildTarget.StandaloneLinux64, new[] { UnityEngine.Rendering.GraphicsDeviceType.OpenGLCore });
PlayerSettings.gpuSkinning = false;
PlayerSettings.graphicsJobs = false;
ConfigureGraphicsSettings(BuildTarget.StandaloneLinux64);
BuildIl2CPPPlayer(BuildTarget.StandaloneLinux64, BuildTargetGroup.Standalone, BuildOptions.StrictMode);
}
public static void BuildAndroidIl2CPPPlayer()
{
Debug.Log("Builder: Building Android IL2CPP Player");
PlayerSettings.SetUseDefaultGraphicsAPIs(BuildTarget.Android, false);
PlayerSettings.SetGraphicsAPIs(BuildTarget.Android, new[] { UnityEngine.Rendering.GraphicsDeviceType.OpenGLCore });
PlayerSettings.gpuSkinning = false;
PlayerSettings.graphicsJobs = false;
ConfigureGraphicsSettings(BuildTarget.Android);
BuildIl2CPPPlayer(BuildTarget.Android, BuildTargetGroup.Android, BuildOptions.StrictMode);
}
public static void BuildAndroidIl2CPPProject()
{
Debug.Log("Builder: Building Android IL2CPP Project");
PlayerSettings.SetUseDefaultGraphicsAPIs(BuildTarget.Android, false);
PlayerSettings.SetGraphicsAPIs(BuildTarget.Android, new[] { UnityEngine.Rendering.GraphicsDeviceType.OpenGLCore });
PlayerSettings.gpuSkinning = false;
PlayerSettings.graphicsJobs = false;
ConfigureGraphicsSettings(BuildTarget.Android);
EditorUserBuildSettings.exportAsGoogleAndroidProject = true;
BuildIl2CPPPlayer(BuildTarget.Android, BuildTargetGroup.Android, BuildOptions.AcceptExternalModificationsToPlayer);
}
Expand Down Expand Up @@ -203,6 +194,14 @@ private static void ValidateArguments(Dictionary<string, string> args)
}
}

private static void ConfigureGraphicsSettings(BuildTarget target)
{
PlayerSettings.SetUseDefaultGraphicsAPIs(target, false);
PlayerSettings.SetGraphicsAPIs(target, new[] { UnityEngine.Rendering.GraphicsDeviceType.OpenGLCore });
PlayerSettings.gpuSkinning = false;
PlayerSettings.graphicsJobs = false;
}

// Audio created issues, especially for iOS simulator so we disable it.
private static void DisableUnityAudio()
{
Expand Down

0 comments on commit abe5b90

Please sign in to comment.