42 Commits

Author SHA1 Message Date
Michael Vance 973ee146a8 Support for a new 'Statistics' pane.
Notes
======
- Create a (hopefully) cross-backend performance statistics abstraction as part of FetchFrameInfo. This currently collects statistics about constant buffer binds, sampler binds, resource binds, client and server style resource updates (e.g. Map and UpdateSubresource), index & vertex buffer binds, and draws and dispatches. In my captures this covers approximately half of all API traffic. The rest is often shader sets, and then usual RS, OM, etc., that aren't currently tracked. During READING state parsing on the wrapped device context, record statistics about the calls and store them into the current frame info. We inspect objects occasionally to get things like their type for recording. It may be useful to expand this in the future to check bind types, etc. On the GL/Vulkan backends the stats data is never initialized and we display the same statistics data as before.
- Add a new statistics pane in the UI. A variety of shim arbitration/marshalling is provided to get the statistics data across the managed/native boundary. Removed the old statistics menu item. Currently the statistics pane is just a text log of various gathered data, with ASCII art (woo!) histograms. However in the future we would like to have image based historgrams as well as support for gathering statistics on a mask of stages, etc.
- Remove 'diagnostic' events (e.g. push/pop/marker) from the API call count as it distorts the API:draw call ratio.
- Add _First and _Count to ShaderResourceType and ShaderStageType for weak enumeration (weak due to int cast requirement).
- Provide utility functions Log2Floor for 32 and 64 bit types. These require OS specific clz, which are provided for Windows/VS and Linux/gcc/clang.

TODO
======
- UI toolkit based historgram, ability to set stages enabled for statistics, etc.
- Revisit necessity of gathering statistics across frames--apparently there is no multi-frame capture in a single log anymore?
- Revisit min/max/etc. gathering on the data--is there some way to improve this to not be so mechanical? Perhaps with field enumeration? However if moving to C++/Qt in future, possibly not a good time investment.
2016-04-11 21:23:05 -04:00
baldurk bb408e7de4 Update enums on C# to match C++ enums 2016-02-21 15:35:47 +01:00
baldurk 2e0ffa7813 Batch update copyright years everywhere 2016-02-07 18:50:45 +01:00
baldurk 2107b2fe55 Handle push/pop markers when inserting via queuesubmit
* This allows push/pop regions to cross command buffers, as long as they
  are submitted in the right order etc.
2016-02-07 18:50:14 +01:00
baldurk 5b2806f573 Add check for vulkan 2016-02-07 18:50:13 +01:00
baldurk c8436d3646 Implement resource usage tracking 2016-02-07 18:50:05 +01:00
baldurk 459196fd21 Shift responsibility for 'whole pass' type processing to replay drivers
* Note, currently broken as the drivers don't have previous/next EIDs
  set up on their drawcalls
2016-02-07 18:49:36 +01:00
baldurk 4b7c33d531 Fixes for vulkan for BGRA changes, add R4G4 special format 2016-02-07 18:49:21 +01:00
baldurk e51cf27321 Get abbreviations from common pipeline state (as they're API specific)
* Also the PipelineStateViewer will set its current 'sticky' API type
  to the common pipeline state, so that when a log isn't loaded we can
  still get API-specific properties that match the last API used.
2016-02-07 18:46:38 +01:00
baldurk 7dd5760420 Try to handle unbound resources a bit better 2016-02-07 18:46:31 +01:00
baldurk edac1f0bfd Pass vulkan pipeline state along to UI 2016-02-07 18:41:29 +01:00
baldurk 8b7a025853 Refactor BGRA formats to not be special (so allow any BGRA format)
* Also add ASTC and D16S8 types while in the neighbourhood
2015-11-29 22:05:26 +01:00
baldurk 57ba6e0806 Add overlays to clear before current draw/pass. Refs #164
* Depth is not cleared, only colour buffers.
* This uses the same definition of pass as the quad overdraw overlay,
  which isn't quite the same as the auto-grouping passes (which allow
  for varying colour binds being grouped together). It only counts up
  to the last draw where the outputs were different.
