mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-10-20 11:01:08 +00:00
Guarantee struct type field ordering
This commit is contained in:
1 parent
ef6dcaf8b4
commit
abdec82be1
1 file changed
+3
-1
@@ -23,6 +23,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Reflection;
|
||||
using System.Collections.Generic;
|
||||
@@ -454,7 +455,8 @@ namespace renderdoc
|
||||
return null;
|
||||
|
||||
// Get instance fields of the structure type.
|
||||
FieldInfo[] fields = structureType.GetFields(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);
|
||||
FieldInfo[] fields = structureType.GetFields(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance)
|
||||
.OrderBy(field => field.MetadataToken).ToArray();
|
||||
|
||||
object ret = Activator.CreateInstance(structureType);
|
||||
|
||||
|
||||
Reference in new issue
Block a user