Commit Graph

111 Commits

Author SHA1 Message Date
Silent 3074ebeb51 Project fixes to fix building from paths with spaces 2018-03-26 15:07:12 +01:00
Baldur Karlsson 68a3f3a31f Filter out previous/next drawcall shortcuts when text editing.
Closes #911

editing.
path.
'ad0678a'.
2018-03-12 15:46:44 +00:00
baldurk ab7fa9e281 Ignore python env vars which might load incompatible libs. Refs #902
* PYTHONHOME is used *ahead* of the python36.zip on Python's default
  search path, so we need to suppress that to make sure it doesn't
  interfere.
2018-03-07 22:18:55 +00:00
baldurk c1ceb3b02a Make PySide2 optional on windows
* It's already optional on linux due to distributions not necessarily
  carrying packages for it yet. We also make it optional on windows
  since by the same measure it's not a huge problem if it's missing, and
  official builds will include it. This means we don't have to ship the
  binary dependencies
2018-02-02 20:47:19 +00:00
baldurk cdca0ee6de Append C++14 standard flag instead of prepending.
* This stops it from being overridden by the global --std=c++11 in the
  root CMakeLists.txt which ends up after it in the command line.
2018-01-18 16:24:55 +00:00
baldurk e305029ddd Update copyright years to 2018 2018-01-01 17:55:29 +00:00
baldurk 2e74989b69 Allow None when converting std::function types
* It just creates an empty callback
2018-01-01 17:31:22 +00:00
baldurk 4c0347f856 Fix compile errors with python bindings on callbacks with return values 2018-01-01 17:31:21 +00:00
baldurk 21d5943d82 Remove dependency on Qt in qrenderdoc python module
* The main addition here apart from some extra stubs is a new rdc type
  for date time objects.
* Although the module doesn't do anything and is only used for docs
  reflection it is desirable to not have to link against Qt as this
  can cause problems when linking the module without unresolved symbols.
2017-12-27 16:05:15 +00:00
baldurk 0f94f7fef7 Fix some int/Py_ssize_t usage in container handling wrappers 2017-12-25 21:33:10 +00:00
baldurk 16804e67b4 Disable debug information in release for generated swig cxx files
* This should avoid C1128 errors.
2017-12-25 20:56:35 +00:00
baldurk a7398525b2 Add simple tab-completion in interactive python shell 2017-12-25 15:05:30 +00:00
baldurk 16f64a5ace Remove use of unnecessary swig generated .py wrappers
* These .py wrappers are relevant for the non-builtin path, but since we
  use -builtin they serve no purpose except to make things more complex.
* So instead we make the module directly exported as 'module' instead of
  '_module'.
* On windows there's no conflict because we have renderdoc.dll vs
  renderdoc.pyd. On linux it's librenderdoc.so vs renderdoc.so.
* To prevent supporting files like .lib / .pdb from conflicting on
  windows we build the python modules into a subdirectory. They're not
  ever used by the UI (it links in the bindings directly).
2017-12-25 15:05:28 +00:00
baldurk 203dca8434 Split out invocation of SPIRVDisassembler into member function 2017-12-22 17:03:08 +00:00
baldurk 417a811fad Expand docstring checks to also check names of symbols in the interface 2017-12-22 14:41:43 +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 b15422f4c1 Re-arrange CMakeLists.txt a bit to separate qrenderdoc & pyrenderdoc
* Now you can build the python modules without building the full UI,
  which is mostly useful for docs builds so we can do a minimal compile
  and still generate the docs.
2017-12-19 18:05:25 +00:00
baldurk 04d38bdfe5 Add renderdoc_python.cxx to qrenderdoc module build
* This is needed for rdcarray template instantiations, otherwise there
  are unresolved linker errors.
2017-12-19 18:02:07 +00:00
baldurk 0b3d56f9f9 Ensure python global shutdown after context has closed 2017-12-19 17:32:12 +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 03a0a06f60 Remove use of itoa (not portable) 2017-12-15 18:12:01 +00:00
baldurk cc442b7aee Fix compilation of python modules on windows and rename generated files 2017-12-15 17:33:51 +00:00
baldurk 53e669748e Add emulation of python list functions/interface in rdcarray bindings 2017-12-13 22:43:05 +00:00
baldurk 0b527fab49 Use rdc types instead of Qt containers in public QRenderDoc interface
* This is to support python bindings - the pyside implementation of
  QVector, QString, etc is not available to SWIG, so SWIG treates these
  all as opaque types.
