Beispiel #1
0
        public static bool CheckPhysicalDeviceQueueFamilySupport(Vk.PhysicalDevice device,
                                                                 Vk.QueueFlags flags, Vk.SurfaceKhr surface, out QueueFamilyIndices queueFamilies)
        {
            Vk.QueueFamilyProperties[] props = device.GetQueueFamilyProperties();
            queueFamilies = new QueueFamilyIndices();

            for (uint i = 0; i < props.Length; i++)
            {
                Vk.QueueFamilyProperties family = props[i];
                if (family.QueueCount > 0)
                {
                    if (family.QueueFlags.HasFlag(flags))
                    {
                        queueFamilies.GraphicsFamily = i;
                    }

                    if (device.GetSurfaceSupportKHR(i, surface))
                    {
                        queueFamilies.PresentFamily = i;
                    }

                    if (queueFamilies.AllFamiliesExist())
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
Beispiel #2
0
 public bool EnsureQueueFamilySupport(Vk.PhysicalDevice device, Vk.QueueFlags family) =>
 VkHelper.CheckPhysicalDeviceQueueFamilySupport(device,
                                                family, this.Window.VulkanSurface, out this.vkQueueFamilies);
 internal Engine.Renderer.Vulkan.Queue GetQueue(Interop.QueueFlags byFlag)
 {
     return(myQueueLookup[byFlag].CreateQueue());
 }