Hi all! Hope it's not a problem if I ask something about IL instructions in a forum about .NET languages, but I really need some help fixing a problem.
I'm trying to reverse those instructions...
ldloc.s texturedRefconv.i ldloc.s num11ldloc.1 mul ldloc.s num12add conv.i sizeof [Microsoft.DirectX.Direct3D]Microsoft.DirectX.Direct3D.CustomVertex/TransformedColoredTexturedmul add conv.u stloc.s texturedPtr
My best try is:
CustomVertex.TransformedColoredTextured* texturedPtr = (CustomVertex.TransformedColoredTextured*)((byte)(texturedRef + ((k * num2) + m)));
Buy I obviously get something like that:
ldloc.s texturedRefconv.i ldloc.s num11ldloc.1 mul ldloc.s num12add conv.i sizeof [Microsoft.DirectX.Direct3D]Microsoft.DirectX.Direct3D.CustomVertex/TransformedColoredTexturedmul add conv.u4 <--------------- Differenceconv.u stloc.s texturedPtr
If I compile this line removing the (byte) boxing:
CustomVertex.TransformedColoredTextured* texturedPtr = (CustomVertex.TransformedColoredTextured*)(texturedRef + ((k * num2) + m));
I get those instructions (without final conv):
ldloc.s texturedRefconv.i ldloc.s num11ldloc.1 mul ldloc.s num12add conv.i sizeof [Microsoft.DirectX.Direct3D]Microsoft.DirectX.Direct3D.CustomVertex/TransformedColoredTexturedmul add stloc.s texturedPtr
Those differences are making texture rendering process very very slow because I can't get a stand alone "conv.u". Any ideas anyone?
Thanks in advance!