Commit Graph

11309 Commits

Author SHA1 Message Date
baldurk 64f98f286e Add test of heavy descriptor reallocation and reuse 2020-08-20 13:48:17 +01:00
baldurk 077aebc9e1 Fix sanitisation of aspect mask in subresource range 2020-08-20 10:49:23 +01:00
baldurk 83714b825c Remove note about android support being new 2020-08-20 10:47:16 +01:00
baldurk a48ab556f3 Fix compile errors 2020-08-19 19:18:37 +01:00
baldurk ffac439cce Record which queries are reset in each frame & restore them to validity
* It's possible that a frame capture could copy from a query and then reset it,
  without then recording something valid into the query. Then the next replay
  the copy would be unavailable and if WAIT_BIT is set that would lead to a
  device lost.
* We already fill out queries with dummy valid data on create time, so now we
  record any queries that are reset and re-fill them with valid data again.
2020-08-19 18:02:03 +01:00
baldurk 4afc97e6dd Fix backwards assert 2020-08-19 17:57:50 +01:00
baldurk 213aded173 Fix compilation of single flush validate 2020-08-19 16:35:58 +01:00
baldurk 15f35931df Fix wrong string format specifier 2020-08-19 15:21:00 +01:00
baldurk 73cc1f5476 Add specialised rdcarray which implements key/value lookup 2020-08-19 15:21:00 +01:00
baldurk d2e0b7ceb1 Implement move semantics support for rdcarray/pair 2020-08-19 15:21:00 +01:00
baldurk babbdadc36 Cache a single value inline in ImageSubresourceMap
* Having a single subresource (range) is a common case, so avoid allocating
  storage in an array for that, only switch to the array when we have more than
  one range to store.
2020-08-19 14:24:51 +01:00
baldurk 8a350f28c8 Batch updates to background ref cache
* If the background cache is empty also (for a descriptor set that has never
  been written before) we can duplicate it straight from bindFrameRefs).
2020-08-19 14:24:51 +01:00
baldurk 0859aaa163 Change descriptor set lock to spinlock
* We don't expect contention on this, the only time it will contend is when
  actively capturing a frame between updates and submits reading the descriptor
  contents, so we penalise that case while making the background case faster -
  since a spinlock is 'free' to take when there's no contention.
2020-08-19 14:24:51 +01:00
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