Commit Graph

13130 Commits

Author SHA1 Message Date
baldurk c5a588d2e4 Fix texture-as-buffer view format string generation 2022-05-23 14:43:08 +01:00
baldurk 6db5e339bb Handle external queues properly when doing coherent memory readback 2022-05-23 13:56:05 +01:00
baldurk b0fce7c8cc Zero-initialise query struct 2022-05-23 13:56:05 +01:00
baldurk e925688913 Fix use-after-free when freeing vulkan postponed memory. Closes #2573 2022-05-23 13:56:05 +01:00
Jake Turner 362d1a46b3 Change serialization name for RDMTL structs
Changed from "RDMTL::TYPE" -> "MTLTYPE" to better match the Metal type name
Rename RDMTL::FunctionGroups -> RDMTL::FunctionGroup
2022-05-23 10:23:42 +01:00
Jake Turner cb98a133bf Use RDCMTL descriptor structs C++ wrapped APIs
Create the RDCMTL descriptor struct in the ObjC hook and pass it to the C++ wrapped APIs
ie.
WrappedMTLDevice::newTextureWithDescriptor takes a RDMTL::TextureDescriptor &
WrappedMTLDevice::newRenderPipelineStateWithDescriptor takes a RDMTL::RenderPipelineDescriptor &

This means the wrapping and unwrapping of resources in the descriptor structs is handled by the conversion methods for the structs
2022-05-23 10:23:42 +01:00
Jake Turner 3baa24407a Initialize member variables in the RDMTL structs
Match the default values set when the Metal versions of the structs are initialized
2022-05-23 10:23:42 +01:00
Jake Turner d1c5db388a Tweak METAL helper macros
METAL_NOT_HOOKED
Get class name directly from self pointer instead of getting the class type from self and then the class name from the class type
Change the log to be an RDCERR instead of an RDCWARN

METAL_NOT_IMPLEMENTED_ONCE
Change the log to be an RDCWARN instead of RDCDEBUG to match METAL_NOT_IMPLEMENTED macro
2022-05-23 10:23:42 +01:00
Jake Turner 3794f63636 Call real MTLCommandBuffer::enqueue from the hook
Fixes infinite loop if application calls MTLCommandBuffer::enqueue
2022-05-23 10:23:42 +01:00
baldurk 225b6001d2 Reference bool via lowercase bool not Bool 2022-05-20 17:57:16 +01:00
baldurk d7404bb66d Fix missing newline in docs code snippet 2022-05-20 17:00:47 +01:00
baldurk a1abc95ac2 Remove use of QStringView from newer Qt versions 2022-05-20 16:43:09 +01:00
baldurk d103d31f55 Don't replay past end of indirect draws on vulkan. Closes #2590
* If the popmarker inserted at the end of an indirect multi-draw is selected
  this points past the end of the normal draws, but we don't want to replay that
  extra draw.
2022-05-20 15:51:01 +01:00
baldurk 601ed78771 Fx mac ssh host signature for new server 2022-05-20 15:48:21 +01:00
baldurk 90accaef67 Add usage from trailing events in command buffers on D3D12. Closes #2589 2022-05-20 14:48:21 +01:00
baldurk cef5aa857b Avoid declaring redundant structs for anonymous GL structs 2022-05-20 14:15:31 +01:00
baldurk 8566d55650 Add missing value check in GL_CBuffer_Zoo 2022-05-20 14:15:31 +01:00
baldurk e4751e66f3 Update docs for buffer viewer changes 2022-05-20 14:15:31 +01:00
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 d6c7bbb90d Remove appveyor integration from catch 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 949165d739 Split mesh and buffer viewer documentation up
* There's no reason to make users aware that the mesh viewer and buffer viewer
  are implemented in a common way, they are very different and should be
  documented separately.
* This hasn't updated the buffer viewer documentation with the recently added
  features.
2022-05-20 13:37:26 +01:00
baldurk ac886728ca Don't use docking UI for raw buffer viewer mode 2022-05-20 13:37:26 +01:00
baldurk 788b408bc2 Add test for GL reflection & reconstruction of runtime arrays 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