# Use defaults from the Google style with the following exceptions:
BasedOnStyle: Google
IndentWidth: 4
+AccessModifierOffset: -2
ColumnLimit: 132
SortIncludes: false
...
*
****************************************************************************/
-
#pragma once
#ifdef _WIN32
-#pragma warning( disable : 4065 )
+#pragma warning(disable : 4065)
#endif
#include <vulkan/vulkan.h>
-static inline const char* string_VkObjectType(VkObjectType input_value)
-{
- switch ((VkObjectType)input_value)
- {
+static inline const char* string_VkObjectType(VkObjectType input_value) {
+ switch ((VkObjectType)input_value) {
case VK_OBJECT_TYPE_QUERY_POOL:
return "VK_OBJECT_TYPE_QUERY_POOL";
case VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION:
enum class OutputType { text, html, json, vkconfig_output };
class Printer {
- public:
+ public:
Printer(OutputType output_type, std::ostream &out, const uint32_t selected_gpu, const VulkanVersion vulkan_version)
: output_type(output_type), out(out) {
switch (output_type) {
return input;
}
- protected:
+ protected:
OutputType output_type;
std::ostream &out;
int indents = 0;
// always desired, requiring a manual decrease of indention. This wrapper facilitates that while also
// automatically re-indenting the output to the previous indent level on scope exit.
class IndentWrapper {
- public:
+ public:
IndentWrapper(Printer &p) : p(p) {
if (p.Type() == OutputType::text) p.IndentDecrease();
}
if (p.Type() == OutputType::text) p.IndentIncrease();
}
- private:
+ private:
Printer &p;
};
class ObjectWrapper {
- public:
+ public:
ObjectWrapper(Printer &p, std::string object_name) : p(p) { p.ObjectStart(object_name); }
ObjectWrapper(Printer &p, std::string object_name, size_t count_subobjects) : p(p) {
p.ObjectStart(object_name, static_cast<int32_t>(count_subobjects));
}
~ObjectWrapper() { p.ObjectEnd(); }
- private:
+ private:
Printer &p;
};
class ArrayWrapper {
- public:
+ public:
ArrayWrapper(Printer &p, std::string array_name, size_t element_count = 0) : p(p) {
p.ArrayStart(array_name, static_cast<int32_t>(element_count));
}
~ArrayWrapper() { p.ArrayEnd(); }
- private:
+ private:
Printer &p;
};
\ No newline at end of file
~FileLineException() throw() {}
const char *what() const throw() { return msg.c_str(); }
- private:
+ private:
std::string msg;
};
#define THROW_ERR(arg) throw FileLineException(arg, __FILE__, __LINE__);
~VulkanException() throw() {}
const char *what() const throw() { return msg.c_str(); }
- private:
+ private:
std::string msg;
};
#define THROW_VK_ERR(func_name, err) throw VulkanException(func_name, __FILE__, __LINE__, err);
#endif // VK_USE_PLATFORM_METAL_EXT
}
- private:
+ private:
template <typename T>
void Load(T &func_dest, const char *func_name) {
#if defined(__linux__)
Load(vkGetPhysicalDeviceToolPropertiesEXT, "vkGetPhysicalDeviceToolPropertiesEXT");
}
- private:
+ private:
PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr;
VkInstance instance;
template <typename T>
// ---------- Surfaces -------------- //
class AppSurface {
- public:
+ public:
AppInstance &inst;
VkPhysicalDevice phys_device;
SurfaceExtension surface_extension;