internal void SampleTexture(int sampler, SrcRegister texReg) { ilgen.Emit (OpCodes.Ldloc, samplerMap [sampler]); LoadValue (texReg); ilgen.Emit (OpCodes.Call, typeof (Sampler).GetMethod ("Sample")); }
public override void EmitBody(CodeGenContext ctx) { if (sampler.Kind != RegKind.SamplerState) throw new Exception ("bad tex input reg "+tex.Kind); if (tex.Kind != RegKind.Texture) throw new Exception ("bad tex coord reg"); ctx.SampleTexture (sampler.Number, tex.Number); ctx.StoreValue (dest); }