Commit Graph

869 Commits

Author SHA1 Message Date
baldurk 07d7bbc1ae Add tests for buffer format parsing 2022-05-20 14:15:31 +01:00
baldurk 6b133b437c Account for specified struct padding in final root struct 2022-05-20 14:15:31 +01:00
baldurk 7acde16d1e Improve parsing of pointers in buffer formats 2022-05-20 14:15:31 +01:00
baldurk 8ab61370a9 Make blank parse result more consistent 2022-05-20 14:15:31 +01:00
baldurk d2c557a1ae Pick better packing defaults for APIs where we know what is expected
* For vulkan any packing can be legal so we don't pick a default, but at least
  for D3D and GL the type of buffer implies a packing.
2022-05-20 14:15:31 +01:00
baldurk 31feedd16d Remove ShaderConstantDescriptor, inline into ShaderConstantType
* This struct was redundant isnce it was only ever used in the type and not
  meaningfully accessed directly.
2022-05-20 14:15:31 +01:00
baldurk 8c6192d5bd Copy catch.hpp into qrenderdoc and run on --unittest in non-release 2022-05-20 14:15:31 +01:00
baldurk 2d8687e28e Show parse errors on the line they occur 2022-05-20 14:15:31 +01:00
baldurk 3908082bd6 Improve python docstring checks
* We need to check for getsets having duplicate docstrings, and ignore
  docstrings being duplicated between members of different structs.
2022-05-20 14:15:30 +01:00
baldurk abe645f031 Add support for saving and loading structure definitions 2022-05-20 14:15:30 +01:00
baldurk 4bb54d00dd Show visible offsets and (optionally) padding in buffers. Closes #1664 2022-05-20 14:15:30 +01:00
baldurk 5ac9de0a20 Show truncation in fixed variables explicitly instead of showing 0s 2022-05-20 14:15:30 +01:00
baldurk 43fa3cd94b Use BufferViewer for viewing constant buffers
* Unifying these views means that constant buffers have all the same
  reformatting and it avoids having multiple paths for what is now effectively
  the same control (a buffer can either have fixed data, repeating data, or
  both)
2022-05-20 14:15:30 +01:00
baldurk fcdcc9714b Implement export options for fixed items in buffer view 2022-05-20 13:37:27 +01:00
baldurk a36516c8a5 Explicitly handle unbounded arrays and display declared fixed vars
* GL and Vulkan allow buffers to have fixed variables before a trailing AoS
  unbounded array. These fixed variables can't be easily displayed in a table
  and previously we skipped them. Now we display these in a tree format.
* We also support formats which don't have an unbounded array at all and display
  these just with the tree. This will allow the BufferViewer to subsume the
  capabilities of the ConstantBufferPreviewer (though it needs to handle opaque
  non-buffer-backed variables, and slot-following).
2022-05-20 13:37:26 +01:00
baldurk d0720fe787 Allow a [[pad]] annotation to specify padding elements
* These elements are consumed but not shown, so the offsets of subsequent
  elements still act as if they're there. This may be more convenient than
  specifying a manual offset on the next element or a struct size.
2022-05-20 13:37:26 +01:00
baldurk d2bbf76479 Fix struct declaration order when multiple structs use a common struct 2022-05-20 13:37:26 +01:00
baldurk 97a3943cdd Use packing rules when generating format strings for structs
* This allows the calling code to pass a hint of what packing is known or likely
  to be used, meaning less generated manual offsetting/padding when the implicit
  rules cover it.
2022-05-20 13:37:26 +01:00
baldurk 4dc7b3f8b7 Process packing rules when parsing formatting strings
* Instead of having a global tight/non-tight we now let the format string
  specify the packing rules (defaulting to scalar - i.e. tight packing as
  before), and use the resulting properties to calculate packing.
2022-05-20 13:37:26 +01:00
baldurk 7abe72be6b Add a function to estimate packing rules based on members
* This is primarily for GL/VK where the packing rules are not pre-defined and
  are also not explicitly reflected, so we instead see what rules are broken
  along the way to get the most conservative ruleset we can (that way minimising
  the need for manual offset decorations)
2022-05-20 13:37:26 +01:00
baldurk 43fda618f3 Add a packing rules struct to contain important packing rules
* There are several different API packing rulesets - GL has std140 and std430
  (and packed/shared, which is implementation defined but is likely to be
  similar to one of these or more conservative), VK effectively has rules for
  those both, as well as scalar packing which is close to C packing. D3D has one
  ruleset for cbuffer packing similar to std140, and effectively scalar for
  structured resources.
* These rulesets are quite similar and only differ by the properties here. There
  is one exception in the handling of empty structs - but in GLSL these are
  illegal so we will take the HLSL interpretation and always treat them as 0
  bytes.
