💾 Блог: Как отслеживать FPS в играх UWP в Windows 10 📀

Analyzing opengl and vulkan applications

Applications that do not use D3D9 or DXGI APIs for presenting frames (e.g., as is typical with OpenGL or Vulkan applications) will report the following:

  • Runtime = Other
  • SwapChainAddress = 0
  • msInPresentAPI = 0

In this case, TimeInSeconds will represent the first time the present is observed in the kernel, as opposed to the runtime, and therefore will be sometime after the application presented the frame (typically ~0.5ms). Since msUntilRenderComplete and msUntilDisplayed are deltas from TimeInSeconds, they will be correspondingly smaller then they would have been if measured from application present.

Beta options

-track_mixed_realityCapture Windows Mixed Reality data to a CSV file with “_WMR” suffix.

Capture target options

-captureallRecord all processes (default).
-process_name nameRecord only processes with the provided exe name. This argument can be repeated to capture multiple processes.
-exclude nameDon’t record processes with the provided exe name. This argument can be repeated to exclude multiple processes.
-process_id idRecord only the process specified by ID.
-etl_file pathConsume events from an ETW log file instead of running processes.

Command line options

Capture target options: -captureall Record all processes (default). -process_name name Record only processes with the provided exe name. This argument can be repeated to capture multiple processes. -exclude name Don't record processes with the provided exe name. This argument can be repeated to exclude multiple processes. -process_id id Record only the process specified by ID. -etl_file path Consume events from an ETW log file instead of running processes.
Output options (see README for file naming defaults): -output_file path Write CSV output to the provided path. -output_stdout Write CSV output to STDOUT. -multi_csv Create a separate CSV file for each captured process. -no_csv Do not create any output file. -no_top Don't display active swap chains in the console window. -qpc_time Output present time as a performance counter value.
Recording options: -hotkey key Use provided key to start and stop recording, writing to a unique CSV file each time. 'key' is of the form MODIFIER KEY, e.g., alt shift f11. (See README for subsequent file naming). -delay seconds Wait for provided time before starting to record. If using -hotkey, the delay occurs each time recording is started. -timed seconds Stop recording after the provided amount of time. -exclude_dropped Exclude dropped presents from the csv output. -scroll_indicator Enable scroll lock while recording. -simple Disable GPU/display tracking. -verbose Adds additional data to output not relevant to normal usage.
Execution options: -session_name name Use the provided name to start a new realtime ETW session, instead of the default "PresentMon". This can be used to start multiple realtime capture process at the same time (using distinct names). A realtime PresentMon capture cannot start if there are any existing sessions with the same name. name is not sensitive to case. -stop_existing_session If a trace session with the same name is already running, stop the existing session (to allow this one to proceed). -dont_restart_as_admin Don't try to elevate privilege. Elevated privilege isn't required to trace a process you started, but PresentMon requires elevated privilege in order to query processes started on another account. Without it, these processes cannot be targeted by name and will be listed as '<error>'. -terminate_on_proc_exit Terminate PresentMon when all the target processes have exited. -terminate_after_timed When using -timed, terminate PresentMon after the timed capture completes.
Beta options: -qpc_time_s Output present time as a performance counter value converted to seconds. -terminate_existing Terminate any existing PresentMon realtime trace sessions, then exit. Use with -session_name to target particular sessions. -include_mixed_reality Capture Windows Mixed Reality data to a CSV file with "_WMR" suffix.

Csv file names

The default CSV file name is PresentMon-TIME.csv, where TIME is the capture
time in ISO 8601 format.

:/>  Как узнать какая сеть на пк

If the CSV file contains a single target process (-process_id or one
-process_name or -multi_csv) then the CSV filename is
PresentMon-PROCESSNAME-TIME.csv.

If an output file name is provided with -output_file PATH.EXT then that name
will be used, but -PROCESSNAME is appended to PATH if -multi_csv, and
-INDEX is appended if -hotkey where INDEX increases each time the hotkey
is used.

