| 1385 | } |
| 1386 | |
| 1387 | PrinterCreateDetails get_printer_create_details(ParsedResults &parse_data, AppInstance &inst, AppGpu &selected_gpu, |
| 1388 | std::string const &executable_name) { |
| 1389 | PrinterCreateDetails create{}; |
| 1390 | create.print_to_file = parse_data.print_to_file; |
| 1391 | create.file_name = (!parse_data.filename.empty()) ? parse_data.filename : parse_data.default_filename; |
| 1392 | switch (parse_data.output_category) { |
| 1393 | default: |
| 1394 | case (OutputCategory::text): |
| 1395 | create.output_type = OutputType::text; |
| 1396 | break; |
| 1397 | case (OutputCategory::html): |
| 1398 | create.output_type = OutputType::html; |
| 1399 | break; |
| 1400 | case (OutputCategory::profile_json): |
| 1401 | create.output_type = OutputType::json; |
| 1402 | create.start_string = |
| 1403 | std::string("{\n\t\"$schema\": ") + "\"https://schema.khronos.org/vulkan/profiles-0.8-latest.json\""; |
| 1404 | if (parse_data.filename.empty()) { |
| 1405 | create.file_name = std::string("VP_" APP_UPPER_CASE_NAME "_") + std::string(selected_gpu.props.deviceName) + "_" + |
| 1406 | selected_gpu.GetDriverVersionString(); |
| 1407 | for (auto &c : create.file_name) { |
| 1408 | if (c == ' ' || c == '.') c = '_'; |
| 1409 | } |
| 1410 | create.file_name += ".json"; |
| 1411 | } |
| 1412 | break; |
| 1413 | case (OutputCategory::vkconfig_output): |
| 1414 | create.output_type = OutputType::vkconfig_output; |
| 1415 | create.start_string = "{\n\t\"" API_NAME " Instance Version\": \"" + inst.api_version.str() + "\""; |
| 1416 | break; |
| 1417 | } |
| 1418 | return create; |
| 1419 | } |
| 1420 | |
| 1421 | void RunPrinter(Printer &p, ParsedResults parse_data, AppInstance &instance, std::vector<std::unique_ptr<AppGpu>> &gpus, |
| 1422 | std::vector<std::unique_ptr<AppSurface>> &surfaces) { |