Commit Graph

85 Commits

Author SHA1 Message Date
baldurk e305029ddd Update copyright years to 2018 2018-01-01 17:55:29 +00:00
baldurk 43d561a4c0 Fix NULL checking and NULL dereferencing issues
* Reported by Coverity Scan - most of these are not an issue and a
  couple of them are coverity getting really confused (like seeing a
  pointer being assigned to NULL and a count to 0, then a few lines
  later declaring that a loop 0..count will dereference the pointer).
* However it's harmless in all cases to add a bit of robustness to keep
  the analysis happy.
2017-11-22 19:11:21 +00:00
baldurk 9e5cfa8b96 Add safety to satisfy Coverity on some errors that are likely impossible
* Reported by Coverity Scan
2017-11-22 19:11:14 +00:00
baldurk 327fda94a0 Add refactored serialisation system
* The new system contains the ability to export serialised data to a
  structured form in memory - and conversion back to serialised bytes.
* This will allow offline transformations/visualisation of capture files
  as well as more rich representations of API calls in the UI.
* Likewise it enables a number of optimisations such as the ability to
  write straight from mapped API memory to disk via a compressor,
  without any intermediate copies.
2017-11-07 19:30:32 +00:00
baldurk 3aa3262089 Expose ToStr interface publicly, split out into separate files
* Note that while this is public and uses std::string, because it's a
  template with specialisations in a .inl the string never crosses a
  module boundary - each including module has its own implementation.
* This will be used as part of the upcoming serialisation refactor.
* Some POD structs are still given ToStr implementations as we haven't
  yet switched over the serialisation system to expect all structs to
  have serialise functions.
2017-11-03 16:23:02 +00:00
baldurk 834edf0dc2 Add a microsecond timer from the start of the process 2017-11-03 16:22:59 +00:00
baldurk 9ef0c5282c Make aligned buffer allocation a common function, out of serialiser 2017-11-03 16:15:19 +00:00
baldurk 276783b948 Move custom printf & string_utils out of serialise/ folder 2017-11-03 16:07:46 +00:00
baldurk 5e59616a8c Update rdctype::array to have a more stl-like mutable interface
* For the most part the interface is stl-compatible, but we have a few
  little changes of our own for convenience.
* This class is still needed after deleting the C# UI, because we don't
  want to pass C++ stl structs over module boundaries and possibly run
  into hard to diagnose incompatibilities.
2017-11-03 16:01:58 +00:00
baldurk 05c87778ea Fix native-newline printing to print atomically
* With the log append setup, printing lines and newlines separately can
  lead to them being interleaved between multiple processes writing to
  the same log.
* This way the lines in a print could still be scattered, but without
  over-allocating to modify newlines in place (which would be more
  expensive too) this can't be fixed, and both multi-line prints and
  multiple processes writing a lot of log prints are rare.
2017-09-26 12:15:51 +01:00
baldurk 6ec2aa55a0 Change logging to use native line-endings - i.e. CRLF on windows
* This means even if notepad is associated with .log files, it will look
  correct, since notepad can't hand LF line-endings :(.
2017-09-19 17:28:11 +01:00
baldurk eb15c43b41 Add Catch.hpp for unit testing, with appveyor hooks 2017-08-29 13:19:44 +01:00
baldurk 40a0272a3e Remove use of bool32 replay API type&optimise mem layout in some structs 2017-08-24 10:44:45 +01:00
baldurk e85c8d19bf Combine 'special' with 'specialFormat' as single resource format type
* There was no good reason to have a flag indicating if the special
  format was valid or not. Now it's a single enum, with a value
  'Regular' indicating that the compCount/compWidth/compType fully
  describe the format itself.
* This makes code patterns easier as you no longer need to check for
  special then check for specialFormat, you can just test the type
  directly.
2017-08-24 10:37:16 +01:00
baldurk fdf04cae39 Print better error messages for failures to save textures to disk 2017-06-02 17:59:57 +01:00
baldurk b94d13b838 Make sure linux log files don't get deleted while still logging to them
* We need to use file locks to ensure the last process knows it can
  delete the log, as well as delete any inherited file descriptors when
  forking to launch a new executable.
* To accomplish this, tracking the single logfile handle is now part of
  the OS-specific code instead of common logging code. It makes little
  difference either way as we don't support multiple log files.
2017-05-17 19:41:39 +01:00
baldurk 142d3d11ad Compile fix for OS X - add overload for size_t 2017-04-19 19:48:22 +01:00
baldurk 83f769a2cd Document the enums in replay_enums.h 2017-04-18 14:57:44 +01:00
baldurk bfa1153a40 Handle prints of lines over 4k characters 2017-04-18 14:57:41 +01:00
baldurk d94f387399 Refactor bucketing code a little to use a record type enum 2017-04-18 14:57:37 +01:00
baldurk d40fc8471d Change API enums to enum class, remove now redundant prefixing
* This gives a little nicer syntax, a bit better type safety, and also
  reflects better for SWIG bindings. Overall it's a minor change but
  better.
* We don't update the C# UI at all, since it's soon to be removed and
  not worth the effort/code churn.
* For now so we're ABI compatible with C#, all enums are uint32_t, but
  that is an obvious optimisation in future to reduce struct packing.
* We avoid 'None' as an enum value, because it's a reserved word in
  python so will cause problems generating bindings.
