Skip to content
Snippets Groups Projects
Commit 36ea0948 authored by Martin Finkel's avatar Martin Finkel
Browse files

editor: error on d3d12

parent 6c6fdbcc
No related branches found
Tags 2.0.0
1 merge request!120editor: error on d3d12
......@@ -26,6 +26,10 @@ public class PreProcessBuild :
"\n\nPlease go to Player Settings > Android > Auto Graphics API and remove Vulkan from the list." +
"\nOnly OpenGL ES 2.0 and 3.0 are currently supported on Android.";
const string WindowsD3D12ErrorMessage = "The Direct3D12 graphics API is not supported by the VLC Unity plugin." +
"\n\nPlease go to Player Settings > Windows or UWP > Auto Graphics API and remove Direct3D12 from the list." +
"\nOnly Direct3D11 is currently supported on Windows and UWP targets.";
#if UNITY_SUPPORTS_BUILD_REPORT
public void OnPreprocessBuild(BuildReport report)
{
......@@ -42,10 +46,19 @@ public void OnPreprocessBuild(BuildTarget target, string path)
throw new BuildFailedException(AndroidVulkanErrorMessage);
}
}
else if(target == BuildTarget.StandaloneWindows64 || target == BuildTarget.WSAPlayer)
{
if(IsD3D12Configured(target))
{
throw new BuildFailedException(WindowsD3D12ErrorMessage);
}
}
}
static bool IsVulkanConfigured => GetGraphicsApiIndex(BuildTarget.Android, GraphicsDeviceType.Vulkan) >= 0;
static bool IsD3D12Configured(BuildTarget target) => GetGraphicsApiIndex(target, GraphicsDeviceType.Direct3D12) >= 0;
static int GetGraphicsApiIndex(BuildTarget target, GraphicsDeviceType api)
{
int result = -1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment