Commit Graph

11296 Commits

Author SHA1 Message Date
baldurk 6eca4a4cd4 Cache call to FormatImageAspects 2020-08-19 14:24:51 +01:00
baldurk d0f59de405 Re-use descriptors in descriptor pool
* If an application allocates from and resets descriptor pools at very high
  frequency the overhead of freeing and reallocating those descriptor sets can
  be high. Instead use the descriptor pool as a pool for children and look up
  the freelist first for an existing descriptor set before trying to allocate a
  new one.
2020-08-19 14:24:51 +01:00
baldurk 488a9e3faf Block allocate storage for current descriptor set bindings 2020-08-19 14:24:51 +01:00
baldurk 78e2475dad Use a read/write lock for resource record access in resource manager 2020-08-19 14:24:51 +01:00
baldurk 7cc54fea20 Pass resource record into AddBindRefs when available
* This avoids a redundant call to GetResourceRecord when the caller already has
  it directly available.
2020-08-19 14:24:51 +01:00
baldurk 88c6dc27e4 Use plain array instead of set for resource record parents array 2020-08-19 14:24:51 +01:00
Thomas Poulet 7a65dba274 Fix dry-run option in CreatePipelineLibrary
This commit addresses an issue where the application is crashing when receiving nullptr in ppPipelineLibrary. As per the specifications, ppPipelineLibrary can optionally accept nullptr and perform a dry run. Since pipeline libraries are not supported, we return the driver unsupported case.
https://docs.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12device1-createpipelinelibrary
2020-08-18 14:22:30 +01:00
baldurk 466debe9a4 Clean background frame references every 20 submits
* This means the background references array won't build up even for programs
  that don't present.
2020-08-17 12:44:47 +01:00
baldurk bf8390d313 Fix docker build to work with https apt sources 2020-08-17 10:26:30 +01:00
baldurk 01e05e6d96 Cancel a rename in progress if a different resource is selected 2020-08-17 10:22:23 +01:00
baldurk 7f1748e8fc Don't misbehave when freeing or destroying VK_NULL_HANDLE 2020-08-14 19:48:21 +01:00
baldurk 2b990bdf46 Remove RightToLeft property that was accidentally added 2020-08-14 19:19:16 +01:00
baldurk e7657f6212 Use QTextBoundaryFinder to truncate resource names 2020-08-14 14:58:16 +01:00
baldurk bf2cee8bc5 Fix D3D12On7 presents not properly adding frame capturer 2020-08-14 14:58:15 +01:00
baldurk 73248c8488 Include RenderDoc logfile after test runs 2020-08-14 14:58:12 +01:00
baldurk e11c3523a6 Fix subprocess timeout not properly kicking in 2020-08-14 14:58:08 +01:00
baldurk 407b4740f2 Re-evaluate composite spec constants when data is available. Refs #1908 2020-08-13 12:27:00 +01:00
baldurk bc3f23e867 Add missing bounds check for 32-bit indices 2020-08-13 11:36:07 +01:00
baldurk aac929af8f Go back to reporting normalised vertex inputs on GL as SNorm/UNorm
* This is still accurate, what we're missing is "read data as int, then cast to
  float" which is represented by setting 'floatCast' to true. A normalized cast
  or interpret is accurately represented by saying the input is snorm/unorm
  typed.
2020-08-13 10:22:56 +01:00
baldurk 9df6103be4 Remove debug log left in 2020-08-12 15:15:33 +01:00
baldurk 61c6d88b7d Update reftype on rollover from one binding to another
* When we roll over from one binding to another due to descriptor count being
  larger than a single binding, we need to update the frame reftype since it
  might go from storage to sampled or vice-versa and so change from read-only to
  read-write.
2020-08-12 15:15:33 +01:00
baldurk d274599880 Remove IDs from background ref cache as appropriate
* This prevents the cache from growing unbounded.
2020-08-12 15:15:33 +01:00
baldurk e2e7c1f80c Add the ID for the resource underneath image views
* Without this we don't properly cache the references for images, only for
  views.
2020-08-12 15:15:33 +01:00
baldurk b0d3fb12a9 Don't perform queue submit until after flushing maps/references
* While active capturing we might do significant work to flush coherent mapped
  memory regions and prepare initial contents for postponed resources that are
  about to be write-referenced. We need to do that before submitting the actual
  work to the queue or else the contents may be corrupted.
2020-08-12 15:15:33 +01:00
baldurk 50b2964c88 Don't dirty memory on allocation, wait until a buffer is bound
* Otherwise we'll prepare and serialise contents for memory that's only used for
  images, which is wasteful at best.
2020-08-12 15:15:32 +01:00
baldurk 7f9b5d1103 Detect mapped memory writes to tiled images and skip. Closes #1863
* We track memory bindings to see which regions of a memory object are only used
  for tiled images, and discard any writes in case this was accidental detection
  of changes by the GPU which we don't want to replay. In the case of aliasing
  if there's linear and tiled resources then we still replay the writes.
* Note that we have to take a slower path involving a copy since we can't
  serialise straight into memory in this case, so applications should avoid
  mapping memory behind
2020-08-12 15:15:32 +01:00
baldurk 18689e3b89 Fix handling of deprecated debug marker object type enums 2020-08-10 16:12:40 +01:00
baldurk 6bb177ec02 Lazily create readback buffer
* This means we don't allocate a large buffer even though we won't actually use
  it. Most important for memory constrained platforms like android.
