@@ -8,6 +8,7 @@ namespace Vortice.Direct3D12
8
8
{
9
9
public partial class ID3D12Device4
10
10
{
11
+ #region CreateCommandList1
11
12
public T CreateCommandList1 < T > ( CommandListType type , CommandListFlags commandListFlags = CommandListFlags . None ) where T : ID3D12GraphicsCommandList1
12
13
{
13
14
CreateCommandList1 ( 0 , type , commandListFlags , typeof ( T ) . GUID , out IntPtr nativePtr ) . CheckError ( ) ;
@@ -37,14 +38,58 @@ public Result CreateCommandList1<T>(int nodeMask, CommandListType type, CommandL
37
38
commandList = MarshallingHelpers . FromPointer < T > ( nativePtr ) ;
38
39
return result ;
39
40
}
41
+ #endregion
40
42
41
- public T ? CreateCommittedResource1 < T > (
43
+ #region CreateCommittedResource1
44
+ public T CreateCommittedResource1 < T > (
42
45
HeapProperties heapProperties ,
43
46
HeapFlags heapFlags ,
44
47
ResourceDescription description ,
45
48
ResourceStates initialResourceState ,
46
49
ID3D12ProtectedResourceSession protectedSession ,
47
50
ClearValue ? optimizedClearValue = null ) where T : ID3D12Resource1
51
+ {
52
+ CreateCommittedResource1 ( ref heapProperties , heapFlags ,
53
+ ref description ,
54
+ initialResourceState ,
55
+ optimizedClearValue ,
56
+ protectedSession ,
57
+ typeof ( T ) . GUID , out IntPtr nativePtr ) . CheckError ( ) ;
58
+ return MarshallingHelpers . FromPointer < T > ( nativePtr ) ;
59
+ }
60
+
61
+ public Result CreateCommittedResource1 < T > (
62
+ HeapProperties heapProperties ,
63
+ HeapFlags heapFlags ,
64
+ ResourceDescription description ,
65
+ ResourceStates initialResourceState ,
66
+ ID3D12ProtectedResourceSession protectedSession ,
67
+ out T ? resource ) where T : ID3D12Resource1
68
+ {
69
+ Result result = CreateCommittedResource1 ( ref heapProperties , heapFlags ,
70
+ ref description ,
71
+ initialResourceState ,
72
+ null ,
73
+ protectedSession ,
74
+ typeof ( T ) . GUID , out IntPtr nativePtr ) ;
75
+ if ( result . Failure )
76
+ {
77
+ resource = default ;
78
+ return result ;
79
+ }
80
+
81
+ resource = MarshallingHelpers . FromPointer < T > ( nativePtr ) ;
82
+ return result ;
83
+ }
84
+
85
+ public Result CreateCommittedResource1 < T > (
86
+ HeapProperties heapProperties ,
87
+ HeapFlags heapFlags ,
88
+ ResourceDescription description ,
89
+ ResourceStates initialResourceState ,
90
+ ID3D12ProtectedResourceSession protectedSession ,
91
+ ClearValue optimizedClearValue ,
92
+ out T ? resource ) where T : ID3D12Resource1
48
93
{
49
94
Result result = CreateCommittedResource1 ( ref heapProperties , heapFlags ,
50
95
ref description ,
@@ -53,45 +98,96 @@ public Result CreateCommandList1<T>(int nodeMask, CommandListType type, CommandL
53
98
protectedSession ,
54
99
typeof ( T ) . GUID , out IntPtr nativePtr ) ;
55
100
if ( result . Failure )
56
- return default ;
101
+ {
102
+ resource = default ;
103
+ return result ;
104
+ }
105
+
106
+ resource = MarshallingHelpers . FromPointer < T > ( nativePtr ) ;
107
+ return result ;
108
+ }
109
+ #endregion
57
110
111
+ #region CreateHeap1
112
+ public T CreateHeap1 < T > ( HeapDescription description , ID3D12ProtectedResourceSession protectedSession ) where T : ID3D12Heap1
113
+ {
114
+ CreateHeap1 ( ref description , protectedSession , typeof ( T ) . GUID , out IntPtr nativePtr ) . CheckError ( ) ;
58
115
return MarshallingHelpers . FromPointer < T > ( nativePtr ) ;
59
116
}
60
117
61
- public T ? CreateHeap1 < T > ( HeapDescription description , ID3D12ProtectedResourceSession protectedSession ) where T : ID3D12Heap1
118
+ public Result CreateHeap1 < T > ( HeapDescription description , ID3D12ProtectedResourceSession protectedSession , out T ? heap ) where T : ID3D12Heap1
62
119
{
63
120
Result result = CreateHeap1 ( ref description , protectedSession , typeof ( T ) . GUID , out IntPtr nativePtr ) ;
64
121
if ( result . Failure )
65
- return default ;
122
+ {
123
+ heap = default ;
124
+ return result ;
125
+ }
126
+
127
+ heap = MarshallingHelpers . FromPointer < T > ( nativePtr ) ;
128
+ return result ;
129
+ }
130
+ #endregion
66
131
132
+ #region CreateProtectedResourceSession
133
+ public T CreateProtectedResourceSession < T > ( ProtectedResourceSessionDescription description ) where T : ID3D12ProtectedResourceSession
134
+ {
135
+ CreateProtectedResourceSession ( description , typeof ( T ) . GUID , out IntPtr nativePtr ) . CheckError ( ) ;
67
136
return MarshallingHelpers . FromPointer < T > ( nativePtr ) ;
68
137
}
69
138
70
- public T ? CreateProtectedResourceSession < T > ( ProtectedResourceSessionDescription description ) where T : ID3D12ProtectedResourceSession
139
+ public Result CreateProtectedResourceSession < T > ( ProtectedResourceSessionDescription description , out T ? resource ) where T : ID3D12ProtectedResourceSession
71
140
{
72
141
Result result = CreateProtectedResourceSession ( description , typeof ( T ) . GUID , out IntPtr nativePtr ) ;
73
142
if ( result . Failure )
74
- return default ;
143
+ {
144
+ resource = default ;
145
+ return result ;
146
+ }
75
147
148
+ resource = MarshallingHelpers . FromPointer < T > ( nativePtr ) ;
149
+ return result ;
150
+ }
151
+ #endregion
152
+
153
+ #region CreateReservedResource1
154
+ public T CreateReservedResource1 < T > ( ResourceDescription description , ResourceStates initialState , ClearValue clearValue , ID3D12ProtectedResourceSession protectedResourceSession ) where T : ID3D12Resource1
155
+ {
156
+ CreateReservedResource1 ( ref description , initialState , clearValue , protectedResourceSession , typeof ( T ) . GUID , out IntPtr nativePtr ) . CheckError ( ) ;
76
157
return MarshallingHelpers . FromPointer < T > ( nativePtr ) ;
77
158
}
78
159
79
- public T ? CreateReservedResource1 < T > ( ResourceDescription description , ResourceStates initialState , ClearValue clearValue , ID3D12ProtectedResourceSession protectedResourceSession ) where T : ID3D12Resource1
160
+ public Result CreateReservedResource1 < T > ( ResourceDescription description , ResourceStates initialState , ClearValue clearValue , ID3D12ProtectedResourceSession protectedResourceSession , out T ? resource ) where T : ID3D12Resource1
80
161
{
81
162
Result result = CreateReservedResource1 ( ref description , initialState , clearValue , protectedResourceSession , typeof ( T ) . GUID , out IntPtr nativePtr ) ;
82
163
if ( result . Failure )
83
- return default ;
164
+ {
165
+ resource = default ;
166
+ return result ;
167
+ }
168
+
169
+ resource = MarshallingHelpers . FromPointer < T > ( nativePtr ) ;
170
+ return result ;
171
+ }
84
172
173
+ public T CreateReservedResource1 < T > ( ResourceDescription description , ResourceStates initialState , ID3D12ProtectedResourceSession protectedResourceSession ) where T : ID3D12Resource1
174
+ {
175
+ CreateReservedResource1 ( ref description , initialState , null , protectedResourceSession , typeof ( T ) . GUID , out IntPtr nativePtr ) . CheckError ( ) ;
85
176
return MarshallingHelpers . FromPointer < T > ( nativePtr ) ;
86
177
}
87
178
88
- public T ? CreateReservedResource1 < T > ( ResourceDescription description , ResourceStates initialState , ID3D12ProtectedResourceSession protectedResourceSession ) where T : ID3D12Resource1
179
+ public Result CreateReservedResource1 < T > ( ResourceDescription description , ResourceStates initialState , ID3D12ProtectedResourceSession protectedResourceSession , out T ? resource ) where T : ID3D12Resource1
89
180
{
90
181
Result result = CreateReservedResource1 ( ref description , initialState , null , protectedResourceSession , typeof ( T ) . GUID , out IntPtr nativePtr ) ;
91
182
if ( result . Failure )
92
- return default ;
183
+ {
184
+ resource = default ;
185
+ return result ;
186
+ }
93
187
94
- return MarshallingHelpers . FromPointer < T > ( nativePtr ) ;
188
+ resource = MarshallingHelpers . FromPointer < T > ( nativePtr ) ;
189
+ return result ;
95
190
}
191
+ #endregion
96
192
}
97
193
}
0 commit comments