Commit Graph

13106 Commits

Author SHA1 Message Date
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
baldurk 4e5e01e739 Improve consistency in shader constant reflection
* This reports the struct vartype now, ensures that struct sizes are always
  reported and alignments are respected, along with some other fixes to more
  accurately report memory layouts of structs.
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
Jake Turner 5a722b0efa Apple: cache debugger detection
Also added check if sysctl succeeded
2022-05-20 13:36:23 +01:00
Jake Turner 1d9be38380 Apple: support for Output_DebugMon log channel 2022-05-20 13:36:23 +01:00
Jake Turner 39cdfeb138 Set s_hookObjcMethods true in MTLHookObjcMethods
PR Feedback
2022-05-18 10:17:16 +01:00
Jake Turner 814ad814cd Adopt g_* naming convention for class static's
WrappedMTLDevice
real_CAMetalLayer_nextDrawable -> g_real_CAMetalLayer_nextDrawable
nextDrawableTLSSlot -> g_nextDrawableTLSSlot
2022-05-18 10:17:16 +01:00
Jake Turner 8d7d060e63 Set nextDrawable TLS data before creating hook 2022-05-18 10:17:16 +01:00
Jake Turner 259205fdc9 Remove extra rdDescriptor variable
PR Feedback.
2022-05-18 10:17:16 +01:00
Jake Turner 00fdb79d68 Hook CAMetalLayer nextDrawable message
PR Feedback.
Replace the brittle callstack string comparison
2022-05-18 10:17:16 +01:00
Jake Turner cef722a3d8 Simplify GetObjcArray implementation
PR Feedback.
Remove optimisation of the array of pointers on the stack
resize the to array when adding a valid object
2022-05-18 10:17:16 +01:00
Jake Turner ddf56d7b0d Move DoSerialise* methods to metal_serialise.cpp
PR Feedback.
Moved from metal_types.cpp -> metal_stringise.cpp
2022-05-18 10:17:16 +01:00
Jake Turner 7f19df6a2b Refactored WrappedMTLDevice texture helper methods
PR Feedback.
Replaced NewTexture & NewIOSurfaceTextureWithDescriptor with a single combined method Common_NewTexture
2022-05-18 10:17:16 +01:00
Jake Turner 8a85d15386 Added wrapped MTLRenderPipelineState & MTLTexture
Implemented capture serialisation for APIs:
MTLDevice::newRenderPipelineStateWithDescriptor
MTLDevice::newTextureWithDescriptor

Workaround to prevent Metal capture library assert triggering on the bridge MTLTexture object, add protocol "MTLTextureImplementation" to class "ObjCBridgeMTLTexture"

Serialisation for helper types:
MTL::TextureDescriptor
MTL::RenderPipelineDescriptor
MTL::RenderPipelineColorAttachmentDescriptor
MTL::PixelFormat
MTL::TextureType
MTL::PrimitiveTopologyClass
MTL::ResourceOptions
MTL::CPUCacheMode
MTL::StorageMode
MTL::HazardTrackingMode
MTL::TextureUsage
MTL::TextureSwizzleChannels
MTL::TextureSwizzle
MTL::ColorWriteMask
MTL::BlendOperation
MTL::BlendFactor
MTL::Winding
MTL::TessellationFactorFormat
MTL::TessellationControlPointIndexType
MTL::TessellationFactorStepFunction
MTL::TessellationPartitionMode
2022-05-18 10:17:16 +01:00
Jake Turner 1fdf8fc776 Fix MTL::LinkedFunctions bug in metal-cpp.h
MTLLinkedFunctions groups is an NS::Dictionary* not an NS::Array*
ie.
@property(readwrite, nonatomic, copy, nullable) NSDictionary<NSString *,NSArray<id<MTLFunction>> *> *groups;
2022-05-18 10:17:16 +01:00
baldurk 6dfca8bc87 Ensure vkCmdSetEvent2 struct chain is properly unwrapped. Closes #2582 2022-05-11 11:31:11 +01:00
baldurk ee3e77a5a7 Only update backing store if it has been allocated. Closes #2583 2022-05-11 00:52:42 +01:00
Jake Turner f3fe008d73 Store ObjC bridge class in Wrapped C++ classes
Stored as first member data in Wrapped C++ classes (m_ObjcBridge)
Can cast WrappedMTL* C++ pointer to ObjCBridgeMTL* type to use as the ObjC bridge class
Can cast ObjCBridgeMTL* pointer to WrappedMTL* C++ type to use as the Wrapped C++ class

Removed use of term ObjCBridge except on the ObjC bridge declarations

WrappedMTLObject member initialization
Prefer member initialization instead of constructor initialization list
2022-05-10 11:36:02 +01:00
baldurk 797fbcc181 Fix friendly name of registers in cbuffer declarations in dxbc 2022-05-09 11:32:25 +01:00
baldurk 2fc0866c9f Fix display of register names for matrix source variables 2022-05-09 11:32:11 +01:00
baldurk 8d34ea577d Add some missing tooltips for event browser location buttons 2022-05-06 13:17:09 +01:00
baldurk e5000ff91b Handle source variables that map to non-existant debug variables 2022-05-04 15:47:04 +01:00
baldurk 09519c802f Add usage from trailing events in command buffers 2022-05-04 15:47:04 +01:00
kkhalid 7d68116f5d Update dxbc_debug.cpp
fix clang-CL errors : call to constructor of 'ShaderVariable' is ambiguous
2022-05-04 10:01:13 +01:00
kkhalid 229d80b439 Update win32_threading.cpp
fixing compilation errors with clang-cl:  "template specialization requires 'template<>"
2022-05-04 10:01:13 +01:00