Commit Graph

184 Commits

Author SHA1 Message Date
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 f9cb1c68b9 Only call XCloseDisplay if xlib or xcb is enabled. Closes #782 2017-10-24 10:18:31 +01:00
baldurk cee18446bf Use file type and maxsize from thumb command properly 2017-09-29 12:11:15 +01:00
baldurk c05bdc2032 Don't call XCloseDisplay with a NULL Display*
* Normally we'd always have a Display*, but if we're running without an
  X server present, the Display* will be NULL.
2017-09-26 13:29:56 +01:00
baldurk 4c08c83e87 Don't leak Display* handle 2017-09-26 11:54:31 +01:00
baldurk 7b2af6b381 Auto-guess format of thumbnail from .jpg file extension 2017-09-26 11:53:16 +01:00
baldurk 1992183e8e Add support for specifying a subfolder under the lib/ target. Refs #750
* This allows a buidler to customise from e.g. /usr/lib/librenderdoc.so
  to /usr/lib/renderdoc/librenderdoc.so - which is harmless since the
  library is 'private' and not intended to be linked against directly.
2017-09-26 11:00:17 +01:00
baldurk 86c3ee4086 Fixes for compiling with disabled xcb, or disabled xlib & xcb 2017-09-19 17:28:12 +01:00
Cody Northrop 2b1bc02a22 android: Set versionName and versionCode during build
This will allow us to determine the status of the installed
server before using it.
2017-09-15 12:17:58 -07:00
Janos Pantos ff084037a5 Fix detecting renderdoccmd as a replay application on android
* Force loading librenderdoccmd.so in the Loader
* Build renderdoc as libVkLayer_GLES_RenderDoc.so, link renderdoccmd
  against it, otherwise we will get UnsatisfiedLinkError when running
2017-09-15 12:17:21 -07: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 af9b74ff48 cmdline.h: don't complain about unrecognised short options in the 'rest' 2017-08-28 18:50:20 +01:00
baldurk d4488ff690 Re-use parent console if it's available
* This means we won't get an ugly console window popping up when running
  renderdoccmd on windows, but if we run it from a terminal then we'll
  get output as normal.
* One downside is that cmd.exe seems to snoop the exe type (GUI or
  console) and if it's a GUI application it returns to the prompt
  immediately. bash for example though waits for process termination.
* The other is that pipe redirects to file don't work properly.
2017-08-28 18:50:19 +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
Cody Northrop e819035f9e cmake: Update javac classpath to work on Windows 2017-08-17 09:53:40 +01:00
Cody Northrop fc316d5ba0 cmake: Add control over Android build-tools version
Specify -DANDROID_BUILD_TOOLS_VERSION=<foo> to change from the
default of 26.0.1.

Also respect the selected Android platform version.
2017-08-17 09:53:39 +01:00
Cody Northrop a95d2bb625 android: Update packaging to work with latest SDK
This removes dependencies on deprecated tools "ant" and "android project"

The new method relies on JAVA_HOME and ANDROID_SDK being set.

It also requires specific versions of the Android build-tools (26.0.1) and
platforms (android-23).  See updates to CONTRIBUTING.md and our Travis-CI
config for details.

Travis-CI and documentation also roll forward to latest public NDK r14b.
2017-08-17 09:53:37 +01:00
baldurk 2b01ee78f2 Remove C# renderdocui UI. Add qrenderdoc to visual studio solution 2017-08-14 18:09:59 +01:00
Cody Northrop d66afc0144 android: Add ability to check RenderDoc support, try to fix it
After selecting an application to launch on Android, inspect it to see if
it contains the RenderDoc layer and required permissions. If it does not,
display a warning similar to desktop. When clicked, if only the layer was
missing, offer to patch the APK, uninstall, and reinstall, with the
warning that it doesn't work for all applications (or at all for GLES).
Also provides pointers to how to package the layer yourself.

The process works by using the host temp directory to pull the APK and
modify it.  If the steps fail for any reason, the log is populated and
patching is halted.
2017-07-21 10:29:46 -07:00
Cody Northrop 7f0758f0ae android: Rename librenderdoc to libVkLayer_GLES_Renderdoc
This allows the library to be used as a Vulkan layer and shared
object for GLES debugging.  It was already being renamed in the
distribution scripts.  We've been renaming by hand for local
Vulkan development.
2017-07-21 10:29:46 -07:00
baldurk 44b74eb813 Refactor global hooking, to bring it into the C++ OS-specific code
* This way it can be used from Qt or any other UI as well.
* The pipes are created internally and just passed as stdin to the
  renderdoccmd processes instead of being named pipes.
2017-07-12 12:41:39 +01:00
baldurk f190f9af06 Fix global hook shim referencing removed functions
* It was still pointing at old functions, which have since been removed.
2017-06-28 11:24:02 +01:00
baldurk fb87f68b19 Build android apk inside build folder, not in source tree
* This means multiple builds don't cross-contaminate, and removing the
  build folder will clean everything up again.
2017-06-15 05:28:07 -07:00
baldurk 238493a178 Give the Android remote server a nicer title, and an icon 2017-06-15 05:28:07 -07:00
Michael Rennie 70f55a1458 Start/Shutdown Android server from RemoteManager dialog.
ANativeActivity_finish when renderdoccmd() returns.
2017-06-14 05:03:46 -07:00
Michael Rennie 53c0c20c8a Prevent connection to server until Android permissions granted.
Server pops up dialog requesting file system access when the server is
launched. This is only obvious when the device is unlocked, otherwise this
pop up is never displayed.

Fixed by waiting for the user to grant permissions by preventing starting
a target app until the server is ready to open captures.
2017-06-14 05:03:46 -07: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 87ec279f1c Update some forgotten Copyright years to 2017 2017-05-19 17:28:41 +01:00
baldurk c854294dc8 Add calls to XInitThreads() to allow driver multithreading optimisations 2017-05-05 16:45:29 +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 13f61eaf8e Disable edit and continue debug information, since E&C is disabled 2017-04-27 19:47:49 +01:00
Cody Northrop f60968b103 android: Target android-23 explicitly for APK
Using "1" here was very specific to the build system, as noted by the comment.
When run on systems with older APIs install, it resulted in java compile errors.
2017-04-26 20:47:04 +01:00
baldurk dae3a41db1 Don't try to put android apk in ${CMAKE_SOURCE_DIR}/bin anymore 2017-04-18 14:57:49 +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 2e87ca4531 Require qt creator to locate the cmake project to build on non-windows
* Previously the cmake build would put librenderdoc.so in a /bin folder
  in the source folder so the qt creator project could link against a
  fixed path when just opening the project solo.
* This won't scale though for fetching the SWIG outputs from cmake, and
  it's ugly to modify the source folder for out-of-source builds.
* Instead we have cmake generate a qt creator include file with all of
  the settings and paths needed, and pass the CMAKE_BINARY_DIR into
  qmake when building. This does mean that when opening the project in
  qt creator you need to specify CMAKE_DIR=/path/to/build though.
* As a bonus, this means we can let cmake identify where python is and
  have qt creator link against it rather than having to hardcode include
  paths etc.
2017-04-18 14:57:40 +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