llvm / llvm/offload-test-suite

Switch to EnhancedBarriers for DX12

Open
#1,112 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
18
Forks
39
Avg merge
2d 18h
Merged PRs (30d)
40

Description

Legacy Barriers in DX12 are not as expressive as to what the driver/GPU should exactly do with the barrier. Due to this we need to have a bunch of barriers that need to transition into a specific state where it is unnecessary to do so.

For example buffers don't have a 'state' they can be in, as they are never in a compressed format. However, legacy barriers force you to specify what 'state' a buffer is in to express if a cache flush needs to happen and where execution needs to be blocked. This model forces the user to do unnecessary state tracking which complicates the code base and adds overhead.

By using Enhanced Barriers we will be able to much more accurately describe which of the following three things need to happen by placing the barrier:
1. Block Execution: wait until previous commands have finished a certain stage before launching new work
2. Flush/Invalidate caches: make sure data is visible for the next command
3. Transition Texture State: change the state a texture is in which possibly requires the driver to insert extra GPU to for example resolve a depth buffer.

Another bonus is that Enhanced Barriers map almost directly to barriers in Vulkan (especially with the synchronization2 extension https://docs.vulkan.org/refpages/latest/refpages/source/VK_KHR_synchronization2.html). This will allow the code to be more uniform between the two render backend implementations.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the DX12 legacy barrier implementation and the corresponding Vulkan synchronization code. Read the Enhanced Barriers and VK_KHR_synchronization2 references cited in the issue, then determine the required cross-backend changes. Done means the DX12 backend uses Enhanced Barriers and the barrier model is more uniform with Vulkan.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend, computer-graphics
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.