o3de / o3de-atom-sampleviewer

Atom sample viewer project for the Open 3D Engine
https://o3de.org
Other
32 stars 37 forks source link

Multi-device resources #679

Closed martinwinter-huawei closed 5 months ago

martinwinter-huawei commented 6 months ago

This PR is setup in tandem with a corresponding PR #17974 into o3de/development and can only be merged in tandem. It transitions the samples in the ASV to multi-device resources. As the change set is enormous, this feature has been developed separately on a dedicated branch o3de/o3de-atom-sampleviewer at multi-device-resources (github.com) and is now ready to be merged.

This PR does essentially two things:

  1. It transitions existing samples to multi-device resources
  2. It introduces two new samples, namely:
    1. RHI/MultiGPU
      • Shows how to do split-frame rendering with a simple triangle pass on the RHI level, copying over the result from the second device to the first device and compositing the final output there. This sets up ScopeProducers on specific devices to submit DrawItems to different GPUs and submit the corresponding CopyItems to transfer the data between GPUs
    2. RPI/MultiGPU
      • This shows how to do the same example as on the RPI layer (just without the animation) using the Pass and Pipeline setups in json.

List of PRs

The following table lists all PRs that have been merged into multi-device-resources and are part of this PR. The final merge will also include one additional commit which changes the naming scheme (the intermediate naming used MultiDeviceResource as well as SingleDeviceResource, this now changes to Resource and DeviceResource). The table lists all PRs into o3de as well as o3de-atom-sampleviewer.

PR Description Corresponding PR in ASV
Buffer-related resources by jhmueller-huawei · Pull Request #16657 · o3de/o3de (github.com) Introduces multi-device versions of resources related to Buffer Buffer-related resources by martinwinter-huawei · Pull Request #661 · o3de/o3de-atom-sampleviewer (github.com)
Image-related resources by martinwinter-huawei · Pull Request #17040 · o3de/o3de (github.com) Introduces multi-device versions of resources related to Image Image-related resources by martinwinter-huawei · Pull Request #662 · o3de/o3de-atom-sampleviewer (github.com)
PipelineState-related resources by martinwinter-huawei · Pull Request #17095 · o3de/o3de (github.com) Introduces multi-device versions of resources related to PipelineState PipelineState-related resources by martinwinter-huawei · Pull Request #664 · o3de/o3de-atom-sampleviewer (github.com)
Query-related resources by martinwinter-huawei · Pull Request #17100 · o3de/o3de (github.com) Introduces multi-device versions of resources related to Query Query-related resources by martinwinter-huawei · Pull Request #663 · o3de/o3de-atom-sampleviewer (github.com)
Adding missing image conversions by martinwinter-huawei · Pull Request #17115 · o3de/o3de (github.com) Fixes some resource-conversions missed during #17040
Add multi-device TransientAttachmentPool by martinwinter-huawei · Pull Request #17116 · o3de/o3de (github.com) Introduces multi-device version of TransientAttachmentPool
Missing image/buffer resources in ModelLod by martinwinter-huawei · Pull Request #17118 · o3de/o3de (github.com) Fixes some resource-conversions related to ModelLod
MultiDeviceBuffers and -pipelines in Meshlets Gem by martinwinter-huawei · Pull Request #17132 · o3de/o3de (github.com) Fixes some resource-conversions in Meshlets-Gem
RayTracing-related resources by martinwinter-huawei · Pull Request #17147 · o3de/o3de (github.com) Introduces multi-device versions of resources related to RayTracing RayTracing-related resources by martinwinter-huawei · Pull Request #667 · o3de/o3de-atom-sampleviewer (github.com)
SwapChain-related resources by jhmueller-huawei · Pull Request #17225 · o3de/o3de (github.com) Introduces multi-device version of SwapChain
Multi device rpi srg by jhmueller-huawei · Pull Request #17267 · o3de/o3de (github.com) Lets RPI::ShaderResouceGroup use the multi-device version of ShaderResourceGroup SRG-related resources by martinwinter-huawei · Pull Request #668 · o3de/o3de-atom-sampleviewer (github.com)
Fixes for some minor issues/warnings. by jhmueller-huawei · Pull Request #17349 · o3de/o3de (github.com) Smaller fixes
DrawItem-related resources by martinwinter-huawei · Pull Request #17514 · o3de/o3de (github.com) Introduces multi-device versions of resources related to DrawItem DrawItem-related resources by martinwinter-huawei · Pull Request #669 · o3de/o3de-atom-sampleviewer (github.com)
DispatchItem-related resources by martinwinter-huawei · Pull Request #17520 · o3de/o3de (github.com) Introduces multi-device versions of resources related to DispatchItem
Multi device attachment readback by jhmueller-huawei · Pull Request #17531 · o3de/o3de (github.com) Transitions all single-device resources in AttachmentReadback to multi-device
Multi-device: deviceIndex in Scope by jhmueller-huawei · Pull Request #17583 · o3de/o3de (github.com) Introduces a deviceIndex in the Scope class
Reduce MultiDevice::DefaultDeviceIndex by jhmueller-huawei · Pull Request #17586 · o3de/o3de (github.com) Introduce the deviceIndex in the FrameGraphExecuteContext and utilize the deviceIndex wherever possible Utilize context.GetDeviceIndex() where possible by martinwinter-huawei · Pull Request #670 · o3de/o3de-atom-sampleviewer (github.com)
Multi device RPI integration: FrameGraph by jhmueller-huawei · Pull Request #17593 · o3de/o3de (github.com) Transition FrameScheduler and FrameGraph-related resources including the backends to support multi-device resources FrameGraph-related changes by martinwinter-huawei · Pull Request #671 · o3de/o3de-atom-sampleviewer (github.com)
Multi-device RPI final transition by jhmueller-huawei · Pull Request #17604 · o3de/o3de (github.com) Clean-up and fix some lingering cases not yet using multi-device resources
Multi-device: Using device indices in RenderPass by jhmueller-huawei · Pull Request #17624 · o3de/o3de (github.com) ScopeProducers get a deviceIndex and consequently the Renderpass gets a deviceIndex in json
Multi device minor fixes by jhmueller-huawei · Pull Request #17679 · o3de/o3de (github.com) Mostly compile fixes and reverting formatting
Fixes in FrameGraph* for backends by martinwinter-huawei · Pull Request #17796 · o3de/o3de (github.com) Smaller fixes in the backends for FrameGraph*
Multi device copy pass and fixes by martinwinter-huawei · Pull Request #17883 · o3de/o3de (github.com) Introduction of a multi-device enabled CopyPass Multi-GPU RHI & RPI samples by martinwinter-huawei · Pull Request #677 · o3de/o3de-atom-sampleviewer (github.com)
Show pass execution device index if multi devices are available by hosea1008 · Pull Request #17904 · o3de/o3de (github.com) Show the deviceIndex in the PassViewer

Contributors & Reviewers

Many thanks to the contributors to this PR (listed in alphabetical order)

And also many thanks to the reviewers of all these PRs, as this is a huge change, the review effort also was significant and helped improve the code significantly (listed in random order)