Example #1
0
        private void CreateLogicalDevice()
        {
            var queueFamilies = FindQueueFamilies(physicalDevice, surface).Value;

            var queueCreateInfos = queueFamilies.GraphicsFamily == queueFamilies.PresentFamily
                ? new[]
            { new VkDeviceQueueCreateInfo
              {
                  QueueFamilyIndex = queueFamilies.GraphicsFamily,
                  QueuePriorities  = new [] { 1f }
              } }
                : new []
            {
                new VkDeviceQueueCreateInfo
                {
                    QueueFamilyIndex = queueFamilies.GraphicsFamily,
                    QueuePriorities  = new[] { 1f }
                },
                new VkDeviceQueueCreateInfo
                {
                    QueueFamilyIndex = queueFamilies.PresentFamily,
                    QueuePriorities  = new[] { 1f }
                }
            };
            var deviceFeatures = new VkPhysicalDeviceFeatures
            {
            };
            var createInfo = new VkDeviceCreateInfo
            {
                QueueCreateInfos      = queueCreateInfos,
                EnabledFeatures       = deviceFeatures,
                EnabledExtensionNames = DeviceExtensions,
                EnabledLayerNames     = LayerNames
            };

            device        = physicalDevice.CreateDevice(createInfo, null).Object;
            graphicsQueue = device.GetDeviceQueue(queueFamilies.GraphicsFamily, 0);
            presentQueue  = device.GetDeviceQueue(queueFamilies.PresentFamily, 0);
        }
Example #2
0
 public VkSwapchainKHR(IVkDevice device, HandleType handle, IVkAllocationCallbacks allocator)
 {
     Device    = device;
     Handle    = handle;
     Allocator = allocator;
 }
Example #3
0
 public VkDescriptorPool(IVkDevice device, HandleType handle, IVkAllocationCallbacks allocator)
 {
     Device    = device;
     Handle    = handle;
     Allocator = allocator;
 }
Example #4
0
 public VkQueue(IVkDevice device, HandleType handle)
 {
     Device = device;
     Handle = handle;
 }
Example #5
0
 public VkShaderModule(IVkDevice device, HandleType handle, IVkAllocationCallbacks allocator)
 {
     Device    = device;
     Handle    = handle;
     Allocator = allocator;
 }
Example #6
0
 public VkRenderPass(IVkDevice device, HandleType handle, IVkAllocationCallbacks allocator)
 {
     Device    = device;
     Handle    = handle;
     Allocator = allocator;
 }
Example #7
0
 public VkCommandBuffer(IVkDevice device, HandleType handle)
 {
     Device = device;
     Handle = handle;
 }
Example #8
0
 public VkDescriptorSet(IVkDevice device, HandleType handle)
 {
     Device = device;
     Handle = handle;
 }
Example #9
0
 public VkDeviceMemory(IVkDevice device, HandleType handle, IVkAllocationCallbacks allocator)
 {
     Device = device;
     Handle = handle;
     Allocator = allocator;
 }
Example #10
0
 public VkPipelineLayout(IVkDevice device, HandleType handle, IVkAllocationCallbacks allocator)
 {
     Device    = device;
     Handle    = handle;
     Allocator = allocator;
 }
Example #11
0
 public VkPipelineCache(IVkDevice device, HandleType handle, IVkAllocationCallbacks allocator)
 {
     Device = device;
     Handle = handle;
     Allocator = allocator;
 }
Example #12
0
 public VkFramebuffer(IVkDevice device, HandleType handle, IVkAllocationCallbacks allocator)
 {
     Device = device;
     Handle = handle;
     Allocator = allocator;
 }
Example #13
0
 public VkCommandPool(IVkDevice device, HandleType handle, IVkAllocationCallbacks allocator)
 {
     Device = device;
     Handle = handle;
     Allocator = allocator;
 }
Example #14
0
 public VkDescriptorSetLayout(IVkDevice device, HandleType handle, IVkAllocationCallbacks allocator)
 {
     Device = device;
     Handle = handle;
     Allocator = allocator;
 }
Example #15
0
 public VkImageView(IVkDevice device, HandleType handle, IVkAllocationCallbacks allocator)
 {
     Device    = device;
     Handle    = handle;
     Allocator = allocator;
 }
Example #16
0
 public VkSampler(IVkDevice device, HandleType handle, IVkAllocationCallbacks allocator)
 {
     Device    = device;
     Handle    = handle;
     Allocator = allocator;
 }
Example #17
0
 public VkCommandBuffer(IVkDevice device, HandleType handle)
 {
     Device = device;
     Handle = handle;
 }