Commit Graph

5302 Commits

Author SHA1 Message Date
baldurk ea1dbc27f9 Remove parent widget parameter from shader view/edit/debug functions 2017-04-18 14:57:48 +01:00
baldurk 35f9c53486 Rename *Method to *Callback to be more explicit in the name 2017-04-18 14:57:48 +01:00
baldurk a2a96a556c Tweak a few things in the pipeline state & config interfaces
* Remove reference out parameters that aren't a good fit for python
  bindings, and change a few names to make a better interface.
2017-04-18 14:57:48 +01:00
baldurk ceb73b85d9 Rename ILogViewerForm to ILogViewer 2017-04-18 14:57:48 +01:00
baldurk 494086f40d Rename RenderManager to ReplayManager 2017-04-18 14:57:48 +01:00
baldurk e3ef56b5a0 Remove some ancient and unused Qt Creator files 2017-04-18 14:57:48 +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 dd1e090040 Make some parameter names more verbose 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 43eb5072b4 Remove 'magic constant' use of ~0U as invalid/skip/no result.
* In python it's not as quick to get ~0U since ints aren't unsigned or
  fixed size. Adding named constants makes it easier for people to use
  the right values, and C++ users can still pass ~0U.
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 a1f2fdacbc Add std::initializer_list support to rdctype::array 2017-04-18 14:57:46 +01:00
baldurk 05d0e2eb77 Add utility functions for rdctype::pair, make_pair and cast to tuple
* make_pair is obvious, the cast to tuple allows using std::tie to split
  a returned pair into two local variables.
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 2c978ef9e9 Document Vulkan pipeline state object 2017-04-18 14:57:46 +01:00
baldurk d139eb9657 Document the OpenGL pipeline state object 2017-04-18 14:57:46 +01:00
baldurk 94b97223b2 Document the D3D12 pipeline state object 2017-04-18 14:57:45 +01:00
baldurk 362aed739b Document the D3D11 pipeline state object 2017-04-18 14:57:45 +01:00
baldurk b31725ad67 Document renderdoc_replay.h, main interfaces and free functions
* Also include some guidelines on documentation writing.
2017-04-18 14:57:45 +01:00
baldurk 61b191b501 Document the remaining non-pipeline structures in data_types.h 2017-04-18 14:57:45 +01:00
baldurk ab73425ec6 Document the shader types 2017-04-18 14:57:45 +01:00
baldurk 90d8b2bd47 Copy capture options documentation from comments in renderdoc_app.h 2017-04-18 14:57:45 +01:00
baldurk 043b47ec91 Add documentation for data types in control_types.h 2017-04-18 14:57:45 +01:00
baldurk dd75707157 Set copyright year to current year at build time 2017-04-18 14:57:45 +01:00
baldurk 99063c2401 Add entries in sphinx documentation to generate correct API autodocs 2017-04-18 14:57:44 +01:00
baldurk 83f769a2cd Document the enums in replay_enums.h 2017-04-18 14:57:44 +01:00
baldurk 35ae996a34 Check docstrings in the qrenderdoc bindings as well 2017-04-18 14:57:44 +01:00
baldurk 15d427f3d0 Check that all constants (typically enum values) are documented properly 2017-04-18 14:57:44 +01:00
baldurk b8d3efdb31 Move document checking to a C++ header file
* It's better to edit C++ source natively not in the SWIG file, and also
  clang-format can format it.
