PixelMagic.CodeGenContext.LoadValue C# (CSharp) Method

LoadValue() private method

private LoadValue ( SrcRegister src ) : void
src SrcRegister
return void
        internal void LoadValue(SrcRegister src)
        {
            ilgen.Emit (OpCodes.Ldloc, GetReg (src.Kind, src.Number));

            if (src.Swizzle != SrcRegister.MakeSwizzle (0, 1, 2, 3))
                EmitShuffle ((ShuffleSel)src.Swizzle);

            switch (src.Modifier) {
            case SrcModifier.None:
                break;
            case SrcModifier.Negate:
                //FIXME We could be using a ^ (1 << 31) to negate (could we?)
                //FIXME Make The JIT intrinsify this
                ilgen.Emit (OpCodes.Call, typeof (Vector4f).GetMethod ("get_MinusOne"));
                ilgen.Emit (OpCodes.Call, typeof (Vector4f).GetMethod ("op_Multiply"));
                break;
            default:
                throw new Exception ("can't handle src reg modifier " + src.Modifier);
            }
        }

Usage Example

Example #1
0
 public override void EmitBody(CodeGenContext ctx)
 {
     ctx.LoadValue (src);
     ctx.StoreValue (dest);
 }
All Usage Examples Of PixelMagic.CodeGenContext::LoadValue