Commit Graph
55 Commits
Author SHA1 Message Date
baldurk 767f123c73 Handle debug search paths on D3D12 correctly
* We also need to unwrap the needless PDB wrapper on MS's separate debug info
  setup.
2020-06-29 18:34:07 +01:00
baldurk fec709b2d1 Support using ILDN to locate separate debug info
* This works the same way as the existing separate pdb support
2020-06-18 17:22:42 +01:00
Daniel Craig fc63964335 Show correct clear/CopyDst/CopySrc subresource in texture viewer
This is implemented and tested on vulkan/d3d12/d3d11.
2020-04-06 20:12:05 +01: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 107f89048b Fix race condition when keeping D3D12 buffers alive during capture
* There was a gap between stopping active capturing (meaning newly created
  buffers are given an extra refcount) and releasing the extra refcount. Any
  newly created buffers in that gap would still be released but that would mean
  one of the application's ref's is removed, possibly destroying a buffer by
  mistake.
* Instead we keep a specific list of buffers that we're extending so that we
  know that the buffers we release are exactly those we gave extra refs to.
2020-03-09 14:28:03 +00:00
baldurk 3c61c01ba7 Don't allow buffers to be destroyed during D3D12 capture
* We need to make sure we can still look up GPU addresses for buffers that were
  destroyed during the frame, otherwise we might get the wrong contents for
  descriptors.
2020-02-03 18:18:17 +00:00
baldurk 2916c0f9f7 Update copyright years to 2020 2020-01-06 16:20:45 +00:00
baldurk 37a255c8a4 Remove std::vector/std::string use from D3D12 driver 2019-12-16 18:10:32 +00:00
baldurk 3cbce1f0c4 Fix calculation of dataSize and using wrong pitch in WriteToSubresource 2019-10-21 12:28:18 +01:00
baldurk cd020007d2 Rename dxbc_inspect.* to dxbc_container.*, and DXBCFile -> DXBCContainer 2019-10-18 20:57:35 +01:00
baldurk 9c6bfa6788 Remove static resource lists, make them members of the device 2019-09-06 22:19:28 +01:00
baldurk 190cba427c Refactor shader editing to more reliable approach
* When we replace a shader in GL there are a few knock-ons: we need to replace
  the programs that use this shader, and then from there we need to replace the
  pipelines that use the program. We also need to beware of programs created
  with glCreateShaderProgramv which refer to themselves as both a program and a
  shader.
* Previously we'd look at the edited shader, then recurse and look at programs,
  then recurse and look at pipelines. We'd try to remember which one replaced
  which so we could undo it again.
* Now we just do this in subsequent passes since there is only a one-way
  dependency: First replace the shader as needed, then update any programs and
  either replace or remove replacement as needed, and finally update any
  pipelines.
* On Vulkan and D3D12 it's simpler as we just have shaders -> pipelines but the
  same principle applies.
2019-09-05 20:36:12 +01:00
baldurk 776b9d048f Lock around mangement of D3D12 resource maps 2019-06-04 18:18:10 +01:00
baldurk 7206a0cd25 Removing 'use std::vector' 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 e01bc4c734 Implement untested support for D3D12.3/D3D12.4 interfaces. Closes #1268
* Most of the interfaces are not supported - protected sessions, raytracing,
  etc.
* We also split apart the 1/2/3/4 wrapped implementations to avoid uber files.
2019-02-19 17:54:53 +00:00
baldurk 86ff87863e Update copyright years to 2019 2019-02-01 18:32:13 +00:00
baldurk 76e42a1a2a Make sure to correctly identify removed buffer in GPUAddress mapping
* When multiple buffers are aliased over the same heap memory, they'll have the
  same GPU base address. Our mapping needs to ensure it removes the right entry
  when a resource is released.
2019-01-28 19:55:39 +00:00
baldurk 8024c8c342 Store and serialise resources in D3D12 descriptors by id directly
* The problem with storing resource pointers in descriptors is that it can be
  invalidated without detection - a kind of A-B-A problem - if the resource is
  deleted and then another resource is allocated with the same pointer.
* Descriptor creation in D3D12 is extremely complex and there are many ways a
  resource could become incompatible with the descriptor metadata struct.
  Detecting all possible ways a new resource could be incompatible is not
  feasible.
* As a solution, we store the ResourceId which we know is immutable, serialise
  via the pointer, and keep the live ResourceId on replay. If the resource was
  deleted, the serialisation will fail because we look up the pointer at the
  point of serialise, and a deleted resource will end up being NULL.
* To try and abstract this away and avoid potential confusion with the
  ResourceIds, we make the descriptor contents private and provide accessors.
