Commit Graph

8971 Commits

Author SHA1 Message Date
baldurk c8a518f05c Refactor rdcstr with small-string and literal-string optimisations
* rdcstr no longer inherits from rdcarray, it implements all functionality
  itself.
* There are now three representations:
  - Heap-allocated, same as how rdcarray behaves.
  - Local-allocated, for small strings we store them in a union array.
  - Compile-time literal, only created from user-defined literals.
* The main observation is that a lot of RenderDoc's strings are compile-time
  literals either from struct names, member names, or stringified enum values.
  Storing these directly and allowing them to be moved and copied quickly saves
  on allocations and time. When the string is modified, it's copied to one of the other formats.
2019-05-15 14:12:17 +01:00
baldurk fb333ebc9b Remove 'using std::map'
* This will make it easier to replace std::map in future
2019-05-15 14:12:17 +01:00
baldurk 95e63cb965 Remove pending-dirty operations, mark resources dirty immediately
* Now that the dirty list is only read once at the start of the frame we can
  mark resources dirty mid-frame freely and don't have to defer that. The
  internal resource manager locking prevents us from adding to the list while it
  is being modified.
2019-05-15 14:12:17 +01:00
baldurk ce92ba70d1 Revert accidental change to GL_Simple_Triangle test 2019-05-15 14:12:17 +01:00
amhagan 8a4f7c918b Fix VK_EXT_full_screen_exclusive functions
Hook up AcquireFullScreenExclusiveModeEXT, ReleaseFullScreenExclusiveModeEXT,
and GetDeviceGroupSurfacePresentModes2EXT functions.
2019-05-15 06:09:16 -07:00
baldurk 3791dee78d Fix 32-bit compilation 2019-05-14 20:45:04 +01:00
baldurk 1df6fd9c9d Don't crash if SSBO has no members 2019-05-14 18:16:38 +01:00
baldurk 2f574b57c2 Don't print debug messages while trying to link initial contents program 2019-05-14 18:16:10 +01:00
baldurk d3d5d63b2a Add tests of awkward lifetime edge cases for resources on all APIs
* This is primarily around initial states - either a resource which is from a
  previous frame and maybe wasn't dirtied and needs initial states created for
  it when it's modified mid-frame, or a resource that's created and destroyed
  all within one frame.
2019-05-14 17:13:29 +01:00
baldurk af14d2f0ce If a program is linked mid-capture, inject new initial contents chunk
* This is only intended to handle the case where a new program is created mid
  frame and linked for the first time, and we need the initial contents chunk to
  get location translation among other things. We don't yet handle programs
  being re-linked multiple times mid-frame.
2019-05-14 17:13:23 +01:00
baldurk d3d85fff1f glUniformBlockBinding should be serialised mid-frame only, not in init
* glUniformBlockBinding can be changed at runtime and previously pushing all
  instances of it into the resource record means it would be overwritten by any
  bindings retrieved by the initial contents. That's fine (if redundant) if they
  aren't changed afterwards, but if they are changed then this will be wrong.
2019-05-14 17:13:23 +01:00
baldurk 73a909995a Fetch program used in pipeline when checking drawcall safety 2019-05-14 17:13:22 +01:00
baldurk 0f09aba456 Mark programs as frame referenced in glUseProgramStages 2019-05-14 17:13:22 +01:00
baldurk 8e2b608975 Snapshot descriptor set Resource IDs when preparing initial states
* If we only copy the slot contents without converting Vk* handles to IDs then
  we run the risk that the resource will be deleted and re-allocated mid frame
  before we do that at serialise time.
* Instead we fetch IDs immediately and serialise as IDs, then look up the
  handles on replay
2019-05-14 17:13:22 +01:00
baldurk 0ae245c4a8 Refactor initial state callbacks to always allow deleted resources
* Instead of passing the resource handle itself to GetSize_InitialState or
  Serialise_InitialState, we pass the Id, ResourceRecord, and prepared initial
  contents. All of these can survive past the destruction of the resource.
