Пример #1
0
        static SupportBuffer()
        {
            FieldSize    = Unsafe.SizeOf <Vector4 <float> >();
            RequiredSize = Unsafe.SizeOf <SupportBuffer>();

            SupportBuffer instance = new SupportBuffer();

            FragmentAlphaTestOffset        = OffsetOf(ref instance, ref instance.FragmentAlphaTest);
            FragmentIsBgraOffset           = OffsetOf(ref instance, ref instance.FragmentIsBgra);
            FragmentRenderScaleCountOffset = OffsetOf(ref instance, ref instance.FragmentRenderScaleCount);
            GraphicsRenderScaleOffset      = OffsetOf(ref instance, ref instance.RenderScale);
            ComputeRenderScaleOffset       = GraphicsRenderScaleOffset + FieldSize;
        }
Пример #2
0
 private static int OffsetOf <T>(ref SupportBuffer storage, ref T target)
 {
     return((int)Unsafe.ByteOffset(ref Unsafe.As <SupportBuffer, T>(ref storage), ref target));
 }