Commit Graph

210 Commits

Author SHA1 Message Date
baldurk 3aaccc4fda Use rdcfixedarray in parameters for functions instead of C arrays
* This maps better to tuples in python
2020-12-15 22:52:38 +00:00
baldurk 2b0f9c2eba Use richtext representation for ResourceId when converting to string 2020-12-15 22:52:38 +00:00
baldurk 143f66478a Support converting an rdcarray pointer to rdcarray
* This means if there's no intervening list() it still works, e.g. passing an
  rdcarray property to a function paramater that expects an rdcarray in python.
2020-12-15 22:52:38 +00:00
baldurk 0163328884 Fix error messages not being printed from async python callbacks 2020-12-15 22:52:38 +00:00
baldurk 4bc795c344 Fix DumpObject to work with lists 2020-12-15 22:52:38 +00:00
baldurk afc9fc8f1e Fix verify-docstrings.py 2020-12-09 23:27:42 +00:00
baldurk 7ff7e0a71d Replace fixed C arrays with wrapper class in public interface
* These map more naturally to python tuples and are easier to wrap in and out.
* We also tidy up the FloatVecVal etc and standardise the members of
  ShaderValue.
2020-12-09 18:16:08 +00:00
baldurk 580f96c8a1 Rename ShaderVariableType/Descriptor to ShaderConstant
* These structs are no longer used with ShaderVariable so the name is misleading
  at best.
2020-12-09 15:18:27 +00:00
baldurk 659fdaa235 Check that all complex struct members that have :type: in docstrings
* Ideally we'd document every member unconditionally for best autocompletion,
  but that's a lot of modification so for now we stick to just making sure that
  any members that are struct types (or lists/tuples) have the :type:
  declaration so that we can autocomplete inside them.
2020-12-09 15:18:27 +00:00
baldurk 6b8ce92d88 Clean up docstrings in python interfaces to be strictly typed/formatted
* Also added a script that can run as part of CI to verify that the docstring
  matches, by generating a regex from the docstring documented parameter types
  and return type and making sure we find a match within the C headers. This
  ensures all parameters are documented with the right types, no extra
  parameters are documented, and the return type is correct.
* The script also checks proper scoping so that if qrenderdoc docstrings
  mention a renderdoc type, they need to scope it properly.
2020-12-07 17:44:51 +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
baldurk df6fec13f9 Remove use of automodule in docs
* One automodule in a file for our modules is way too much, so we split it into
  files. Unfortunately this means that only one file can have those classes and
  functions be linkable from elsewhere.
* Instead we bite the bullet and manually curate the items into pages, and at
  the same time subdivide the 'enums and data' page more which is a general
  readability and usability win as well.
* We also add some previously not-included functions, and add a doc-build time
  check to ensure that functions and classes aren't omitted from the
  documentation in future
2020-12-07 17:44:50 +00:00
baldurk 6f7e8bb396 Add python interface consistency check that we don't use non-class enums
* These enums are generally not preferred anyway, but they also can't have
  docstrings so can't be checked for *missing* docstrings.
2020-12-05 09:57:40 +00:00
baldurk e2d47fa1a5 Fix compilation of PythonCaptureViewer 2020-12-03 21:14:13 +00:00
baldurk 6bc4e007a0 Fix C++ invokes being responsible for destroying python callbacks
* If the last refcount on a python lambda/temp function is released when a
  wrapping std::function is destroyed in a C++ invoke, we can't destroy it
  safely. Instead we queue up that decref and process it the next chance we're
  able (which is either when the current execution finishes for a python shell
  execution, or on the next function call which handles extensions).
2020-12-03 14:55:02 +00:00
baldurk 1e1ac07a07 Allow python scripts to implement and register as ICaptureViewer classes 2020-12-03 10:44:27 +00:00
baldurk efac5ad70a Disable runtime and security checks in development builds
* This provides a decent speed boost and these have never caught any issues
  before. Asan/gflags/valgrind etc do a better job of this when needed.