* Removes the need for AllowDeletedResource_InitialState() - it's always allowed
  now.
* Need_InitialStateChunk is also refactored but it's only used on D3D11
  currently and potentially will be removed in future.
2019-05-14 17:13:22 +01:00
baldurk 4d91a6b90c Optimise size of D3D11ResourceRecord by removing rarely used pointers
* If deferred contexts map a resource they'll incur a vector resize the first
  time.
2019-05-14 15:30:55 +01:00
baldurk 0fd6b0c546 Remove forced initial states for resources
* This was used for two things:
  - UAVs on D3D11, which we can just mark dirty at creation as we do
   with things on D3D12/Vulkan where we know we'll always want initial
   states.
  - Texture views/Texture buffers on GL, where we check if the texture
   was referenced and force initial states for the underlying data
   store. This requires a bit more work but can still be achieved by a
   GL-specific force-inclusion pass on the frame references.
2019-05-14 15:30:55 +01:00
baldurk ada97bf7bd Only reference dirty resource list at capture begin time. Closes #1309
* The problem with trying to keep the list of dirty resources identical at the
  start and the end of the capture is that resources being deleted or dirtied
  mid-frame causes problems. For the latter we have 'pending dirty' ugliness,
  for the former we weren't properly handling it in all cases. Instead just
  prepare initial contents from dirty resources, then use the list of resources
  that had initial contents prepared to determine which should be saved.
* This means resources freed mid frame are fine, as long as we hold onto their
  resource records and initial contents which we do. It also means the pending
  dirty handling can be removed and we can just dirty resources as soon as we
  want - it will be ignored mid-frame and apply to subsequent frames.
2019-05-14 15:30:55 +01:00
baldurk 9d4b9034c5 Don't try to look up current texture bind state for proxy textures 2019-05-14 15:30:55 +01:00
baldurk fe2aaa60dc Handle stencil-only backbuffers 2019-05-14 15:30:55 +01:00
baldurk 886c20f580 Allow creating initial states for any resource type when necessary 2019-05-14 15:30:55 +01:00
baldurk 077d95e05a Fix applying program pipeline initial states
* We need to update our internal tracking, and handle GL's non-ordered shader
  bitmask.
2019-05-14 15:30:55 +01:00
baldurk 13ed3dfe0e VAOs and FBOs shouldn't mask the reference type to read only 2019-05-14 15:30:54 +01:00
baldurk a8694e6a27 Mark resources as written when their state changes
* This forces initial state snapshotting creation even if initial states weren't
  saved for the resource initially.
2019-05-14 15:30:54 +01:00
baldurk a01cd2c37b Mark containers like VAO or XFB as written on implicit buffer binds 2019-05-14 15:30:54 +01:00
baldurk e73bb1ff94 If a glBufferData call on replay resizes a buffer down, don't allow it 2019-05-14 15:30:54 +01:00
baldurk 3690e8908a Sync to GPU when fence is signalled on a queue
* Dynamic descriptor writes that happen after a fence sync must be synchronised
  against the work on queues. Since we don't capture CPU-waits on fences we need
  to sync on the signal.
2019-05-14 15:30:54 +01:00
baldurk 5a18717b6e Add D3D12 helper to set descriptor table parameter offset 2019-05-13 19:07:23 +01:00
baldurk 37d3320847 Don't process split of an empty string 2019-05-13 19:07:23 +01:00
amhagan 4f06af0eb3 Add HDR Extensions
Add support for VK_AMD_display_native, VK_EXT_full_screen_exclusive, and VK_EXT_hdr_metadata.
2019-05-13 10:50:33 -07:00
baldurk 652e77c2f9 Always create proxy buffers on D3D11 as just VB and IB
* We don't use proxy buffers for anything else so it's safe to ignore other
  creation flags. This way we don't get problems with more flexible APIs like
  vulkan allowing buffer usage combinations that are illegal on D3D11.
