| 275 | |
| 276 | #if defined(VULKANINFO_WSI_ENABLED) |
| 277 | void DumpPresentableSurfaces(Printer &p, AppInstance &inst, const std::vector<std::unique_ptr<AppGpu>> &gpus, |
| 278 | const std::vector<std::unique_ptr<AppSurface>> &surfaces) { |
| 279 | // Don't print anything if no surfaces are found |
| 280 | if (surfaces.size() == 0) return; |
| 281 | p.SetHeader(); |
| 282 | ObjectWrapper obj(p, "Presentable Surfaces"); |
| 283 | IndentWrapper indent(p); |
| 284 | |
| 285 | std::vector<SurfaceTypeGroup> surface_list; |
| 286 | |
| 287 | for (auto &surface : surfaces) { |
| 288 | auto exists = surface_list.end(); |
| 289 | for (auto it = surface_list.begin(); it != surface_list.end(); it++) { |
| 290 | // check for duplicate surfaces that differ only by the surface extension |
| 291 | if (*(it->surface) == *(surface.get())) { |
| 292 | exists = it; |
| 293 | break; |
| 294 | } |
| 295 | } |
| 296 | if (exists != surface_list.end()) { |
| 297 | exists->surface_types.insert(surface.get()->surface_extension.name); |
| 298 | } else { |
| 299 | // find surface.phys_device's corresponding AppGpu |
| 300 | AppGpu *corresponding_gpu = nullptr; |
| 301 | for (auto &gpu : gpus) { |
| 302 | if (gpu->phys_device == surface->phys_device) corresponding_gpu = gpu.get(); |
| 303 | } |
| 304 | if (corresponding_gpu != nullptr) |
| 305 | surface_list.push_back({surface.get(), corresponding_gpu, {surface.get()->surface_extension.name}}); |
| 306 | } |
| 307 | } |
| 308 | for (auto &group : surface_list) { |
| 309 | DumpSurface(p, inst, *group.gpu, *group.surface, group.surface_types); |
| 310 | } |
| 311 | p.AddNewline(); |
| 312 | } |
| 313 | #endif // defined(VULKANINFO_WSI_ENABLED) |
| 314 | |
| 315 | void DumpGroups(Printer &p, AppInstance &inst) { |
no test coverage detected