Commit Graph

2913 Commits

Author SHA1 Message Date
baldurk d62ce264b6 Display custom names for input layouts 2016-04-12 22:46:25 +02:00
Baldur Karlsson 37e6e7a94e Merge pull request #243 from michaelkvance/statistics-squashed
Support for a new 'Statistics' pane.
2016-04-12 11:10:53 +02:00
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 a0f20713f4 Add checks for QueryInterface(IUnknown) to return 'this'. Refs #238 2016-04-11 23:14:24 +02:00
baldurk e24f93970d Add empty marked rows for descriptor sets required by shader but unbound 2016-04-11 20:57:24 +02:00
baldurk edd61c4486 Add warnings and skip when shader needs desc sets/binds that are unbound
* These should be converted into log warnings/errors soon.
2016-04-11 20:57:23 +02:00
baldurk 9536962156 Don't crash if fewer vertex buffers are bound than required by pipeline 2016-04-11 20:57:22 +02:00
baldurk 5fade945cf Set number of samples to 1 at minimum, even if it was set to 0 2016-04-11 20:57:20 +02:00
baldurk f986b715b4 Don't pass invalid array to API if user code didn't bind sets properly 2016-04-11 20:57:19 +02:00
baldurk 84dcd7b9ad Fix off-by-one in assert, allow Switch as first thing in function 2016-04-11 20:57:18 +02:00
baldurk df00fc95e7 Remove assert that's no longer needed 2016-04-11 20:57:16 +02:00
baldurk 83ff0df942 Add custom_assert.h to project 2016-04-09 16:31:05 +02:00
baldurk 6d070fb83e Use sizeof(a) instead of a::PoolType::AllocByteSize
* The coverity compiler doesn't seem to handle the AllocByteSize case
  correctly
2016-04-09 15:45:01 +02:00
baldurk e4dae008e9 fix public/private keywords that snuck into declarations somehow 2016-04-09 15:44:22 +02:00
baldurk 8a2b0bd6e9 Match upstream change to fix this warning, made a few days ago 2016-04-09 13:30:45 +02:00
baldurk 51721f78b8 Fix for VS2015 warnings, mostly variable shadowing 2016-04-09 13:15:01 +02:00
baldurk 836248b629 Fix for compile warning, parameter shadowing class member 2016-04-09 13:01:09 +02:00
baldurk dacd633fac Remove true from 'infinite' for loops, to fix warning C4127 const expr 2016-04-09 12:44:28 +02:00
baldurk 7b20c110ac Enable warning level4 with a couple of disabled warnings on all projects
* Unused formal parameter remains disabled, but we also disable a
  warning about being unable to generate an operator=.
* glslang remains compiled on level 3, since most of the new warnings
  aren't easily fixable so would be muted anyway.
2016-04-09 12:43:00 +02:00
baldurk 6550b5eefc Enable warning C4127 - conditional expression is constant 2016-04-09 12:42:59 +02:00
baldurk cda0b4cb5a Enable warning C4189: local variable is initialized but not referenced 2016-04-09 11:24:45 +02:00
baldurk 905e2ce0a2 use new stb_image_write *_to_func instead of custom _to_file functions 2016-04-09 11:05:15 +02:00
baldurk c6d2c631f9 A couple of typecast warning fixes for stb_image.h 2016-04-09 11:04:51 +02:00
baldurk 23439da708 Update stb libraries. stb_image 2.12, image_write 1.02, truetype 1.11 2016-04-09 11:04:28 +02:00
baldurk 24f225899e Don't reset list of fences if there are no live fences 2016-04-08 20:33:16 +02:00
baldurk 40b9e6d80b Don't init device table if the createdevice call failed 2016-04-08 20:33:06 +02:00
baldurk a2244f38d2 Fix invalid erase using wrong sizeof() that crashes 32bit. Refs #239 2016-04-08 19:58:06 +02:00
baldurk 401c6949e0 Fix some issues with HLSL constant buffer padding requirements 2016-04-08 19:58:05 +02:00
baldurk 6a8b5b4212 Default to counter of 0 if UAV initial data isn't available 2016-04-08 19:58:04 +02:00
Baldur Karlsson 96c081d758 Merge pull request #240 from ttyio/master
clean up unnecessary code
2016-04-08 12:29:09 +02:00
ttyio 79e30d6a03 clean up unnecessary code 2016-04-08 17:54:18 +08:00
baldurk 1ed69916c9 Use the new tinyexr API for memory load/save instead of manual additions 2016-04-07 00:55:30 +02:00
baldurk 432423d84a Update to the latest tinyexr library
* Manual warning fix for VS2015U2 applied. Refs #233
2016-04-07 00:54:57 +02:00
baldurk 96aa458dd1 Add an abort button for interrupting python scripts during execution 2016-04-06 22:54:16 +02:00
baldurk 840338140d Rewrap enumerated physical devices every time. Refs #234 2016-04-06 20:18:55 +02:00
baldurk ed400cbed0 Iterate over consistent queue count, not number of families. Refs #236 2016-04-05 20:36:33 +02:00
baldurk 215d0c704c Check for EXT_depth_bounds_test before fetching/applying state 2016-04-02 18:21:33 +02:00
baldurk caf2e2c20d Don't pass mipLevel to textureSize() for rectangle textures 2016-04-02 18:21:26 +02:00
baldurk 5888c09ba0 Mute any errors generated by logging from earlier in the function 2016-04-02 16:32:44 +02:00
baldurk a3325fbcff Fix scarily broken iteration of GL context creation attribs list. 2016-04-02 16:26:08 +02:00
baldurk ba70a31557 Alias serialisation of a few gl*Parameteri functions, to display enums
* Since sizeof(GLenum) == sizeof(int32_t), we can make a backwards
  compatible change to the serialisation so that depending on the param
  name we either serialise the value as an int or a GLenum. This only
  makes a difference in the text representation, as the enum name is
  displayed instead of its integer value.
2016-04-02 16:14:21 +02:00
baldurk 019c0db6fe Support .cap files in File -> Open menu and drag & drop 2016-04-02 15:58:17 +02:00
baldurk 1edb57b66d Instead of SetLastError(0), try to restore the 'real' last error 2016-04-02 15:49:22 +02:00
baldurk 27696d9c7f Handle GL attribList being NULL - use a default attrib list of { 0 } 2016-04-02 15:49:22 +02:00
baldurk 7a513ff965 Don't do any processing internally if GL context creation failed 2016-04-02 15:49:20 +02:00
baldurk 009bfb2c74 Where possible apply offs/len knowledge when viewing buffers. Refs #224 2016-04-02 15:39:27 +02:00
baldurk f626e627b6 Use the deserialised dimensions for dispatch, not 0,0,0. Refs #216 2016-04-02 14:38:13 +02:00
baldurk b630b84e20 Don't re-declare gl_ClipDistnace in gl_PerVertex that we don't need. 2016-04-02 13:42:22 +02:00
baldurk 979712730d Fix descriptor set pool sizes being wrong 2016-04-02 13:24:25 +02:00
baldurk 0ed225ec12 Update DS error message code that changed 2016-04-02 13:24:14 +02:00