worrying and love the debugger renderdoc or: how i learned to … · 2018. 6. 8. · d3d11...
TRANSCRIPT
RenderDoc or: How I Learned to Stop Worrying and Love the Debugger
Baldur Karlsson
My background● Graphics Programmer at Crytek
● Joined in late 2010
● Shipped Crysis 2 in early 2011
● Worked on both PC and Console versions
My background● Over 2011 worked on Crysis console port
● Exclusively working with console graphics tools
● Joined Crysis 3 at the end of 2011
● PC graphics tools compared very poorly
Crysis 3 - © Crytek/EA 2013
● PC graphics bugs a particular pain point
● Where possible tested on consoles
● Used console tools in preference
● Often on PC reduced to ‘printf’ debugging
PC graphics tools
D3D11 Debuggers (2012)
● DIY graphics debugger hobby project
● In essence what does a graphics debugger do?
● At its core, inspect intermediate values
● Requires concrete & reproducible frame
A better way?
“It can’t be that hard.”
- Some sucker, Summer 2012
Naïve plan● Intercept & record all graphics API calls
● Replay all calls up to point then stop
● Do any extra display/inspection/analysis then
● API guarantees identical results given identical
inputs & commands*
* Not really, but mostly. Let’s pretend.
“I have not failed. I've just found 10000 ways that won't work.”
- Thomas Edison
Naïve plan● Essentially describes how RenderDoc works
● Slightly simplified, but not inaccurate
● Devil’s in the details
● First commit: 27th June 2012
Text log - 1 week later
ID3D11Device::CreateBuffer (6){ Descriptor = D3D11_BUFFER_DESC (0) { ByteWidth: 0x3960 Usage: D3D11_USAGE_DYNAMIC BindFlags: 0x1 CPUAccessFlags: 0x10000 MiscFlags: 0x0 StructureByteStride: 0xCCCCCCCC } // Descriptor = D3D11_BUFFER_DESC HasInitialData: False MemPitch: 0x0 MemSlicePitch: 0x0 pBuffer: 0x00AD4B4C} // ID3D11Device::CreateBuffer
UI Visualiser - Several weeks in
UI Visualiser - Several weeks in
Texture raw pointer value
UI Visualiser - Several weeks in
Drawcall index
Initial Scope● Low expectations at the time
● If possible the tool will scratch my own itch
● Maybe others in the office will try it sometimes
● That’s about it
Further iteration
● Without grand plans I could iterate simply
● Easy little things to add e.g. min/max range
● Small scope - just make the tool I want
● Keep motivated by working on fun things
Simple steps
Even more iteration
Even more iteration
Even more iteration
● alpha1 build tagged 27th May 2013
● Able to capture CryEngine (ish)
● Too late for Crysis 3 :(
● D3D11 active in later projects
alpha1
The saviour has arrived!● Finally, a reliable tool on PC!
The saviour has ... not quite arrived.● Crashes every 5 minutes
● Corrupted replay output
● Lacking features
● Bottom line: Not production ready
Home-grown = Home-fixed● With source and understanding, bugs quickly
fixed
● Turnaround time in minutes or days, not months
● Direct response to feature requests
● Highly tailored experience
Public Release● Very promising progression
● Would be good to share with the world
● Nothing to lose by letting others try
● Goal: September 2013
Public Release● Build ready by September 2013
● Internal delays
● Steam Dev Days Feb 2014 - VOGL released
● Final release shortly after - February 2014, source
in March 2014
Public Release - v0.18
Public Release - v0.18● alpha1 .. alpha12 internal builds
● v0.13 . .v0.17 private builds
● v0.18 first public build
● Windows-only, DX11 only
Continuing the project● Left Crytek in late 2014
● Spare-time project continued
● Continual improvements, features, additions
● Worked on what was most interesting/useful
OpenGL support● v0.22 - 27th Feb 2015
● Support for ‘modern’ Core profile GL: 3.2 - 4.5
● Windows-only still
● Headless linux support
Vulkan Support● Approached by LunarG at SIGGRAPH 2015
● Discussed adding Vulkan support for
simultaneous release with 1.0 spec
● With support from Unity, dedicated time to
implementing
● Released with Vulkan 1.0 - v0.27 16th Feb 2016
Linux Support● Linux support in earlier versions but only
headless
● UI rewritten from scratch in Qt
● v0.33 - 23rd Feb 2017
● Qt UI finally released cross platform in v1.0 one
year later
The Present● Contracting for Valve full time for past 2 years
● Used by many companies and ~1000 people
● ~7100 commits and ~295k SLOC
● RenderDoc 1.0 supports:
○ Windows, Linux, Android
● Using any of:
○ Vulkan, D3D11, D3D12, OpenGL & GLES
The Future● Continued support and plan for future
● Latest github code supports Vulkan 1.1
● Contributions from companies such as AMD,
Samsung, Google, Imagination
● Many years of work ahead
Questions?