PixelMagic.CodeGenContext.StoreValue C# (CSharp) Method

StoreValue() private method

private StoreValue ( DestRegister dst ) : void
dst DestRegister
return void
        internal void StoreValue(DestRegister dst)
        {
            var dest = GetReg (dst.Kind, dst.Number);
            /*FIXME we must merge the instruction mask with the dest var mask.*/
            if (dst.WriteMask != 0xF) {
                //return

                var mask = GetMask (dst.WriteMask);

                //src & mask
                ilgen.Emit (OpCodes.Ldloc, mask);
                ilgen.Emit (OpCodes.Call, typeof (Vector4f).GetMethod ("op_BitwiseAnd"));

                //mask.AndNot (dest)
                ilgen.Emit (OpCodes.Ldloc, mask);
                ilgen.Emit (OpCodes.Ldloc, dest);
                ilgen.Emit (OpCodes.Call, typeof (VectorOperations).GetMethod ("AndNot", new Type[] { typeof (Vector4f), typeof (Vector4f)}));

                //(mask & src) | mask.AndNot (dest);
                ilgen.Emit (OpCodes.Call, typeof (Vector4f).GetMethod ("op_BitwiseOr"));
            }
            ilgen.Emit (OpCodes.Stloc, dest);
        }

Usage Example

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