2017-04-18 14:57:33 +01:00
baldurk eb5ae4a1bf Fix macro for pool name in assert 2017-02-24 14:01:29 +00:00
baldurk 030cbfde9a Batch update copyright years everywhere 2017-01-06 12:13:31 +00:00
baldurk 5c280ee2ed Print the name of the type in pool errors 2016-11-18 16:51:28 +01:00
baldurk 8d0915401f Unify feature macro handling 2016-11-07 18:14:49 +01:00
baldurk 8f4a55a3b5 Set all processes under a given UI instance to log to the same file.
* Using OS-specific append writing functions instead of simple fopen/
  fwrite/fclose we can guarantee that multiple processes writing to the
  same log file won't trash or interleave their log output.
* To make the logs readable the PID is now included along with the
  project/timestamp.
* After that, we make sure that when we launch a program we set the
  output log to the same file as the parent UI. This keeps all the logs
  together and removes user confusion over which logfile is needed.
* We also move all of RenderDoc's temporary files under a RenderDoc
  folder in the temp folder, instead of scattering the files in the root
2016-11-02 23:37:38 +01:00
Balazs Torok 12e5a9a316 basic implementation for Direct3D9 and Direct3DDevice9 2016-10-12 18:04:10 +02:00
baldurk bfac4adfb8 Expose full logging to UI layer, pipe Qt messages etc into main logs 2016-10-07 15:58:45 +02:00
James Fulop dd55043527 add lerp macro 2016-09-30 10:51:56 +02:00
baldurk a9e4396655 Fix compile error that somehow doesn't trigger on VS 2016-09-28 13:55:24 +02:00
Michael Rennie ab71450fb0 Add offset to Android network ports, to differentiate from localhost.
This requires adb forward to include the offset, for example:
adb forward tcp:38970 tcp:38920
adb forward tcp:39970 tcp:39920
2016-09-15 13:42:05 +01:00
baldurk ced197abe3 Only enable stdout/stderr log output after main initialisation
* This suppresses lines like "RenderDoc v0.31 x64 (...) loaded in replay
  application" which are only useful for the logfile and not for actual
  user output.
2016-08-25 21:07:40 +02:00
baldurk 8183c0d2ac Better handling of BGRA8 dds saving and loading 2016-08-19 17:36:36 +02:00
baldurk 481a28dc29 Rename RemoteAccess to TargetControl to better disambiguate RemoteServer 2016-08-19 12:23:19 +02:00
baldurk e81895b060 [Coverity] Remove use of rand() now SetFrameEvent takes 'bool force'
* I honestly can't figure out how to tell Coverity that rand() use isn't
  a security flaw, but it's on longer needed so...
2016-07-20 16:01:48 +02:00
baldurk 0c55e9374c For platforms printing to stdout/stderr, skip debug msgs & long prefix 2016-07-13 17:55:21 +02:00
baldurk 504b18ab3f D32S8 type formats are 8 bytes per pixel, not 5. 2016-07-13 15:52:19 +02:00
baldurk 6854c5bf96 Deliberately leak logfile string storage, so it's always around 2016-06-28 18:23:41 +02:00
EecheE c52e763e8c Changed default histogram range to [-1,+1] for snorm textures.
If viewing a SNORM texture, default histogram range is set to [-1,1]
instead of [0,1].
Added support for BC5U .dds fourcc code.
2016-06-25 17:14:41 -07:00
baldurk 5f28b745a2 Format code according to newly added clang-format
_  /)
                 mo / )
                 |/)\)
                  /\_
                  \__|=
                 (    )
                 __)(__
           _____/      \\_____
          |  _     ___   _   ||
          | | \     |   | \  ||
          | |  |    |   |  | ||
          | |_/     |   |_/  ||
          | | \     |   |    ||
          | |  \    |   |    ||
          | |   \. _|_. | .  ||
          |                  ||
          |repository history||
          |                  ||
  *       | *   **    * **   |**      **
   \))ejm97/.,(//,,..,,\||(,,.,\\,.((//
2016-05-22 19:41:53 +02:00
Michael Vance 8b1794456d Switch RENDERDOC_PLATFORM to RENDERDOC_PLATFORM_<PLAT>.
Notes
======
- With no clean way to do string comparisons in the C preprocessor, have a define per-platform. This avoids the clever string concatenation for determining the OS-specic bits, and allows SN-DBS to distribute builds without custom rewrite rules.
- Fix up instances of WIN32, etc., in non-3rdparty sources to refer to this.
- Move the per-platform specific bits into their own subdirs.
2016-04-15 13:59:59 -04:00
baldurk b826f58497 Move scratch buffer for log formatting from stack to static data section
* Reduces stack pressure in case applications have manually specified
  smaller stacks.
2016-04-14 21:09:22 +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 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 51721f78b8 Fix for VS2015 warnings, mostly variable shadowing 2016-04-09 13:15:01 +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
Chia-I Wu c752f20310 Include stdlib.h for exit
exit is called from RDCFATAL and RDCDUMPMSG.
2016-03-12 06:29:19 +08:00
baldurk 542131624f Create new assert macro, that can log the values in the expression
* The main motivation for this is because it's convenient to be able
  to just assert a simple expression rather than print a proper error
  message, but then after the fact you want to know what the value was
  (e.g. a return code, or similar).
2016-02-27 17:29:16 +01:00