Commit Graph

81 Commits

Author SHA1 Message Date
baldurk eac94b74f6 Allow cbuffer previewer to apply custom format to non-buffer-backed CBs
* This in particular means push constants and specialization constants on vulkan
  but also applies to root-value cbuffers on D3D12.
* GL bare uniforms are not feasible to expose in this way.
2021-04-14 18:59:12 +01:00
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 4bc795c344 Fix DumpObject to work with lists 2020-12-15 22:52:38 +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 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 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 36d74b32b9 Add optional output file for qrenderdoc unit tests 2020-06-11 20:06:43 +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 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 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 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 e205054317 Add UI support for GPU typed pointers in buffers 2019-11-29 13:53:44 +00:00
baldurk 8b7d23cba1 Rename SDObjectData::str member in python, to avoid confusion
* Although it's legal, the language type is 'str' so this could cause
  namespacing issues potentially
2019-11-12 20:44:35 +00:00
baldurk 6d40bbb783 Add experimental wayland support. Refs #853
* This is only lightly tested and may break heavily. It is disabled by default
 and must be explicitly enabled.
* In particular this is only known to work for Wayland use at capture time.
 Wayland on replay is still unsupported. Known issues include: EGL pbuffer
 surfaces are not implemented on Wayland, Wayland cannot get window dimensions,
 and there are hangs/failures with GL and vulkan presentation with Wayland.
2019-09-02 15:02:27 +01:00
baldurk 878acd4ad9 Add a function to enumerate which GPUs are available at replay time 2019-08-27 18:51:56 +01:00
baldurk e2704fa2eb Add an abstracted interface around android-specific handling
* This makes it easier to use the same kind of interface to manage other kinds
  of devices.
2019-07-31 17:51:13 +01:00
baldurk e48065c96b Replace use of std::pair with rdcpair wherever possible
* Only remaining uses in our code is when we're interacting with std::map where
  it uses std::pair internally
2019-05-17 16:32:56 +01:00
baldurk fbb6b23b23 Support advanced cbuffer layouts
* This includes 8/16/64-bit integers, 16-bit/64-bit floats, and scalar block
  packing
2019-02-07 15:23:06 +00:00
baldurk 6d07e1c42e Add support for VK_EXT_discard_rectangles 2019-02-05 18:40:31 +00:00
baldurk 354b37be56 Add support for VK_EXT_sample_locations 2019-02-05 18:40:31 +00:00
baldurk 94dfb9890b Allow registering window, panel and context menu items with callbacks 2018-10-23 14:23:12 +01:00
baldurk b5854f0fec Implement VK_EXT_transform_feedback, and use it for mesh output
* For pipelines using tessellation or containing a geometry shader we use
  transform feedback to fetch the output of the vertex pipeline after these
  stages.
2018-10-16 16:53:03 +01:00
baldurk 9bf00cb1a6 More natural python handling for GetDefaultCaptureOptions, return struct 2018-09-18 18:01:28 +01:00
baldurk a4dfad6e82 Add a backend query to check shader encodings BuildTargetShader allows
* This will allow the backend to specify both the native format (e.g. SPIR-V,
  DXBC) as well as a language it might be able to internally compile (GLSL or
  HLSL).
* The caller will then able to decide for itself whether it wants to compile to
  native format and pass that down, or pass the language down and let it be
  built internally.
* Currently BuildTargetShader still only accepts shader source.
2018-08-09 16:56:51 +01:00
baldurk 1761f5ab36 Highlight variables/registers that have changed 2018-06-22 19:28:33 +01:00
baldurk 52e9a6c01d Pass through line-mapping information for each instruction to UI
* This lets the UI highlight the source line as stepping happens, as well as
  allowing stepping purely in HLSL.
2018-06-22 19:28:30 +01:00
baldurk ff9f5675e9 Display high-level language locals corresponding to registers 2018-06-22 19:28:30 +01:00
baldurk 14e3a3d360 Move API-agnostic pipeline state wrapper into core interface
* There's no need for this to be in the UI, and moving it allows it to be used
  from script which is very useful.
2018-06-18 18:39:06 +01:00
baldurk 206e0f1188 Add quality-of-life/convenience accessor functions to SDObject 2018-05-24 21:42:29 +01:00
baldurk afb7ea5dab Improve python wrapping of WindowingData
* If we make WindowingData an empty struct not an opaque one, it won't leak memory
* Similarly we need typemaps to allow python to pass plain ints and have them cast to pointers
2018-05-15 19:44:17 +01: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 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 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 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