Exemple #1
0
        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));
        }
Exemple #2
0
        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));
        }
Exemple #3
0
        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");
        }
Exemple #4
0
        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);
        }
Exemple #5
0
 public Result Initialize(MgApplicationInfo appInfo)
 {
     return(Initialize(appInfo, null, null));
 }
Exemple #6
0
 public void Initialize(MgApplicationInfo appInfo)
 {
     Initialize(appInfo, null, null);
 }