Skip to content
Snippets Groups Projects
Commit 84781a4a authored by Sebastian Gaida's avatar Sebastian Gaida
Browse files

[#16] remove debug code

parent c818872a
No related branches found
No related tags found
1 merge request!12Resolve "Swapchain Class"
Pipeline #24851 passed
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
#include "vulkan/vulkan.hpp" #include "vulkan/vulkan.hpp"
#include "Context.hpp" #include "Context.hpp"
#include "vkcv/Window.hpp" #include "vkcv/Window.hpp"
#include <iostream>
namespace vkcv { namespace vkcv {
class SwapChain final { class SwapChain final {
......
#include <iostream>
#include "vkcv/Context.hpp" #include "vkcv/Context.hpp"
namespace vkcv namespace vkcv
......
...@@ -109,12 +109,6 @@ namespace vkcv ...@@ -109,12 +109,6 @@ namespace vkcv
queuePairsTransfer = {}; queuePairsTransfer = {};
std::vector<vk::QueueFamilyProperties> qFamilyProperties = physicalDevice.getQueueFamilyProperties(); std::vector<vk::QueueFamilyProperties> qFamilyProperties = physicalDevice.getQueueFamilyProperties();
// DEBUG
std::cout << "Input queue flags:" << std::endl;
for (auto qFlag : queueFlags) {
std::cout << "\t" << to_string(qFlag) << std::endl;
}
//check priorities of flags -> the lower prioCount the higher the priority //check priorities of flags -> the lower prioCount the higher the priority
std::vector<int> prios; std::vector<int> prios;
for(auto flag: queueFlags){ for(auto flag: queueFlags){
...@@ -123,23 +117,16 @@ namespace vkcv ...@@ -123,23 +117,16 @@ namespace vkcv
prioCount += (static_cast<uint32_t>(flag & qFamilyProperties[i].queueFlags) != 0) * qFamilyProperties[i].queueCount; prioCount += (static_cast<uint32_t>(flag & qFamilyProperties[i].queueFlags) != 0) * qFamilyProperties[i].queueCount;
} }
prios.push_back(prioCount); prios.push_back(prioCount);
std::cout<< "prio Count: " << prioCount << std::endl;
} }
//resort flags with heighest priority before allocating the queues //resort flags with heighest priority before allocating the queues
std::vector<vk::QueueFlagBits> newFlags; std::vector<vk::QueueFlagBits> newFlags;
for(int i = 0; i < prios.size(); i++){ for(int i = 0; i < prios.size(); i++){
auto minElem = std::min_element(prios.begin(), prios.end()); auto minElem = std::min_element(prios.begin(), prios.end());
int index = minElem - prios.begin(); int index = minElem - prios.begin();
std::cout << "index: "<< index << std::endl;
newFlags.push_back(queueFlags[index]); newFlags.push_back(queueFlags[index]);
prios[index] = std::numeric_limits<int>::max(); prios[index] = std::numeric_limits<int>::max();
} }
std::cout << "Sorted queue flags:" << std::endl;
for (auto qFlag : newFlags) {
std::cout << "\t" << to_string(qFlag) << std::endl;
}
// create requested queues and check if more requested queues are supported // create requested queues and check if more requested queues are supported
// herefore: create vector that updates available queues in each queue family // herefore: create vector that updates available queues in each queue family
// structure: [qFamily_0, ..., qFamily_n] where // structure: [qFamily_0, ..., qFamily_n] where
...@@ -154,7 +141,6 @@ namespace vkcv ...@@ -154,7 +141,6 @@ namespace vkcv
} }
initialQueueFamilyStatus = queueFamilyStatus; initialQueueFamilyStatus = queueFamilyStatus;
// check if every queue with the specified queue flag can be created // check if every queue with the specified queue flag can be created
// this automatically checks for queue flag support! // this automatically checks for queue flag support!
for (auto qFlag : newFlags) { for (auto qFlag : newFlags) {
...@@ -168,7 +154,6 @@ namespace vkcv ...@@ -168,7 +154,6 @@ namespace vkcv
queueFamilyStatus[i][0]--; queueFamilyStatus[i][0]--;
queueFamilyStatus[i][1]--; queueFamilyStatus[i][1]--;
queueFamilyStatus[i][2]--; queueFamilyStatus[i][2]--;
std::cout << "Graphics queue available at queue family #" << i << std::endl;
found = true; found = true;
} }
} }
...@@ -184,7 +169,6 @@ namespace vkcv ...@@ -184,7 +169,6 @@ namespace vkcv
queueFamilyStatus[i][0]--; queueFamilyStatus[i][0]--;
queueFamilyStatus[i][1]--; queueFamilyStatus[i][1]--;
queueFamilyStatus[i][2]--; queueFamilyStatus[i][2]--;
std::cout << "Compute queue available at queue family #" << i << std::endl;
found = true; found = true;
} }
} }
...@@ -200,7 +184,6 @@ namespace vkcv ...@@ -200,7 +184,6 @@ namespace vkcv
queueFamilyStatus[i][0]--; queueFamilyStatus[i][0]--;
queueFamilyStatus[i][1]--; queueFamilyStatus[i][1]--;
queueFamilyStatus[i][2]--; queueFamilyStatus[i][2]--;
std::cout << "Transfer queue available at queue family #" << i << std::endl;
found = true; found = true;
} }
} }
...@@ -213,24 +196,9 @@ namespace vkcv ...@@ -213,24 +196,9 @@ namespace vkcv
} }
} }
std::cout << "Initial queue status:" << std::endl;
int x = 0;
for (std::vector<int> e : initialQueueFamilyStatus) {
std::cout << "#" << x << ":\t[" << e[0] << ", " << e[1] << ", " << e[2] << "]" << std::endl;
x++;
}
std::cout << "Actual queue status:" << std::endl;
x = 0;
for (std::vector<int> e : queueFamilyStatus) {
std::cout << "#" << x << ":\t[" << e[0] << ", " << e[1] << ", " << e[2] << "]" << std::endl;
x++;
}
// create all requested queues // create all requested queues
for (int i = 0; i < qFamilyProperties.size(); i++) { for (int i = 0; i < qFamilyProperties.size(); i++) {
uint32_t create = std::abs(initialQueueFamilyStatus[i][0] - queueFamilyStatus[i][0]); uint32_t create = std::abs(initialQueueFamilyStatus[i][0] - queueFamilyStatus[i][0]);
std::cout << "For Queue Family #" << i << " create " << create << " queues" << std::endl;
if (create > 0) { if (create > 0) {
vk::DeviceQueueCreateInfo qCreateInfo( vk::DeviceQueueCreateInfo qCreateInfo(
vk::DeviceQueueCreateFlags(), vk::DeviceQueueCreateFlags(),
......
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