From 58f69e4c48fc6419d7012af3b9f6e8e0ce5dfcf6 Mon Sep 17 00:00:00 2001
From: Simeon Hermann <shermann04@uni-koblenz.de>
Date: Tue, 1 Jun 2021 16:06:38 +0200
Subject: [PATCH] [#61] exemplary annotated code of what had to be changed to
 run the app with an Intel HD Grapics

---
 projects/first_mesh/src/main.cpp | 2 +-
 src/vkcv/CommandResources.cpp    | 8 +++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/projects/first_mesh/src/main.cpp b/projects/first_mesh/src/main.cpp
index 107cd432..480ec2a3 100644
--- a/projects/first_mesh/src/main.cpp
+++ b/projects/first_mesh/src/main.cpp
@@ -25,7 +25,7 @@ int main(int argc, const char** argv) {
 		window,
 		applicationName,
 		VK_MAKE_VERSION(0, 0, 1),
-		{ vk::QueueFlagBits::eTransfer,vk::QueueFlagBits::eGraphics, vk::QueueFlagBits::eCompute },
+		{ 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_KHR_swapchain" }
 	);
diff --git a/src/vkcv/CommandResources.cpp b/src/vkcv/CommandResources.cpp
index 71c990c3..7a08c366 100644
--- a/src/vkcv/CommandResources.cpp
+++ b/src/vkcv/CommandResources.cpp
@@ -55,8 +55,14 @@ namespace vkcv {
 		else if (type == QueueType::Compute) {
 			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) {
-			return queueManager.getTransferQueues().front();
+			if (queueManager.getTransferQueues().size() == 0) {
+				return queueManager.getGraphicsQueues().front();
+			}
+			else {
+				return queueManager.getTransferQueues().front();
+			}
 		}
 		else if (type == QueueType::Present) {
 			return queueManager.getPresentQueue();
-- 
GitLab