Commit Graph
72 Commits
Author SHA1 Message Date
baldurk fcdea67879 Update copyright years to 2022 2022-02-17 17:38:32 +00:00
baldurk a769f3e253 D3D12 placed resources keep a refcount on their heap 2021-11-05 14:15:01 +00:00
baldurk 6535e3b20c Don't fetch GPU descriptor address for non-shader-visible heaps
* Silences a D3D12 debug warning
2021-09-17 14:29:23 +01:00
baldurk 69a27aea40 Handle MakeResident/Evict being refcounted, and handle placed resources
* Placed resources aren't directly resident or non-resident, it's the underlying
  heap that needs to be made resident or evicted.
2021-08-26 12:06:25 +01:00
baldurk 45a8a63474 Dynamically allocate shaders and structured files to allow detaching
* These are the only handles returned up by reference from the replay driver,
  dynamically allocating them means that we can steal/move the ownership of
  these and keep them valid even after the replay driver is destroyed.
* Note - ShaderDebugTrace is also returned by reference but it is already
  dynamically allocated like this.
2021-08-18 20:12:06 +01:00
baldurk 83cee7b35d Add protection against unknown resources when capturing
* This can happen because the addresses map is shared among all devices so some
  other devices might have added resources which we don't recognise the IDs for
  - though this could break in other ways (same address range for different
  resources on different devices) so it's generally not supported.
2021-07-05 14:20:48 +01:00
baldurk cb2b321a09 Ensure reserved descriptors are properly initialised
* We just want to change the number reported as 'real' descriptors for external
  replay/state queries
2021-04-13 13:21:52 +01:00
baldurk 026da176bb Update copyright years to 2021 2021-01-13 13:56:10 +00:00
baldurk f0d00b5ad4 Don't allow command pool/allocator reset until capture is finished
* Even after transitioning to background capturing we can't allow reset or else
  we could record over chunks that we have yet to write to disk.
2020-11-20 13:10:38 +00:00
baldurk 8548892939 Add support for new D3D interfaces
* Nothing interesting/useful is supported here, we just add new interfaces that
  we recognise even though the user can't use them since we don't report support
  for the new features.
* This also makes it easier to track future changes when we're not behind.
2020-10-30 16:49:57 +00:00
baldurk c455fa9d49 Fix broken Unwrap() on D3D12 2020-09-14 12:31:57 +01:00
baldurk ac8a90ebbe Fix refcounting of D3D12 shader objects 2020-09-12 23:16:15 +01:00
baldurk fb19ccb535 Don't pool-allocate D3D12 shaders 2020-09-10 13:35:16 +01:00
baldurk 3b04aa227b Reduce the memory footprint of D3D12 objects 2020-09-10 13:34:44 +01:00
baldurk fb3c293621 Create a default SRV/UAV descriptor when needed. Closes #2040
* In D3D12 if the user passes NULL for the UAV or SRV descriptor when calling
  Create*View we don't have the runtime to generate a default one for us when we
  query, we'll just have nothing stored. So instead when we need to generate a
  default "whole resource" descriptor to look up.
2020-09-04 23:23:31 +01:00
baldurk 50cb5a1a9e Lock resource from mapping when diffing in queue execute. Closes #1998 2020-07-30 11:23:02 +01:00
baldurk 02a54be6ad When replaying resource discards fill with explicit pattern. Closes #284
* This helps catches cases where a discarded image is accidentally used and in
  many cases may still have valid data. Particularly on Vulkan this is relevant
  for DONT_CARE renderpass load and store ops.
2020-07-13 17:29:11 +01:00
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