From 2a61e8c4ea69a791fe5b9d38e094bc7462303e88 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Fri, 1 Sep 2017 13:12:51 +1000 Subject: [PATCH] ostream: add queue_families to physical_device --- ostream.cpp | 42 ++++++++++++++++++++++++++++++++++++++---- ostream.hpp | 6 ++++++ 2 files changed, 44 insertions(+), 4 deletions(-) diff --git a/ostream.cpp b/ostream.cpp index 0df127c..f51861d 100644 --- a/ostream.cpp +++ b/ostream.cpp @@ -24,6 +24,22 @@ #include +/////////////////////////////////////////////////////////////////////////////// +std::ostream& +operator<< (std::ostream &os, VkExtent2D val) +{ + return os << "[ " << val.width << ", " << val.height << " ]"; +} + + +//----------------------------------------------------------------------------- +std::ostream& +operator<< (std::ostream &os, VkExtent3D val) +{ + return os << "[ " << val.width << ", " << val.height << ", " << val.depth << "]"; +} + + /////////////////////////////////////////////////////////////////////////////// static std::ostream& @@ -129,8 +145,26 @@ cruft::vk::operator<< (std::ostream &os, const physical_device &d) os << " ], "; os << " properties: " << d.properties () - << ", features: " << d.features () - << " }"; + << ", features: " << d.features (); - return os; -} \ No newline at end of file + os << ", queues: "; + const auto &queues = d.queue_families (); + std::copy ( + std::cbegin (queues), + std::cend (queues), + util::infix_iterator (os, ", ") + ); + + return os << "}"; +} + + +/////////////////////////////////////////////////////////////////////////////// +std::ostream& +operator<< (std::ostream &os, const VkQueueFamilyProperties &val) +{ + return os << "{ flags: " << val.queueFlags + << ", count: " << val.queueCount + << ", granularity: " << val.minImageTransferGranularity + << " }"; +}; diff --git a/ostream.hpp b/ostream.hpp index fff9348..f86b568 100644 --- a/ostream.hpp +++ b/ostream.hpp @@ -27,7 +27,13 @@ /////////////////////////////////////////////////////////////////////////////// +std::ostream& operator<< (std::ostream&, VkExtent2D); +std::ostream& operator<< (std::ostream&, VkExtent3D); std::ostream& operator<< (std::ostream&, VkPhysicalDeviceType); + + +/////////////////////////////////////////////////////////////////////////////// +std::ostream& operator<< (std::ostream&, const VkQueueFamilyProperties&); std::ostream& operator<< (std::ostream&, const VkPhysicalDeviceLimits&); std::ostream& operator<< (std::ostream&, const VkPhysicalDeviceProperties&);