2022-05-20 13:37:26 +01:00
baldurk cee4b25b28 Allow specifying offsets and struct strides manually with offsets
* Use these when generating buffer formatter strings instead of declaring manual
  padding variables.
2022-05-20 13:37:26 +01:00
baldurk 91f530f039 Parse out annotation name and parameter explicitly 2022-05-20 13:37:26 +01:00
baldurk a42f9edc3a Add annotation for binary view 2022-05-20 13:37:26 +01:00
baldurk 0890afd70e Specify rgb, hex, unorm/snorm and format packing as annotations 2022-05-20 13:37:26 +01:00
baldurk 01d9c6698b Add flags for format-intepreted packed types 2022-05-20 13:37:26 +01:00
baldurk cb49f21f2a Support enums in buffer formatter 2022-05-20 13:37:26 +01:00
baldurk 2399c9d136 Add support for bitfield packing in the buffer viewer formatting 2022-05-20 13:37:25 +01:00
baldurk cef00a102b Add struct VarType and combine flags into single field
* This is not a space saving right now, but allows more flags to be added
  without adding more storage.
2022-05-20 13:37:25 +01:00
baldurk 8aa0390948 Add string messages to returned result codes to display to user
* Most of the main entry points that can fail with relevant reasons now has a
  way of specifying a message to return with it. This message can be displayed
  to the user to give more information or context about an error.
2022-04-26 16:21:54 +01:00
baldurk 7b4f535663 Refactor watch variables to support complex types including structs 2022-03-07 18:45:57 +00:00
baldurk fcdea67879 Update copyright years to 2022 2022-02-17 17:38:32 +00:00
Remi Palandri d1858f4479 add support for VK_QCOM_FDM_offset 2022-02-14 21:02:27 +00:00
baldurk 76e273cbd4 Fix another clang warning 2022-02-03 11:13:16 +00:00
baldurk e42b0ff2ca Refactor ShaderVariable use and non-32-bit precision. Closes #2466 2022-02-02 15:00:43 +00:00
baldurk f40e1fe951 Fix docstring references to ShaderSourcePrefix 2022-02-01 00:09:35 +00:00
baldurk 3ac4bd0ebd Refactor custom shaders to abstract binding differences. Closes #2458
* Newly written shaders and any updated shaders can now use pre-defined macros
  to abstract away binding differences between APIs, so custom shaders will be
  more portable in particular shaders written in HLSL for D3D or GLSL on OpenGL
  won't break on vulkan because they refer to incorrect binds.
2022-01-31 19:14:08 +00:00
baldurk 0620a8f114 Allow customising the fixed/monospace font as well. Refs #2443 2022-01-12 11:24:22 +00:00
baldurk 089126c34b Add a new in-app API function ShowReplayUI to raise the UI window
* This is not guaranteed to work, e.g. on windows where for good reason
  background windows can't necessarily raise themselves.
2022-01-12 11:24:22 +00:00
baldurk a0d40073ce Allow customising the font family. Closes #2443 2022-01-10 17:53:18 +00:00
baldurk 33751470f2 Fix random new CI failure by setting CMAKE_CXX_STANDARD_REQUIRED 2021-11-25 12:16:45 +00:00
baldurk 966ab0a738 Add command line option to qrenderdoc to run a script with the UI open 2021-11-17 15:52:52 +00:00
baldurk d4a5592780 Add functionality to reset an edited shader to original. Closes #2334
* We also add the ability to toggle on/off the replacement being active without
  needing to intentionally add a compile error (and this also makes it more
  explicitly clear when the shader replacement is enabled or not. This could be
  useful for quick A/B testing between the edited version and the original.
2021-11-02 14:09:50 +00:00
baldurk 72af2abd7d Handle runtime/unbounded arrays in buffer viewer formatting 2021-11-01 13:53:28 +00:00
baldurk ee8c685880 Tweak docstring on performance counter viewer 2021-10-18 23:03:39 +01:00
baldurk 3324b7f86c Hide hidden/internal parameters in resource inspector 2021-10-18 17:53:08 +01:00
baldurk 6dd63c6aec Convert counter viewer to item model, sync filter with event browser 2021-10-18 14:14:36 +01:00
baldurk 73f78bd8a4 Ensure formatting tags aren't exported/put on the clipboard. Refs #2382
* When we're formatting text we want just the plain text version to be used.
2021-10-06 16:31:43 +01:00
baldurk ff40a98ac7 Specify stage for spirv-cross in case it's needed to disambiguate 2021-10-04 17:01:34 +01:00
baldurk 3fb4e230de Handle single-basic-element buffers in GL/Vulkan properly. Closes #2378
* We still need to handle multiple elements in the root of a struct specially by
  commenting out the fixed members, but the final element needs to go through
  the normal DeclareStruct() path to handle things like per-column padding in
  matrices etc.
2021-10-04 12:02:09 +01:00