Well, I'm answering like 6 years late but I did this. Apparently there's a property that contains the length of the fixed buffer! Here's a simple method to get it. You need to pass the MyStruct type and the name of the field:
public static int GetFixedBufferSize(Type type, string field)
{
FieldInfo fi = type.GetField(field);
object[] attrs = fi.GetCustomAttributes(typeof(FixedBufferAttribute), false);
if (attribs != null && attribs.Length != 0)
{
FixedBufferAttribute attr = (FixedBufferAttribute)attribs[0];
Console.WriteLine($"{attr.ElementType.Name} {field}[{attr.Length}]");
return attr.Length;
};
throw new Exception("Not a FixedBuffer");
}
Hopefully this works for you, I tried it with your example and it worked!