Commit Graph

6310 Commits

Author SHA1 Message Date
baldurk a36d379360 Change D3D11 replay initialisation to new system with RDCFile* 2017-11-07 19:30:42 +00:00
baldurk d41eeb432d Change D3D11 Chunks to enum class, improve names & use ToStr 2017-11-07 19:30:41 +00:00
baldurk f419723160 Update serialisers of D3D11 structs to new format, in split out file 2017-11-07 19:30:40 +00:00
baldurk d33b3f5940 Re-enable DXGI driver 2017-11-07 19:30:39 +00:00
baldurk 5024fd0f35 Update DXGI project to latest code 2017-11-07 19:30:39 +00:00
baldurk b36a0decdf Change LogState to CaptureState and add more intuitive helper functions 2017-11-07 19:30:38 +00:00
baldurk 2a4612b92e Update win32 thumbnail shell extension to use RDCFile to fetch thumbnail 2017-11-07 19:30:37 +00:00
baldurk 536c467b46 Convert remote server to new serialisation and replay initialisation 2017-11-07 19:30:37 +00:00
baldurk b992e95f94 Update replay proxy to use new serialisation mechanism 2017-11-07 19:30:36 +00:00
baldurk 9388d2b71b Change core capture code to be more centred around container handle
* When opening a capture file, a format is now available to allow
  easy import from another format without a completely different
  interface. Only rdc files can be replayed, but any other file can
  load and access structured data through the same interface.
* The replay initialisation and capture writing interfaces also use the
  RDCFile instead of passing filenames or Serialisers around directly.
  Driver initialisation parameters are now entirely private, and don't
  need to be exposed - any agnostic metadata like thumbnail, driver, etc
  are all accessed via the RDCFile container itself.
* Callstack resolution is now part of the container file, not the
  back-end via way of its Serialiser.
* Importers/Exporters to other non-RDC formats are registered in a
  similar way to replay/remote drivers.
* It is also then possible to construct an RDC file from thin air, by
  creating an empty RDCFile container and filling it with data, then
  requesting it to be written to disk.
2017-11-07 19:30:35 +00:00
baldurk a63e99177d Add serialisation for public interface structs 2017-11-07 19:30:35 +00:00
baldurk 034a0f3759 Update target control code to use new serialisation system 2017-11-07 19:30:34 +00:00
baldurk d26f634978 Update resource manager to new serialisation with direct-to-disk writes
* Since the initial states will all be written directly to the file
  serialiser without intermediate copies, there will be no ability to
  seek backwards to fixup chunk lengths.
* Instead all chunks will write an upper bound size estimate first, then
  any padding is written at the end if they came in under the estimate.
2017-11-07 19:30:33 +00:00
baldurk dc6f11f07b Remove socket_helpers.h - serialiser can now write directly to socket 2017-11-07 19:30:32 +00:00
baldurk 327fda94a0 Add refactored serialisation system
* The new system contains the ability to export serialised data to a
  structured form in memory - and conversion back to serialised bytes.
* This will allow offline transformations/visualisation of capture files
  as well as more rich representations of API calls in the UI.
* Likewise it enables a number of optimisations such as the ability to
  write straight from mapped API memory to disk via a compressor,
  without any intermediate copies.
2017-11-07 19:30:32 +00:00
baldurk 7562da9a20 Temporarily remove driver support. (See commit msg if bisecting)
* The commits following this add a new refactored serialisation system.
  As a balance between readability of individual commits and ability to
  bisect/compile at interim steps, the individual API back-ends are
  disabled in this commit, so that after the serialisation system is
  committed the project compiles again as soon as possible.
* However this is of course not much use in itself as then the code
  can't function usefully. The drivers are re-enabled as each one is
  updated to the new system, so at least the codebase should stay
  compiling, even if each individual API may not yet be functioning.
2017-11-07 19:30:31 +00:00
baldurk 382639fb3f Change rdcarray resize strategy to exponential instead of minimal
* Normally this wasn't a problem but in a few cases we were doing lots
  of push_back calls and this caused horrible resize-by-1 behaviour.
* So instead we double the available count (if that's larger than just
  satisfying the request).
2017-11-07 19:29:42 +00:00
baldurk bfc5946227 Fix command line options for WoW32 renderdoccmd global hook 2017-11-07 19:29:42 +00:00
baldurk 594c8ccae6 Fix for invalid use of assign() in new rdcstr interface
* This will go away with the serialise refactor, but is currently broken
2017-11-06 13:53:41 +00:00
baldurk 2c2270051c Hide/disable options when they're not available. Refs #788
* Hopefully these can be restored at some point, when the features are
  implemented. For now where possible we remove options that are just
  unavailable always, and selectively disable others when they may or
  may not be available based on what API the capture uses.
