mirror of
https://github.com/charles-lunarg/vk-bootstrap.git
synced 2024-11-22 15:24:34 +00:00
Fix API of CustomQueueDescription
This commit is contained in:
parent
d759d3d575
commit
834960e58f
@ -1437,10 +1437,8 @@ DispatchTable Device::make_table() const { return { device, fp_vkGetDeviceProcAd
|
|||||||
|
|
||||||
Device::operator VkDevice() const { return this->device; }
|
Device::operator VkDevice() const { return this->device; }
|
||||||
|
|
||||||
CustomQueueDescription::CustomQueueDescription(uint32_t index, uint32_t count, std::vector<float> priorities)
|
CustomQueueDescription::CustomQueueDescription(uint32_t index, std::vector<float> priorities)
|
||||||
: index(index), count(count), priorities(priorities) {
|
: index(index), priorities(priorities) {}
|
||||||
assert(count == priorities.size());
|
|
||||||
}
|
|
||||||
|
|
||||||
void destroy_device(Device device) {
|
void destroy_device(Device device) {
|
||||||
device.internal_table.fp_vkDestroyDevice(device.device, device.allocation_callbacks);
|
device.internal_table.fp_vkDestroyDevice(device.device, device.allocation_callbacks);
|
||||||
@ -1455,7 +1453,7 @@ Result<Device> DeviceBuilder::build() const {
|
|||||||
|
|
||||||
if (queue_descriptions.size() == 0) {
|
if (queue_descriptions.size() == 0) {
|
||||||
for (uint32_t i = 0; i < physical_device.queue_families.size(); i++) {
|
for (uint32_t i = 0; i < physical_device.queue_families.size(); i++) {
|
||||||
queue_descriptions.push_back(CustomQueueDescription{ i, 1, std::vector<float>{ 1.0f } });
|
queue_descriptions.push_back(CustomQueueDescription{ i, std::vector<float>{ 1.0f } });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1464,7 +1462,7 @@ Result<Device> DeviceBuilder::build() const {
|
|||||||
VkDeviceQueueCreateInfo queue_create_info = {};
|
VkDeviceQueueCreateInfo queue_create_info = {};
|
||||||
queue_create_info.sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO;
|
queue_create_info.sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO;
|
||||||
queue_create_info.queueFamilyIndex = desc.index;
|
queue_create_info.queueFamilyIndex = desc.index;
|
||||||
queue_create_info.queueCount = desc.count;
|
queue_create_info.queueCount = static_cast<std::uint32_t>(desc.priorities.size());
|
||||||
queue_create_info.pQueuePriorities = desc.priorities.data();
|
queue_create_info.pQueuePriorities = desc.priorities.data();
|
||||||
queueCreateInfos.push_back(queue_create_info);
|
queueCreateInfos.push_back(queue_create_info);
|
||||||
}
|
}
|
||||||
|
@ -719,9 +719,8 @@ struct Device {
|
|||||||
|
|
||||||
// For advanced device queue setup
|
// For advanced device queue setup
|
||||||
struct CustomQueueDescription {
|
struct CustomQueueDescription {
|
||||||
explicit CustomQueueDescription(uint32_t index, uint32_t count, std::vector<float> priorities);
|
explicit CustomQueueDescription(uint32_t index, std::vector<float> priorities);
|
||||||
uint32_t index = 0;
|
uint32_t index = 0;
|
||||||
uint32_t count = 0;
|
|
||||||
std::vector<float> priorities;
|
std::vector<float> priorities;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -209,8 +209,8 @@ TEST_CASE("Device Configuration", "[VkBootstrap.bootstrap]") {
|
|||||||
auto queue_families = phys_device.get_queue_families();
|
auto queue_families = phys_device.get_queue_families();
|
||||||
for (uint32_t i = 0; i < (uint32_t)queue_families.size(); i++) {
|
for (uint32_t i = 0; i < (uint32_t)queue_families.size(); i++) {
|
||||||
if (queue_families[i].queueFlags & VK_QUEUE_GRAPHICS_BIT) {
|
if (queue_families[i].queueFlags & VK_QUEUE_GRAPHICS_BIT) {
|
||||||
queue_descriptions.push_back(vkb::CustomQueueDescription(
|
queue_descriptions.push_back(
|
||||||
i, queue_families[i].queueCount, std::vector<float>(queue_families[i].queueCount, 1.0f)));
|
vkb::CustomQueueDescription(i, std::vector<float>(queue_families[i].queueCount, 1.0f)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (phys_device.has_dedicated_compute_queue()) {
|
if (phys_device.has_dedicated_compute_queue()) {
|
||||||
@ -218,15 +218,15 @@ TEST_CASE("Device Configuration", "[VkBootstrap.bootstrap]") {
|
|||||||
if ((queue_families[i].queueFlags & VK_QUEUE_COMPUTE_BIT) &&
|
if ((queue_families[i].queueFlags & VK_QUEUE_COMPUTE_BIT) &&
|
||||||
(queue_families[i].queueFlags & VK_QUEUE_GRAPHICS_BIT) == 0 &&
|
(queue_families[i].queueFlags & VK_QUEUE_GRAPHICS_BIT) == 0 &&
|
||||||
(queue_families[i].queueFlags & VK_QUEUE_TRANSFER_BIT) == 0)
|
(queue_families[i].queueFlags & VK_QUEUE_TRANSFER_BIT) == 0)
|
||||||
queue_descriptions.push_back(vkb::CustomQueueDescription(
|
queue_descriptions.push_back(
|
||||||
i, queue_families[i].queueCount, std::vector<float>(queue_families[i].queueCount, 1.0f)));
|
vkb::CustomQueueDescription(i, std::vector<float>(queue_families[i].queueCount, 1.0f)));
|
||||||
}
|
}
|
||||||
} else if (phys_device.has_separate_compute_queue()) {
|
} else if (phys_device.has_separate_compute_queue()) {
|
||||||
for (uint32_t i = 0; i < (uint32_t)queue_families.size(); i++) {
|
for (uint32_t i = 0; i < (uint32_t)queue_families.size(); i++) {
|
||||||
if ((queue_families[i].queueFlags & VK_QUEUE_COMPUTE_BIT) &&
|
if ((queue_families[i].queueFlags & VK_QUEUE_COMPUTE_BIT) &&
|
||||||
((queue_families[i].queueFlags & VK_QUEUE_GRAPHICS_BIT) == 0)) {
|
((queue_families[i].queueFlags & VK_QUEUE_GRAPHICS_BIT) == 0)) {
|
||||||
queue_descriptions.push_back(vkb::CustomQueueDescription(
|
queue_descriptions.push_back(
|
||||||
i, queue_families[i].queueCount, std::vector<float>(queue_families[i].queueCount, 1.0f)));
|
vkb::CustomQueueDescription(i, std::vector<float>(queue_families[i].queueCount, 1.0f)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user