Commit Graph

85 Commits

Author SHA1 Message Date
baldurk 13c1cf6ad4 Return ReplayStatus when launching/injecting, use to indicate JDWP error
* If android studio or other android tools are open when a package is
  launched for debugging, they greedily jump on it and connect which
  prevents us from connecting.
2018-02-20 11:54:57 +00:00
baldurk 934800793a Improve workflow for capture import/export
* If the export doesn't need buffers, we export directly from the loaded
  capture file instead of re-loading it.
* Add progress bars for the load step so it shows what's happening
  instead of looking stalled.
* Reduce compression rate on XML+ZIP buffers as it took too long trying
  to compress when exporting large captures.
2018-02-19 00:52:13 +00:00
baldurk 468c6c1e80 Wrap up CaptureOptions encoding via string into member util functions 2018-02-14 19:21:55 +00:00
baldurk dea21b20a0 Remove global GIT_COMMIT_HASH define, use GitVersionHash global var
* On windows, the change in a global GIT_COMMIT_HASH define in each
  project needing it meant a full rebuild every time the commit changed.
* Ideally we'd set the define only on one file in each project, but
  MSBuild doesn't seem to support that. Instead we make a new tiny
  project that compiles a single cpp exporting a global var, and
  reference that global var in each other project.
2018-01-16 20:17:53 +00:00
baldurk 0991642393 Add error message in case reading from file fails while embedding 2018-01-04 21:46:41 +00:00
baldurk dec06a19fb Don't pass NULL f to fclose, passing --no-clobber if file doesn't exist 2018-01-04 21:46:41 +00:00
baldurk e305029ddd Update copyright years to 2018 2018-01-01 17:55:29 +00:00
baldurk 96e39cb781 Add a preview window ability to remote servers. Always on for android
* On android in particular this shows some sense of what's happening on
  the device and gives user feedback that it's not completely dead.
2018-01-01 17:31:23 +00:00
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 649e82b8ed Add two commands to renderdoccmd for embedding and extracting sections 2017-12-20 18:01:20 +00:00
baldurk 8d29758851 Remove members of public structs called 'bytes'
* It is at best confusing, and at worst could cause errors by aliasing
  with the python type.
2017-12-15 17:33:53 +00:00
baldurk 584b3c041c Add functionality to return raw thumbnail bytes, not encoded
* This is useful if you want to retrieve the thumbnail for in-memory
  processing instead of writing it to disk immediately.
2017-12-12 14:30:09 +00:00
baldurk 4ff439ed79 A couple of improvements to convert cmd, fail if format isn't explicit 2017-11-24 18:14:23 +00:00
baldurk 016bc29609 Add a tool menu item that will recompress a capture file 2017-11-17 16:33:05 +00:00
Peter Gal 9603e86215 Fix renderdoccmd help screen
The help information for the 'convert' command in the
renderdoccmd was incorrect.
2017-11-09 19:09:40 +01:00
baldurk 7ca6c80414 Add ability to convert a capture to structured data without replaying 2017-11-08 18:24:22 +00:00
baldurk 9388d2b71b Change core capture code to be more centred around container handle
* When opening a capture file, a format is now available to allow
  easy import from another format without a completely different
  interface. Only rdc files can be replayed, but any other file can
  load and access structured data through the same interface.
* The replay initialisation and capture writing interfaces also use the
  RDCFile instead of passing filenames or Serialisers around directly.
  Driver initialisation parameters are now entirely private, and don't
  need to be exposed - any agnostic metadata like thumbnail, driver, etc
  are all accessed via the RDCFile container itself.
* Callstack resolution is now part of the container file, not the
  back-end via way of its Serialiser.
* Importers/Exporters to other non-RDC formats are registered in a
  similar way to replay/remote drivers.
* It is also then possible to construct an RDC file from thin air, by
  creating an empty RDCFile container and filling it with data, then
  requesting it to be written to disk.
2017-11-07 19:30:35 +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 e6c5c03896 Remove rdctype namespace. Rename rdctype::str -> rdcstr, rdcarray, etc
* Since these types are more prevalent than originally designed, it
  makes more sense to remove the namespace for ease of typing/naming.
* Also add a specialised type 'bytebuf' for an array of bytes.
* This makes mapping easier to SWIG since there's no special casing for
  namespaced arrays. Especially so for nested cases like
  rdctype::array<rdctype::str> -> rdcarray<rdcstr>
2017-11-03 16:04:59 +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 cee18446bf Use file type and maxsize from thumb command properly 2017-09-29 12:11:15 +01:00
baldurk 7b2af6b381 Auto-guess format of thumbnail from .jpg file extension 2017-09-26 11:53:16 +01:00
baldurk 82a0e055ba Change how replay programs are identified, from filename to sym export
* Instead of checking on the filename, we look for a specially named
  exported symbol somewhere in a module that's already loaded.
* This allows us to mark the python module as a replay program, so if
  it's loaded into the python interpreter it will be able to use the
  replay API.
2017-08-31 18:34:19 +01:00
baldurk eb15c43b41 Add Catch.hpp for unit testing, with appveyor hooks 2017-08-29 13:19:44 +01:00
baldurk 00e06d8ff1 Make display rendering colours theme-aware.
* In particular this removes hard-coded checkerboard colours that don't
  look right on dark themes.
