274 Commits

Author SHA1 Message Date
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
baldurk b70e897838 Change workaround for visual assist bug with large raw strings in macros
* The bug seems to happen if two raw strings concatenated together are
  large enough, so instead we pass them as separate parameters to a
  different macro then concatenate them inside the macro.
2017-08-16 16:29:56 +01:00
baldurk c74c3d36bc Improve ResourceId repr/str handling, and add an int() handling 2017-08-03 19:10:41 +01:00
baldurk 09ba0b46af Add typemap for QPair 2017-08-03 17:57:24 +01:00
baldurk ee67b85b58 When we hit an exception, pass the line number of the top-of-stack
* This allows us to update the current line highlight before stopping.
2017-08-03 17:57:24 +01:00
baldurk 87ef595cce For a block invoke to another thread, safe and restore
* In future we could handle async exceptions by storing the exception
  information in a std::function derived object (instead of the separate
  ExceptionHandling that lives on the stack) and query it out in a new
  WaitForInvoke function maybe. Right now we just print the exception
  to the output log and abort the callback.
2017-08-03 17:57:23 +01:00
baldurk 1c93ee9441 If a python error has occurred, don't try to do any work, just bail 2017-08-03 17:57:22 +01:00
baldurk a11a00a7b5 Make sure Qt objects are deleted on the Qt main thread 2017-07-17 12:36:20 +01:00
baldurk 78d64449d6 Fix compilation of qrenderdoc module on VS 2017-07-05 16:29:10 +01:00
baldurk 25c72714cd Fix errors to be more friendly when converting QWidgets in python 2017-06-22 14:20:19 +01:00
baldurk ea85b5e366 Fix stub to match changed signature 2017-06-09 19:36:20 +01:00
baldurk 0b1c3725b9 Add a fallback path for opaque qwidgets if pyside2 isn't compiled in
* Even if we don't have pyside2 to treat qwidgets as full objects and
  access their methods and data, we still need to be able to pass around
  the QWidget* as an opaque pointer to be able to use the API properly.
* This change falls back to just using SWIG's default opaque pointer
  wrapping and unwrapping when pyside2 isn't available.
2017-06-09 17:02:09 +01:00
baldurk 21836c240d Don't crash on NULL pointers being dealloc'd
* The error handling code will be OK if a NULL parameter was passed in
  but during cleanup it will go through tempdealloc, so we need to check
  that the pointer is actually valid.
2017-06-09 16:57:33 +01:00
baldurk 055acb05e1 Fix an unused variable warning with python parameterless callbacks 2017-06-08 21:31:21 +01:00
baldurk ffcbf233d1 Link against python in python modules for now. Refs #639
* This really isn't ideal as it means the python module will only work
  with that specific major.minor version of python, when it could in
  theory work with any python version above 3.2 or so, depending on what
  features are used.
* Since we're not distributing these modules yet though, add this
  linking to support -Wl,--no-undefined.
2017-06-08 14:02:21 +01:00
baldurk ab432f24fc Implement the UI option for preferring monospaced font 2017-05-04 20:36:46 +01:00
baldurk 8b3c06ac67 QStringLiteral compile fix for static qrenderdoc code 2017-05-03 08:53:56 +01:00
baldurk 0ecc6ca877 Enable QT_NO_CAST_FROM_ASCII & QT_NO_CAST_TO_ASCII
* Added a couple of utility macros to help with the conversion. lit() is
  paired with tr() for untranslated text.
* QFormatStr is more explicitly for non-textual formatting strings.
* Both are just #define'd to QStringLiteral()
2017-05-02 22:58:12 +01:00
baldurk 829e1aa77e Fix handling of 'slots' Qt keyword clashing with python
* On linux without any PCH we have a slightly different case to windows
  with the PCH, so we need to be careful not to redefine the macro.
2017-04-28 19:36:09 +01:00
baldurk 1f8a93c37a Add precompiled header file use to qrenderdoc on VS 2017-04-28 18:36:55 +01:00
baldurk 8824e18b0a Search share/renderdoc/pylibs for python libs.
* This is only relevant for static qrenderdoc builds where the python
  used isn't the system python, so it needs to locate its libs.
  Otherwise the system libpython3.so and libs will be used.
2017-04-19 18:07:56 +01:00
baldurk 94e64a0aec Add build of renderdoc python modules for documentation generation 2017-04-19 18:07:55 +01:00
baldurk d51091e893 Pass in (char *) params to a couple of functions for backwards-compat
* Earlier python headers specified these parameters as char * instead of
  const char * so we get compile warnings passing in literals.
2017-04-19 18:07:53 +01:00
baldurk 5a432747c7 Don't set Py_TPFLAGS_HAVE_FINALIZE when we don't implement tp_finalize 2017-04-19 18:07:52 +01:00
baldurk 1d1b7d8c55 Fix off-by-one error converting strings
* The length returned by PyBytes_AsStringAndSize isn't the byte size
  including null terminator, but the number of bytes in the string.
2017-04-19 18:03:19 +01:00
baldurk 2a4596e06a Add python shell qt window 2017-04-19 18:03:19 +01:00
baldurk 31050d651e Batch up output callbacks, instead of calling for every write
* If it's called every write then it risks spamming the system with
  signals and locking the UI thread with constant writes. Checking and
  flushing output every 100ms is sufficient.
2017-04-19 18:03:18 +01:00
baldurk b904b28187 Add support for aborting python execution at the next traceback call 2017-04-18 14:57:50 +01:00
baldurk f0853eda9f Fix exception fetching and passing through signals 2017-04-18 14:57:50 +01:00
baldurk d22da5e297 Step up python stack until we find our globals, or run out of stack
* In python globals aren't really global, they're just module-level
  variables. So to find our _renderdoc_internal we have to potentailly
  walk the stack if we're inside another module until we get to the
  globals dict we set up.
2017-04-18 14:57:49 +01:00
baldurk c3505944bd Add interactive evaluation that prints the result of a command 2017-04-18 14:57:49 +01:00
baldurk 1afeea8d4d Upgrade missing docs error msg to fatal to ensure docs aren't forgotten 2017-04-18 14:57:49 +01:00
baldurk 35f9c53486 Rename *Method to *Callback to be more explicit in the name 2017-04-18 14:57:48 +01:00
baldurk 494086f40d Rename RenderManager to ReplayManager 2017-04-18 14:57:48 +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 4c0fc8ce1d Add a specialisation for bytes objects 2017-04-18 14:57:46 +01:00
baldurk f476058567 Pull the ultimate parent pipeline object to the top of any docs page 2017-04-18 14:57:46 +01:00
baldurk 35ae996a34 Check docstrings in the qrenderdoc bindings as well 2017-04-18 14:57:44 +01:00