2019-05-10 23:51:08 +01:00
baldurk 4520dcbaa2 Adjust offset used in VB string if there was padding bytes 2019-05-10 23:50:32 +01:00
baldurk 3b5dec17fc Reset pack state, not unpack state, when fetching texture data 2019-05-10 18:25:48 +01:00
baldurk 301e3b0b3a Handle FRONT_AND_BACK in our emulated backbuffer FBO remapping 2019-05-10 18:25:48 +01:00
baldurk 4582056de0 Avoid calling glCopyImageSubData on Qualcomm as some drivers have bugs 2019-05-10 18:25:48 +01:00
Alex Vakulenko ca2307e34c Make it possible to write chunks larger than 4 GB
Added a special chunk flag indicating that chunk size is a 64 bit value.
This allows to handle larger chunks (which heppens quite rarely) while
still maintaining backward compatibility with the majority of traces.

Bumped RDC file version of 0x101 (1.1) to make sure older version cannot
read the new file format.
2019-05-10 10:25:26 -07:00
baldurk cfa5dd3ea5 Add more specific errors if DLL injection fails 2019-05-08 14:11:15 +01:00
baldurk bd85073bb7 Fix tests using old CreateHeadlessWindowingData() function 2019-05-08 14:11:15 +01:00
Aaron Hagan 36102f6ccc Add Vulkan SDK 1.0.106 Header Files
Added 1.0.106 vulkan header files and renamed the following enums and structures.

sname:VkPhysicalDeviceShaderDrawParameterFeatures -> slink:VkPhysicalDeviceShaderDrawParametersFeatures;
sname:VkPhysicalDeviceBufferAddressFeaturesEXT    -> slink:VkPhysicalDeviceBufferDeviceAddressFeaturesEXT;

etext:VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETER_FEATURES -> ename:VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES;
etext:VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES      -> ename:VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES; etext:VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES_KHR  -> ename:VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES_KHR;
etext:VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_ADDRESS_FEATURES_EXT    -> ename:VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT.
2019-05-07 09:34:37 -07:00
baldurk 5c28bd0a31 Add a parameter to allow saving RGB PNGs 2019-05-06 15:57:02 +01:00
baldurk 7db90232f9 Allow creating completely headless outputs and reading back their output
* This is useful when writing automated tests that want to test the output of
  rendering which only happens to outputs, such as mesh rendering, or could
  potentially be bypassed with direct readback like GetTextureData vs rendering
  a texture.
2019-05-06 15:52:43 +01:00
baldurk ad038ff3e0 Add a log message when running as administrator 2019-05-06 12:25:31 +01:00
baldurk 7ca902f2e5 Handle fences in D3D11's IdentifyTypeByPtr. Closes #1374 2019-05-06 11:29:51 +01:00
baldurk 60a4877c68 Add test that aliased entry points on GL are recorded faithfully 2019-05-03 12:32:44 +01:00
baldurk a42220a035 Add helpers to set/push/pop markers on GL 2019-05-03 12:27:21 +01:00
baldurk 2ae29bbecb Try to avoid crashing if a failed map is used mid-capture 2019-05-03 11:37:17 +01:00
baldurk cd9ab1c9db Add test of GL_Buffer_Updates 2019-05-03 11:36:34 +01:00
baldurk 1bef46bfee Add a debugger friendly option to the python test framework
* This suppresses the use of a global try/except to catch exceptions then log &
  continue. Instead it runs the test and lets the debugger catch any exceptions
  that happen.
2019-05-03 11:13:52 +01:00
baldurk a32bbb8232 Fix version check for GLES 1.x. Refs #1372 2019-05-03 11:08:46 +01:00
baldurk b680d74efd In python tests allow comparing RGB and RGBA PNGs
* We force the missing alpha channel to full 255 on all pixels.
2019-05-03 11:00:59 +01:00