MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-Tools / DumpSurface

Function DumpSurface

vulkaninfo/vulkaninfo.cpp:228–262  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

226}
227
228void DumpSurface(Printer &p, AppInstance &inst, AppGpu &gpu, AppSurface &surface, std::set<std::string> surface_types) {
229 std::string surface_type_list_str = "";
230 if (surface_types.size() > 0) {
231 surface_type_list_str = " [";
232 bool is_first = true;
233 for (auto &name : surface_types) {
234 if (!is_first) {
235 surface_type_list_str += ", ";
236 } else {
237 is_first = false;
238 }
239 surface_type_list_str += name;
240 }
241 surface_type_list_str += "]";
242 }
243 ObjectWrapper obj(p, std::string("GPU id : ") + p.DecorateAsValue(std::to_string(gpu.id)) + " (" + gpu.props.deviceName + ")" +
244 surface_type_list_str);
245
246 if (surface_types.size() == 0) {
247 p.SetAsType().PrintKeyString("Surface type", "No type found");
248 } else if (surface_types.size() == 1) {
249 p.SetAsType().PrintKeyString("Surface type", surface.surface_extension.name);
250 } else {
251 ArrayWrapper arr(p, "Surface types", surface_types.size());
252 for (auto &name : surface_types) {
253 p.PrintString(name);
254 }
255 }
256
257 DumpSurfaceFormats(p, inst, surface);
258 DumpPresentModes(p, surface);
259 DumpSurfaceCapabilities(p, inst, gpu, surface);
260
261 p.AddNewline();
262}
263
264struct SurfaceTypeGroup {
265 AppSurface *surface;

Callers 1

DumpPresentableSurfacesFunction · 0.85

Calls 8

DumpSurfaceFormatsFunction · 0.85
DumpPresentModesFunction · 0.85
DumpSurfaceCapabilitiesFunction · 0.85
DecorateAsValueMethod · 0.80
PrintKeyStringMethod · 0.80
PrintStringMethod · 0.80
AddNewlineMethod · 0.80
to_stringFunction · 0.70

Tested by

no test coverage detected