LoginSignup
8
5

More than 5 years have passed since last update.

apitraceを使ってみる(まだよくわかっていない)

Posted at

導入

たぶんhomebrewでQtが入っていないとうまくいかないかも

$ git clone git@github.com:apitrace/apitrace.git
$ cd apitrace
$ mkdir build
$ cd build
$ cmake ..
$ make -j4
$ make install
$ apitrace

で何かしらメッセージが出れば成功

実行

適当なプログラムをapitrace経由で実行してみる

  • --apiは、glglslを指定する模様。
  • --outputで上の階層を指定しているのは、glfwの仕様で初期化時に*.app/Contents/Resources/が作業パスになる為。そうすると dump.traceに結果が出力される。
$ apitrace trace --api=gl --output=../../../dump.trace  ./graphicsExampleDebug.app/Contents/MacOS/graphicsExampleDebug

観測

上で出力したtraceファイルを開いてみる。qapitraceコマンドでGUIが立ち上がる。

$ qapitrace ./dump.trace

Screen Shot 2014-06-24 at 22.15.18.png

こんな感じ。見た所OpenGLのコマンドがガリガリ書かれている模様。

CPU/GPU内で実行されている処理のプロファイリングをしたり、任意の地点でのGLコンテクスト内部状態を見たりとかができる臭い。

Screen Shot 2014-06-24 at 22.18.05.png

traceした結果はプレイバックできたり、シェーダー、テクスチャものぞけるみたい。

結果

クソ便利そう

8
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
5