예제 #1
0
 internal static void Init()
 {
     Vulkan.Load(ref createInstance);
     Vulkan.Load(ref enumerateExtensionProperties);
     Vulkan.Load(ref enumerateLayerProperties);
     initialized = true;
 }
예제 #2
0
        public Device(PhysicalDevice physicalDevice, DeviceCreateInfo info)
        {
            if (physicalDevice == null)
            {
                throw new ArgumentNullException(nameof(physicalDevice));
            }
            if (info == null)
            {
                throw new ArgumentNullException(nameof(info));
            }

            PhysicalDevice = physicalDevice;
            Instance       = physicalDevice.Instance;
            queues         = new Dictionary <QueueID, Queue>();

            if (info.extensions == null)
            {
                Extensions = new List <string>();
            }
            else
            {
                Extensions = new List <string>(info.extensions);
            }

            ValidateExtensions();

            CreateDevice(info);

            Vulkan.Load(ref getDeviceProcAddr, Instance);
            Commands = new DeviceCommands(this);
        }
예제 #3
0
        void Init(InstanceCreateInfo mInfo)
        {
            if (!GLFW.GLFW.VulkanSupported())
            {
                throw new InstanceException("Vulkan not supported");
            }
            if (!initialized)
            {
                Init();
            }

            if (mInfo.extensions == null)
            {
                extensions = new List <string>();
            }
            else
            {
                extensions = new List <string>(mInfo.extensions);
            }

            if (mInfo.layers == null)
            {
                layers = new List <string>();
            }
            else
            {
                layers = new List <string>(mInfo.layers);
            }

            CreateInstance(mInfo);

            Extensions = extensions.AsReadOnly();
            Layers     = layers.AsReadOnly();

            Vulkan.Load(ref getProcAddrDel, instance);

            Commands = new InstanceCommands(this);

            GetPhysicalDevices();
        }