_AutomatedPeriodicBenchmarkSuite_.bv.lua 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. ----------------------------------------------------------------------------------------------------
  2. --
  3. -- Copyright (c) Contributors to the Open 3D Engine Project.
  4. -- For complete copyright and license terms please see the LICENSE at the root of this distribution.
  5. --
  6. -- SPDX-License-Identifier: Apache-2.0 OR MIT
  7. --
  8. --
  9. --
  10. ----------------------------------------------------------------------------------------------------
  11. g_baseFolder = ResolvePath('@user@/scripts/PerformanceBenchmarks/')
  12. IDLE_COUNT = 100
  13. FRAME_COUNT = 100
  14. SAMPLES_TO_RUN = {
  15. {prefix = 'RPI', name = 'CullingAndLod', width = 1400, height = 800},
  16. {prefix = 'RPI', name = 'SponzaBenchmark', width = 1400, height = 800},
  17. {prefix = 'Performance', name = '100KDrawable_SingleView', width = 800, height = 600},
  18. {prefix = 'Performance', name = '100KDraw_10KDrawable_MultiView', width = 800, height = 600}
  19. }
  20. Print('Capturing data for ' .. tostring(#SAMPLES_TO_RUN) .. ' benchmarks')
  21. for index, sample in ipairs(SAMPLES_TO_RUN) do
  22. sample_path = sample['prefix'] .. '/' .. sample['name']
  23. Print('Opening sample ' .. sample_path)
  24. OpenSample(sample_path)
  25. ResizeViewport(sample['width'], sample['height'])
  26. output_path = g_baseFolder .. sample['name']
  27. CaptureBenchmarkMetadata(sample['name'], output_path .. '/benchmark_metadata.json')
  28. Print('Idling for ' .. tostring(IDLE_COUNT) .. ' frames..')
  29. IdleFrames(IDLE_COUNT)
  30. Print('Capturing timestamps for ' .. tostring(FRAME_COUNT) .. ' frames...')
  31. for i = 1,FRAME_COUNT do
  32. frame_timestamps = output_path .. '/frame' .. tostring(i) .. '_timestamps.json'
  33. cpu_timings = output_path .. '/cpu_frame' .. tostring(i) .. '_time.json'
  34. CapturePassTimestamp(frame_timestamps)
  35. CaptureCpuFrameTime(cpu_timings)
  36. end
  37. end
  38. Print('Capturing complete.')
  39. OpenSample(nil)