2020-11-20 17:02:33 +00:00
baldurk 916c431dfa Compile fixes 2020-11-18 19:05:03 +00:00
baldurk 0aefcced95 Add a small interface into Qt widgets to our own python wrapping
* This by no means replaces PySide2, but it allows python extensions to write
  simple UIs without needing to rely on PySide2, which might not be available
  (generally all windows builds have it as well as recent binary linux builds,
  but local windows builds may not and most linux builds probably won't).
2020-11-18 18:21:20 +00:00
baldurk ab2f4e4046 Fix exception handling in wrapped python callbacks 2020-11-18 15:41:20 +00:00
baldurk 91d8c30cd3 Fix python object conversion for NULL QWidgets 2020-11-18 13:11:58 +00:00
baldurk 804fddcdf7 Allow python extensions to be loaded from app folder as well as user
* This will let us distribute extensions with the renderdoc builds.
2020-11-10 13:57:27 +00:00
baldurk caa8bb5be0 Fix incremental build dependencies in python modules 2020-10-30 16:28:03 +00:00
baldurk 05034e7b57 Ignore deprecated declaration warnings in python modules 2020-10-27 15:15:20 +00:00
baldurk 935cb113ed Add new string type rdcinflexiblestr specifically for structured data
* This is a string type which heavily optimises for immutability and minimal
  storage. It only contains one pointer to the string data and always
  reallocates on modify. For compile-time literals it doesn't modify or
  allocate.
* On x64 we use the top bit in a tagged pointer to store a flag of whether it's
  heap or literal, on other platforms it uses a separate field (meaning another
  pointer sized value effectively, including padding).
* This is best for structured data which tends to use a lot of immutable strings
  for type/name information, and only a few for actual string data (which are
  only allocated once and aren't modified after that). Similarly we rarely want
  to know only the size of any of these strings, we want the whole string so not
  explicitly storing the size is not a big deal.
* Overall this reduces SDObject from 128 bytes to 80 bytes.
2020-10-27 15:15:19 +00:00
baldurk 394896a3c9 Hide list of children completely in structured data
* This makes it easier to enforce object ownership, as well as gives us options
  for e.g. generating structure data on demand lazily.
2020-10-26 10:24:47 +00:00
baldurk d5f45f6476 Allow overriding the python install on windows
* Also document the new requirement for os.add_dll_directory as of python 3.8
2020-08-31 12:38:49 +01:00
baldurk 716c72f399 Remove custom FindPySide2.cmake, rely on normal packaging
* It seems PySide2 packaging is much more stable now, so we can generally rely
  on the distro packages.
2020-08-28 19:06:06 +01:00
baldurk 285c4b95df Add Qt5Qml.dll stub for 32-bit pyside2 distribution
* When the pyside2 we ship was built it accidentally included a small dependency
  on Qt5Qml, which we don't distribute so the pyside2 libraries wouldn't load.
* We can generate a tiny stub with the right exports and load it manually from
  the PySide2 folder on 32-bit qrenderdoc builds to allow pyside2 to load
  subsequently. The stub source is tiny, and added alongside.
* Putting it in the PySide2 folder means that even if someone puts RenderDoc's
  build folder in their PATH, our stub Qt5Qml won't break anything because it
  won't be loaded. If they put PySide2 in the PATH it might, but then it's their
  fault!
2020-08-28 19:06:05 +01:00
baldurk 36d74b32b9 Add optional output file for qrenderdoc unit tests 2020-06-11 20:06:43 +01:00
baldurk d1f4a47cd5 Add a load of MSBuild nonsense to *avoid* targeting a specific Win SDK
* Even though we don't care about the windows SDK version at all, we actively
  need to avoid the default which actively sabotages us.
2020-06-11 20:05:03 +01:00
baldurk 08cf66abce Fix racing busy signals when connecting to remote servers 2020-05-15 19:03:26 +01:00
baldurk e90461c065 Fix incorrect check in DumpObject helper 2020-04-23 19:14:08 +01:00
baldurk 91de355955 Add a helper to dump objects with dir() and bypass swig's repr 2020-04-17 17:32:57 +01:00
Steve Karolewics 1137c4694c Make D3D12Pipe root element centric instead of shader centric
D3D12Pipe now stores an array of root elements, each one corresponding
to a root element or range in the root signature. Migrated usage in the
D3D12 pipeline state viewer and PipeState retrieval of resources.
Restricted number of resource array textures displayed in the texture
viewer to prevent app hangs.
2020-04-08 18:38:38 +01:00
baldurk d408f77241 Add configuration system for core renderdoc module
* This allows persistent config storage and registering tweak variables that
  works independent of the UI's configuration.
* Config vars can be debug only, which means they will be compiled out in stable
  version releases. This allows for debug-logging tweaks that are available in
  all builds (including nightly builds) for diagnostic purposes, but have zero
  overhead in stable releases.
* Variables have a loose hierarchy defined with _ or . to separate nodes.
2020-03-18 17:34:59 +00:00
baldurk 14dc2a57f6 Fix refcounting on python traceback object 2020-03-06 17:56:27 +00:00
baldurk 7d4685fc17 Fix exception catch-and-rethrow in extension BlockInvoke. Closes #1721 2020-02-13 11:01:45 +00:00
baldurk 661ee35f30 Refactor ShaderDebugTrace to not return a single list of complete states
* The ShaderDebugTrace now only sets up the initial state of an opaque
  ShaderDebugger handle.
* This handle can then be passed to a new function - ContinueDebug - to
  iteratively return N more states. The number of states is implementation
  defined and may be a fixed number or it may run for a fixed time.
* The states themselves no longer contain a complete snapshot of all variables,
  but instead only the changed variables for that iteration. The changes are
  stored as before and after value to make it easier to step forwards and
  backwards (only the ShaderDebugState is needed to move forward or backwards,
  you don't have to search back for the last set value of a variable to 'undo' a
  change).
2020-02-06 17:58:42 +00:00
baldurk 66cebe0a4c Refactor shader debug trace to have single mutable variable array
* Moving away from 'registers' explicitly being stored, we now have a single
  variable array where the shader representation is responsible for allocating
  it.
* In DXBC we calculate the number of each type of mutable variable (temps,
  indexable temps, and outputs) and assign slots linearly.
* We also update some naming - high-level variables aren't "locals" since they
  could be globals too, and debugging variables aren't "registers" but simply
  the variables we use for debugging which may be more complex than float4 for
  other APIs.
* The local variable matching by string name is unnecessary for this change
  but will be more useful in future after further refactors where there isn't
  a single list of variables to index into at the upper level.
2020-02-06 17:58:41 +00:00
baldurk c43d9146a9 Use globbing to get dependencies for swig builds
* Fixes a warning in VS2019 from stale warnings and should mean rebuilds are
  more accurate too.
2020-01-06 16:25:34 +00:00
baldurk 2916c0f9f7 Update copyright years to 2020 2020-01-06 16:20:45 +00:00
baldurk 93b0d65726 Override new/delete for structured data objects to go through our allocs
* Otherwise if structured data cross a module boundary the (de)allocation could
  fail.
* We also ban new/delete for structs that don't need it
2019-12-17 14:51:11 +00:00
baldurk 14d01ff995 Remove support for serialising STL types, remove STL interop 2019-12-16 18:10:32 +00:00
baldurk 25536836b6 Split up renderdoc_replay.h header further 2019-12-16 17:06:15 +00:00
baldurk ec7a852582 Refactor and improve rdcarray/rdcstr interface
* We are going to replace all std::string/std::vector use with these.
2019-12-16 17:06:15 +00:00
baldurk 8e21b28785 Split basic_types.h into separate independent headers 2019-12-16 17:05:11 +00:00
baldurk 6d1d302491 Fix a number of warnings identified by higher clang warning levels
* We enable a couple of high signal-to-noise warnings in all clang builds
2019-12-02 20:41:28 +00:00
baldurk ff08748238 Ensure all files have trailing new-lines and enforce with clang warning 2019-12-02 20:28:05 +00:00
baldurk e205054317 Add UI support for GPU typed pointers in buffers 2019-11-29 13:53:44 +00:00