2015-10-25 15:49:16 +01:00
baldurk c7cfdcc689 Add basic support for displaying/picking S8 textures. Refs #165 2015-10-25 14:09:43 +01:00
baldurk 6a2344d9d8 Show correct inputs/outputs for copy and dispatch calls. Refs #147
* Next step is to display VS and other stage inputs on the input panel.
* Also need to tidy up the fetching of highest mip/array slice etc to
  use the same codepath.
2015-08-23 13:20:23 +02:00
baldurk 296d7e39b1 Handle glTextureBufferRangeEXT not being available
* This way we don't have to require GL_ARB_texture_buffer_range as well
  when technically it should only be needed if the application used it.
2015-07-23 23:06:25 +02:00
baldurk a5cc19ccc6 Implement replay-side resource tracking for OpenGL
* This means that the timeline bar will show use as read/write/clear etc
  and that right clicking on textures in the texture viewer will show
  the events where that texture is used for rendering, for reading, and
  so on.
2015-04-11 11:03:19 +01:00
baldurk 95f4011bcb Add option to favour monospaced font for all data. Refs #118
* The option will enable monospaced fonts for all data displays, like
  the list of events, API calls, etc as well as pipeline displays, entry
  of filename/directory in the capture window and many other places.
  Pure UI labelling etc mostly still stays as a serif font.
* A few sizes of controls were tweaked (like headers in the pipeline
  windows) so that they didn't just barely overflow with the larger
  font.
* While looking at this, it became obvious that buffer viewers and
  constant bufferviewers should always display in monospaced regardless,
  so that has been changed.
2015-04-09 21:49:03 +01:00
baldurk 5bcbb47203 List GenerateMips, Copy and Resolve calls in event browser with draws
* What gets listed as a 'drawcall' is a bit fuzzy - previously it was
  drawing calls, dispatches and clears, but you could make a good
  argument for these to be included as well. As a semi-experiment, these
  calls are now included and will be listed in the event browser.
* Other calls can change resources like direct buffer or texture uploads
  and Map() type calls, but these remain as API calls listed between
  draw calls. Again this is mostly an arbitrary distinction.
* D3D11 logs are backwards compatible, GL logs are not (although it'd
  be relatively simple, GL logs will likely break backwards compat soon
  anyway, so not worth supporting it now only to break it soon).
2015-03-11 13:13:41 +00:00
baldurk 8ccf071865 Implement GetTextureData for GL - underlying code behind texture saving
* This should support all forms of textures off the bat, multisampled
  textures, 3D textures, arrays, compressed and uncompressed, etc.
2015-02-09 17:29:13 +00:00
baldurk b7f9d5b6d0 Generalise drawcall timing to get arbitrary sets of counter values
* Client code can enumerate the IDs of counters that are supported -
  some of these will be general, some will be IHV specific. It can also
  request descriptions of the counters to determine the type of data or
  units. This can be used to 'discover' counters that aren't hard
  coded into renderdoc. I'll want to at least reserve IHV ranges so that
  counter IDs are globally unique, and ideally IHV counters will also be
  predeclared where possible.
* Also the refactor removes some ugly rdctype::array use outside of the
  replay layer and replaces it just with std::vector, which is a nice
  bonus.
2015-01-28 21:15:19 +00:00
baldurk 96b8818120 Give constant buffer previewer proper naming on OpenGL logs 2015-01-20 14:57:20 +00:00
baldurk 24fd91a7e0 Display texture swizzling and depth/stencil read mode on textures 2015-01-17 15:53:09 +00:00
baldurk 51a0ee1dc1 Fix typo! 2015-01-16 22:54:03 +00:00
baldurk 04f1d4a378 Centralise debug message processing, and allow adding custom warnings
* This will allow the adding of things like 'redundant api call' for calls
  that have no effect, as well as potential problems like drawing with an
  empty viewport, or similar things that are common problems. Reading out-
  of-bounds on buffers etc is a good example of 'defined' behaviour that
  is probably not desired.
