[MUSIC PLAYING]
DAN GALPIN: Hi, I'm Dan Galpin and we're
introducing frame profiling, a new tool
within the Android GPU Inspector today on The Game Show.
The Android GPU Inspector, or AGI,
is a graphics profiling tool that
allows you to see what's going on inside
of the GPU of your Android device
so you can better understand graphics bottlenecks
and optimize the performance of your 3D game or app.
We've supported system profile functionality
since the launch of AGI.
It shows a timeline of events such as CPU activity,
memory usage, and per process information
alongside high frequency GPU hardware
counters and if you're using Vulkan,
GPU activity information.
It gives you a high level look at what's
happening inside of each frame based upon the counters
that your GPU supports.
Frame profiling uses that system profile data to help
you inspect a single frame.
You can see the time required for each render pass
and examine what commands, geometry, shaders,
and textures are associated with it.
To get started with Android GPU Inspector, head on over
to developer.android.com to download the tool
and check to see if your development machine
and device are supported.
AGI depends on having the Android Debug Bridge
or ADB installed.
If you've done any Android development on your machine,
you likely have it already.
Otherwise, you can get it from the SDK manager
with an Android studio or you can download
the standalone package.
Once AGI has validated your device,
you can select from a list of installed applications
that can be profiled, typically debug versions,
and then for the type of trace you
can select either Vulkan or OpenGL on ANGLE
depending on which API or app your game is using.
You can start tracing at the beginning,
at a specific time or frame, or select a manual capture start
like I'm doing.
All frame profiling captures are for a single frame.
And then we have AGI launch our app or game
and capture the frame data so we can begin our analysis.
In the profile view, you can see much of the same data
that we get from AGI system profiler.
You can see the frame buffer size being rendered
into the time it took to render and on this device,
you can see the time it spent during binning
and even the time spent on individual render slices.
The information in this view will
vary depending on the GPU family being profiled.
Clicking on one of the render pass blocks within the timeline
highlights the associated commands
within the commands window.
Within the render pass, you can look at individual draw calls,
look at the state, and examine structures or memory regions.
Defining debug markers within your code
allows you to group calls under heading and the command tree,
and popular game engines do lots of this automatically.
Select a draw call, or a group containing a draw call,
and you can see what the current framebuffer state is.
The pipeline tab gives you insight
into some key details of what is happening
at each stage of the render pipeline to that call.
Unused pages will be grayed out.
In the input assembler stage, you
can examine the vertex bindings and attributes as well as
the topology of your vertex primitives.
This allows you to answer questions about vertex formats
and see whether your vertex data is optimally
compressed and laid out.
All of the programmable shader stages, vertex shader,
tessellation, control and evaluation, geometry shader,
and fragment shader allow you to see the shader associated
with stage, the descriptor sets bound to it,
and give you a static analysis of the shader complexity.
You can either view the disassembled SPIRV
or a decompile version created using SPIRV-Cross.
The rasterization pipeline stage allows
you to take a look at parameters on the rasterization
state, the multi sample state, and the viewport
and scissors that describes where and what gets rendered
to upper frame buffer.
Finally the blend stage allows you to see the parameters
for each color blend attachment state, the overall blend state,
and the depth and stencil states.
In addition, you can look at the overall driver state
after the execution of the selected
command within the state tab.
The performance tab allows you to get
estimates of various aspects of GPU performance
for each render pass.
These will vary depending on the GPU
you're working with but mine includes texture and vertex
memory read bandwidth, the percentage of nearest linear
and isotropic filtering, the percentage of time shading
fragments and vertices, and much more.
You can filter from the list of GPU counters.
You'll also be able to run experiments here
to determine performance impacts quickly,
such as the result of disabling anisotropic filtering.
This just scratches the surface of what AGI can do.
You can see a list of your textures
with their associated metadata, you can easily
find your largest textures.
You can view the geometry associated with each call
and take a look at the complexity
in terms of vertices, indices, and triangles.
You can get a report of any errors returned by the API
and get a list of all the shaders used along
with your disassembled and decompiled output and bindings.
So that's the Android Graphics Inspector with frame profiling.
Let us know what you think and what more we could
do to give you the insights you need
to solve performance problems.
As always, thanks for your support
in continuing to build incredible games.
I'm Dan Galpin for The Game Show.
Please remember to like, subscribe, share,
and stay safe.
[MUSIC PLAYING]