Commit Graph
43 Commits
Author SHA1 Message Date
baldurk 856c838def Update copyright years to 2026 and fix copyright ranges
* In a previous update in 2021 many copyright ranges were truncated
  accidentally, and some files have been copy-pasted with wrong years. These
  dates have been fixed based on git history and original copyright messages.
2026-01-05 14:17:28 +00:00
baldurk 2322e165de Update copyright years to 2025 2025-03-14 18:54:37 +00:00
Aras PranckeviciusandBaldur Karlsson 02fd7ac0cd Refactor: is_exr_file checks memory buffer
All places that used is_exr_file already had first four bytes
of the file read into memory. So make is_exr_file work just
like is_dds_file does and check those bytes directly, no need
to hit stdio again.
2024-11-04 15:52:30 +00:00
baldurk 9f4f0e6aa1 Update copyright years to 2024 2024-02-12 11:04:52 +00:00
baldurk 9d39b8e1a8 Reformat code for clang-format 15 2023-09-05 11:02:08 +01:00
baldurk 7c6b4633df Don't report unsupported file types as 'corrupted' captures
* This adds a specific error message if even the magic number doesn't look like
  a supported file type.
2023-06-23 18:53:41 +01:00
baldurk 1ec0606ce8 Add threading on final compression & write to file 2023-06-02 18:53:45 +01:00
baldurk d47e79ae07 Update copyright years to 2023 2023-02-01 12:23:32 +00:00
baldurk 8e4ae67929 Only apply D3D12Core.dll signature check to untrusted files
* UE5 at least currently (as of this commit) re-signs D3D12Core.dll by Epic.
  Rather than failing to load all such captures, only fail if the capture is
  marked as downloaded since local captures should be implicitly trusted.
2022-11-04 17:42:23 +00:00
baldurk 8aa0390948 Add string messages to returned result codes to display to user
* Most of the main entry points that can fail with relevant reasons now has a
  way of specifying a message to return with it. This message can be displayed
  to the user to give more information or context about an error.
2022-04-26 16:21:54 +01:00
baldurk fcdea67879 Update copyright years to 2022 2022-02-17 17:38:32 +00:00
baldurk 208ab0fd7d Don't seek file until after it's checked for validity 2021-04-13 16:28:08 +01:00
baldurk 026da176bb Update copyright years to 2021 2021-01-13 13:56:10 +00:00
baldurk e5f4ca7bb8 Remove use of const char * in public API and OS specific where possible
* This prevents unnecessary conversions back and forth between rdcstr and const
  char * when going through interfaces. In the OS specific layer this is rarely
  an issue because most of the implementations don't convert to rdcstr, but it
  is convenient to be able to pass in an rdcstr directly. The few cases where
  there's an unecessary construction of an rdcstr is acceptable.
* A couple of places in the public API need to return a string from a global
  function, so can't return an rdcstr due to C ABI, so they still return a const
  char *.
* Similarly const char * is kept for logging, to avoid a dependency on rdcstr
  and because that's one place where unnecessary conversions/constructions may
  be impactful.
2020-12-07 17:44:50 +00:00
baldurk 4dae8721f8 Add extra error in case of failed file I/O 2020-10-30 16:28:03 +00:00
baldurk 680857cb0f Fix structured data conversion to preserve timestamp base
* The timestamp base is queryable from the capture file and settable too, and
  conversions preserve un-rebased timestamps. Only rebasing when loading a
  capture for replay.
2020-08-27 15:54:01 +01:00
baldurk 55c62dd307 Serialise timestamps and durations as tick counts, and convert on replay
* When we're capturing programs with high-frequency enough API calls, the
  overhead of the math & extra function calls over Timing::GetTick() is
  measurable. Removing it and serialising pure tick based durations/timestamps
  and then converting on replay gives us identical results and saves time while
  background capturing.