* These heuristics could also identify potential performance problems.
* It also supports adding debug messages after log-load time, so you could
  do an additional extra-strength pass, or do a detailed check of one
  draw call (e.g. a broken draw, to try and figure out the problem). If
  there are any unread debug messages, the status bar will flash and the
  debug messages window will show a count as (N).
2015-01-11 00:20:50 +00:00
baldurk 1c9269fc8d Add simple OpenEXR save/load support using tinyexr
* Thanks to https://github.com/syoyo/tinyexr for the load and save code!
2015-01-06 17:43:19 +00:00
baldurk e1d01970c6 Add fetching of Indirect params, and stepping through MultiDraw calls
* This means glMultiDrawIndirect is fetched, decomposed into child draw
  calls and you can step through them individually
2014-12-14 12:17:38 +00:00
baldurk c51fade47a Add support for texture rectangles. See gl-330-texture-rect 2014-12-01 22:55:35 +00:00
baldurk b6ba100ed1 Add a couple more buffer creation flags 2014-12-01 12:41:00 +00:00
baldurk ea8203e160 Add backface culling overlay 2014-11-27 23:36:06 +00:00
baldurk 551b0372c8 Allow fully flexible display of position&other component on meshes
* You can choose which component will be used as 'position' when rendering
  vertex inputs. Helpful if a position component isn't auto-detected, or
  if you want to render UV co-ordinates onto the screen.
* Instead of fixed TEXCOORD0/Color options for solid shading onto the mesh
  you can choose a secondary column yourself.
* Also the solid shading options are available on vertex output meshes as
  well as inputs.
2014-11-13 18:37:58 +00:00
baldurk 6308d78cd4 Implement debug device/debug api message tracking for GL 2014-11-02 10:52:24 +00:00
valeriog d18557239f Added visualization of rasterizer state for OpenGL. 2014-10-31 19:40:16 +01:00
baldurk deffa8c68e Add displayable string representation for primitive topology 2014-10-07 23:20:19 +01:00
baldurk a0d6d771f2 Pass through child processes via remote access to UI. Refs #78 2014-09-28 13:58:18 +01:00
baldurk 326ca2ebe8 Move SaveTexture logic to replay layer
* Expand the abilities of the GetTextureData in replay drivers
  to be able to resolve samples and render down to RGBA8 unorm
  for file export to other programs.
* Greatly improve the ability to save textures - in theory any
  texture format/type/dimension/etc should now be mappable in
  sensible & useful ways to output formats.
2014-09-16 01:25:13 +01:00
baldurk 72e2ed1513 Remove UNorm_SRGB component type as it's redundant 2014-09-14 20:29:25 +01:00
baldurk 55e0178ec9 Add quad overdraw mode. Thanks Stephen Hill (@self_shadow)!
* http://blog.selfshadow.com/2012/11/12/counting-quads/
* Quad Overdraw based on ScenePS4 from the revised implementation. The
  colours are new, up to 20 levels. Picking pixels shows the overdraw level
* Available per-pass and per-drawcall, a pass defined the same way as in
  the mesh view, drawcalls since last clear or RT change.
* List of events now passed through to RenderOverlay the same as RenderMesh
2014-08-17 15:28:51 +01:00
baldurk 49ab71181c Add some system attributes from GL 2014-08-12 16:47:00 +01:00
baldurk 25c4771589 Add drawcall flags for clearcolour/cleardepth 2014-07-13 18:55:04 +01:00
baldurk 9b8adebb91 Bind resources while in READING, as we're replaying edit chunks
* While replaying the initial chunks, we're doing edit type operations but
  we haven't serialised out the binding operations in between, so in this
  state we do the bind-to-edit binds ourselves.
2014-06-01 11:54:54 +01:00
baldurk c38affcded Initial commit of existing code.
* All renderdoc code up to this point was written by me, history is available by request
2014-05-02 08:33:01 +01:00