Commit Graph

14422 Commits

Author SHA1 Message Date
baldurk 68929a567b Work around D3D12 confusion where feature can be unsupported but used
* Even if new barriers aren't supported, it's still possible to use the creation
  function and create them in any of the new layouts. In this case we can't use
  new barriers to transition them out of that state so we have to pretend
  they've already been moved out.
2024-03-02 13:46:45 +00:00
baldurk 9348bb4510 Don't recreate heaps as displayable 2024-03-02 00:14:31 +00:00
baldurk 9500ebd94b Fix initialisation errors and resource leaks 2024-03-02 00:03:25 +00:00
baldurk cab4928b34 Bump the versions of some CI actions to avoid deprecation warnings 2024-03-01 13:57:19 +00:00
baldurk 24f4bd7b42 Generate SPIR-V code with utf-8 encoding 2024-03-01 13:44:25 +00:00
baldurk 10c8d1f58a Remove accidentally included unit test 2024-03-01 13:03:18 +00:00
baldurk 6855013033 Fix compilation 2024-03-01 12:27:30 +00:00
baldurk 7c40d92905 Fix renderdoc project filters 2024-03-01 12:13:32 +00:00
baldurk 755291ad47 Handle SPIR-V with empty and file contents source directives
* This can happen if e.g. there's an OpSource with no contents, and then a
  DebugSource with contents.
2024-03-01 12:11:37 +00:00
baldurk 3e2340fe16 Add identified support for slang (the language and the tool) 2024-03-01 12:11:37 +00:00
baldurk b8261d9357 Update SPIR-V headers to latest 2024-03-01 12:11:37 +00:00
baldurk 02539a6240 Add experimental option to allow use of D3D12 RT 2024-03-01 12:11:37 +00:00
Amit Prakash 6254393bdf Add serialisation & replay of Acceleration structure build calls
* Add patching of BLAS address in TLAS
* Add a compute shader to patch the BLAS address
* Adds a pipeline, and root signature for patching the BLAS
2024-03-01 12:11:37 +00:00
Amit Prakash 19701205ef Add helper to reference all buffer resources
* There is no easy way to track the referenced resources in
  acceleration structure builds, especially BLAS resource, as there is
  no way to track how and when they will change.
  Now with this change, we will track all the buffer resource
  irrespective they are used in AS or not after the first call to AS
  build.
2024-03-01 12:11:37 +00:00
Amit Prakash 475dc0aabf Add to track the lifetime of acceleration structs
* During recording of acceleration structure builds, add a callback to
  track lifetime of virtual acceleration structure resource.
* Execute the callback at time command list execution to ensure the
  order of correct acceleration structure on the backing buffer storage.
2024-03-01 12:11:37 +00:00
Amit Prakash ae8bc03c18 Add acceleration structure as a virtual resource
* Add Resource_AccelerationStructure as a new resource type
* Add D3D12AccelerationStructure class for virtual resource for tracking
  acceleration structure lifetime.
* Since D3D12 doesn't provide a proper API-tracked way of seeing these
  resources, we instead will track it ourselves and create a virtual
  resource where valid ASs exist.
2024-03-01 12:11:37 +00:00
Amit Prakash 4e37c99d53 Add RT buffer management and resource handling helpers
* Add D3D12RaytracingResourceAndUtilHandler for managing DXR additional
  resources and workload
* Add D3D12GpuBufferPool to manage GPU buffer resources
2024-03-01 12:11:37 +00:00
Amit Prakash 38ff2b859d Add serialization for state object desc
Co-authored-by: Nate, High <nate.high@amd.com>
2024-03-01 12:11:37 +00:00
Amit Prakash b52bb00101 Add inital plumbing/stub code for DXR
* Adds specialized serialization for DXR enums, and structs
* Adds new Chunks for DXR API Calls
2024-03-01 12:11:37 +00:00
Amit Prakash f67ce809ed Add include handler for 6_0+ compilation 2024-03-01 12:11:36 +00:00
Jake Turner cb18d1cf52 D3D12 Pixel History fix format conversion for post-modification value
The per fragment post-modification value needs similar handling as the per fragment shader out
2024-02-29 06:47:14 +00:00
Jake Turner 5b55188260 Pixel History UI draw background colour for UINT and SINT targets 2024-02-29 06:47:14 +00:00
Jake Turner 298deafb40 D3D12 Pixel History handle copying data from Texture3D
Tested with different and different slices
2024-02-29 06:47:14 +00:00
Jake Turner 985531cf0e D3D12 Pixel History force scratch targets to be Texture2D
Fixes device timeout for history on 1D or 3D targets
2024-02-29 06:47:14 +00:00
Jake Turner 00777e8474 D3D12 Pixel History force event info structures to be 48 byte aligned
This is to ensure buffer offsets are always a multiple of 16 & 12 bytes
12 byte alignment is required to support copying R32G32B32 pixels
2024-02-29 06:47:14 +00:00
Jake Turner 713194f7bf D3D12 Pixel History rework how image states are computed
The CPU image state tracking does not know about state changes from a future command list which is submitted before the current list.
This leads to incorrect state transition when copying pixel data and getting incorrect data in the pixel history
2024-02-29 06:47:14 +00:00
Jake Turner 8eb4342704 D3D12 Pixel History Test split barriers into new command list
Record the draw command list before the barrier command list
Submit the barrier command list before the draw command list
2024-02-29 06:47:14 +00:00
baldurk 70b79d73e7 Ensure vulkan pixel history that adds dynamic states gets those bound 2024-02-28 15:48:20 +00:00
Jake Turner 26dac0821d Add missing break to DXIL disassembly of Operation::Fence 2024-02-28 15:14:30 +00:00
baldurk 13b9bd5133 Track dynamic states that have been set even if not valid for pipeline
* Previously we treated dynamic state as valid in a temporary state (when e.g.
  pushing and popping state) only if it was valid for the currently bound
  pipeline. However it's possible for an application to have a static pipeline
  bound, set some dynamic state, then set the pipeline needing that dynamic
  state before the draw. The state is temporarily invalid for a period of time
  but eventually becomes valid, and if we're restoring that state we need to
  restore the dynamically set state assuming it will become valid.
