MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/RTXGI-DDGI / Load

Function Load

samples/test-harness/src/Config.cpp:490–535  ·  view source on GitHub ↗

* Load and parse the configuration file. */

Source from the content-addressed store, hash-verified

488* Load and parse the configuration file.
489*/
490bool Load(
491 ConfigInfo &config,
492 LightInfo &lights,
493 Camera &camera,
494 std::vector<DDGIVolumeDesc> &descs,
495 InputInfo &inputInfo,
496 InputOptions &inputOptions,
497 RTOptions &rtOptions,
498 PostProcessOptions &postOptions,
499 VizOptions &vizOptions,
500 std::ofstream &log)
501{
502 // Load the config file
503 std::ifstream file(config.filepath, std::ios::ate | std::ios::binary);
504 if (!file.is_open())
505 {
506 log << "Error: failed to load configuration file: '";
507 log << config.filepath << "'\n";
508 return false;
509 }
510
511 // Read the config file to a buffer
512 size_t fileSize = (size_t)file.tellg();
513 char* buffer = new char[fileSize];
514
515 file.seekg(0);
516 file.read(buffer, fileSize);
517 file.close();
518
519 // Parse the config file
520 bool result = ParseConfig(buffer, config, lights, camera, descs, inputInfo, inputOptions, rtOptions, postOptions, vizOptions, log);
521
522 // Delete the config file buffer
523 delete[] buffer;
524
525 // Check the probe ray counts for each volume descriptor
526 for (size_t i = 0; i < descs.size(); i++)
527 {
528 if (descs[i].numRaysPerProbe % descs[i].numIrradianceTexels != 0)
529 {
530 log << "Warning: numRaysPerProbe is not a multiple of numIrradianceTexels. This is not an optimal configuration when using shared memory during blending.\n";
531 }
532 }
533
534 return result;
535}
536
537/**
538* Parse the command line to get the configuration file path.

Callers

nothing calls this directly

Calls 1

ParseConfigFunction · 0.85

Tested by

no test coverage detected