beyond printf debugging graphics through tools presenters dave aronson nvidia – technical...
TRANSCRIPT
![Page 1: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/1.jpg)
![Page 2: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/2.jpg)
Beyond Printf
Debugging Graphics Through Tools
![Page 3: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/3.jpg)
Presenters Dave Aronson
NVIDIA – Technical Evangelist [email protected]
Karen Stevens Microsoft – Software Design Engineer /
Test XNA Professional Game Platform [email protected]
![Page 4: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/4.jpg)
Purpose To determine criteria for graphics tool
selection
To demonstrate how tools can be used to identify and solve top game scenarios
![Page 5: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/5.jpg)
Agenda Tool Selection Scenarios Live Demos Q&A References
![Page 6: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/6.jpg)
Preliminary Criteria PointsWhen selecting a tool, consider: Budget General machine requirements Hardware manufacturers Additional required software Code modification requirements Product support Features and general areas of
interest
![Page 7: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/7.jpg)
Popular Tool Areas of Interest Game Assets
Textures, Shaders, Vertex Buffers, etc API Usage
DirectX / OpenGL calls, state, debug spew
Driver Driver versions, driver timing
Hardware Timing, hardware usage
![Page 8: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/8.jpg)
Tools Shown Today AMD
GPU PerfStudio Microsoft
PIX for Windows NVIDIA
PerfHUD FXComposer
![Page 9: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/9.jpg)
Tools Shown Today AMD
Microsoft
NVIDIA
![Page 10: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/10.jpg)
Tool Categorization Game Asset
PIX for Windows, GPU PerfStudio, FXComposer, PerfHUD
API PIX for Windows, PerfHUD, GPU
PerfStudio Driver
PerfHUD, GPU PerfStudio Hardware
PerfHUD, GPU PerfStudio
![Page 11: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/11.jpg)
ExampleCriteria: Application uses DirectX 9 / HLSL NVIDIA GeForce 7800 card is present Do not want to change code to use tool Preference towards free tools
Possible options from previous list: FX Composer PIX for Windows
![Page 12: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/12.jpg)
How to Choose Determine analysis levels of interest
One strategy is to start at the game asset level and work down the list
Determine how tool fits criteria Prioritize your requirements
Experiment Most tools are free or have free trial
periods, try a variety of scenarios
![Page 13: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/13.jpg)
Scenarios Glitches
Incorrect behavior
Bottlenecks Poor performance
![Page 14: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/14.jpg)
GlitchesThe game is not behaving as expected: Game Crash Blank Screen Missing Objects Flickering
![Page 15: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/15.jpg)
Game Crash
![Page 16: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/16.jpg)
Game CrashScenario: Game crashes when moving from
windowed to full screen Only occurs on specific video cards The game does not have a debug
build due to performance/game play reasons
![Page 17: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/17.jpg)
Game Crash Select settings to handle crash
analysis
![Page 18: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/18.jpg)
Game Crash Setup diagnostic logging
![Page 19: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/19.jpg)
Game Crash
![Page 20: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/20.jpg)
Game CrashAnalysis: Error: Direct3D9: (ERROR) :All user
created D3DPOOL_DEFAULT surfaces must be freed before ResetEx can succeed. ResetEx Fails. An unhandled exception occurred.
![Page 21: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/21.jpg)
Game Crash Open run file for analysis
![Page 22: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/22.jpg)
Game Crash Examine objects left after last valid
call
![Page 23: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/23.jpg)
Game Crash Located rouge object creation point
![Page 24: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/24.jpg)
Game Crash Trace calls for objects requiring
release
![Page 25: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/25.jpg)
Game CrashConclusion: Some D3DPOOL_DEFAULT textures were
not released before ResetEx occurred Tools can examine remaining
objects/textures to help ID items that require rework
Remaining objects are easily cleaned up once identified
Allows debugging of both retail and debug builds (assuming no copy write protection)
![Page 26: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/26.jpg)
Blank Screen
![Page 27: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/27.jpg)
Blank ScreenScenario: Many machines render a black screen The program works fine on some
machines Video card is the same on all
machines Video driver is the same on all
machines
![Page 28: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/28.jpg)
Blank Screen Overriding states can rule out issues
early
![Page 29: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/29.jpg)
Blank Screen Overriding texture renders scene
viewable
![Page 30: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/30.jpg)
Blank Screen Checking for sampler issues
Samplers exist, values look ok
![Page 31: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/31.jpg)
Blank Screen Check texture sampler 0 - OK
![Page 32: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/32.jpg)
Blank Screen Sampler texture 1 should not be
black
![Page 33: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/33.jpg)
Blank Screen Render frame and select inaccurate
pixel
![Page 34: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/34.jpg)
Blank Screen Pixel history shows all calls output
black
![Page 35: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/35.jpg)
Blank Screen Shader debugging proves black
texture obliterates computed color
![Page 36: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/36.jpg)
Blank ScreenAnalysis: Incorrect texture is used The texture is involved in all lighting
operations, therefore everything is black
Black is a common fallback for textures which were unable to be loaded at runtime
![Page 37: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/37.jpg)
Blank ScreenConclusion: The texture failed to load Texture loading is based on a file path Machines with an incorrect path
didn’t load the texture Correcting path in setup restored
lighting to all machines
![Page 38: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/38.jpg)
Missing Objects
![Page 39: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/39.jpg)
Missing ObjectsScenario: Code traces prove all draw calls are
executed A few of the objects drawn are not
displaying on the screen
![Page 40: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/40.jpg)
Missing Objects Rendered scene has missing objects
![Page 41: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/41.jpg)
Missing Objects Check wireframe geometry of scene
![Page 42: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/42.jpg)
Missing Objects Suspicious artifacts present
![Page 43: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/43.jpg)
Missing Objects Incorrect vertex shader input
![Page 44: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/44.jpg)
Missing Objects Yields unexpected output
![Page 45: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/45.jpg)
Missing Objects Incorrect input & fogged out
![Page 46: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/46.jpg)
Missing Objects Defect demonstration, modifying
application: no fog, no cull, zooming out
![Page 47: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/47.jpg)
Missing ObjectsConclusion: Incorrect values were sent to vertex
shaders in both cases Culling reduced odds of detecting the
scene was inside the rook, fogging hid few remaining visible faces
![Page 48: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/48.jpg)
Flickering
![Page 49: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/49.jpg)
FlickeringScenario: Texture shifts between two images
every time mouse is moved or scene position changes
There is only one known mesh object used for the chess board
![Page 50: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/50.jpg)
Flickering Examine wireframe for obvious z-
fighting
![Page 51: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/51.jpg)
Flickering Examine mesh view for hidden
artifacts
![Page 52: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/52.jpg)
Flickering Hidden mesh subset uncovered
![Page 53: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/53.jpg)
FlickeringConclusion: The checkerboard mesh had 2
subsets 1 subset was coplanar with the board
top Removal of subset fixed
unanticipated z-fighting
![Page 54: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/54.jpg)
Bottleneck AnalysisOverall behavior is correct, but
rendering takes longer than expected:
Culling & Render Order Buffer Sizes Ineffective Code Inefficient Shaders Batch Sizes
![Page 55: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/55.jpg)
Culling & Render Order Look at the overdraw in PerfHUD is it
really solid?
![Page 56: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/56.jpg)
Culling & Render Order Scroll through the draw calls in
PerfHUD to see how the frame is drawn
![Page 57: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/57.jpg)
Culling & Render Order Notice how the draws are just
stacking and nothing is culled Are objects being
renderer multiple times?
![Page 58: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/58.jpg)
Culling & Render Order Check the render states Render state
changes can happen in multiple places
![Page 59: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/59.jpg)
Culling & Render Order You want to draw where the culling
behavior will have the most affect.
![Page 60: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/60.jpg)
Culling & Render Order Remember that transparent objects
must be drawn after opaque objects. They also need to be drawn via the painters algorithm.
![Page 61: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/61.jpg)
Culling & Render OrderGuidelines: Order of culling methods used:
Software (portal/scene) View Frustum Z-test Bounding box – DX10 hw query (did any pixels render or potentially
render?)
![Page 62: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/62.jpg)
Buffer Sizes Performance is slow But everything looks correct Thrashing of system resources
![Page 63: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/63.jpg)
Buffer Sizes There could be lots of swapping
occurring
![Page 64: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/64.jpg)
Buffer Sizes Look at the perfmon counter for
memory page faults is it too high?
![Page 65: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/65.jpg)
Buffer Sizes Is the swapping due to textures or
other buffers Look at the signals in PerfHUD
![Page 66: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/66.jpg)
Buffer Sizes Sort the object table textures in PIX
by size
![Page 67: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/67.jpg)
Buffer Sizes Use mip-mapped
textures Use smaller
textures Use a compact
texture format Don’t become infatuated with new
features E.g. Selectively use aniso on textures
![Page 68: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/68.jpg)
Buffer Sizes Only use data where necessary Pack data buffers with a smaller vdecl Use LOD techniques to reduce the
amount of data needed
Use a paging algorithm for loading data
Reuse Render targets when possible
![Page 69: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/69.jpg)
Inefficient Code Are you sure you are GPU bound? Look at the timing in PIX, PerfHUD
CPU
GPU
![Page 70: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/70.jpg)
Inefficient Code
Total time Input
AssemblyGeometry
Shader
Texture
Raster Ops
Frame Buffer
![Page 71: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/71.jpg)
Inefficient Code Adjust
render size, texture sizes, cull objects
![Page 72: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/72.jpg)
Inefficient Code Still slow? CPU bound Redundant state setting, set texture
calls
![Page 73: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/73.jpg)
Inefficient Shaders Use a tool to analyze your shader
![Page 74: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/74.jpg)
Inefficient Shaders Are you sure it is the shader? Swap the shader for a simpler
shader, did that make a difference? Suboptimal code in inner loop
![Page 75: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/75.jpg)
Batch Sizes Small batch sizes are inefficient and
hard to detect Just because the batches are big
doesn’t mean that it is good either
![Page 76: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/76.jpg)
Summary Tools can be a valuable aid to quickly
determine root causes of a variety of graphics problems
Tools can cover a variety of debugging levels, from high-level API issues to low-level hardware issues
![Page 77: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/77.jpg)
Live Demos Microsoft - PIX for Windows
NVIDIA - PerfHUD
![Page 78: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/78.jpg)
Q&AQuestions, Comments, Concerns?
![Page 79: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/79.jpg)
Resources Tools shown today can be downloaded at:
AMD http://developer.amd.com
Microsoft http://msdn.microsoft.com/directx
NVIDIA http://developer.NVIDIA.com/
The “PIXGameDebugging” application used in this presentation is available as a d3d9 tutorial in the DirectX Software Development Kit, March 2008 release.
![Page 80: Beyond Printf Debugging Graphics Through Tools Presenters Dave Aronson NVIDIA – Technical Evangelist daronson@nvidia.com Karen Stevens Microsoft](https://reader036.vdocument.in/reader036/viewer/2022062315/56649e4c5503460f94b418b5/html5/thumbnails/80.jpg)
ResourcesRecommended Newsgroups, sites, &
Forums http://developer.NVIDIA.com/forums/ http://forums.xna.com/ http://www.gamedev.net/ http://developer.intel.com http://www.opengl.org http://www.gremedy.com/ http://www.acm.org