2024-02-28 14:52:14 +00:00
baldurk 06475a81cf Ensure user allocation callbacks are uniformly set to NULL. Closes #3263 2024-02-28 14:06:36 +00:00
Jake Turner 89166801fa Core OS Add test multiple modifications to an env variable 2024-02-28 07:36:49 +00:00
Dustin Toff 59e6edcfea Fix posix ApplyEnvironmentModifications for repeated modifications
This behavior is correctly applied on Windows but on posix systems would fail to apply duplicate
entries that should be additive, such as multiple prepends. Previously only the last modification
would win.
2024-02-28 07:35:42 +00:00
Cam Mannett fa70f8fa87 Ray Query API interception and serialisation
Ignoring acceleration structure host-build for now, and by extension deferred operation handle functions are pass-though (i.e. ignored on replay).
2024-02-27 11:15:01 +00:00
baldurk e5410ad8fb Allow naming queues and command buffers on D3D12 2024-02-26 14:09:27 +00:00
baldurk 230b63adce Find latest dxc from windows SDK, not from redist folder, in demos
* It seems like the D3D redist folder is not kept up to date so may contain a
  stale/old DLL.
2024-02-26 12:49:02 +00:00
baldurk 58cc331e27 Use a dedicated transfer queue for D3D12 GPU readbacks
* This prevents a potential deadlock/failed readback situation if the queue
  we're submitting on at the time memory needs to be read is currently blocked
  by a pending wait and can't execute more code.
2024-02-23 18:50:31 +00:00
baldurk ec17ee5999 Batch calls to GetPostVSBuffers to work around Android being awful
* On Android the end-to-end latency of a single call is large enough that doing
  a call per-instance in a draw with a high number of instances is a real
  problem
2024-02-23 15:00:28 +00:00
baldurk 36f4432351 Calculate tighter bounds for data copied in D3D11 initial states
* This can be a problem since copying by pitch * count can slightly over-read if
  the pitch is larger than a row or slice, potentially reading into unmapped
  pages.
2024-02-23 14:09:40 +00:00
baldurk ac18f52757 Fix incorrect index being used when rebinding partial state 2024-02-23 13:52:24 +00:00
baldurk a5073a6868 Fix incorrect sizes used for calculating next patch size 2024-02-23 13:23:57 +00:00
baldurk bfebf53be0 Add new image layout to descriptor storage enum 2024-02-19 14:45:46 +00:00
Jovan Ristic 0f6c619e54 D3D12 Pixel History fix format conversion.
* DecodeFormattedComponents converted everything to floats which were
then reinterpreted as int or uint via the unioned fields of PixelValue,
resulting in erroneous value display in PixelHistoryView.
* I've made a pixel history specific version of the format conversion
which treats the values the way the viewer expects.
2024-02-15 07:47:46 +00:00
Jake Turner 932caeb7c8 Enable the D3D12 Pixel History feature
Removed the developer config option D3D12_PixelHistory
2024-02-15 06:01:46 +00:00
Jake Turner 226bf7071b Add ShaderBuiltin::MultiViewIndex
Mapped to:
SPIR-V ViewIndex (which was previously mapped to ShaderBuiltin::ViewportIndex)
GL gl_ViewIndex
2024-02-14 11:10:15 +00:00
Jake Turner 045a71082b D3D12 Pixel History support for direct DispatchMesh draws
D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH_MESH is not supported
2024-02-14 07:50:20 +00:00
Jake Turner 893142d7f0 In Pixel History always shaderOut for depth targets
Including when there is no pixel shader bound
2024-02-13 17:27:05 +00:00
Jake Turner e254e66ae4 In Pixel History View do not force shaderOut to show four components
Matches the formatting used for "Tex Before" and "Tex After"
2024-02-13 17:27:05 +00:00
Jake Turner 364f5998c2 In Vulkan Pixel History zero out unwritten shaderOut elements
In Vulkan these are not defined to be zero (behaviour is driver dependent)
2024-02-13 17:27:04 +00:00
Jake Turner 822b770569 Use the loadRP when making the pipeline for Vulkan Pixel Debug
Fixes validation error related to dependencies:

VUID-vkCmdDraw-renderPass-02684] Validation Error: [ VUID-vkCmdDraw-renderPass-02684 ] Object 0: handle = 0x61ee4f000000021b, type = VK_OBJECT_TYPE_RENDER_PASS; Object 1: handle = 0x1c2336000000021a, type = VK_OBJECT_TYPE_RENDER_PASS; | MessageID = 0x50685725 | vkCmdDraw: RenderPasses incompatible between active render pass w/ VkRenderPass 0x61ee4f000000021b[] with a dependencyCount of 0 and pipeline state object w/ VkRenderPass 0x1c2336000000021a[] with a dependencyCount of 2. The Vulkan spec states: The current render pass must be compatible with the renderPass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS (https://vulkan.lunarg.com/doc/view/1.3.261.1/windows/1.3-extensions/vkspec.html#VUID-vkCmdDraw-renderPass-02684)
2024-02-13 17:27:04 +00:00