2017-11-06 12:45:40 +00:00
baldurk dfbb567464 Update qprocessinfo to 39678d76bd9b462da9acbfea397dd56494aab73e 2017-11-06 12:45:40 +00:00
Peter Gal a611119704 [EGL] Force context change when querying surface dimensions
On some Linux system the eglQuerySurface is unable to query
the surface dimensions if the context is not the same
as when it was created.
2017-11-06 13:45:32 +01: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 2cee89e326 Add errno.h header for OS X 2017-11-04 09:30:22 +00:00
baldurk 270737a66b Fix formatting from bad git cherry-pick
* Apparently git cherry-pick doesn't apply commit hooks :(.
2017-11-03 20:03:23 +00:00
baldurk 8fd388ae26 Fix for unit tests 2017-11-03 19:50:54 +00:00
baldurk b695720a11 Move UniformType and AttribType enums to global scope 2017-11-03 17:51:10 +00:00
baldurk 091a32d98f Extract out OpenGL initial state code (unchanged) to separate file 2017-11-03 17:51:10 +00:00
baldurk 37213598bf Extract out D3D12 initial state code (unchanged) to separate file 2017-11-03 17:39:10 +00:00
baldurk 5d1ea47414 Extract out D3D11 initial state code (unchanged) to separate file 2017-11-03 17:38:43 +00:00
baldurk 5bd3493238 Add an XML codec for converting to/from structured data representation 2017-11-03 17:25:11 +00:00
baldurk 0edee7649d Remove no longer needed mutable DrawcallTreeNode structures
* The DrawcallDescription children is mutable, so we don't need a
  separate struct for that purpose in D3D11/GL where there's no side
  data to carry along with (where draws are late-bound when submitted).
2017-11-03 17:21:40 +00:00
baldurk 6073e8a8d4 indent hookset.pl to clang-format rules. No tabs, 2 space indent 2017-11-03 17:21:40 +00:00
baldurk a13a97286b Add an extra macro for aliased wrappers (to preserve orig function call)
* This will be used in future to record the exact entry point the application
  called, instead of just the function that we serialised (so calls aren't
  falsely promoted to DSA variants, etc).
2017-11-03 17:21:39 +00:00
baldurk 0eaf89ae02 Add gl_hooks_vrapi.cpp to VS project 2017-11-03 17:11:02 +00:00
baldurk bc8aea585d Null/Default GLResource objects have name = 0.
* This gives us a sane default, particularly for when we want to
  serialise a GLResource directly.
2017-11-03 17:08:30 +00:00
baldurk fa071a6ca5 Allow specifying source/id/severity when adding GL markers 2017-11-03 17:08:18 +00:00
baldurk 8346c630cb Manually prioritise normal GL over GLES for enums.
* Where the same enum value is used in multiple cases this then picks
  the GL version. This is especially important when the same value is
  used for radically different enum values.
2017-11-03 17:08:12 +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
baldurk 459c5a856e Add new I/O streaming system, with pluggable compression
* This I/O will form the basis of the new serialiser - it will simply
  read to or write from one of these I/O streams. Then that stream can
  come from a file, go to a memory buffer, or go through a compressor
  or decompressor transparently.
* It also allows a unified way of writing over sockets instead of
  needing special socket helper functions.
* With this commit, the code isn't used aside from in tests.
2017-11-03 16:26:06 +00:00
baldurk 3aa3262089 Expose ToStr interface publicly, split out into separate files
* Note that while this is public and uses std::string, because it's a
  template with specialisations in a .inl the string never crosses a
  module boundary - each including module has its own implementation.
* This will be used as part of the upcoming serialisation refactor.
* Some POD structs are still given ToStr implementations as we haven't
  yet switched over the serialisation system to expect all structs to
  have serialise functions.
2017-11-03 16:23:02 +00:00
baldurk 834edf0dc2 Add a microsecond timer from the start of the process 2017-11-03 16:22:59 +00:00
baldurk 6937756618 Add new structured data, that will be used to expose serialised values
* We have some special handling to allow SWIG wrapping of these types:
  SDFile owns the chunks and buffers within, and each object owns its
  children. Copying is disallowed except from SWIG where we assume the
  wrapper is handling lifetime management for its objects externally.
2017-11-03 16:19:45 +00:00
baldurk 9db71b803a Change python wrapping of arrays to be more pythonic, by reference
* Previously we would convert from python to C++ arrays immediately by
  copying, and vice-versa convert TO python immediately by creating a
  new python list by copying.
* This however behaves rather poorly in common situations, e.g.:
  > foo.bar.append(5)
  Would not append 5 to foo.bar, but copy foo.bar to a temporary, append
  5 to it, then destroy it leaving foo.bar untouched.
* Instead we leave the C++ array type as a pointer for as long as we can
  and instead implement the python sequence API as extensions/slots that
  work in-place on the original array.
2017-11-03 16:19:41 +00:00
baldurk 81aa36e24b Use a macro to reduce visual noise in resource_manager.h 2017-11-03 16:17:30 +00:00
baldurk 9ef0c5282c Make aligned buffer allocation a common function, out of serialiser 2017-11-03 16:15:19 +00:00
baldurk eb7e14d46d Add a formatter for 64-bit integers 2017-11-03 16:13:29 +00:00
baldurk 2d219018cd Move enum class operators from replay_enums.h into main header 2017-11-03 16:10:11 +00:00
baldurk 276783b948 Move custom printf & string_utils out of serialise/ folder 2017-11-03 16:07:46 +00:00
baldurk e6c5c03896 Remove rdctype namespace. Rename rdctype::str -> rdcstr, rdcarray, etc
* Since these types are more prevalent than originally designed, it
  makes more sense to remove the namespace for ease of typing/naming.
* Also add a specialised type 'bytebuf' for an array of bytes.
* This makes mapping easier to SWIG since there's no special casing for
  namespaced arrays. Especially so for nested cases like
  rdctype::array<rdctype::str> -> rdcarray<rdcstr>
2017-11-03 16:04:59 +00:00