@@ -8,6 +8,7 @@ namespace Vortice.Direct3D12
88{
99 public partial class ID3D12Device4
1010 {
11+ #region CreateCommandList1
1112 public T CreateCommandList1 < T > ( CommandListType type , CommandListFlags commandListFlags = CommandListFlags . None ) where T : ID3D12GraphicsCommandList1
1213 {
1314 CreateCommandList1 ( 0 , type , commandListFlags , typeof ( T ) . GUID , out IntPtr nativePtr ) . CheckError ( ) ;
@@ -37,14 +38,58 @@ public Result CreateCommandList1<T>(int nodeMask, CommandListType type, CommandL
3738 commandList = MarshallingHelpers . FromPointer < T > ( nativePtr ) ;
3839 return result ;
3940 }
41+ #endregion
4042
41- public T ? CreateCommittedResource1 < T > (
43+ #region CreateCommittedResource1
44+ public T CreateCommittedResource1 < T > (
4245 HeapProperties heapProperties ,
4346 HeapFlags heapFlags ,
4447 ResourceDescription description ,
4548 ResourceStates initialResourceState ,
4649 ID3D12ProtectedResourceSession protectedSession ,
4750 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
4893 {
4994 Result result = CreateCommittedResource1 ( ref heapProperties , heapFlags ,
5095 ref description ,
@@ -53,45 +98,96 @@ public Result CreateCommandList1<T>(int nodeMask, CommandListType type, CommandL
5398 protectedSession ,
5499 typeof ( T ) . GUID , out IntPtr nativePtr ) ;
55100 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
57110
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 ( ) ;
58115 return MarshallingHelpers . FromPointer < T > ( nativePtr ) ;
59116 }
60117
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
62119 {
63120 Result result = CreateHeap1 ( ref description , protectedSession , typeof ( T ) . GUID , out IntPtr nativePtr ) ;
64121 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
66131
132+ #region CreateProtectedResourceSession
133+ public T CreateProtectedResourceSession < T > ( ProtectedResourceSessionDescription description ) where T : ID3D12ProtectedResourceSession
134+ {
135+ CreateProtectedResourceSession ( description , typeof ( T ) . GUID , out IntPtr nativePtr ) . CheckError ( ) ;
67136 return MarshallingHelpers . FromPointer < T > ( nativePtr ) ;
68137 }
69138
70- public T ? CreateProtectedResourceSession < T > ( ProtectedResourceSessionDescription description ) where T : ID3D12ProtectedResourceSession
139+ public Result CreateProtectedResourceSession < T > ( ProtectedResourceSessionDescription description , out T ? resource ) where T : ID3D12ProtectedResourceSession
71140 {
72141 Result result = CreateProtectedResourceSession ( description , typeof ( T ) . GUID , out IntPtr nativePtr ) ;
73142 if ( result . Failure )
74- return default ;
143+ {
144+ resource = default ;
145+ return result ;
146+ }
75147
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 ( ) ;
76157 return MarshallingHelpers . FromPointer < T > ( nativePtr ) ;
77158 }
78159
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
80161 {
81162 Result result = CreateReservedResource1 ( ref description , initialState , clearValue , protectedResourceSession , typeof ( T ) . GUID , out IntPtr nativePtr ) ;
82163 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+ }
84172
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 ( ) ;
85176 return MarshallingHelpers . FromPointer < T > ( nativePtr ) ;
86177 }
87178
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
89180 {
90181 Result result = CreateReservedResource1 ( ref description , initialState , null , protectedResourceSession , typeof ( T ) . GUID , out IntPtr nativePtr ) ;
91182 if ( result . Failure )
92- return default ;
183+ {
184+ resource = default ;
185+ return result ;
186+ }
93187
94- return MarshallingHelpers . FromPointer < T > ( nativePtr ) ;
188+ resource = MarshallingHelpers . FromPointer < T > ( nativePtr ) ;
189+ return result ;
95190 }
191+ #endregion
96192 }
97193}
0 commit comments