Added toString for descriptor set layout binding

This commit is contained in:
matthias@arch 2022-11-07 02:24:31 +01:00
parent 76c34b3ad0
commit 0d205cd7a5
2 changed files with 16 additions and 0 deletions

View File

@ -1,4 +1,5 @@
#include "vk_convert.hpp"
#include <gz-util/string/conversion.hpp>
bool vkBool2Bool(const vk::Bool32& b) {
if (b == VK_TRUE) {
@ -35,3 +36,12 @@ vk::Bool32 string2VkBool(const std::string& s) {
return VK_FALSE;
}
}
std::string toString(const vk::DescriptorSetLayoutBinding& binding) {
return "{ binding: " + gz::toString(binding.binding) +
", desc. count: " + gz::toString(binding.descriptorCount) +
", desc. type: " + vk::to_string(binding.descriptorType) +
", stage flags: " + vk::to_string(binding.stageFlags);
}

View File

@ -4,9 +4,15 @@
#include <vulkan/vulkan.hpp>
#include <string>
/* #ifdef GZ_UTIL_STRING_CONCEPTS */
/* static_assert(false, "gz-util/string/conversion.hpp is included before vk_convert.hpp!"); */
/* #endif */
vk::Bool32 bool2VkBool(const bool& b);
bool vkBool2Bool(const vk::Bool32& b);
vk::Bool32 string2VkBool(const std::string& s);
std::string vkBool2String(const vk::Bool32& b);
std::string toString(const vk::DescriptorSetLayoutBinding& binding);