2. Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2
! Gordon
Selley
is
a
member
of
AMD’s
GPU
Developer
Tools
Team
and
is
the
team
leader
for
GPU
PerfStudio2.
He
has
developed
graphics
soPware
for
the
flight
simula:on,
TV
and
film
FX,
PC
and
online
games
industry.
3. OPTIMIZING
GAME
DEVELOPMENT
USING
AMD'S
GPU
PERFSTUDIO
2
PRESENTATION
OVERVIEW
! Introduc:on
to
GPU
PerfStudio
2
‒ What
it
is
and
what
it
does
‒ Who
uses
it
! Using
GPU
PerfStudio
2
‒ How
it
is
used
in
prac:ce
‒ Recent
user
case
studies
‒ Assassins
Creed
3
–
Understanding
the
frame
‒ Far
Cry
3
–
Automated
data
mining
of
game
content
‒ Steam
Linux®-‐
Por:ng
Source2
to
OpenGL
! What’s
New?
‒ GPU
PerfStudio
2.14
‒ Mantle
‒ Linux®
! Summary
! Ques:ons
3
|
Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2|
NOVEMBER
21,
2013
|
4. INTRODUCTION
TO
GPU
PERFSTUDIO
2
WHAT
IT
IS
! GPU
PerfStudio2
is
AMD's
performance
and
debugging
tool
for
graphics
applica:ons
‒ A
suite
of
tools
that
can
be
used
to
debug
and
increase
performance
on
AMD
GPUs
! Key
Features
‒ Integrated
Frame
Profiler,
Frame
Debugger,
and
API
Trace
with
CPU
:ming
informa:on
‒ Shader
Debugger
with
support
for
DirectX®
10
&
11
HLSL
and
Assembly
code
‒ Client
/
Server
model
-‐
GPU
PerfStudio
2
Client
runs
locally
or
remotely
over
the
network
‒ GPU
PerfStudio
2
Server
supports
32-‐bit
and
64-‐bit
applica:ons
‒ Supports
DirectX®
11,
DirectX®
10.1
,
DirectX®
10
and
OpenGL®
4.2
applica:ons
‒ No
special
build
required
for
your
applica:on
‒ Small
footprint
–
no
installa:on
‒ Free
download
hjp://developer.amd.com
4
|
Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2|
NOVEMBER
21,
2013
|
5. INTRODUCTION
TO
GPU
PERFSTUDIO
2
FRAME
DEBUGGER
! Capture,
play
back
and
view
the
contents
of
a
frame
! Scrub
through
draw
calls
! Visualize
the
GPU
:me
for
each
draw
call
! Inspect
the
resources
at
each
stage
of
the
pipeline
! View
all
game
resources
and
state
bound
at
each
draw
call
! View
and
edit
the
shader
code
! Visualize
the
geometry
being
rendered
5
|
Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2|
NOVEMBER
21,
2013
|
6. INTRODUCTION
TO
GPU
PERFSTUDIO
2
FRAME
PROFILER
! Iden:fy
costly
draw
calls
! Detect
GPU
pipeline
stage
bojlenecks
! Inves:gate
performance
issues
at
the
counter
level
6
|
Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2|
NOVEMBER
21,
2013
|
7. INTRODUCTION
TO
GPU
PERFSTUDIO
2
SHADER
DEBUGGER
&
EDITOR
! Edit
the
live
HLSL
and
GLSL
code
inside
your
app
while
running
in
the
tool
! Debug
the
live
HLSL
and
Assembly
code
inside
your
app
while
running
in
the
tool
‒ Step
through
shader
code
‒ Inspect
all
register
values
‒ Insert
and
run-‐to
break
points
! Compare
before
and
aPer
edit
performance
using
the
Profiler
7
|
Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2|
NOVEMBER
21,
2013
|
8. INTRODUCTION
TO
GPU
PERFSTUDIO
2
API
TRACE
! Inspect
all
API
calls
(with
arguments)
! CPU
:meline
informa:on
for
each
API
call
! Visualize
mul:-‐threaded
API
usage
! Supports
DirectX®
11
Command
Lists
and
deferred
contexts
8
|
Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2|
NOVEMBER
21,
2013
|
9. INTRODUCTION
TO
GPU
PERFSTUDIO
2
! Remote
and
local
debug
sessions
Server
Server
! Remote
usage
allows
the
game
to
be
run
full
screen.
Higher
profiling
accuracy,
useful
during
final
op:miza:on.
Client
Client
Remote
debugging
! Local
usage
on
a
single
machine
(preferred
by
developers).
More
suited
for
use
during
development.
9
|
Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2|
NOVEMBER
21,
2013
|
Server
&
Client
10. INTRODUCTION
TO
GPU
PERFSTUDIO
2
WHO
USES
IT?
! Widely
used
by
internal
groups
in
AMD
‒ AMD
Developer
Technology
Engineers:
Op:mize
&
debug
game
:tles
in
conjunc:on
with
developers
‒ AMD
Driver
Performance
Team:
Improve
GPU
benchmarks
and
:tles
at
the
driver
level
‒ AMD
Driver
Team:
Inspect
apps
that
cause
driver
problems
‒ AMD
Game
Compute
Team:
Debug
and
op:mize
game
technologies
for
new
GPU
hardware
-‐
AMD
Mecha
Demo,
Ladybug,
Leo
demo
! External
users
‒ Graphics
developers:
Used
in
the
development
of
DirectX®11
and
OpenGL
graphics
applica:ons
10
|
Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2|
NOVEMBER
21,
2013
|
11. USING
GPU
PERFSTUDIO
2
HOW
IS
IT
USED
IN
PRACTICE?
! There
is
no
one-‐fits-‐all
solu:on
for
tool
usage
in
game
development
! Developers
use
tools
from
mul:ple
vendors
‒ Typically
to
target
specific
GPU
hardware
! Developers
use
internally
developed
tools
in
conjunc:on
with
vendor
tools
‒ GPUPerfAPI
is
AMD’s
library
for
accessing
GPU
performance
counters
on
Radeon
graphics
cards.
! Tool
requirements
vary
during
the
development
life
cycle
of
a
game
‒ Frame
structure
followed
by
performance
! Driver,
graphics
API,
and
hardware
changes
make
tools
development
a
constantly
moving
target
! Two
relevant
quotes
from
GDC
2013
‒ GPU
tools
are
“Special
Flowers”
–
referring
to
the
round
robin
nature
of
trying
out
each
vendor’s
tools
on
the
latest
build
to
see
which
will
work.
‒ “Used
effec:vely
tools
can
lead
to
a
pot
of
gold”
–
commen:ng
on
developers
tendency
to
try
to
roll
their
own
rather
than
try
an
off-‐the-‐shelf
solu:on.
11
|
Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2|
NOVEMBER
21,
2013
|
12. USING
GPU
PERFSTUDIO
2
HOW
IS
IT
USED
IN
PRACTICE?
! Typical
uses
of
GPU
PerfStudio2
‒ TransiMoning
from
a
forward
to
deferred
render
‒ Ability
to
inspect
render
targets
in
detail
‒ Debug
and
profile
the
resolve
shader
‒ LocaMng
and
debugging
a
shader
within
a
game
‒ Complex
shader
compila:on
path
make
it
hard
to
locate
draw
calls
that
use
specific
shader
code
‒ DetecMng
expensive
draw
calls
‒ Quick
detec:on
‒ Understand
the
issue
at
the
pipeline
stage
and
GPU
counter
level
‒ Profiling
of
individual
assets
within
a
game
‒ Important
for
budge:ng
‒ MulM-‐threading
a
single
context
‒ Console
games
typically
use
many
threads
‒ Thread
count
is
usually
reflected
in
the
PC
version
‒ PorMng
an
OpenGL
game
engine
from
Windows®
to
Linux®
12
|
Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2|
NOVEMBER
21,
2013
|
13. USING
GPU
PERFSTUDIO
2
HOW
IS
IT
USED
IN
PRACTICE?
! Take
a
look
at
three
usage
scenarios
from
developers
‒ Assassins
Creed
3
–
Understanding
the
frame
‒ Far
Cry
3
–
Automated
data
mining
of
game
content
‒ Steam
Linux®
–
Por:ng
Source2
to
OpenGL
13
|
Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2|
NOVEMBER
21,
2013
|
15. USING
GPU
PERFSTUDIO
2
ASSASSINS
CREED
III
! Developed
using
the
Anvil
Next
rendering
engine
•
•
•
•
Based
on
the
previous
Anvil
and
Scimitar
Engines
Same
engine
lineage
as
previous
AC
games,
star:ng
with
AC1
First
AC
game
to
use
deferred
rendering
First
DirectX®11
Scimitar
:tle
15
|
Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2|
NOVEMBER
21,
2013
|
16. USING
GPU
PERFSTUDIO
2
ASSASSINS
CREED
III
! Anvil
Next
-‐
New
rendering
effects
! Weather
•
Volumetric
mist
•
Falling
snow/rain
•
Surface
wetness/snow
•
Deformable
snow
! Bulk
crowds
•
Thousands
of
NPCs
for
large-‐scale
bajles
! LighMng
improvements
•
New
sta:c
ligh:ng
techinique
•
New
large-‐scale
sta:c
AO
! Ocean
simulaMon
! DX11
•
New
hexagonal
filtering
method
•
New’ish
AO
tech
(combining
MSSAO+low-‐res
HBAO)
16
|
Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2|
NOVEMBER
21,
2013
|
17. USING
GPU
PERFSTUDIO
2
ASSASSINS
CREED
III
! How
UbisoW
used
GPUPerfStudio2
with
Assassins
Creed
III
•
•
•
•
•
•
It
was
used
by
all
5
of
the
graphics
programmers
Quick
startup
of
tool
with
the
app
(fast
edit/test
cycle)
It
was
used
for
cross
plaworm
development
Most
of
the
work
was
done
using
the
Frame
Debugger
‒ To
understanding
the
frame
structure
‒ To
iden:fy
slow
draw
calls
‒ To
iden:fy
and
then
op:mize
shaders
The
profiler
was
used
towards
the
end
of
the
dev
cycle
Stability
‒ “This
is
really
the
most
important
thing
with
this
type
of
tool.
The
reality
is
unfortunately
that
we
oPen
need
to
cycle
PIX/GPA/GPS2/Nsight
to
find
one
that
works
for
our
par:cular
scene.
GPS2
works
the
most
oPen
by
far.”
17
|
Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2|
NOVEMBER
21,
2013
|
18. UNDERSTANDING
THE
FRAME
-‐
DEMONSTRATION
ASSASSINS
CREED
III
AND
GPU
PERFSTUDIO2
18
|
Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2|
NOVEMBER
21,
2013
|
20. GPU
PERFSTUDIO
2
|
Far
Cry3
! Developed
using
the
Dunia
2
engine
•
•
•
•
•
•
The
Dunia
engine
was
originally
used
in
Far
Cry2
Dunia
2
was
switched
to
a
deferred
renderer
in
the
middle
of
Far
Cry3
development
2
out
of
the
10
programmers
used
GPU
PerfStudio2
2
programmers
developed
for
console
Highly
op:mized
for
Xbox
360
and
PS3
(SPU)
Op:mized
later
for
PC
20
|
Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2|
NOVEMBER
21,
2013
|
21. GPU
PERFSTUDIO
2
|
Far
Cry3
! Dunia
2-‐
New
rendering
effects
•
Deferred
rendering
with
mul:-‐
sample
an:-‐aliasing
(MSAA)
‒ Analysis
of
each
scene/level
in
the
game,
selec:vely
enabling
MSAA
on
sec:ons
of
the
scene
(like
trees
and
ligh:ng)
that
would
benefit
from
the
technique.
Avoiding
MSAA
on
sec:ons
that
would
slow
the
game
with
no
visual
improvement.
•
Comprehensive
light-‐culling
system.
‒ This
mechanism
performs
intelligent,
real-‐:me
calcula:on
of
the
ligh:ng
that
would
be
visible
to
the
player,
then
lets
the
GPU
reject
the
material
that
won’t
be
seen.
Not
only
is
the
MSAA
faster
than
it
would
otherwise
be
(when
enabled),
but
general
frame
rates
are
improved
versus
engines
without
this
technology.
21
|
Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2|
NOVEMBER
21,
2013
|
22. GPU
PERFSTUDIO
2
|
Far
Cry3
! Dunia
2-‐
New
rendering
effects
•
•
•
•
Transparency
super-‐sample
an:-‐
aliasing
(SSTr)
Real-‐:me
global
illumina:on
DirectCompute-‐accelerated
ambient
occlusion
Advanced
hair
and
skin
shading
22
|
Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2|
NOVEMBER
21,
2013
|
23. GPU
PERFSTUDIO
2
|
Far
Cry
3
! What
GPUPerfStudio2
was
used
for
on
Far
Cry
3
• Mainly
used
the
Frame
Debugger
to
inves:gate
rendering
bugs
• Issues
when
ac:va:ng
DirectX®11
mul:-‐threaded
rendering
(bad
ordering
of
sync
points)
• Issues
with
using
wrong
render
targets
in
MSAA
‒ For
example
using
MSAA
color
with
non-‐MSAA
depth
in
the
same
draw
call
•
•
•
Stencil
issues
for
skin
and
hair
rendering
Crossfire
related
issues
Locate
where
specific
shaders
were
used
in
the
frame
23
|
Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2|
NOVEMBER
21,
2013
|
24. AUTOMATED
DATA
MINING
OF
GAME
CONTENT
! Understanding
the
client
server
model
•
•
The
client
and
server
exchange
data
through
a
web
server
You
can
see
the
commands
arrive
at
the
server
in
the
console
window
24
|
Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2|
NOVEMBER
21,
2013
|
25. AUTOMATED
DATA
MINING
OF
GAME
CONTENT
! Understanding
the
client
server
model
•
•
You
can
also
view
the
commands
sent
to
the
server
during
your
debug
session
in
the
client
server
log
Open
the
Server
Log
from
the
client
Help
menu
25
|
Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2|
NOVEMBER
21,
2013
|
26. AUTOMATED
DATA
MINING
OF
GAME
CONTENT
! Understanding
the
client
server
model
The
log
displays
the
These
look
like
URL’s
commands
sent
from
the
client
to
the
server.
The
log
will
contain
any
error
messages
generated
by
the
server
26
|
Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2|
NOVEMBER
21,
2013
|
27. AUTOMATED
DATA
MINING
OF
GAME
CONTENT
Use
the
command
URL
in
a
web
browser
to
request
data
from
the
server
We
can
access
state
data
We
can
access
the
shader
code.
In
fact
we
can
access
all
data
necessary
to
reconstruct
the
draw
call.
27
|
Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2|
NOVEMBER
21,
2013
|
FarCry3
running
with
GPU
PerfStudio2
We
can
see
the
data
command
requests
in
the
server
console
window
Ajach
the
GPU
PerfClient,
pause
the
app,
move
to
draw
call
28. AUTOMATED
DATA
MINING
OF
GAME
CONTENT
! GPU
PerfStudio2
is
web
server
that
can
be
scripted
•
•
•
•
It
is
possible
to
use
PerfStudio2
web
requests
in
scripts
to
automate
and
customize
access
to
your
apps
data
As
part
of
the
work
carried
out
on
Far
Cry3
we
needed
to
know
where
specific
sec:ons
of
HLSL
code
were
being
used
in
a
frame.
We
were
able
to
use
a
script
to
retrieve
the
HLSL
code
from
each
draw
call
in
a
frame
an
search
the
code
for
keywords
that
would
iden:fy
the
code.
Lets
look
at
an
example
that
does
something
similar
28
|
Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2|
NOVEMBER
21,
2013
|
29. AUTOMATED
DATA
MINING
OF
GAME
CONTENT
! Here
is
the
Perl
script
we
used
sub get_pixel_shader_code
{
return http_Request($GPS_CodeViewer_URL, $XML_Request);
}
# main loop
for( my $i = 1; $i < $GPS_NumBreakpoints; $i++ )
{
my $retVal = iterate_breakpoint($i+$GPS_BreakpointID);
if( $retVal == 1 )
{
#print "Breakpoint is OKn";
my $psCode = get_pixel_shader_code();
if( $psCode =~ m/(W{1}HashW{1}(w+)W{2}HashW{1})/i )
}
else
{
#print "Hash Not Foundn";
}
}
else
{
#print "Breakpoint FAILED!n";
}
}
print "nFound source code for ", scalar keys %HashOfPixelShaderCRCs, " *unique* pixel shaders used in this frame.n";
29
|
Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2|
NOVEMBER
21,
2013
|
30. AUTOMATED
DATA
MINING
OF
GAME
CONTENT
! How
the
script
works
•
•
•
The
GPU
PerfClient
was
connected
to
the
game,
it
was
paused
and
the
Frame
Debugger
was
opened
.
A
perl
script
was
run
to
send
a
command
that
sets
the
breakpoint
to
the
start
index
Inside
a
loop
‒ The
next
command
retrieved
the
PS
HLSL
code
from
that
draw
call.
‒ The
HLS
code
was
stored
using
its
unique
hash
as
the
key
‒ The
breakpoint
was
advanced
‒ When
finished
with
the
loop
we
can
find
out
how
many
unique
shaders
there
are
30
|
Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2|
NOVEMBER
21,
2013
|
31. AUTOMATED
DATA
MINING
OF
GAME
CONTENT
! AWer
a
script
has
run
on
FarCry3
The
render
target
overlay
shows
its
contents
at
draw
call
10
–
the
breakpoint
the
script
finished
at
The
server
log
shows
the
breakpoint
and
code
viewer
commands
The
script
finds
2
unique
shaders
in
the
first
10
draw
calls
31
|
Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2|
NOVEMBER
21,
2013
|
32. AUTOMATED
DATA
MINING
OF
GAME
CONTENT-‐
DEMONSTRATION
USING
GPU
PERFSTUDIO2
WITH
FAR
CRY
3
32
|
Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2|
NOVEMBER
21,
2013
|
34. STEAM
LINUX®-‐
PORTING
SOURCE2
TO
OPENGL
! Overview
of
the
Windows®
to
Linux®
conversion
process
•
•
The
process
of
por:ng
Steam
to
Linux®
started
by
por:ng
the
Source
Engine
to
OpenGL
on
Windows®
Valve
used
SDL
to
abstract
away
windowing/input
APIs.
Resulted
in
one
build
that
could
be
compiled
to
Windows®32/DirectX®9/OpenGL,
Linux®/OpenGL,
OSX
Allowed
them
to
use
several
key
Windows®
based
OpenGL
tools,
such
as
GPS2
and
CodeXL
•
•
The
vast
majority
of
OpenGL
or
rendering
related
bugs
found
on
Linux®
could
be
reproduced
on
Windows®
So,
the
majority
of
OpenGL
and
rendering
related
debugging
was
be
done
under
Windows®
34
|
Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2|
NOVEMBER
21,
2013
|
35. PORTING
STEAM
TO
LINUX®
USING
AMD’S
GPU
PERFSTUDIO
2
! Why
use
GPU
PerfStudio2?
•
•
•
Valve
had
numerous
glitches
and
bugs
in
L4D2
and
TF2
Windows®/Linux®
OpenGL
mode
Many
were
new
bugs
introduced
by
op:mizing
and
fixing
the
renderer
and
the
D3D-‐>GL
transla:on
backend
GPU
PerfStudio2
was
the
only
available
OpenGL
debugger
product
Valve
could
find
with
a
usable
frame
•
debugger
that
didn't
fall
over
when
faced
with
a
“large
GL
applicaMon”
It
was
not
only
a
useful
debugger
and
profiler,
it
was
also
a
great
way
to
help
learn
OpenGL
35
|
Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2|
NOVEMBER
21,
2013
|
36. PORTING
STEAM
TO
LINUX®
USING
AMD’S
GPU
PERFSTUDIO
2
! Started
with
PerfStudio2's
"API
Trace"
window
•
•
•
The
"Interface"
column
is
especially
useful,
as
it
shows
the
OpenGL
version
(or
the
OpenGL
extension)
used
by
each
API
call.
This
data
is
par:cularly
helpful
while
learning
OpenGL.
The
API
Trace
view
is
synchronized
with
the
Frame
Debugger
-‐
i.e.
select
a
draw
call
in
the
trace
view,
then
switch
to
the
frame
debugger
to
focus
on
that
draw
The
trace
can
be
saved
to
.CSV
files.
It's
easy
to
diff
mul:ple
traces
using
Beyond
Compare,
which
was
used
to
find
several
difficult
GL
bugs.
(We
saved
a
trace,
exited
and
tweaked
the
app,
then
relaunched
the
game
and
placed
the
camera
in
the
same
exact
loca:on/orienta:on
as
the
first
trace
and
saved
another
trace.)
36
|
Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2|
NOVEMBER
21,
2013
|
37. PORTING
STEAM
TO
LINUX®
USING
AMD’S
GPU
PERFSTUDIO
2
! The
Frame
Debugger
“saved
our
bacon”
countless
Mmes
while
porMng
TF2/L4D2
to
GL
You
can
hand-‐edit
GLSL
shaders
by
clicking
the
"Enable
shader
edi:ng"
bujon,
then
tweaking
the
named
PIX
begin/end
Supports
shader
and
hi‰ng
compile.
This
is
in
GL
mode.
This
is
cri:cal
markers
a
very
powerful
way
of
qThe
Frame
Buffer
visualiza:on
through
all
GL
uickly
You
can
scrub
for
quickly
zeroing
in
on
specific
conduc:ng
experiments
while
of
whe
frame
dor
f
urther
bojom
:meline,
window
is
t here
we
f o
a liot
of
draws/blits
n
the
parts
Most
of
our
debugging
is
dhe
how
the
frame
is
debugging.
debugging.
In
pand
visualize
by
ar:cular,
t one
analysis.
scrubbing
through
draw/blit
"descrip:on"
composed
ivery
app
window.
This
tab
can
be
n
the
events
and
examining
the
state
of
for
the
overall
For
example,
we
used
this
to
useful.
you
get
a
feel
helps
render
targets/textures.
debug
par:cularly
tricky
GL
flow
of
the
frame's
GL
calls.
texture
completeness
issues,
by
hacking
a
shader
to
only
fetch
from
a
single
texture
(some:mes
with
explicit
LOD).
37
|
Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2|
NOVEMBER
21,
2013
|
38. PORTING
STEAM
TO
LINUX®
USING
AMD’S
GPU
PERFSTUDIO
2
! The
Frame
Debugger
“saved
our
bacon”
countless
Mmes
while
porMng
TF2/L4D2
to
OpenGL
•
•
PerfStudio2
supports
displaying
both
sampler
objects
and
texture
parameters
(most
other
tools
did
not
support
sampler
objects
at
that
:me)
Valve
also
ran
:tles
in
DirectX®9
mode
and
used
PIX
for
Windows®
to
capture
frames.
In
a
few
cases,
it
was
invaluable
to
be
able
to
capture
a
frame
in
both
PIX
and
GPS2
and
manually
compare
the
states,
framebuffers,
shaders,
etc.
38
|
Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2|
NOVEMBER
21,
2013
|
39. PORTING
STEAM
TO
LINUX®
USING
AMD’S
GPU
PERFSTUDIO
2
! Trouble
shooMng
GPU
PerfStudio2
with
OpenGL
apps
•
If
you
have
problems
capturing
frames
with
PerfStudio
2
in
OpenGL
mode:
‒ First
try
capturing
a
sample
OpenGL
app,
before
trying
to
capture
a
bigger
app
‒ Try
experimen:ng
with
the
Server
Se‰ngs
-‐
try
"Slow
Mo:on"
or
"None“
‒ Try
disabling
mul:threading
in
your
app
•
On
one
new
project,
that
didn't
use
SDL
to
create
the
OpenGL
context,
we
had
some
problems
ge‰ng
GPS2
to
connect:
‒ Try
sta:cally
linking
against
opengl32.lib,
not
dynamically
loading
it
and
calling
GetProcAddress()
‒ Check
how
you're
calling
SwapBuffers:
try
SwapBuffers()
instead
of
calling
wglSwapBuffers()
‒ Double
and
triple
check
how
you're
crea:ng
the
OpenGL
context,
what
version
it
is,
its
ajributes,
etc.
Proper
OpenGL
context
crea:on
is
surprisingly
tricky.
•
AMD's
CodeXL
can
help
you
debug
context
crea:on
code
-‐
it
checks
for
a
bunch
of
common
OpenGL
context
crea:on
errors
39
|
Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2|
NOVEMBER
21,
2013
|
40. GPU
PERFSTUDIO
2
-‐
DEMONSTRATION
LEFT
4
DEAD
2
40
|
Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2|
NOVEMBER
21,
2013
|
42. OPTIMIZING
GAME
DEVELOPMENT
USING
AMD'S
GPU
PERFSTUDIO
2
LATEST
VERSION
! What’s
new
in
GPS2.14?
‒ Hardware
counter
support
for
AMD
“Hawaii”
(R9
290
series)
GPU’s
‒ Improved
support
for
mul:threaded
applica:ons
‒ Pipeline
specific
counters
for
OpenGL
‒ Support
for
OpenGL
Compute
! Currently
in
development
‒ Support
for
Linux®/OpenGL
applica:ons
‒ Support
for
Mantle
applica:ons
‒ There’s
op:miza:on,
and
then
there’s
Mantle.
Games
enabled
with
Mantle
speak
the
language
of
GCN
architecture
to
unlock
revolu:onary
performance
and
image
quality.
42
|
Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2|
NOVEMBER
21,
2013
|
43. OPTIMIZING
GAME
DEVELOPMENT
USING
AMD'S
GPU
PERFSTUDIO
2
LINUX®
/OPENGL
SUPPORT
! Currently
in
development
! Targe:ng
Ubuntu
12.04
LTS
(64
bit)
! GPS2
Server
and
game
running
on
Linux®
! GPS2
Client
running
on
Windows®
! Release
2014
Game
sourced
from:
hjp://supertuxkart.sourceforge.net
43
|
Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2|
NOVEMBER
21,
2013
|
44. OPTIMIZING
GAME
DEVELOPMENT
USING
AMD'S
GPU
PERFSTUDIO
2
MANTLE
! Mantle
is
a
new
graphics
API
from
AMD
! Designed
for
GPU
efficiency
! Unlocks
new
performance
features
of
AMD’s
GCN
GPU’s
! “Small
batch”
problem
is
history
! Using
Mantle,
Oxide’s
StarSwarm
shows
higher
numbers
of
game
objects
at
a
sustainable
frame
rate
than
current
graphics
APIs
44
|
Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2|
NOVEMBER
21,
2013
|
45. OPTIMIZING
GAME
DEVELOPMENT
USING
AMD'S
GPU
PERFSTUDIO
2
MANTLE
TOOLS
! Currently
in
development
! APITrace
of
Oxide’s
StarSwarm
! Much
more
in
2014
45
|
Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2|
NOVEMBER
21,
2013
|
46. OPTIMIZING
GAME
DEVELOPMENT
USING
AMD'S
GPU
PERFSTUDIO
2
SUMMARY
! GPU
PerfStudio
2
is
AMD’s
performance
and
debugging
tool
for
graphics
applica:ons
! A
lightweight,
no
installer,
no
change
to
your
game,
drag
and
drop,
suite
of
GPU
tools
! Used
in-‐house
by
AMD
and
externally
by
game
developers
! Used
to
develop
DirectX11®
and
OpenGL
4.2
graphics
applica:ons
! Support
for
Linux®/OpenGL
and
Mantle
in
2014
! Download
from
hjp://developer.amd.com
46
|
Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2|
NOVEMBER
21,
2013
|
47. Ques:ons
Op:mizing
Game
Development
using
AMD's
GPU
PerfStudio
2
Download
from
hjp://developer.amd.com
Email:
gordon.selley@amd.com