ostream: add queue_families to physical_device

This commit is contained in:
Danny Robson 2017-09-01 13:12:51 +10:00
parent 7163123b71
commit 2a61e8c4ea
2 changed files with 44 additions and 4 deletions

View File

@ -24,6 +24,22 @@
#include <cruft/util/iterator.hpp> #include <cruft/util/iterator.hpp>
///////////////////////////////////////////////////////////////////////////////
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 static
std::ostream& std::ostream&
@ -129,8 +145,26 @@ cruft::vk::operator<< (std::ostream &os, const physical_device &d)
os << " ], "; os << " ], ";
os << " properties: " << d.properties () os << " properties: " << d.properties ()
<< ", features: " << d.features () << ", features: " << d.features ();
<< " }";
return os; os << ", queues: ";
const auto &queues = d.queue_families ();
std::copy (
std::cbegin (queues),
std::cend (queues),
util::infix_iterator<VkQueueFamilyProperties> (os, ", ")
);
return os << "}";
} }
///////////////////////////////////////////////////////////////////////////////
std::ostream&
operator<< (std::ostream &os, const VkQueueFamilyProperties &val)
{
return os << "{ flags: " << val.queueFlags
<< ", count: " << val.queueCount
<< ", granularity: " << val.minImageTransferGranularity
<< " }";
};

View File

@ -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&, VkPhysicalDeviceType);
///////////////////////////////////////////////////////////////////////////////
std::ostream& operator<< (std::ostream&, const VkQueueFamilyProperties&);
std::ostream& operator<< (std::ostream&, const VkPhysicalDeviceLimits&); std::ostream& operator<< (std::ostream&, const VkPhysicalDeviceLimits&);
std::ostream& operator<< (std::ostream&, const VkPhysicalDeviceProperties&); std::ostream& operator<< (std::ostream&, const VkPhysicalDeviceProperties&);