Skip to content

Commit 7cbda81

Browse files
committed
2 parents 9684c3a + 5ec49d3 commit 7cbda81

1 file changed

Lines changed: 24 additions & 8 deletions

File tree

d3d/D3D12EnhancedBarriers.md

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,10 @@ This document proposes an enhanced D3D12 Barrier API/DDI design that is capable
5050
- [Copy Queues](#copy-queues)
5151
- [Layout Access Compatibility](#layout-access-compatibility)
5252
- [Access Bits Barrier Sync Compatibility](#access-bits-barrier-sync-compatibility)
53-
- [Fence Barriers](#fence-barriers)
53+
- [Fence Barriers (Preview)](#fence-barriers-preview)
5454
- [Signal Barriers](#signal-barriers)
5555
- [Wait Barriers](#wait-barriers)
56+
- [Enabling and using Fence Barriers preview](#enabling-and-using-fence-barriers-preview)
5657
- [Fence Creation Flags Supporting Fence Barriers](#fence-creation-flags-supporting-fence-barriers)
5758
- [Command List Scoped Fences](#command-list-scoped-fences)
5859
- [Cross Queue Synchronization](#cross-queue-synchronization)
@@ -74,8 +75,8 @@ This document proposes an enhanced D3D12 Barrier API/DDI design that is capable
7475
- [ID3D12VideoDecodeCommandList3 Barrier](#id3d12videodecodecommandlist3-barrier)
7576
- [ID3D12VideoProcessCommandList3 Barrier](#id3d12videoprocesscommandlist3-barrier)
7677
- [ID3D12VideoEncodeCommandList3 Barrier](#id3d12videoencodecommandlist3-barrier)
77-
- [ID3D12GraphicsCommandListXXX WaitBarrier](#id3d12graphicscommandlistxxx--waitbarrier)
78-
- [ID3D12GraphicsCommandListXXX SignalBarrier](#id3d12graphicscommandlistxxx-signalbarrier)
78+
- [ID3D12CommandListFenceBarriers WaitBarrier (Preview)](#id3d12commandlistfencebarriers-waitbarrier-preview)
79+
- [ID3D12CommandListFenceBarriers SignalBarrier (Preview)](#id3d12commandlistfencebarriers-signalbarrier-preview)
7980
- [ID3D12Device10 CreateCommittedResource3](#id3d12device10-createcommittedresource3)
8081
- [ID3D12Device10 CreatePlacedResource2](#id3d12device10-createplacedresource2)
8182
- [ID3D12Device10 CreateReservedResource2](#id3d12device10-createreservedresource2)
@@ -1292,7 +1293,7 @@ Some Access types require matching Sync. For the following access bits, at leas
12921293

12931294
------------------------------------------------
12941295

1295-
## Fence Barriers
1296+
## Fence Barriers (Preview)
12961297

12971298
Fence barriers allow app developers to perform GPU command execution timeline synchronization between command queues or with the CPU. This improves both GPU/CPU and GPU/GPU concurrency, and gives developers an alternative to split barriers.
12981299

@@ -1345,6 +1346,21 @@ A `WaitBarrier` with [external dependencies](#external-dependencies-and-d3d12_ba
13451346
13461347
Consecutive layout transitioning `WaitBarrier` operations with no intervening `SignalBarrier` on a given texture subresource in a single `ExecuteCommandLists` scope is invalid. Such a scenario would imply concurrent write operations to the same subresource, which is not supported.
13471348
1349+
### Enabling and using Fence Barriers preview
1350+
1351+
The Fence Barriers preview requires developer mode. Additionally, developers must use `D3D12EnableExperimentalFeatures` to enable fence barriers preview APIs:
1352+
1353+
```c++
1354+
D3D12EnableExperimentalFeatures(1, &D3D12FenceBarriersExperiment, nullptr, 0))
1355+
```
1356+
1357+
The `ID3D12CommandListFenceBarriers` interface must be queried from an existing `ID3D12CommandList` object:
1358+
1359+
```c++
1360+
CComPtr<ID3D12CommandListFenceBarriers> pFenceBarriersCL;
1361+
pCL->QueryInterface(IID_PPV_ARGS(&pFenceBarriersCL));
1362+
```
1363+
13481364
### Fence Creation Flags Supporting Fence Barriers
13491365
13501366
New fence creation flags are required to fully support fence barriers.
@@ -2385,12 +2401,12 @@ void ID3D12VideoEncodeCommandList3::Barrier(
23852401
| `NumBarrierGroups` | Number of barrier groups pointed to by `pBarrierGroups` |
23862402
| `pBarrierGroups` | Pointer to an array of `D3D12_BARRIER_GROUP` objects |
23872403

2388-
### ID3D12GraphicsCommandListXXX WaitBarrier
2404+
### ID3D12CommandListFenceBarriers WaitBarrier (Preview)
23892405

23902406
Waits for the full set of fence/value pairs to be satisfied then executes the provided barrier operations.
23912407

23922408
``` c++
2393-
void ID3D12GraphicsCommandListXXX::WaitBarrier(
2409+
void ID3D12CommandListFenceBarriers::WaitBarrier(
23942410
UINT NumBarrierGroups,
23952411
const D3D12_BARRIER_GROUP *pBarrierGroups,
23962412
UINT NumFences, ID3D12Fence * const *ppFences,
@@ -2405,14 +2421,14 @@ void ID3D12GraphicsCommandListXXX::WaitBarrier(
24052421
| `ppFences` | Pointer to an array of `ID3D12Fence` pointers of size `NumFences` |
24062422
| `pFenceValues` | Pointer to an array of fence values of size `NumFences` |
24072423
2408-
### ID3D12GraphicsCommandListXXX SignalBarrier
2424+
### ID3D12CommandListFenceBarriers SignalBarrier (Preview)
24092425
24102426
Executes the provided barriers, signalling a fence after all barrier transactions have fully completed. Any subsequent dependent operations must be preceded by a `WaitBarrier` with matching fence/value pairs.
24112427
24122428
If a wait barrier on a texture subresource corresponds to a preceding signal barrier, the `LayoutBefore` on the wait barrier must match the `LayoutAfter` from the signal barrier or be set to `D3D12_BARRIER_LAYOUT_UNDEFINED`, which avoids a layout transition. This effectively matches split barrier behavior where a barrier transaction is started by the split-begin barrier, and completed by the split-end barrier.
24132429
24142430
``` c++
2415-
void ID3D12GraphicsCommandListXXX::SignalBarrier(
2431+
void ID3D12CommandListFenceBarriers::SignalBarrier(
24162432
UINT NumBarrierGroups,
24172433
const D3D12_BARRIER_GROUP *pBarrierGroups,
24182434
ID3D12Fence *pFence,

0 commit comments

Comments
 (0)