2017-08-28 18:50:17 +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 3ab7510c7f Avoid calling XOpenDisplay multiple times, fixes crashes on Intel Mesa
* See https://bugs.freedesktop.org/show_bug.cgi?id=99831
  https://bugs.freedesktop.org/show_bug.cgi?id=54971
* It's not clear if it's invalid to call XOpenDisplay more than once but
  at the very least it's only really used as convenience to avoid
  plumbing the display handle through.
2017-05-30 12:02:00 +01:00
baldurk ae50fa99ee Revamp version tagging, remove ugly suffix on git hash. Refs #571
* Tacking -official onto the git hash was a hack only needed on windows,
  and since we want more information it doesn't scale.
* Instead we track anything we need to know about the version in
  separate variables, like whether it's a stable build or a nightly/
  local build. Or if it's built by a downstream distribution then the
  version number for the downstream build.
2017-04-27 19:47:50 +01:00
baldurk 6930841705 Rename ReplayRenderer to ReplayController
* It's not a renderer, it's an interface to controlling the replay and
  any 'renderer' type work actually happens in ReplayOutput.
2017-04-18 14:57:47 +01:00
baldurk a7ab0d9300 Move capture-file handling functions into a single interface
* This allows us to return complex types like byte arrays or pairs of
  status & render handle.
* Also in future more introspection of the capture file will be possible
  and this provides an easy extension to that without adding new entry
  points.
2017-04-18 14:57:47 +01:00
baldurk bc79e2296f Make EnvironmentModification struct and pass around array directly
* The old 'store in opaque void*' is kept as entry point wrappers only
  for the C# UI.
2017-04-18 14:57:47 +01:00
baldurk f6c045f473 Refactor public interface to be less strict C and more python friendly
* Generally this means removing ref out parameters and instead returning
  values. In a couple of cases we will want to avoid copies in future
  either by returning const references (e.g. to the pipeline state which
  is immutable).
* At the same time, some pointless bool return values that were always
  true and didn't indicate errors have been removed. They can be added
  again if an error condition comes back.
* Some free functions still have out parameters as C linkage doesn't
  allow returning user types by value.
* The C# UI still invokes into C wrappers for all the C++ classes, which
  handle taking the return value and doing a copy into an out parameter
  still for compatibility.
2017-04-18 14:57:46 +01:00
baldurk 637d4089e2 Rename colour to color in public API code
* Following the principle of least surprise, color tends to be more
  commonly used in APIs and graphics code even outside the USA.
2017-04-18 14:57:37 +01:00
baldurk 0ad5709df3 Remove poorly chosen 'Fetch' prefix from a few data structures.
* This goes all the way back to the first iterations where these were
  the only structures and 'Fetch' referred to them returning data from
  the core code to the UI.
2017-04-18 14:57:36 +01:00
baldurk bd199ca8e6 Remove declarations for C interface from renderdoc_replay.h header
* The functions are still exported and that's all renderdocui cares for.
* The interface is no longer to be used so gets in the way of the
  generated SWIG bindings.
2017-04-18 14:57:36 +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 747d0550f9 Compile fix - missing rename was mixed in with other changes 2017-03-13 19:06:22 +00:00
baldurk 487a1b7903 Start moving towards C++ only UI code. Assume C++ for the replay API
* The C# P/Invoke stuff doesn't directly use the header, and we are soon
  going to deprecate the C interface entirely.
2017-03-13 17:56:00 +00:00
baldurk 030cbfde9a Batch update copyright years everywhere 2017-01-06 12:13:31 +00:00
baldurk 2a4d2451ff Allow 'promoting' back to capture 64-bit from 32-bit, in 64-bit install
* A 64-bit install has an x86 subfolder to capture 32-bit programs. If
  a 32-bit program then launches a 64-bit program we need to 'promote'
  back to run the original bitness to capture it.
* It's still not supported to capture 64-bit in general from just a
  32-bit install as the support files aren't included.
2016-12-08 19:04:59 +00:00
baldurk c810a96300 Keep debug log the same even when going via cap32for64 2016-12-08 19:04:57 +00:00
baldurk 5286f950ff Add processing to different formats and max size while fetching thumb 2016-11-02 23:39:35 +01:00
baldurk 9f4a60028e Handle injecting environment variable params
* This also fixes the problem of capturing 32-bit programs with 64-bit
  RenderDoc failing to properly insert environment variables and
  error'ing when it tries to do it directly.
2016-09-28 17:55:45 +02:00
baldurk 3693a17c73 Tiny tweak to renderdoccmd usage output 2016-08-25 21:07:40 +02:00
baldurk 90604c6d9c Print custom lines of API support on the version string of renderdoccmd
* An easy way to check what support is compiled into this binary.
2016-08-25 21:07:40 +02:00
baldurk 6819f22181 Tweak aliases for help/version to cover a couple of more cases 2016-08-25 21:07:40 +02:00
baldurk 5393d939fd Fix crash if replay renderer doesn't create 2016-08-25 21:07:40 +02:00
baldurk b5e6f8bef2 Allow specifying environment variable modifications
* This works for local and remote invocations of programs, but is mostly
  useful on unix systems (Windows programs use env vars less often)
2016-08-19 17:26:33 +02:00
baldurk d63e3b89ad Add support for copying files back from remote server 2016-08-19 17:26:24 +02:00