vulkan_device: refactor feature testing
This commit is contained in:
parent
948ac976d1
commit
279005448a
3 changed files with 674 additions and 1183 deletions
|
@ -60,22 +60,9 @@ std::string GetDriverVersion(const Device& device) {
|
|||
return GetReadableVersion(version);
|
||||
}
|
||||
|
||||
std::string BuildCommaSeparatedExtensions(std::vector<std::string> available_extensions) {
|
||||
std::sort(std::begin(available_extensions), std::end(available_extensions));
|
||||
|
||||
static constexpr std::size_t AverageExtensionSize = 64;
|
||||
std::string separated_extensions;
|
||||
separated_extensions.reserve(available_extensions.size() * AverageExtensionSize);
|
||||
|
||||
const auto end = std::end(available_extensions);
|
||||
for (auto extension = std::begin(available_extensions); extension != end; ++extension) {
|
||||
if (const bool is_last = extension + 1 == end; is_last) {
|
||||
separated_extensions += *extension;
|
||||
} else {
|
||||
separated_extensions += fmt::format("{},", *extension);
|
||||
}
|
||||
}
|
||||
return separated_extensions;
|
||||
std::string BuildCommaSeparatedExtensions(
|
||||
const std::set<std::string, std::less<>>& available_extensions) {
|
||||
return fmt::format("{}", fmt::join(available_extensions, ","));
|
||||
}
|
||||
|
||||
} // Anonymous namespace
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue