Commit Graph
56 Commits
Author SHA1 Message Date
baldurk 7a2305ae31 Change by-ref passed float or bool parameters to callbacks in public API
* Mostly used for passing a progress float back during a long blocking
  call like opening a capture or doing a copy.
* This is much more feasible for python to bind to.
* In several cases we just use a tiny lambda that updates a float anyway
  since we can't push the progress directly into a progress dialog, but
  need to let it query from a temporary in-between float.
2018-01-01 17:31:23 +00:00
baldurk ebaefc82a9 Normalise and make python/public interface more consistent
* We enforce a naming scheme more strongly - types, member functions,
  and enum values must be UpperCaseCamel, and member variables must be
  lowerCaseCamel. No underscores allowed.
* eventId not eventID or EID, and Id preferred to ID in general. Also
  for resourceId.
* Removed some lingering hungarian m_Foo naming.
* Some pipeline state structs that are almost identical between the
  different APIs are pulled out into common structs. Where something
  doesn't make sense (e.g. viewport enable for vulkan) it will just be
  set to a sensible default (in that case always true).
* Changed scissors to be x/y & width/height instead of sometimes
  left/top/right/bottom
* Abbreviations are discouraged, e.g. operation not op, function not
  func.
2017-12-22 13:02:36 +00:00
baldurk 64ab04c42c Fix display of live chunk count 2017-12-14 18:39:18 +00:00
baldurk 413a06b299 Change stream I/O behaviour around sockets
* Previously each read and write would 1:1 become a send or recv call.
* Now we buffer writes and send in batch (or when a chunk finishes),
  and every time we read we try to non-blocking read more data to fill
  the buffer, to allow batching reads where possible without blocking
  on data that will never come.