In all cases, _WMR is added to the file name if -include_mixed_reality is
used.

Dxtory slick и easy, но стоит денег

Dxtory – более удобная альтернатива. Как и PresentMon, Dxtory захватывает свои данные с более низкого уровня в Windows. ему не нужно напрямую взаимодействовать с игровым приложением, что означает, что он работает с этими играми UWP. Вам нужно будет загрузить «последнюю» сборку, а не «стабильную» сборку, по крайней мере, версию 2.0.134, поскольку последние сборки исправляют проблемы совместимости с приложениями DirectX 12.

В отличие от PresentMon, он предлагает графический интерфейс пользователя. Он может даже накладывать свой счетчик FPS на игры UWP. Это скорее настоящая альтернатива FRAPS, со всеми колокольчиками и свистами.

Это приложение является платным программным обеспечением, хотя есть пробная версия, которую вы можете использовать. Разработчик взимает 3800 иен за лицензию, которая составляет около 34,50 долларов США.

Просто запустите приложение Dxtory, а затем запустите – или Alt Tab обратно в свою игру UWP. Счетчик FPS будет наложен на верхний левый угол игры UWP.

Вы также можете вернуться к приложению Dxtory, чтобы просмотреть дополнительную информацию и настроить свои настройки. Но вам не нужно делать ничего особенного, чтобы настроить этот открытый Dxtory, запустить UWP-игру, и он просто сработает. Если вы хотите избавиться от счетчика FPS, просто закройте приложение Dxtory.

License

Copyright 2022 Intel Corporation

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the “Software”), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

:/>  Account.live.com

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Presentmon бесплатно, но требует небольшой работы

PresentMon – это инструмент с открытым исходным кодом, созданный разработчиком Intel. Он использует отслеживание событий для отслеживания базовой операционной системы Windows для «настоящих» команд и регистрирует информацию о них. Это позволяет контролировать производительность игр DirectX 10, DirectX 11 и DirectX 12.

Он работает, даже если эти приложения являются приложениями Universal Windows Platform (UWP), которые распространяются через Windows Store. Другими словами, этот инструмент работает, потому что ему не нужно взаимодействовать с UWP-приложением – ему не разрешено это делать. Он контролирует Windows на более низком уровне.

Это приложение командной строки, поэтому нет красивого графического интерфейса. Предприимчивый разработчик мог бы создать графический инструмент, построенный на этой командной строке, чтобы сделать это проще в будущем.

К сожалению, на данный момент требуется определенная работа. Вам нужно будет посетить страницу репозитория PresentMon и нажать «Загрузить ZIP», чтобы загрузить репозиторий. Затем вам нужно загрузить бесплатную версию Visual Studio Express Community Edition от Microsoft. Установите Visual Studio и позвольте ему обновить себя.

Разархивируйте загруженный файл репозитория PresentMon и дважды щелкните файл «PresentMon.sln», чтобы открыть его в Visual Studio. Visual Studio предложит загрузить компилятор.

Когда будет выполнена загрузка и установка необходимого программного обеспечения, вы можете открыть файл PresentMon.sln в Visual Studio и создать приложение. Просто выберите «Build»> «Build Solution», чтобы создать его.

Затем вы получите x64-каталог, предполагая, что вы находитесь в 64-разрядной версии Windows 10 (что вы, вероятно, есть). Это содержит команду PresentMon64.exe, которую вы можете использовать. Если хотите, вы можете поместить этот файл в более удобный каталог, например, папку «Рабочий стол» или «Загрузки».

Вам нужно будет использовать идентификатор процесса приложения UWP для его мониторинга. Сначала запустите игру. Затем откройте диспетчер задач, нажав Ctrl Alt Escape.

Щелкните правой кнопкой мыши заголовок на вкладке «Процессы» и включите столбец «PID». Если вы не видите вкладку «Процессы», нажмите «Подробнее».

Найдите запущенную игру UWP, которую вы хотите контролировать, и обратите внимание на ее номер PID. Идентификатор этого процесса будет меняться каждый раз при запуске приложения, поэтому вам придется найти его снова, если вы закроете и снова откроете игру.

Releases

Binaries for main release versions of PresentMon are provided on GitHub:

Please see
CONTRIBUTING
for information on how to request features, report issues, or contribute code
changes.

:/>  FAQ по ORACLE. Проблемы кодировки.

Windows mixed reality

Note: Windows Mixed Reality support is in beta, with limited OS support and maintenance.

https://www.youtube.com/watch?v=

If -include_mixed_reality is used, a second CSV file will be generated with _WMR appended to the filename with the following columns:

Column HeaderData DescriptionRequired argument
ApplicationProcess name (if known)-include_mixed_reality
ProcessIDProcess ID-include_mixed_reality
DwmProcessIDCompositor Process ID-include_mixed_reality
TimeInSecondsTime since PresentMon recording started-include_mixed_reality
MsBetweenLsrsTime between this Lsr CPU start and the previous one-include_mixed_reality
AppMissedWhether Lsr is reprojecting a new (0) or old (1) App frame (App GPU work must complete before Lsr CPU start)-include_mixed_reality
LsrMissedWhether Lsr displayed a new frame (0) or not (1 ) at the intended V-Sync (Count V-Syncs with no display change)-include_mixed_reality
MsAppPoseLatencyTime between App’s pose sample and the intended mid-photon frame display-include_mixed_reality
MsLsrPoseLatencyTime between Lsr’s pose sample and the intended mid-photon frame display-include_mixed_reality
MsActualLsrPoseLatencyTime between Lsr’s pose sample and mid-photon frame display-include_mixed_reality
MsTimeUntilVsyncTime between Lsr CPU start and the intended V-Sync-include_mixed_reality
MsLsrThreadWakeupToGpuEndTime between Lsr CPU start and GPU work completion-include_mixed_reality
MsLsrThreadWakeupErrorTime between intended Lsr CPU start and Lsr CPU start-include_mixed_reality
MsLsrPreemptionTime spent preempting the GPU with Lsr GPU work-include_mixed_reality
MsLsrExecutionTime spent executing the Lsr GPU work-include_mixed_reality
MsCopyPreemptionTime spent preempting the GPU with Lsr GPU cross-adapter copy work (if required)-include_mixed_reality
MsCopyExecutionTime spent executing the Lsr GPU cross-adapter copy work (if required)-include_mixed_reality
MsGpuEndToVsyncTime between Lsr GPU work completion and V-Sync-include_mixed_reality
MsBetweenAppPresentsTime between App’s present and the previous one-include_mixed_reality and not -simple
MsAppPresentToLsrTime between App’s present and Lsr CPU start-include_mixed_reality and not -simple
HolographicFrameIDApp’s Holographic Frame ID-include_mixed_reality-verbose
MsSourceReleaseFromRenderingToLsrAcquireTime between composition end and Lsr acquire-include_mixed_reality-verbose
MsAppCpuRenderFrameTime between App’s CreateNextFrame() API call and PresentWithCurrentPrediction() API call-include_mixed_reality-verbose
MsAppMispredictionTime between App’s intended pose time and the intended mid-photon frame display-include_mixed_reality-verbose
MsLsrCpuRenderFrameTime between Lsr CPU render start and GPU work submit-include_mixed_reality-verbose
MsLsrThreadWakeupToCpuRenderFrameStartTime between Lsr CPU start and CPU render start-include_mixed_reality-verbose
MsCpuRenderFrameStartToHeadPoseCallbackStartTime between Lsr CPU render start and pose sample-include_mixed_reality-verbose
MsGetHeadPoseTime between Lsr pose sample start and pose sample end-include_mixed_reality-verbose
MsHeadPoseCallbackStopToInputLatchTime between Lsr pose sample end and input latch-include_mixed_reality-verbose
MsInputLatchToGpuSubmissionTime between Lsr input latch and GPU work submit-include_mixed_reality-verbose