2020-08-26 19:27:42 +01:00
baldurk 9fd7f447d2 Switch thumbnail to bytebuf instead of byte pointer and length 2020-08-26 19:27:42 +01:00
ArvastraandBaldur Karlsson 482114f6f4 Display Thumbnails for dds files. 2020-03-19 17:16:01 +00:00
baldurk 9f309be350 Print compression percentage when writing RDC files 2020-03-13 12:46:24 +00:00
baldurk 936e6372cb Remove use of 3rdparty/ prefix from includes
* We instead always have 3rdparty/ in the relevant include search paths and rely
  on that. Each library still has its own unique base dir within 3rdparty to
  clarify where the include is coming from.
2020-03-11 18:00:53 +00:00
baldurk 2916c0f9f7 Update copyright years to 2020 2020-01-06 16:20:45 +00:00
baldurk bd9f4fc389 Remove use of vector/string from core project
* This also affects the drivers via interfaces e.g. IReplayDriver and some
  utility functions.
2019-12-16 18:10:31 +00:00
baldurk f68645bddc Reduce dependencies pulled in by common.h 2019-12-16 17:06:16 +00:00
baldurk 5f72b9d53c Remove std::string/std::vector use from os-specific layer 2019-12-16 17:06:15 +00: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 9134ccdebd Include git commit hash in capture version header 2019-03-13 11:48:56 +00:00
baldurk 86ff87863e Update copyright years to 2019 2019-02-01 18:32:13 +00:00
baldurk d1f25eea0f Add extended thumbnail handling into XML codec 2018-12-17 17:10:35 +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
baldurk e305029ddd Update copyright years to 2018 2018-01-01 17:55:29 +00:00
baldurk 184e5c7f8d Change RDCDriver to enum class, don't manually stringify anywhere 2017-12-29 18:30:35 +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
baldurk 0c1d602c37 Use ToStr not an internal array for fixed section names 2017-12-20 18:01:20 +00:00
baldurk 910466ae41 Don't keep RDCFile file handle open in read-write mode when not writing 2017-12-13 22:02:05 +00:00
baldurk b418a5db6a Flush file after writing header length fixups, to ensure it's written 2017-11-27 12:38:44 +00:00
baldurk 01e2e00b5f Add error checking and handling while loading captures
* Previously once we started loading a capture we'd blindly continue
  until we loaded it (and then it's assumed to be successful), or we
  crash.
* Now errors can be reported during serialisation and bubbled up to
  abort the file load process. The next steps are to add error checking
  in each function serialise before doing any replay calls to the API
  with potentially corrupt data, and on top of that catching API-only
  errors when the serialisation is (seemingly) fine, and propagating
  those in a reasonable way.
* We also harden the serialisation a bit so that if it reads an
  obviously invalid byte length for a buffer or array count, it won't
  continue. It's still not perfect as the sizes could still be large and
  invalid but within range, but it should catch the worst cases.
2017-11-24 18:14:21 +00:00
baldurk 016bc29609 Add a tool menu item that will recompress a capture file 2017-11-17 16:33:05 +00:00
baldurk a238d3022a Move section data types into the public replay interface 2017-11-17 16:31:00 +00:00
baldurk 0b899d90b6 Add ability to replace sections in RDCFile 2017-11-17 16:30:59 +00:00
baldurk 13f4ac481e Fix incorrect arguments to error printf 2017-11-09 15:11:20 +00:00
baldurk 8a937a25d3 More errno.h fixes for OS X
* Because apparently the compiler isn't capable of giving more than one
  error at once :(.
2017-11-04 10:04:01 +00:00
baldurk f147ece4c6 Add separate handling for new RDC container format
* The new serialiser system will not handle the container file itself,
  so we've separated it out to deal in sections and stream I/O to read
  from and write to sections.
* We also add the ability to choose the compression scheme for a section
  instead of always using LZ4. LZ4 will still be used on the fly for
  fast write performance, but then RDC files can be re-compressed for
  savings offline.
2017-11-03 16:32:03 +00:00