internal Engine.Renderer.Vulkan.Queue CreateQueue() { SharedQueueItem EndItem = myList.First.Value; Engine.Renderer.Vulkan.Queue myQueue = null; while (myQueue == null) { var firstItem = myList.First.Value; if (!firstItem.IsFull()) { myQueue = myList.First.Value.CreateQueue(); } else { myList.RemoveFirst(); myList.AddLast(firstItem); if (myList.First.Value.Equals(EndItem)) { break; } } } return(myQueue); }
//TODO: eventually expand this public DeviceQueueManager(VulkanPhysicalDevice selectedPhysicalDevice, VulkanLogicalDevice vulkanLogicalDevice) { var Properties = selectedPhysicalDevice.QueueFamilyProperties; if (Properties == null) { throw new Exception("Unable to find queue family properties!"); } // myDeviceCreateQueues = new Interop.DeviceQueueCreateInfo[Properties.Length]; #if DEBUG Debug.WriteLine("Expected number of Queues to Create: " + Properties.Length); #endif for (int index = 0; index < Properties.Length; index++) { var A = Properties[index]; QueueManagerItem myValue; SharedQueueItem myNewQueueItem = new SharedQueueItem((uint)index, A.QueueCount, vulkanLogicalDevice, A.MinImageTransferGranularity, A.TimestampValidBits); foreach (Interop.QueueFlags G in Enum.GetValues(typeof(Interop.QueueFlags))) { if ((A.QueueFlags & G) == G) { //TODO: one main graphics queue restriction? { } if (!myQueueLookup.TryGetValue(G, out myValue)) { myValue = new QueueManagerItem(); myQueueLookup[G] = myValue; } myValue.AddQueue(myNewQueueItem); } } } }
internal void AddQueue(SharedQueueItem myNewQueueItem) { myList.AddLast(myNewQueueItem); }