* Rather than trying to set up bindings that work for rdcarray and
  QList/QVector, or implementing separate bindings, we instead just say
  that the public interface must use the rdc types. In most cases they
  seamlessly convert to/from Qt types anyway.
* In a couple of places we use an array of pairs instead of a map. In
  future we probably want an rdcdict or rdcmap with proper dict bindings
  in python.
2017-12-13 22:43:01 +00:00
baldurk dde3a21e67 Add helpers for constructing structured objects from primitives/QVariant 2017-11-29 19:01:21 +00:00
baldurk 24ef5807e7 Ignore new append function in SWIG 2017-11-27 20:59:41 +00:00
baldurk 5564e8b263 Open shader source from resource inspector 2017-11-22 19:11:28 +00:00
baldurk c860d8baa3 Fix uninitialized variable warnings from static analysis
* Reported by Coverity Scan
2017-11-22 11:31:07 +00:00
baldurk 134f7c8ffe Enforce python bindings rdcarray instantiations, and add missing ones 2017-11-20 20:01:03 +00:00
baldurk b8777b3f82 Update to use latest renderdoc SWIG fork, with new improvements
* Enums are now proper python enums instead of just being a class with
  static int members.
* Fix a refcounting issue with SWIG generated code to access nested
  child structs.
2017-11-20 20:01:02 +00:00
baldurk 657c343ac8 Support multi-line input in the python shell 2017-11-20 20:01:02 +00:00
Cory Bloor 58b628ee8b Fix unused variables
In almost all cases these can be removed. The only exception is in
ShaderViewer.cpp, where regIdx should have been used.
2017-11-18 00:17:06 +01: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 6937756618 Add new structured data, that will be used to expose serialised values
* We have some special handling to allow SWIG wrapping of these types:
  SDFile owns the chunks and buffers within, and each object owns its
  children. Copying is disallowed except from SWIG where we assume the
  wrapper is handling lifetime management for its objects externally.
2017-11-03 16:19:45 +00:00
baldurk 9db71b803a Change python wrapping of arrays to be more pythonic, by reference
* Previously we would convert from python to C++ arrays immediately by
  copying, and vice-versa convert TO python immediately by creating a
  new python list by copying.
* This however behaves rather poorly in common situations, e.g.:
  > foo.bar.append(5)
  Would not append 5 to foo.bar, but copy foo.bar to a temporary, append
  5 to it, then destroy it leaving foo.bar untouched.
* Instead we leave the C++ array type as a pointer for as long as we can
  and instead implement the python sequence API as extensions/slots that
  work in-place on the original array.
2017-11-03 16:19:41 +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 8c74c92079 Move docstring check from fatal-onstart-hack to unit test run by CI 2017-10-02 15:54:23 +01:00
baldurk 3d11c502f5 Don't use SWIG_BUILTIN_INIT for passing SWIG ptrs, use SWIG_POINTER_OWN
* The former is only needed inside tp_init of a new object. Instead when
  we want to pass in and own a pointer, we use SWIG_POINTER_OWN.
* This also removes the need to pass 'self' all the way down in
  ConvertToPy which tidies up a lot of code.
2017-09-29 12:11:15 +01:00
baldurk 4a3af3e67f Let TypeConversion function handle checking input object type
* This means e.g. when we're converting a `bytes` we don't bail when it
  isn't a list.
2017-09-29 12:11:15 +01:00
baldurk 90aedf58e6 Don't error if calling ConvertToPyInPlace on bytes object 2017-09-29 12:11:15 +01:00
baldurk e88f00d7c7 Remove argout typemap as it's no longer needed and applies wrongly often 2017-09-29 12:11:15 +01:00
baldurk 6759d975b0 Add conversion typemaps for fixed-size arrays in python 2017-09-29 12:11:14 +01:00
baldurk 6082c7da55 Remove use of bool32 in CaptureOptions struct. 2017-09-29 12:11:14 +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 3b02ea0a3b Turn off tracing after execution finishes
* This means the tracing isn't still lingering around when we shutdown
  and the context is destroyed.
2017-09-11 20:23:55 +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 fbd1c40654 Add python typemap handling for rdctype::pair 2017-08-31 18:34:19 +01:00
baldurk ef84f494a2 Add a macro that enables qt-compatibility in the renderdoc replay API
* This will be used to remove the ToQStr everywhere (where it's not
  used for actual stringification of enums/structs)
2017-08-16 18:28:11 +01:00