2017-11-27 18:54:19 +00:00
baldurk 01e2e00b5f Add error checking and handling while loading captures
* Previously once we started loading a capture we'd blindly continue
  until we loaded it (and then it's assumed to be successful), or we
  crash.
* Now errors can be reported during serialisation and bubbled up to
  abort the file load process. The next steps are to add error checking
  in each function serialise before doing any replay calls to the API
  with potentially corrupt data, and on top of that catching API-only
  errors when the serialisation is (seemingly) fine, and propagating
  those in a reasonable way.
* We also harden the serialisation a bit so that if it reads an
  obviously invalid byte length for a buffer or array count, it won't
  continue. It's still not perfect as the sizes could still be large and
  invalid but within range, but it should catch the worst cases.
2017-11-24 18:14:21 +00:00
baldurk 016bc29609 Add a tool menu item that will recompress a capture file 2017-11-17 16:33:05 +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 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 d3d35ee216 Change thread creation type to std::function to allow lambdas 2017-09-29 12:11:13 +01:00
baldurk f37079bff0 Use 64-bit counters for tracking compression sizes.
* There's still an issue lurking that the compressed size is stored as
  32-bit on disk, but at least now we don't store the uncompressed size
  as 64-bit but track it as 32-bit.
* The serialisation is going to change Soon(tm) anyway so this
  workaround should be enough for now, since hopefully compressed size
  is comfortably below uncompressed size.
2017-06-28 10:39:11 +01:00
baldurk 3fff6fa86a Ensure that in-memory buffer created serialisers have right version
* When flattening a log m_SerVer would be uninitialised which mean that
  if it was less than 0x32 we'd start aligning buffers when we shouldn't
  have.
2017-05-17 11:59:17 +01:00
baldurk 030cbfde9a Batch update copyright years everywhere 2017-01-06 12:13:31 +00:00
baldurk 5ae3cdf7fb Add a way to hint the initial size of the serialiser buffer 2016-11-18 18:38:28 +01:00
baldurk 8d0915401f Unify feature macro handling 2016-11-07 18:14:49 +01:00
baldurk 07c9b3697b Check for truncated reads when decompressing 2016-10-27 12:40:19 +02:00
baldurk edcce279d2 Don't write debug text string all in one fwrite call 2016-10-27 12:39:47 +02:00
baldurk 459619ff0c Don't try to access file on local disk in statistics. Refs #400 2016-10-19 19:12:41 +02:00
baldurk 237b24e88e Remove printing of buffers as floats. Refs #395
* There's no guarantee that the buffer is actually float data at all,
  so printing it as such can cause float exceptions if the data includes
  NaNs.
* This is not really useful anymore anyway, and if really needed the
  float values can be manually converted from the hex data.
2016-10-13 16:06:25 +02:00
baldurk 726425ee88 Keep chunk count valid with duplicated chunks 2016-09-08 15:50:36 +02:00
baldurk 78ef96b2e7 Set up capturing to flatten/deinterleave deferred context recording 2016-09-05 20:12:40 +02:00
baldurk d2faf76356 Save machine ident in captures and compare to machine ident on open
* If the machine idents differ in significant ways that we'd consider
  it to be a different platform (currently just OS), and if so mark it
  as supported but suggested to be replayed remotely.
2016-08-19 17:26:36 +02:00
baldurk 80bdfe6058 Fix errors and leaks found by valgrind on linux replay host
* These are some leaks, some mismatched new/deletes and some uninit'd
  values. Mostly the leaks are what we care about so that the replay
  host can be kept alive for a long time rather than needing to be
  constantly restarted.
* Also added a valgrind suppression file to suppress some of the false
  positives I ran into while testing.
2016-07-14 20:37:32 +02:00
baldurk 6c5573ec3b Coverity: Delete allocated section in error case 2016-06-09 13:56:54 -07:00
baldurk c1f66de413 Add early OS X compiling support from @Zorro666 - still non-functional!
* Build with cmake -DENABLE_VULKAN=OFF -DENABLE_QRENDERDOC=OFF
2016-05-31 12:05:45 +02:00
baldurk 5f28b745a2 Format code according to newly added clang-format
_  /)
                 mo / )
                 |/)\)
                  /\_
                  \__|=
                 (    )
                 __)(__
           _____/      \\_____
          |  _     ___   _   ||
          | | \     |   | \  ||
          | |  |    |   |  | ||
          | |_/     |   |_/  ||
          | | \     |   |    ||
          | |  \    |   |    ||
          | |   \. _|_. | .  ||
          |                  ||
          |repository history||
          |                  ||
  *       | *   **    * **   |**      **
   \))ejm97/.,(//,,..,,\||(,,.,\\,.((//
2016-05-22 19:41:53 +02:00
baldurk cda0b4cb5a Enable warning C4189: local variable is initialized but not referenced 2016-04-09 11:24:45 +02:00
Chia-I WuandChia-I Wu 69c33da1e7 Include errno.h for errno 2016-03-12 06:29:19 +08:00
baldurk d987423fb9 Linux compile fix - only specialise ToStr on long for windows 2016-03-01 19:32:10 +01:00
baldurk a347b54be4 Add some needed ToStr implementations 2016-02-27 17:51:19 +01:00
baldurk 19a0fc5094 Remove some deprecated code 2016-02-07 18:51:50 +01:00
baldurk 0bdd186550 VS2015 warning fix (shadowed variable) 2016-02-07 18:50:51 +01:00
baldurk 2e0ffa7813 Batch update copyright years everywhere 2016-02-07 18:50:45 +01:00
baldurk 24aa8b3daf Remove singleton from VulkanResourceManager, pass it where needed 2016-02-07 18:44:30 +01:00
baldurk 78fc832722 Don't copy debug string if there's nothing there 2016-02-07 18:42:22 +01:00
baldurk 65011ebcfa Pass scoped context name/type directly, don't combine into temp string 2016-02-07 18:42:16 +01:00
baldurk 607b8d48c9 Remove 'debug' serialiser that synchronously flushes out debug text 2016-02-07 18:42:15 +01:00
baldurk fe414dfc9c Only reset debug text on indent level 0 2016-02-07 18:41:03 +01:00
baldurk 1b8d291874 Avoid pointless multiple file passes, now that seeking isn't cheap 2015-09-18 22:37:44 +02:00
baldurk 822a235349 Make sure not to try and use compressed reader for non-compressed logs 2015-09-15 18:52:43 +02:00
baldurk 219bd2d434 Refactor serialisation format with new version
* The main improvement is that instead of just callstack resolving DB
  and frame capture data, some arbtirary number of sections can be
  included, for e.g. adding notes or saving the bookmarks or whatever
  use the user wants.
* Sections (namely the frame capture data) can now be (de)compressed on
  I/O, which leads to much smaller file sizes.
* Also the default internal alignment has changed from 16 to 64 to be
  more future proof (I decided not to go with completely arbitrary
  alignment).
* A path for loading previous version logs remains and will be removed
  at some point in the future, maybe a version or two down the line.
2015-09-14 09:25:46 +02:00
baldurk e6621c8956 Don't recreate callstacks, instead re-set stack in consistent instance 2015-09-13 21:20:29 +02:00
baldurk 3dac5fe624 Fix calculation for aligning next serialised buffer. Refs #133 2015-04-28 12:21:36 +02:00
baldurk 584d439620 Add util function to align serialised buffers in chunks. Refs #133
* To align a buffer inside a chunk to a wider boundary like 32-bytes in
  this case, the chunk needs to be aligned and the buffer within it also
  needs to be aligned.
* The utility function accounts for the buffer serialised having a
  uint32 length in front of it, so it pads out until that will be at
  the desired boundary. This is a bit of a messy solution, but the
  easiest way to ensure the padding is there while being easily
  backwards compatible with old logs without the padding.
* D3D11 and GL serialise versions are bumped, D3D11 version is backwards
  compatible, GL breaks compatibility.
2015-04-24 11:07:02 +02:00
baldurk 24df051659 Skip any empty-named serialised items in serialiser debug text string 2015-04-24 10:21:04 +02:00
baldurk 6cd1f70bb6 Fix several warnings for compiling on VS2015
* Note at the time of committing there are still some warnings in MS
  headers that you might need to suppress in a couple of files.
* 3rd party code just has the warnings suppressed for ease of merging.
* The majority of warning fixes were for local variables shadowing
  other locals, function parameters, or members. In most cases they
  weren't a problem, but in some cases it was potentially dangerous!
2015-03-13 10:16:19 +00:00
baldurk c9f106b0cb Fix up the replay proxy serialising functions
* Also add some compile time asserts to try and help keep them working.
2015-01-28 12:34:12 +00:00
baldurk f73a7a4a0c Support ARB_map_buffer_alignment on 64byte boundaries
* The real implementation can do more if it wants, and align to a larger
  alignment, but we just return 64 to the program and align to that, which
  satisfies the extension minimum requirements (and chances are no program
  takes advantage of wider alignment anyway).
2014-12-26 16:04:22 +00:00
baldurk 119d9242ab Demote error to warning
* This is the error 6152332e36 was intended
  to address!
2014-12-15 19:06:44 +00:00