| Non-Confidential - REL | 101545__00_en | |||
| ||||
| Home > The Graphics Analyzer interface > Host-side headless mode > Exporting assets | ||||
You can use headless mode to export shader source code and texture assets from an OpenGL ES trace. You must provide an index in the trace from which to export.
For example, you could export the shaders that were loaded at the end of frame 15, or the textures that were loaded at function call index 500.
To export assets, run the aga-headless
script from the Graphics Analyzer installation directory. Pass in the location of the trace file to export assets
from. You must also provide the output directory with the --export-output-directory switch. This
directory is used to write the exported shaders and source code, and must be
writable, otherwise the export operations fail.
You must provide the name of the process that you want to export assets from with the -p or --process switch. If your trace contains multiple processes with the same name, you must also provide the process ID of the process you want to export from, using the --process-id switch.
Provide the trace index for Graphics Analyzer to extract the assets from. Graphics Analyzer attempts to compute the OpenGL ES state at the index and export the assets that are present at that point.
You can specify the index as a function call by using these switches:
--export-function-textures --export-function-shaders
Alternatively, you can index the trace by the frame number, which works the same way as selecting a frame in the Trace Outline. Graphics Analyzer indexes the trace to the function call at the end of the frame that you provide.
You can specify the index as a frame by using these switches:
--export-frame-textures --export-frame-shaders
You can specify a trace index only, in which case Graphics Analyzer exports all assets of the specified type at that index. For example, --export-frame-shaders 15 would export all shaders from frame 15.
You can further provide a comma-separated list of asset IDs to export
from the trace index, in which case Graphics Analyzer exports those
assets only. Join the frame index to the list of asset IDs with a colon (:)
character. For example, --export-function-textures
100:1,2,3,4 would export only texture IDs 1, 2, 3, and 4 from function
call index 100.
You can specify multiple frame indexes in the same command. Each index requires its own switch.
Putting it all together, the final command looks similar to this example, using Unix formatting convention:
aga-headless/path/to/trace.mgd --export-output-directory /path/to/output-dir \ --process com.my.process --process-id 3089 --export-frame-textures 22 \ --export-function-shaders 200:1,2,3,4,5
This command exports the textures from frame 22 and the first five shaders from function index 200 into the output-dir directory.