public Result Initialize(MgApplicationInfo appInfo, MgInstanceExtensionOptions options) { string[] extensions = null; if (options == MgInstanceExtensionOptions.ALL) { MgExtensionProperties[] extensionProperties; var err = mEntrypoint.EnumerateInstanceExtensionProperties(null, out extensionProperties); Debug.Assert(err == Result.SUCCESS, err + " != Result.SUCCESS"); var enabledExtensions = new List <string>(); if (extensionProperties != null) { foreach (var ext in extensionProperties) { enabledExtensions.Add(ext.ExtensionName); } } extensions = enabledExtensions.ToArray(); } else if (options == MgInstanceExtensionOptions.SWAPCHAIN_ONLY) { extensions = new string[] { "VK_KHR_swapchain" }; } return(Initialize(appInfo, null, extensions)); }
public Result Initialize(MgApplicationInfo appInfo, string[] enabledLayerNames, string[] enabledExtensionNames) { var instCreateInfo = new MgInstanceCreateInfo { ApplicationInfo = appInfo, EnabledLayerNames = enabledLayerNames, EnabledExtensionNames = enabledExtensionNames, }; return(mEntrypoint.CreateInstance(instCreateInfo, null, out mInstance)); }
public void Initialize(MgApplicationInfo appInfo, string[] enabledLayerNames, string[] enabledExtensionNames) { var instCreateInfo = new MgInstanceCreateInfo { ApplicationInfo = appInfo, EnabledLayerNames = enabledLayerNames, EnabledExtensionNames = enabledExtensionNames, }; var errorCode = mEntrypoint.CreateInstance(instCreateInfo, null, out mInstance); Debug.Assert(errorCode == Result.SUCCESS, errorCode + " != Result.SUCCESS"); }
public void Initialize(MgApplicationInfo appInfo, MgEnableExtensionsOption options) { string[] extensions = null; if (options == MgEnableExtensionsOption.ALL) { MgExtensionProperties[] extensionProperties; var err = mEntrypoint.EnumerateInstanceExtensionProperties(null, out extensionProperties); Debug.Assert(err == Result.SUCCESS, err + " != Result.SUCCESS"); var enabledExtensions = new List <string>(); if (extensionProperties != null) { foreach (var ext in extensionProperties) { enabledExtensions.Add(ext.ExtensionName); } } extensions = enabledExtensions.ToArray(); } Initialize(appInfo, null, extensions); }
public Result Initialize(MgApplicationInfo appInfo) { return(Initialize(appInfo, null, null)); }
public void Initialize(MgApplicationInfo appInfo) { Initialize(appInfo, null, null); }