2020-08-10 16:09:32 +01:00
baldurk c456d16fc7 Avoid crash if mapped memory is changed while diffing 2020-08-10 15:28:24 +01:00
baldurk dd5f4202cf Add barrier and invalidate when reading back memory via GPU 2020-08-10 15:19:10 +01:00
baldurk 152170dc58 Fix reference data not being updated at right place after map write 2020-08-10 14:09:36 +01:00
baldurk d1c9564267 Show float casting and normalising of GL vertex attributes. Closes #2013 2020-08-10 11:19:57 +01:00
baldurk d9fc87ec2a Do our best to determine suffix for unknown file filters. Closes #1993
* We work around a GNOME bug here by ignoring a selected filter if it's the
  empty string. For all other unknown filters we try to determine the suffix on
  the fly.
2020-08-07 16:12:29 +01:00
baldurk de7030ea8c Perform descriptor copies immediately. Closes #2009
* When we changed to serialise render target descriptor contents at list record
  time we also updated all descriptor writes to happen immediately so we'd get
  the latest contents. However we didn't also update copies, so copies before
  OMSetRenderTargets weren't properly reflected.
* There's nothing that needs the 'old' copy of descriptors so we can remove any
  pending/deferring of updates and do it immediately, which also saves some
  tracking.
2020-08-07 16:05:06 +01:00
baldurk 2a138acf6c Don't call glBindFragDataLocation on GLES even if we have a func pointer
* The function is illegal to call regardless of whether we get a non-NULL
  function pointer. Core GLES doesn't support glBindFragDataLocation but
  fortunately we don't need to call it ourselves unless the user has done some
  dynamic binding - which assumes glBindFragDataLocation is available.
2020-08-07 13:39:00 +01:00
baldurk 9858f516d0 Set default precision specifiers earlier in GLES shader 2020-08-07 12:46:17 +01:00
baldurk efd2c03430 Items in initial contents list don't need to be added as written records
* Resources which aren't referenced in the frame don't need initial states
  unless we have 'Ref All Resources' enabled. These initial states can be
  stripped on replay as they aren't needed.
* We also renamed the WrittenRecords to more explicitly list that this is the
  list of resources needing initial contents, whether because they were dirty
  (and so had initial contents) or because they were written mid-frame and so
  need to be reset.
2020-08-07 12:21:05 +01:00
baldurk f29a2df82b hasData for Create_InitialState is only used on D3D11 2020-08-05 14:11:40 +01:00
baldurk 6af18a5622 Patch another form of handle string in vulkan debug messages 2020-08-05 13:22:27 +01:00
baldurk 685daffd22 Add missing barrier after filling discard pattern buffer 2020-08-05 13:00:11 +01:00
baldurk ab6fc1c4b1 Don't ever wait for idle when rendering overlay in vulkan
* Instead of waiting for idle, we allocate a command buffer per swapchain image
  to render the text overlay and use semaphores and fences to properly
  synchronise with other GPU work ongoing.
2020-08-05 12:15:36 +01:00
baldurk 0ee1209a5f Mention that Vulkan supports shader debugging in documentation 2020-08-05 11:41:32 +01:00
baldurk 9547b049e3 Update version number on in-application API documentation 2020-08-05 11:41:31 +01:00
baldurk 9f2de54521 Better reserve of written records size 2020-08-04 17:52:10 +01:00
baldurk 31b7c35bae Fix logfiles not being deleted if captured application is the last user
* Previously only the UI itself would delete the log if it was the last thing to
  close.
2020-08-04 14:48:51 +01:00
baldurk 211d8532fa Use GPU readbacks for mapped memory in PCI-E window
* On discrete GPUs that expose PCI-E window memory (device local but still host
  visible) this memory is extremely slow to read from on the CPU. It's
  significantly faster to issue a command buffer to get the GPU to copy into CPU
  memory and wait on that command buffer to finish, then read from the copy.
* We do this for detected coherent writes in queue submit, issuing the copy on
  the queue being submitted to. We do *not* do this for memory unmaps or
  explicit application flushes. This does mean those will remain slow, however
  with no queue to use the synchronisation challenges become more significant
  and most applications leave memory persistently mapped.
2020-08-04 14:48:02 +01:00
baldurk 7b1995a7ba Properly handle offsets on memory maps in vulkan 2020-08-04 13:59:45 +01:00
baldurk 27b541c6d5 Always optimise some 3rdparty code like lz4, to speed up debug builds
* We don't need to debug this code and it slows down captures a fair bit if it's
  not optimised
2020-08-04 11:22:15 +01:00
baldurk 2d47466297 Combine last write time and last partial use maps into array
* We only care about tracking two things:
  1. Resources that have been written very recently. These should not be
     postponed as there's a high chance they'll be written mid-frame and so we'd
     need their initial contents.
  2. Resources that have their last non-complete-write reference was a while ago
  However in the second case we can acceptably ignore any resources that haven't
  been written recently either, since if the resource hasn't been written and
  also hasn't been complete-written then it hasn't been used at all.
* So when updating the non-complete-write time we only do this if the resource
  has had a write reference, and intermittently we remove any resources that
  haven't had a write at all.
* Postponed resources will be exactly the same set, because we treat a resource
  as postponable if we have no write time for it at all so it's fine to remove
  old resources from the list. Fewer resources will be skipped, as we now treat
  resources that have no known age as non-skippable. However in the majority of
  these cases we expect either for the resource to not be used at all (thus the
  postpone will never be forced to prepare and we won't serialise anything), or
  else if it is used the chances are high it will be used read-only so the
  postpone will still be enough.
2020-08-03 18:30:20 +01:00
baldurk 035073fac9 When updating descriptor bind refs, cache resource references
* This means we don't have to iterate the whole bindrefs array every time we
  want to propagate references in the background, but we can submit them in
  batch.
2020-08-03 18:30:20 +01:00