| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "gpu/vulkan/vulkan_device_queue.h" | 5 #include "gpu/vulkan/vulkan_device_queue.h" |
| 6 | 6 |
| 7 #include <unordered_set> | 7 #include <unordered_set> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "gpu/vulkan/vulkan_command_pool.h" | 10 #include "gpu/vulkan/vulkan_command_pool.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 for (size_t n = 0; n < queue_properties.size(); ++n) { | 68 for (size_t n = 0; n < queue_properties.size(); ++n) { |
| 69 if ((queue_properties[n].queueFlags & queue_flags) != queue_flags) | 69 if ((queue_properties[n].queueFlags & queue_flags) != queue_flags) |
| 70 continue; | 70 continue; |
| 71 | 71 |
| 72 #if defined(VK_USE_PLATFORM_XLIB_KHR) | 72 #if defined(VK_USE_PLATFORM_XLIB_KHR) |
| 73 if (options & DeviceQueueOption::PRESENTATION_SUPPORT_QUEUE_FLAG && | 73 if (options & DeviceQueueOption::PRESENTATION_SUPPORT_QUEUE_FLAG && |
| 74 !vkGetPhysicalDeviceXlibPresentationSupportKHR(device, n, xdisplay, | 74 !vkGetPhysicalDeviceXlibPresentationSupportKHR(device, n, xdisplay, |
| 75 visual_id)) { | 75 visual_id)) { |
| 76 continue; | 76 continue; |
| 77 } | 77 } |
| 78 #elif defined(VK_USE_PLATFORM_ANDROID_KHR) |
| 79 // On Android, all physical devices and queue families must be capable of |
| 80 // presentation with any native window. |
| 81 // As a result there is no Android-specific query for these capabilities. |
| 78 #else | 82 #else |
| 79 #error Non-Supported Vulkan implementation. | 83 #error Non-Supported Vulkan implementation. |
| 80 #endif | 84 #endif |
| 81 | 85 |
| 82 queue_index = static_cast<int>(n); | 86 queue_index = static_cast<int>(n); |
| 83 break; | 87 break; |
| 84 } | 88 } |
| 85 | 89 |
| 86 if (-1 != queue_index) { | 90 if (-1 != queue_index) { |
| 87 device_index = static_cast<int>(i); | 91 device_index = static_cast<int>(i); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 | 172 |
| 169 std::unique_ptr<VulkanCommandPool> VulkanDeviceQueue::CreateCommandPool() { | 173 std::unique_ptr<VulkanCommandPool> VulkanDeviceQueue::CreateCommandPool() { |
| 170 std::unique_ptr<VulkanCommandPool> command_pool(new VulkanCommandPool(this)); | 174 std::unique_ptr<VulkanCommandPool> command_pool(new VulkanCommandPool(this)); |
| 171 if (!command_pool->Initialize()) | 175 if (!command_pool->Initialize()) |
| 172 return nullptr; | 176 return nullptr; |
| 173 | 177 |
| 174 return command_pool; | 178 return command_pool; |
| 175 } | 179 } |
| 176 | 180 |
| 177 } // namespace gpu | 181 } // namespace gpu |
| OLD | NEW |