Skip to content
Snippets Groups Projects
Commit 55fa52aa authored by Simeon Hermann's avatar Simeon Hermann
Browse files

[#61] fixed handling of the case that only one queue for all usage exists (Intel Graphics)

parent 58f69e4c
No related branches found
No related tags found
1 merge request!46Resolve "Queues-Abfragen anpassen für Intel HD Graphics"
Pipeline #25350 passed
...@@ -25,7 +25,7 @@ int main(int argc, const char** argv) { ...@@ -25,7 +25,7 @@ int main(int argc, const char** argv) {
window, window,
applicationName, applicationName,
VK_MAKE_VERSION(0, 0, 1), VK_MAKE_VERSION(0, 0, 1),
{ vk::QueueFlagBits::eGraphics }, //at this place I now must remove the other queues for the app to work but probably there is a better way to handle this { vk::QueueFlagBits::eGraphics ,vk::QueueFlagBits::eCompute , vk::QueueFlagBits::eTransfer },
{}, {},
{ "VK_KHR_swapchain" } { "VK_KHR_swapchain" }
); );
......
...@@ -55,14 +55,8 @@ namespace vkcv { ...@@ -55,14 +55,8 @@ namespace vkcv {
else if (type == QueueType::Compute) { else if (type == QueueType::Compute) {
return queueManager.getComputeQueues().front(); return queueManager.getComputeQueues().front();
} }
//example of how the non-existence of queues other than the graphics queue could be handled
else if (type == QueueType::Transfer) { else if (type == QueueType::Transfer) {
if (queueManager.getTransferQueues().size() == 0) { return queueManager.getTransferQueues().front();
return queueManager.getGraphicsQueues().front();
}
else {
return queueManager.getTransferQueues().front();
}
} }
else if (type == QueueType::Present) { else if (type == QueueType::Present) {
return queueManager.getPresentQueue(); return queueManager.getPresentQueue();
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
#include "vkcv/QueueManager.hpp" #include "vkcv/QueueManager.hpp"
#include "vkcv/QueueManager.hpp"
namespace vkcv { namespace vkcv {
...@@ -89,7 +88,12 @@ namespace vkcv { ...@@ -89,7 +88,12 @@ namespace vkcv {
} }
} }
if (!found) { if (!found) {
throw std::runtime_error("Too many graphics queues were requested than being available!"); for (int i = 0; i < queueFamilyStatus.size() && !found; i++) {
if (initialQueueFamilyStatus[i][0] > 0) {
queuePairsGraphics.push_back(std::pair(i, 0));
found = true;
}
}
} }
break; break;
case vk::QueueFlagBits::eCompute: case vk::QueueFlagBits::eCompute:
...@@ -104,7 +108,12 @@ namespace vkcv { ...@@ -104,7 +108,12 @@ namespace vkcv {
} }
} }
if (!found) { if (!found) {
throw std::runtime_error("Too many compute queues were requested than being available!"); for (int i = 0; i < queueFamilyStatus.size() && !found; i++) {
if (initialQueueFamilyStatus[i][1] > 0) {
queuePairsCompute.push_back(std::pair(i, 0));
found = true;
}
}
} }
break; break;
case vk::QueueFlagBits::eTransfer: case vk::QueueFlagBits::eTransfer:
...@@ -119,7 +128,12 @@ namespace vkcv { ...@@ -119,7 +128,12 @@ namespace vkcv {
} }
} }
if (!found) { if (!found) {
throw std::runtime_error("Too many transfer queues were requested than being available!"); for (int i = 0; i < queueFamilyStatus.size() && !found; i++) {
if (initialQueueFamilyStatus[i][2] > 0) {
queuePairsTransfer.push_back(std::pair(i, 0));
found = true;
}
}
} }
break; break;
default: default:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment