コード例 #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);
        }
コード例 #2
0
ファイル: VkContext.cs プロジェクト: WillCS/vulkan-project
 public bool EnsureQueueFamilySupport(Vk.PhysicalDevice device, Vk.QueueFlags family) =>
 VkHelper.CheckPhysicalDeviceQueueFamilySupport(device,
                                                family, this.Window.VulkanSurface, out this.vkQueueFamilies);
コード例 #3
0
 internal Engine.Renderer.Vulkan.Queue GetQueue(Interop.QueueFlags byFlag)
 {
     return(myQueueLookup[byFlag].CreateQueue());
 }