Commit Graph

14406 Commits

Author SHA1 Message Date
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
Jake Turner a62634717e Vulkan BDA debugging force m_BufferAddresses to be sorted
The implementation usage of m_BufferAddresses assumes the container is sorted and requires the use of lower_bound() API

Added rdcsortedflatmap subclass of rdcflatmap
Only expose upper_bound(), lower_bound() APIs in rdcsortedflatmap
The upper/lower bound APIs require a sorted container
2024-02-13 17:03:42 +00:00
baldurk 52cfb0e083 Update Vulkan headers to latest, support trivially promoted exts
* We handle support for trivially supported exts like KHR_index_type_uint8 and
  KHR_calibrated_timestamps as it would be more churn and work to temporarily
  make them unsupported, given how they are almost entirely just aliased.
2024-02-13 12:37:05 +00:00
baldurk a2abef423f Fix GIPA and GDPA behaviour to return NULL for unknown functions
* This is the spec-compliant way to handle unknown functions.
2024-02-13 12:37:05 +00:00
baldurk 874920bc38 Fix potential crash on capture close accessing bad data
* Also added some conservative error checking on looking up chunk names.
2024-02-13 12:37:05 +00:00
Jovan Ristic 8d8b76ead7 D3D12 pixel history execute indirect.
* Cache indirect parameters pre-callback so they can be used for replay.
* Move ReplayDraw implementation to device so it can be re-used.
* Non-callback support left as a TODO + Assert.
2024-02-13 08:54:18 +00:00
Jovan Ristic 8108516b56 D3D12 Pixel History handle resolve events.
* Add action callbacks for ResolveSubresource so pixel history can
record pre- and post-mods for the events.
2024-02-13 08:47:11 +00:00
Jovan Ristic dbfd1287cf D3D12 Pixel History state tracking.
* For capture resources, use the actual resource state at the time of
the event rather than a hardcoded state.
* When hardcoded RT source state was used, on UAV events attempting to
transition a texture which was not created with the RTV flag from that
state caused a device removal.
* Includes a fix provided by Jake to ApplyBarriers that caused an
incorrect state to be returned in this usage.
2024-02-13 08:31:45 +00:00
baldurk 9f4f0e6aa1 Update copyright years to 2024 2024-02-12 11:04:52 +00:00
Jake Turner a4ff744a0a Fix Linux compile error 2024-02-08 05:15:07 -08:00
Jake Turner 4c8c31919a On Vulkan do not fill discard pattern during loading
The state tracking will not be complete during loading and can cause a crash trying to rebind the current pipeline after filling the image with the discard pattern
2024-02-08 10:48:10 -08:00
Jake Turner b1d78763c7 Fix Vk validation error about scissor exceeding signed int 2024-02-08 10:46:29 -08:00
Jake Turner f938afee2c PipelineStateViewer support right-click copy of stencil values
Having NoSelection caused nothing to be copied to the clipboard

Examples of copied data

D3D12 `Front Greater Keep Keep Replace FF FF 55`
D3D11 `Front Greater Keep Keep Replace`
GL `Front Greater Keep Keep Replace FF FF 55`
Vk `Front Always Keep Keep Replace FF FF 01`

Closes #3240
2024-02-06 05:45:52 -08:00
Jake Turner 03ab274252 Fix off by one error in the slice range tooltip 2024-02-01 15:43:36 +00:00
Jake Turner 0a330ef593 Add slice information to the Pixel History Window Title 2024-02-01 15:43:24 +00:00
Jake Turner a3eecf33eb Vulkan Mesh Output use state to query vertex bindings
Do not use the "VkGraphicsPipelineCreateInfo" because this does not include the dynamic state.
Fixes Mesh Output being incorrect when dynamic state for vertex input is used.
2024-01-31 12:54:20 +00:00
baldurk 6de0787b58 Update docs to mention customising python path on module project as well 2024-01-30 20:33:13 +00:00