2018-06-18 15:20:08 +01:00
baldurk abd67a7702 Add some DX12 performance optimisations
* Switches some contended mutexes for R/W locks
2018-06-13 09:17:03 +01:00
baldurk 72b40769b5 Add support for D3D12 up to D3D12.3. Closes #966 2018-06-07 14:49:07 +01:00
baldurk c520f637d1 Pre-allocate map array in D3D12Resource, experimental race condition fix 2018-04-26 18:21:20 +01:00
baldurk e305029ddd Update copyright years to 2018 2018-01-01 17:55:29 +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 15ddb868e1 Record chunk thread IDs, timestamps and durations 2017-11-24 18:14:23 +00:00
baldurk 602511bf33 Reduce parameters that need to be passed for viewing shaders 2017-11-22 19:11:27 +00:00
baldurk 3ac3e6c3f1 Fill out resource descriptions in each driver
* For Vulkan and D3D12, we now create a dummy command buffer to ensure
  that there's actually a chunk available to correspond to the command
  buffer that gets submitted or recorded to.
2017-11-17 16:30:50 +00:00
baldurk c2a8e19d07 Split D3D12 struct serialisers separately&serialise interfaces directly
* Interface objects are serialised by type as their ResourceId - see the
  D3D11 code that does the same thing for more explanation.
2017-11-08 18:24:42 +00:00
baldurk 9ef0c5282c Make aligned buffer allocation a common function, out of serialiser 2017-11-03 16:15:19 +00:00
baldurk 0faf0931c2 Ditch D3D11's anomalous identity bindpoint mapping for proper handling 2017-08-31 18:34:00 +01:00
baldurk 030cbfde9a Batch update copyright years everywhere 2017-01-06 12:13:31 +00:00
baldurk b1809c1949 Support HLSL custom display shaders on D3D12 2016-11-18 16:31:33 +01:00
baldurk 4c24dcecde Add typedef for shader data struct and utility accessors in pipeline 2016-11-18 16:31:25 +01:00
baldurk 090e4e5e9a Handle stale descriptors hanging around referencing re-used resources 2016-10-31 01:01:53 +01:00
baldurk 7903c78f6c Unmap all current maps when a resource is deleted 2016-10-31 01:01:53 +01:00
baldurk 88939d1f21 Only add wrapped resources to list on replay (which is single threaded) 2016-10-27 11:35:03 +02:00
baldurk e1c0400e40 Lock around access to GPUAddressRange vector 2016-10-26 23:14:16 +02:00
baldurk 451203187d Handle nested Map/Unmap calls by refcounting 2016-10-26 23:14:10 +02:00
baldurk ac53611f07 If any list executed contains an ExecuteIndirect, ref all buffers
* Since buffers can be referenced indirectly on the GPU by their GPU
  address, there's no feasible way to know if the buffer is actually
  used or not. If an ExecuteIndirect is seen at all we just have to
  pessimistically include all buffers.
* Generally textures take up the bulk of VRAM usage, so this likely
  won't be too bad.
2016-10-21 21:44:24 +02:00
baldurk febe2b1ad9 Patch ExecuteIndirect call data to point to replayed GPU addresses 2016-10-21 21:44:24 +02:00
baldurk 2fe22e96b5 Add support for tracking and saving mid-frame and persistent maps 2016-10-18 19:10:06 +02:00
baldurk 99b45aefb5 Minimal possible residency handling code
* We unwrap objects and track residency state, and when preparing init
  states if necessary then we make those resources resident and sync the
  list execute so we can evict them again immediately afterwards.
* On replay, all resources are created and left as resident, which could
  go over the budget available. If a frame uses close to or more than
  its total budget over the course of a frame this could fail. One fix
  to that would be to track referenced resources in command lists at
  replay time, and only make resident what we need for each list and
  execute them in isolation, then evict right after (so all frame
  resources are 'default evicted').
2016-10-18 12:12:54 +02:00
baldurk 0f660e3ec2 Create and fill out D3D12 pipeline state, without shader resources.
* We make shaders into fake resources with IDs, so they can be
  identified individually (for replacement, fetching reflection data,
  and things like that). This is a little but ugly but worth it for the
  simplicity it will provide everywhere else.
2016-09-22 12:05:47 +02:00
baldurk dbb0e4702e Create DXBC reflection data for shaders in pipelines 2016-09-22 12:05:47 +02:00
baldurk a94b6dafb9 Track bound descriptors and mark their contents are frame referenced 2016-08-06 18:31:49 +02:00
baldurk 407bca01e8 Track renderstate as we go, and allow replaying single draws with it 2016-08-06 18:31:22 +02:00
baldurk 6e5f8ae687 When serialising GPU_VIRTUAL_ADDRESS, make sure to store offset as well 2016-08-06 18:31:07 +02:00
baldurk 8bcb9ae249 Speculative compile fix seen on AppVeyor - missing template<> 2016-07-10 19:07:28 +02:00
baldurk 7ccd3fe98f Don't cast command list/queue to TrackedResource - not inherited 2016-07-10 18:10:03 +02:00
baldurk ad998a4e8b Keep a list of resources 2016-07-10 18:09:59 +02:00