mirror of
https://github.com/charles-lunarg/vk-bootstrap.git
synced 2024-11-10 02:41:47 +00:00
Format internal queue selection functions
This commit is contained in:
parent
70265d8b29
commit
ab60522c9b
@ -1030,14 +1030,18 @@ PhysicalDeviceSelector::Suitable PhysicalDeviceSelector::is_device_suitable(Phys
|
|||||||
if (criteria.required_version > pd.device_properties.apiVersion) return Suitable::no;
|
if (criteria.required_version > pd.device_properties.apiVersion) return Suitable::no;
|
||||||
if (criteria.desired_version > pd.device_properties.apiVersion) suitable = Suitable::partial;
|
if (criteria.desired_version > pd.device_properties.apiVersion) suitable = Suitable::partial;
|
||||||
|
|
||||||
bool dedicated_compute =
|
bool dedicated_compute = detail::get_dedicated_queue_index(pd.queue_families,
|
||||||
detail::get_dedicated_queue_index(pd.queue_families, VK_QUEUE_COMPUTE_BIT, VK_QUEUE_TRANSFER_BIT) != detail::QUEUE_INDEX_MAX_VALUE;
|
VK_QUEUE_COMPUTE_BIT,
|
||||||
bool dedicated_transfer =
|
VK_QUEUE_TRANSFER_BIT) != detail::QUEUE_INDEX_MAX_VALUE;
|
||||||
detail::get_dedicated_queue_index(pd.queue_families, VK_QUEUE_TRANSFER_BIT, VK_QUEUE_COMPUTE_BIT) != detail::QUEUE_INDEX_MAX_VALUE;
|
bool dedicated_transfer = detail::get_dedicated_queue_index(pd.queue_families,
|
||||||
|
VK_QUEUE_TRANSFER_BIT,
|
||||||
|
VK_QUEUE_COMPUTE_BIT) != detail::QUEUE_INDEX_MAX_VALUE;
|
||||||
bool separate_compute =
|
bool separate_compute =
|
||||||
detail::get_separate_queue_index(pd.queue_families, VK_QUEUE_COMPUTE_BIT, VK_QUEUE_TRANSFER_BIT) != detail::QUEUE_INDEX_MAX_VALUE;
|
detail::get_separate_queue_index(pd.queue_families, VK_QUEUE_COMPUTE_BIT, VK_QUEUE_TRANSFER_BIT) !=
|
||||||
|
detail::QUEUE_INDEX_MAX_VALUE;
|
||||||
bool separate_transfer =
|
bool separate_transfer =
|
||||||
detail::get_separate_queue_index(pd.queue_families, VK_QUEUE_TRANSFER_BIT, VK_QUEUE_COMPUTE_BIT) != detail::QUEUE_INDEX_MAX_VALUE;
|
detail::get_separate_queue_index(pd.queue_families, VK_QUEUE_TRANSFER_BIT, VK_QUEUE_COMPUTE_BIT) !=
|
||||||
|
detail::QUEUE_INDEX_MAX_VALUE;
|
||||||
|
|
||||||
bool present_queue =
|
bool present_queue =
|
||||||
detail::get_present_queue_index(pd.phys_device, instance_info.surface, pd.queue_families) !=
|
detail::get_present_queue_index(pd.phys_device, instance_info.surface, pd.queue_families) !=
|
||||||
@ -1282,16 +1286,20 @@ PhysicalDeviceSelector& PhysicalDeviceSelector::select_first_device_unconditiona
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool PhysicalDevice::has_dedicated_compute_queue() const {
|
bool PhysicalDevice::has_dedicated_compute_queue() const {
|
||||||
return detail::get_dedicated_queue_index(queue_families, VK_QUEUE_COMPUTE_BIT, VK_QUEUE_TRANSFER_BIT) != detail::QUEUE_INDEX_MAX_VALUE;
|
return detail::get_dedicated_queue_index(queue_families, VK_QUEUE_COMPUTE_BIT, VK_QUEUE_TRANSFER_BIT) !=
|
||||||
|
detail::QUEUE_INDEX_MAX_VALUE;
|
||||||
}
|
}
|
||||||
bool PhysicalDevice::has_separate_compute_queue() const {
|
bool PhysicalDevice::has_separate_compute_queue() const {
|
||||||
return detail::get_separate_queue_index(queue_families, VK_QUEUE_COMPUTE_BIT, VK_QUEUE_TRANSFER_BIT) != detail::QUEUE_INDEX_MAX_VALUE;
|
return detail::get_separate_queue_index(queue_families, VK_QUEUE_COMPUTE_BIT, VK_QUEUE_TRANSFER_BIT) !=
|
||||||
|
detail::QUEUE_INDEX_MAX_VALUE;
|
||||||
}
|
}
|
||||||
bool PhysicalDevice::has_dedicated_transfer_queue() const {
|
bool PhysicalDevice::has_dedicated_transfer_queue() const {
|
||||||
return detail::get_dedicated_queue_index(queue_families, VK_QUEUE_TRANSFER_BIT, VK_QUEUE_COMPUTE_BIT) != detail::QUEUE_INDEX_MAX_VALUE;
|
return detail::get_dedicated_queue_index(queue_families, VK_QUEUE_TRANSFER_BIT, VK_QUEUE_COMPUTE_BIT) !=
|
||||||
|
detail::QUEUE_INDEX_MAX_VALUE;
|
||||||
}
|
}
|
||||||
bool PhysicalDevice::has_separate_transfer_queue() const {
|
bool PhysicalDevice::has_separate_transfer_queue() const {
|
||||||
return detail::get_separate_queue_index(queue_families, VK_QUEUE_TRANSFER_BIT, VK_QUEUE_COMPUTE_BIT) != detail::QUEUE_INDEX_MAX_VALUE;
|
return detail::get_separate_queue_index(queue_families, VK_QUEUE_TRANSFER_BIT, VK_QUEUE_COMPUTE_BIT) !=
|
||||||
|
detail::QUEUE_INDEX_MAX_VALUE;
|
||||||
}
|
}
|
||||||
std::vector<VkQueueFamilyProperties> PhysicalDevice::get_queue_families() const {
|
std::vector<VkQueueFamilyProperties> PhysicalDevice::get_queue_families() const {
|
||||||
return queue_families;
|
return queue_families;
|
||||||
|
@ -82,13 +82,4 @@ TEST_CASE("Dedicated Transfer Queue, Separate Compute", "[UnitTests.queue_select
|
|||||||
vkb::detail::get_dedicated_queue_index(families, VK_QUEUE_COMPUTE_BIT, VK_QUEUE_TRANSFER_BIT));
|
vkb::detail::get_dedicated_queue_index(families, VK_QUEUE_COMPUTE_BIT, VK_QUEUE_TRANSFER_BIT));
|
||||||
REQUIRE(2 == vkb::detail::get_dedicated_queue_index(families, VK_QUEUE_TRANSFER_BIT, VK_QUEUE_COMPUTE_BIT));
|
REQUIRE(2 == vkb::detail::get_dedicated_queue_index(families, VK_QUEUE_TRANSFER_BIT, VK_QUEUE_COMPUTE_BIT));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
TEST_CASE("Queue Selection logic", "[VkBootstrap.queue_logic]") {
|
|
||||||
vkb::InstanceBuilder builder;
|
|
||||||
|
|
||||||
auto instance_ret = builder.request_validation_layers().build();
|
|
||||||
REQUIRE(instance_ret.has_value());
|
|
||||||
|
|
||||||
vkb::destroy_instance(instance_ret.value());
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user