Commit Graph
180 Commits
Author SHA1 Message Date
baldurk e48065c96b Replace use of std::pair with rdcpair wherever possible
* Only remaining uses in our code is when we're interacting with std::map where
  it uses std::pair internally
2019-05-17 16:32:56 +01:00
baldurk a965a3a703 Remove 'using std::string'
* This will make it easier to replace std::string with rdcstr in future
2019-05-17 16:32:56 +01:00
baldurk 699f8753af Convert ToStr, Serialise, and TypeName to use literal strings 2019-05-15 14:12:17 +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
Alex VakulenkoandBaldur Karlsson 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 ac7801b738 extended_thumbnail section in xml format can be in between sections 2019-05-02 10:27:41 +01:00
baldurk 636b27549d Enable support for EXT_descriptor_indexing. Closes #1111 2019-04-05 09:19:22 +01:00
baldurk 9134ccdebd Include git commit hash in capture version header 2019-03-13 11:48:56 +00:00
baldurk 4327f32667 Deserialise arrays of complex structures 2019-03-01 15:46:49 +00:00
baldurk 86ff87863e Update copyright years to 2019 2019-02-01 18:32:13 +00:00
baldurk 5854810fd4 Make timeouts in tests more forgiving for CI that occasionally fails 2019-02-01 18:32:11 +00:00
baldurk d64ad19f16 Add an optional timeout to Socket::AcceptClient
* This is needed since sometimes on tests a localhost socket won't immediately
  be available to accept()
2019-01-17 17:51:07 +00:00
baldurk b1f3515090 Differentiate chunks with empty callstacks from those without callstacks
* This is a minor distinction but helps ensure that conversions to/from other
  formats are binary identical.
2019-01-10 13:54:04 +00:00
baldurk 2e9635ff63 Add tests of stringification 2019-01-10 11:51:16 +00:00
akharlamovandBaldur Karlsson 04ca50ba63 Adding utility code for VK code generator.
ExtObject extends the SDObject structure with helper
methods.
Intervals are used for memory region tracking.

Change-Id: I38198c0a096ed838d527b6526216fb28326ebc89
2019-01-10 09:48:33 +00:00
baldurk 22f8b2ac79 Specify original Vk*Flags in structured data instead of coerced FlagBits
* We coerce the type to the FlagBits enum for serialisation so the
  stringification picks up the bits properly. However the variable is properly
  typed as just 'Flags' which is a uint32_t typedef, so manually specify its
  typename afterwards.
2019-01-09 16:27:14 +00:00
baldurk 1aa1abdf45 Don't lose base thumbnail when converting from zip.xml 2019-01-03 12:22:29 +00:00
baldurk 09207c5de0 Set structured serialisers as streaming mode
* This means that checks for array sizes won't check against an empty input
  buffer and fail.
2019-01-03 12:22:28 +00:00
baldurk d1f25eea0f Add extended thumbnail handling into XML codec 2018-12-17 17:10:35 +00:00
baldurk bba5e6ee5e Handle PNG thumbnails in XML codec (and Raw, just in case) 2018-12-07 18:19:58 +00:00
akharlamovandBaldur Karlsson a1a0b1a7ec Add ability to save .rdc file thumbnail in formats other than JPEG
By default RenderDoc saves captured frame thumbnail image as JPEG which
is lossy compression and makes it difficult to use as a reference image
for testing. Added an option to save thumbnails in different formats.

In order not to change the binary serialization format of .rdc files, if
the thumbnail format is not JPEG, a default JPEG thumbnail is still
saved in the file header as before, while the actual thumbnail is saved
as an additional chunk in the binary sections list. Older versions of
RenderDoc will just ignore this section and still use the legacy JPEG
thumbnail.

Change-Id: Icbf4fbd629719b49868fb785a656f6c7c9946ef9
2018-11-14 18:32:07 +00:00
akharlamovandBaldur Karlsson 691c115946 Prevent a crash when receiving a corrupt rdc file
It is possible to read a large value into compSize, and consequently read
a large number of bytes into m_CompressBuffer, which can only hold 64k,
which would lead to a crash.
2018-11-13 10:49:50 +00:00
baldurk 6744802a53 Add StructuredSerialiser which allows serialising to SDObjects directly 2018-10-11 14:58:48 +01:00
baldurk 35aa60218a Add DoStringise overloads for strings, needed for asserts 2018-09-03 14:12:19 +01:00
baldurk 13bff84c8e Serialise thumb separately in XML/ZIP import
* That means that if the thumb is missing we don't try and use the last buffer
  as a thumb when it's not.
2018-08-01 17:29:40 +01:00
baldurk e16d06960c Thread ID should be read from XML as uint64_t 2018-06-27 20:24:07 +01:00
baldurk ea3e2c8610 Add multiqueue support for Vulkan. Closes #373 2018-06-13 09:17:03 +01:00
baldurk 1a5b189441 [Coverity] Fix uninitialised variable warnings 2018-05-08 12:22:45 +01:00
baldurk 2402ac7fa0 Add version checking to serialiser 2018-05-04 12:51:51 +01:00
baldurk 4879f6da6e Mark which members of VkDescriptorImageInfo are valid to serialise
* We need to pass flags down from the parent struct to know, since it
  depends on the type of descriptor. This could happen in any case, but
  is most likely for templated descriptor updates where the memory that
  is referenced could be garbage.