2017-04-18 14:57:44 +01:00
baldurk b2cadbfb63 Add pyrenderdoc VS project for generating python extension module 2017-04-18 14:57:44 +01:00
baldurk d746b9278c Define HandleCallbackFailure inline so we don't have it in renderdoc.i 2017-04-18 14:57:44 +01:00
baldurk 2de280d494 Use protected default constructors/destructors to hide them from SWIG 2017-04-18 14:57:44 +01:00
baldurk 694d7b6c7b Split apart renderdoc.i for better organisation 2017-04-18 14:57:43 +01:00
baldurk b33d64acac Simplify pipeline state renames with regexs 2017-04-18 14:57:43 +01:00
baldurk 6f52ef5c68 Add support for passing QWidget * to/from PySide in qrenderdoc bindings 2017-04-18 14:57:43 +01:00
baldurk a77fecf44d Wrap BlockInvoke() calls with a helper function that releases the GIL
* This means that if we BlockInvoke a python callback, we don't end up
  in a deadlock where we're holding the GIL during script execution but
  also waiting on the renderer running (which is trying to acquire the
  GIL before calling the callback).
2017-04-18 14:57:43 +01:00
baldurk cbc27222e2 Add qrenderdoc python SWIG bindings, for the stable/clean interface 2017-04-18 14:57:43 +01:00
baldurk 7a5bf26325 Add conversions for certain Qt types to/from python native types 2017-04-18 14:57:43 +01:00
baldurk 094c4164dc Refactor qrenderdoc to provide stable, clean and deliberate API
* Note, this API is still in-flux and beta, so there may still be some
  more changes before it's 'stable', and even then it will still be
  subject to some amount of change.
* This API is then exposed to python via SWIG bindings and hides
  internals that don't need to be visible, and means the actual API is
  easier to work with.
* We also use this API to reduce inter-dependencies between different
  windows that need to interact with each other at a high level.
* The naming is python/standard RenderDoc TitleCase method names, not
  Qt style camelCase methods.

# Conflicts:
#	qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp
#	qrenderdoc/Windows/TextureViewer.cpp
2017-04-18 14:57:43 +01:00
baldurk 6969b5b677 Fix refcounting and lifetime management around async python callbacks
* We need to keep a PythonContext (and its globals Dict) around while
  we still have some pending callbacks happening. So now the external
  code creates a PythonContext and then releases it when it's done, but
  the context will hang around until the global redirector object is
  destructed, which is responsible for deleting the context.
* The global redirector is deleted when a refcounting cycle is detected
  and the dict is unreachable, which only happens after the context is
  released.
* Any time a callback is passed to something and converted to a
  std::function we add a reference on the global redirector to keep it
  alive. When the callback has finished executing we remove the ref.
* This way, any pending callbacks that have been called but not finished
  or converted (queued) and not called yet asynchronously will keep the
  context object alive to be able to output, handle exceptions, etc.
* Additionally we need to detect when we're being called asynchronously
  and handle exceptions separately instead of trying to propagate up the
  call chain, because there might not be any more python code up the
  chain (e.g. the render manager calling a python callback).
2017-04-18 14:57:42 +01:00
baldurk c49670cfad Add a __str__ function for ResourceId 2017-04-18 14:57:42 +01:00
baldurk 3e1275ed50 Pass PyObject *self along with conversion functions
* We need this object to properly convert any object/pointer to a new
  python owned instance of that type.
2017-04-18 14:57:42 +01:00
baldurk c698fe194e Generalise rdctype typemaps so they can be invoked for multiple types 2017-04-18 14:57:42 +01:00
baldurk dc1ee62730 Generalise function ConvertList to ConvertInPlace
* We'll use the same function for maps and we want to be able to reuse
  the typemaps and things there.
2017-04-18 14:57:42 +01:00
baldurk ab6a868057 Don't rely on TypeName just for error messages calling python callbacks 2017-04-18 14:57:42 +01:00
baldurk 6e1ebf2978 Convert strings directly without using SWIG_AsCharPtrAndSize
* This function is optionally compiled into bindings files so it might
  not be present, there's no need to depend upon it.
2017-04-18 14:57:42 +01:00
baldurk 8c5a2ca34e Remove unused /MANIFESTDEPENDENCY option 2017-04-18 14:57:41 +01:00
baldurk 5adce29b44 Add support for documenting bindings API directly in code 2017-04-18 14:57:41 +01:00