Commit Graph

80 Commits

Author SHA1 Message Date
baldurk 026da176bb Update copyright years to 2021 2021-01-13 13:56:10 +00:00
baldurk e5f4ca7bb8 Remove use of const char * in public API and OS specific where possible
* This prevents unnecessary conversions back and forth between rdcstr and const
  char * when going through interfaces. In the OS specific layer this is rarely
  an issue because most of the implementations don't convert to rdcstr, but it
  is convenient to be able to pass in an rdcstr directly. The few cases where
  there's an unecessary construction of an rdcstr is acceptable.
* A couple of places in the public API need to return a string from a global
  function, so can't return an rdcstr due to C ABI, so they still return a const
  char *.
* Similarly const char * is kept for logging, to avoid a dependency on rdcstr
  and because that's one place where unnecessary conversions/constructions may
  be impactful.
2020-12-07 17:44:50 +00:00
Daniel Craig a7af387a36 Disable crash reporting for unofficial renderdoccmd builds
This follows the lead of crash_handler.h in renderdoc proper.
2020-03-20 16:16:37 +00:00
baldurk b38cbc1b0c Add explicit functions to initialise and shutdown replay. Closes #1685
* It's required for replay applications to call InitialiseReplay() before doing
  any work, and to call ShutdownReplay() once they're finished.
* This lets us do more heavyweight shutdown work before global destructors are
  being invoked and the RenderDoc instance is being destroyed.
* Anything that needs to be shut down during capture still has to happen in
  RenderDoc::~RenderDoc since we obviously can't get the application to call a
  shutdown function in that situation.
2020-01-30 13:39:15 +00:00
baldurk d4e723bfd8 Fix bugs identified by using PVS Studio
* A few copy-paste errors, some tautological checks indicating errors, missing
  return value checks.
2020-01-17 19:53:38 +00:00
Alex Vakulenko 6cd2d18d9e Fix build break on VS2019 due to implicit wchar_t->char conversion
Converting std::wstring to std::string by constructing the latter with
wchar_t iterators result in implicit conversion of wchar_t to char which
trips Visual Studio 2019 compiler into throwing a warning of potential
data loss during conversion. Use conv() helper function to do the
conversion and please the compiler at the same time.
2020-01-17 19:53:09 +00:00
baldurk 2916c0f9f7 Update copyright years to 2020 2020-01-06 16:20:45 +00:00
baldurk 14d01ff995 Remove support for serialising STL types, remove STL interop 2019-12-16 18:10:32 +00:00
baldurk 6be0736d24 Update miniz to 2.10 with ZIP64 support 2019-10-14 14:06:42 +01:00
baldurk 9463cdf785 Add better error checks and race condition protection in crash handling 2019-09-16 11:18:30 +01:00
baldurk c403f5120d Fix release build compilation 2019-05-17 18:24:25 +01:00
baldurk 7206a0cd25 Removing 'use std::vector' 2019-05-17 16:32:56 +01:00
baldurk a965a3a703 Remove 'using std::string'
* This will make it easier to replace std::string with rdcstr in future
2019-05-17 16:32:56 +01:00
baldurk 115fcec8e5 Close crash handling server if no client connects in 5 seconds 2019-04-29 10:45:45 +01:00
baldurk 6dec2dad73 Remove unused code getParentExe 2019-04-29 10:45:28 +01:00
baldurk 86ff87863e Update copyright years to 2019 2019-02-01 18:32:13 +00:00
baldurk d265a14a45 Change renderdoccmd to be a console program on windows.
* This means it outputs natively/properly to stdout/stderr and its output can be
  redirected with pipes.
* It does mean we need to be very careful whenever it's run internally to not
  pop up a command window, which happens by default.
2019-01-09 16:27:15 +00:00
baldurk 5cfe6c7623 Give each breakpad server a unique pipe
* Speculative fix for a hang observed only on official builds when launching a
  32-bit program from a 64-bit version of RenderDoc.
2018-12-17 19:50:37 +00:00
baldurk 1c05c5e5d1 Add option to renderdoccmd replay to specify a loop count 2018-10-02 16:23:40 +01:00
baldurk 6ec402e370 rename logfile -> capturefile parameter on execute, document for python 2018-09-18 18:05:39 +01:00
baldurk 14d9ec461b Ensure there's a trailing path separator on upgrade command path 2018-03-06 11:06:46 +00:00
baldurk 468c6c1e80 Wrap up CaptureOptions encoding via string into member util functions 2018-02-14 19:21:55 +00:00
baldurk 56c6fa2d04 Use QCommandLineParser to parse arguments more intelligently. Refs #843 2018-01-17 21:07:03 +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 6572cd97f5 Tidy up handling of windowing data, make it a bit more type safe 2018-01-01 17:31:19 +00:00
baldurk f2e7f8f1a0 Refactor crash/bug reporter system
* The UI dialog is now in Qt. We run qrenderdoc.exe with a very minimal
  startup to display the dialog and send the report.
* The flow has been simplified to have less text and an easier time to
  just click through and send.
* On the first report, the user is gently nudged to enter their email
  address for contact and by default the email is saved for next time.
  They're not nagged more than once about this.
* Optionally the user can select to upload the capture. This is always
  default off, and there is a confirmation dialog making sure the user
  intended to select it.
* After the bug is reported, a unique URL is generated and returned
  which the user can then click back on to see if there's any update. By
  default the UI will also remember the URL and check it every couple
  of days and alert the user in the help menu that there's an update.
2017-12-19 12:26:34 +00:00
baldurk fd09c323b3 Add helper functions in win32 renderdoccmd for wchar <-> UTF8 conversion 2017-12-19 12:26:34 +00: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 2b01ee78f2 Remove C# renderdocui UI. Add qrenderdoc to visual studio solution 2017-08-14 18:09:59 +01: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 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 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 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 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 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
baldurk f8b3fd3e1e Update renderdoccmd for new remote server code, add daemonise for server 2016-08-19 17:26:08 +02:00
baldurk 8b5f3de916 As DS_SETFOREGROUND doesn't work, move error reporter in/out of topmost
* This will guarantee the window is brought to the front, but it won't
  keep it there and be annoying.
2016-08-01 14:56:21 +02:00
baldurk ebb889a7ee Report supported windowing systems from replay, and choose which to use
* This is primarily for vulkan, which supports either xlib or xcb (and
  not necessarily both). GL still only supports xlib, windows and
  android only support one system regardless of API.
* This should also support xlib again for fetching keystates etc.
2016-07-22 18:23:30 +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 532cdcb7a1 Compile fix for appveyor 2016-07-12 21:55:52 +02:00
baldurk 99c0177cd9 Remove unused GetUsername() function 2016-07-12 19:39:41 +02:00
baldurk 5c53e623df Add win32-specific commands (crash handle, upgrade, global hook) 2016-07-12 17:39:24 +02:00
baldurk ced8a62af6 Add replay command (with optional remote replay) 2016-07-12 17:39:23 +02:00
baldurk 120b03e859 On windows, make sure cmd.exe can see the stdout/stderr 2016-07-12 17:39:21 +02:00
baldurk eb9a545104 Move common functions declarations into header 2016-07-12 17:10:42 +02:00
baldurk b74b833121 Switch renderdoccmd to use vector<string> for passing args 2016-07-12 11:22:51 +02:00