2018-04-24 14:45:42 +01:00
baldurk beee0dccca Ensure if duration is set to be recorded per-chunk, it is at least 0
* This could be the case if no duration is provided and we defaulted to
  -1.
2018-03-02 10:41:28 +00:00
baldurk e5350505c0 Serialise all union members in vulkan structs and add Union SDTypeFlag 2018-02-28 11:51:08 +00:00
baldurk 3fe8ad4e3f Rename 'ResourceId' structured data type to just 'Resource' 2018-02-24 23:22:24 +00:00
baldurk 934800793a Improve workflow for capture import/export
* If the export doesn't need buffers, we export directly from the loaded
  capture file instead of re-loading it.
* Add progress bars for the load step so it shows what's happening
  instead of looking stalled.
* Reduce compression rate on XML+ZIP buffers as it took too long trying
  to compress when exporting large captures.
2018-02-19 00:52:13 +00:00
baldurk c1da853854 Fix test that now has FixedArray flag 2018-02-16 13:25:23 +00:00
baldurk de64755667 Add a structured data flag for fixed-size arrays 2018-02-16 09:39:46 +00:00
baldurk 9b1a937e57 Fix unit tests 2018-02-15 11:21:24 +00:00
baldurk 919c0f11dd Override type for structured data when directly serialising a ResourceId 2018-02-15 10:57:31 +00:00
baldurk 64406b47a3 Add an SDBasic type for ResourceId.
* This type is core enum and used globally (not API specific) that it
  merits becoming a specific structured data type
2018-02-15 10:21:52 +00:00
baldurk 1ee01e1f82 Apply a normalisation pass over the serialised data
* This is a backwards-incompatible change, so it's done here before v1.0
  so that we can freely break compatibility and not need to define a lot
  of ugly compatibility code.
* The primary motivation is to make the serialised data more uniform
  and have fewer special cases where the serialised form is naturally
  defined from the functions/structs in question.
* There are still some special cases or variances but they should be
  more isolated and only where really necessary.
* Remove some cases in the D3D12 struct serialising where we were
  directly serialising child struct members in the parent struct.
* We now try to match argument/struct member order as closely as
  possible.
* Serialising an array with a count no longer reads the count back out
  into that variable, counts must be serialised separately. This means
  all members/arguments are explicitly present in the structured data
  and also eliminates the awkward case where a count needed to be
  serialised separately after an array if we want to have the count be
  a valid number even if the array could be NULL. It also means we don't
  need the FIXED_COUNT() macro since array lengths can be plain values
  and don't have to be a reference type.
2018-02-14 15:57:53 +00:00
baldurk cdf72a8963 Expose an XML-only export for when the buffers aren't needed. 2018-02-13 17:16:25 +00:00
baldurk 58d10bee0f Tweak codec names 2018-02-12 20:47:56 +00:00
baldurk 80bb034315 Treat -1 as the invalid microsecond duration value, not 0
* Some functions can be so quick that they register as a duration of 0.
  This is expected and we should not end up omitting it when importing
  or exporting because we think it was missing. As a 64-bit value,
  losing a bit for signedness is not a problem.
2018-02-12 20:47:51 +00:00
baldurk 9c247a87ae Fix check that was precisely backwards. Caught by unit tests! 2018-01-26 00:06:53 +00:00
baldurk 0268ba8b66 Don't read from char[] string in writing mode 2018-01-25 10:48:56 +00:00
baldurk e305029ddd Update copyright years to 2018 2018-01-01 17:55:29 +00:00
baldurk 7a2305ae31 Change by-ref passed float or bool parameters to callbacks in public API
* Mostly used for passing a progress float back during a long blocking
  call like opening a capture or doing a copy.
* This is much more feasible for python to bind to.
* In several cases we just use a tiny lambda that updates a float anyway
  since we can't push the progress directly into a progress dialog, but
  need to let it query from a temporary in-between float.
2018-01-01 17:31:23 +00:00
baldurk 184e5c7f8d Change RDCDriver to enum class, don't manually stringify anywhere 2017-12-29 18:30:35 +00:00
baldurk ebaefc82a9 Normalise and make python/public interface more consistent
* We enforce a naming scheme more strongly - types, member functions,
  and enum values must be UpperCaseCamel, and member variables must be
  lowerCaseCamel. No underscores allowed.
* eventId not eventID or EID, and Id preferred to ID in general. Also
  for resourceId.
* Removed some lingering hungarian m_Foo naming.
* Some pipeline state structs that are almost identical between the
  different APIs are pulled out into common structs. Where something
  doesn't make sense (e.g. viewport enable for vulkan) it will just be
  set to a sensible default (in that case always true).
* Changed scissors to be x/y & width/height instead of sometimes
  left/top/right/bottom
* Abbreviations are discouraged, e.g. operation not op, function not
  func.
2017-12-22 13:02:36 +00:00
baldurk 6f0756c6dd When trying to find a section by name, try known sections names
* In theory all sections of a known type should be written with their
  proper normalised name, but just in case a capture is a bit misformed
  let's try to look it up by type.
2017-12-20 18:01:20 +00:00