Changeset 8b823e7 in opengl-game for vulkan-utils.hpp
- Timestamp:
- Jan 24, 2021, 11:38:43 PM (4 years ago)
- Branches:
- feature/imgui-sdl
- Children:
- d8cf709
- Parents:
- ce9dc9f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vulkan-utils.hpp
rce9dc9f r8b823e7 3 3 4 4 #include <optional> 5 #include <sstream> 6 #include <stdexcept> 5 7 #include <string> 6 8 #include <vector> … … 32 34 class VulkanUtils { 33 35 public: 36 static string resultString(VkResult result); 37 34 38 static bool checkValidationLayerSupport(const vector<const char*> &validationLayers); 35 39 … … 136 140 } 137 141 142 #define VKUTIL_CHECK_RESULT(f, msg) { \ 143 VkResult res = (f); \ 144 \ 145 if (res != VK_SUCCESS) { \ 146 ostringstream oss; \ 147 oss << msg << " VkResult is \"" << VulkanUtils::resultString(res) << "\" in " << __FILE__ << " at line " << __LINE__;\ 148 \ 149 if (res < 0) { \ 150 throw runtime_error("Fatal: " + oss.str()); \ 151 } else { \ 152 cerr << oss.str(); \ 153 } \ 154 } \ 155 } 156 138 157 #endif // _VULKAN_UTILS_H
Note:
See TracChangeset
for help on using the changeset viewer.