Skip to content

Commit e332b22

Browse files
committed
update d3dx12.h, update Agility SDK to 1.717.1-preview
- this is minimum minor version required for cooperative vectors
1 parent df6896e commit e332b22

12 files changed

+9532
-3075
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
//*********************************************************
2+
//
3+
// Copyright (c) Microsoft Corporation.
4+
// Licensed under the MIT License (MIT).
5+
//
6+
//*********************************************************
7+
8+
#ifndef __D3DX12_H__
9+
#define __D3DX12_H__
10+
11+
#include "d3d12.h"
12+
13+
#if defined( __cplusplus )
14+
15+
#include "d3dx12_barriers.h"
16+
#include "d3dx12_core.h"
17+
#include "d3dx12_default.h"
18+
#include "d3dx12_pipeline_state_stream.h"
19+
#include "d3dx12_render_pass.h"
20+
#include "d3dx12_resource_helpers.h"
21+
#include "d3dx12_root_signature.h"
22+
#include "d3dx12_property_format_table.h"
23+
24+
#ifndef D3DX12_NO_STATE_OBJECT_HELPERS
25+
#include "d3dx12_state_object.h"
26+
#endif // !D3DX12_NO_STATE_OBJECT_HELPERS
27+
28+
#ifndef D3DX12_NO_CHECK_FEATURE_SUPPORT_CLASS
29+
#include "d3dx12_check_feature_support.h"
30+
#endif // !D3DX12_NO_CHECK_FEATURE_SUPPORT_CLASS
31+
32+
#endif // defined( __cplusplus )
33+
34+
#endif //__D3DX12_H__
35+
36+
Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
//*********************************************************
2+
//
3+
// Copyright (c) Microsoft Corporation.
4+
// Licensed under the MIT License (MIT).
5+
//
6+
//*********************************************************
7+
8+
#ifndef __D3DX12_BARRIERS_H__
9+
#define __D3DX12_BARRIERS_H__
10+
11+
#if defined( __cplusplus )
12+
13+
#include "d3d12.h"
14+
15+
//------------------------------------------------------------------------------------------------
16+
struct CD3DX12_RESOURCE_BARRIER : public D3D12_RESOURCE_BARRIER
17+
{
18+
CD3DX12_RESOURCE_BARRIER() = default;
19+
explicit CD3DX12_RESOURCE_BARRIER(const D3D12_RESOURCE_BARRIER &o) noexcept :
20+
D3D12_RESOURCE_BARRIER(o)
21+
{}
22+
static inline CD3DX12_RESOURCE_BARRIER Transition(
23+
_In_ ID3D12Resource* pResource,
24+
D3D12_RESOURCE_STATES stateBefore,
25+
D3D12_RESOURCE_STATES stateAfter,
26+
UINT subresource = D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES,
27+
D3D12_RESOURCE_BARRIER_FLAGS flags = D3D12_RESOURCE_BARRIER_FLAG_NONE) noexcept
28+
{
29+
CD3DX12_RESOURCE_BARRIER result = {};
30+
D3D12_RESOURCE_BARRIER &barrier = result;
31+
result.Type = D3D12_RESOURCE_BARRIER_TYPE_TRANSITION;
32+
result.Flags = flags;
33+
barrier.Transition.pResource = pResource;
34+
barrier.Transition.StateBefore = stateBefore;
35+
barrier.Transition.StateAfter = stateAfter;
36+
barrier.Transition.Subresource = subresource;
37+
return result;
38+
}
39+
static inline CD3DX12_RESOURCE_BARRIER Aliasing(
40+
_In_opt_ ID3D12Resource* pResourceBefore,
41+
_In_opt_ ID3D12Resource* pResourceAfter) noexcept
42+
{
43+
CD3DX12_RESOURCE_BARRIER result = {};
44+
D3D12_RESOURCE_BARRIER &barrier = result;
45+
result.Type = D3D12_RESOURCE_BARRIER_TYPE_ALIASING;
46+
barrier.Aliasing.pResourceBefore = pResourceBefore;
47+
barrier.Aliasing.pResourceAfter = pResourceAfter;
48+
return result;
49+
}
50+
static inline CD3DX12_RESOURCE_BARRIER UAV(
51+
_In_opt_ ID3D12Resource* pResource) noexcept
52+
{
53+
CD3DX12_RESOURCE_BARRIER result = {};
54+
D3D12_RESOURCE_BARRIER &barrier = result;
55+
result.Type = D3D12_RESOURCE_BARRIER_TYPE_UAV;
56+
barrier.UAV.pResource = pResource;
57+
return result;
58+
}
59+
};
60+
61+
#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 608)
62+
63+
//================================================================================================
64+
// D3DX12 Enhanced Barrier Helpers
65+
//================================================================================================
66+
67+
class CD3DX12_BARRIER_SUBRESOURCE_RANGE : public D3D12_BARRIER_SUBRESOURCE_RANGE
68+
{
69+
public:
70+
CD3DX12_BARRIER_SUBRESOURCE_RANGE() = default;
71+
CD3DX12_BARRIER_SUBRESOURCE_RANGE(const D3D12_BARRIER_SUBRESOURCE_RANGE &o) noexcept :
72+
D3D12_BARRIER_SUBRESOURCE_RANGE(o)
73+
{}
74+
explicit CD3DX12_BARRIER_SUBRESOURCE_RANGE(UINT Subresource) noexcept :
75+
D3D12_BARRIER_SUBRESOURCE_RANGE{ Subresource, 0, 0, 0, 0, 0 }
76+
{}
77+
CD3DX12_BARRIER_SUBRESOURCE_RANGE(
78+
UINT firstMipLevel,
79+
UINT numMips,
80+
UINT firstArraySlice,
81+
UINT numArraySlices,
82+
UINT firstPlane = 0,
83+
UINT numPlanes = 1) noexcept :
84+
D3D12_BARRIER_SUBRESOURCE_RANGE
85+
{
86+
firstMipLevel,
87+
numMips,
88+
firstArraySlice,
89+
numArraySlices,
90+
firstPlane,
91+
numPlanes
92+
}
93+
{}
94+
};
95+
96+
class CD3DX12_GLOBAL_BARRIER : public D3D12_GLOBAL_BARRIER
97+
{
98+
public:
99+
CD3DX12_GLOBAL_BARRIER() = default;
100+
CD3DX12_GLOBAL_BARRIER(const D3D12_GLOBAL_BARRIER &o) noexcept : D3D12_GLOBAL_BARRIER(o){}
101+
CD3DX12_GLOBAL_BARRIER(
102+
D3D12_BARRIER_SYNC syncBefore,
103+
D3D12_BARRIER_SYNC syncAfter,
104+
D3D12_BARRIER_ACCESS accessBefore,
105+
D3D12_BARRIER_ACCESS accessAfter) noexcept : D3D12_GLOBAL_BARRIER {
106+
syncBefore,
107+
syncAfter,
108+
accessBefore,
109+
accessAfter
110+
}
111+
{}
112+
};
113+
114+
class CD3DX12_BUFFER_BARRIER : public D3D12_BUFFER_BARRIER
115+
{
116+
public:
117+
CD3DX12_BUFFER_BARRIER() = default;
118+
CD3DX12_BUFFER_BARRIER(const D3D12_BUFFER_BARRIER &o) noexcept : D3D12_BUFFER_BARRIER(o){}
119+
CD3DX12_BUFFER_BARRIER(
120+
D3D12_BARRIER_SYNC syncBefore,
121+
D3D12_BARRIER_SYNC syncAfter,
122+
D3D12_BARRIER_ACCESS accessBefore,
123+
D3D12_BARRIER_ACCESS accessAfter,
124+
ID3D12Resource *pRes) noexcept : D3D12_BUFFER_BARRIER {
125+
syncBefore,
126+
syncAfter,
127+
accessBefore,
128+
accessAfter,
129+
pRes,
130+
0, ULLONG_MAX
131+
}
132+
{}
133+
};
134+
135+
class CD3DX12_TEXTURE_BARRIER : public D3D12_TEXTURE_BARRIER
136+
{
137+
public:
138+
CD3DX12_TEXTURE_BARRIER() = default;
139+
CD3DX12_TEXTURE_BARRIER(const D3D12_TEXTURE_BARRIER &o) noexcept : D3D12_TEXTURE_BARRIER(o){}
140+
CD3DX12_TEXTURE_BARRIER(
141+
D3D12_BARRIER_SYNC syncBefore,
142+
D3D12_BARRIER_SYNC syncAfter,
143+
D3D12_BARRIER_ACCESS accessBefore,
144+
D3D12_BARRIER_ACCESS accessAfter,
145+
D3D12_BARRIER_LAYOUT layoutBefore,
146+
D3D12_BARRIER_LAYOUT layoutAfter,
147+
ID3D12Resource *pRes,
148+
const D3D12_BARRIER_SUBRESOURCE_RANGE &subresources,
149+
D3D12_TEXTURE_BARRIER_FLAGS flag = D3D12_TEXTURE_BARRIER_FLAG_NONE) noexcept : D3D12_TEXTURE_BARRIER {
150+
syncBefore,
151+
syncAfter,
152+
accessBefore,
153+
accessAfter,
154+
layoutBefore,
155+
layoutAfter,
156+
pRes,
157+
subresources,
158+
flag
159+
}
160+
{}
161+
};
162+
163+
class CD3DX12_BARRIER_GROUP : public D3D12_BARRIER_GROUP
164+
{
165+
public:
166+
CD3DX12_BARRIER_GROUP() = default;
167+
CD3DX12_BARRIER_GROUP(const D3D12_BARRIER_GROUP &o) noexcept : D3D12_BARRIER_GROUP(o){}
168+
CD3DX12_BARRIER_GROUP(UINT32 numBarriers, const D3D12_BUFFER_BARRIER *pBarriers) noexcept
169+
{
170+
Type = D3D12_BARRIER_TYPE_BUFFER;
171+
NumBarriers = numBarriers;
172+
pBufferBarriers = pBarriers;
173+
}
174+
CD3DX12_BARRIER_GROUP(UINT32 numBarriers, const D3D12_TEXTURE_BARRIER *pBarriers) noexcept
175+
{
176+
Type = D3D12_BARRIER_TYPE_TEXTURE;
177+
NumBarriers = numBarriers;
178+
pTextureBarriers = pBarriers;
179+
}
180+
CD3DX12_BARRIER_GROUP(UINT32 numBarriers, const D3D12_GLOBAL_BARRIER *pBarriers) noexcept
181+
{
182+
Type = D3D12_BARRIER_TYPE_GLOBAL;
183+
NumBarriers = numBarriers;
184+
pGlobalBarriers = pBarriers;
185+
}
186+
};
187+
#endif // D3D12_SDK_VERSION >= 608
188+
189+
190+
#endif // defined( __cplusplus )
191+
192+
#endif // __D3DX12_BARRIERS_H__
193+

0 commit comments

Comments
 (0)