File tree Expand file tree Collapse file tree 5 files changed +188
-189
lines changed
Expand file tree Collapse file tree 5 files changed +188
-189
lines changed Original file line number Diff line number Diff line change @@ -174,10 +174,11 @@ public void Present()
174174 {
175175 FCommandSubmit submit = new ( )
176176 {
177+ CommandCount = ( uint ) cmd . m_commands . Count ,
178+ ResourceCount = ( uint ) cmd . m_resource_metas . Count ,
179+ Commands = p_commands ,
177180 Resources = p_resources ,
178- Items = p_commands ,
179181 Payload = p_payload ,
180- Count = ( uint ) cmd . m_commands . Count ,
181182 } ;
182183 try
183184 {
@@ -208,10 +209,11 @@ public void PresentNoWait()
208209 {
209210 FCommandSubmit submit = new ( )
210211 {
212+ CommandCount = ( uint ) cmd . m_commands . Count ,
213+ ResourceCount = ( uint ) cmd . m_resource_metas . Count ,
214+ Commands = p_commands ,
211215 Resources = p_resources ,
212- Items = p_commands ,
213216 Payload = p_payload ,
214- Count = ( uint ) cmd . m_commands . Count ,
215217 } ;
216218 try
217219 {
Original file line number Diff line number Diff line change @@ -1773,17 +1773,20 @@ public partial struct FCommandSubmit
17731773
17741774 public unsafe partial struct FCommandSubmit
17751775 {
1776- [ NativeTypeName ( "Coplt::FResourceMeta *" ) ]
1777- public FResourceMeta * Resources;
1776+ [ NativeTypeName ( "Coplt::u32" ) ]
1777+ public uint CommandCount;
1778+
1779+ [ NativeTypeName ( "Coplt::u32" ) ]
1780+ public uint ResourceCount;
17781781
17791782 [ NativeTypeName ( "Coplt::FCommandItem *" ) ]
1780- public FCommandItem * Items;
1783+ public FCommandItem * Commands;
1784+
1785+ [ NativeTypeName ( "Coplt::FResourceMeta *" ) ]
1786+ public FResourceMeta * Resources;
17811787
17821788 [ NativeTypeName ( "Coplt::u8 *" ) ]
17831789 public byte * Payload;
1784-
1785- [ NativeTypeName ( "Coplt::u32" ) ]
1786- public uint Count;
17871790 }
17881791
17891792 [ Guid ( "F1C59CB4-7EE6-4EE2-80F4-07CC568920D2" ) ]
Original file line number Diff line number Diff line change @@ -289,14 +289,16 @@ namespace Coplt
289289
290290 struct FCommandSubmit
291291 {
292- // 提交操作可能会修改此内存,提交后内存将无效
292+ // 有多少命令
293+ u32 CommandCount{};
294+ // 有多少资源
295+ u32 ResourceCount{};
296+ // 需要保证对象指针生命周期 >= FCommandSubmit 的生命周期,提交操作可能会修改此内存,提交后内存将无效
297+ FCommandItem* Commands{};
298+ // 需要保证对象指针生命周期 >= FCommandSubmit 的生命周期,提交操作可能会修改此内存,提交后内存将无效
293299 FResourceMeta* Resources{};
294- // 命令项里面的对象制造需要保证生命周期 >= FCommandSubmit 的生命周期,提交操作可能会修改此内存,提交后内存将无效
295- FCommandItem* Items{};
296- // 提交操作可能会修改此内存,提交后内存将无效
300+ // 需要保证对象指针生命周期 >= FCommandSubmit 的生命周期,提交操作可能会修改此内存,提交后内存将无效
297301 u8 * Payload{};
298- // 有多少命令
299- u32 Count{};
300302 };
301303
302304#ifdef FFI_SRC
You can’t perform that action at this time.
0 commit comments