Zarathos
05-19-2009, 09:22 AM
Can someone help me reversing those instructions?
ldloc.s texturedRef
conv.i
ldloc.s num11
ldloc.1
mul
ldloc.s num12
add
conv.i
sizeof [Microsoft.DirectX.Direct3D]Microsoft.DirectX.Direct3D.CustomVertex/TransformedColoredTextured
mul
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 texturedRef
conv.i
ldloc.s num11
ldloc.1
mul
ldloc.s num12
add
conv.i
sizeof [Microsoft.DirectX.Direct3D]Microsoft.DirectX.Direct3D.CustomVertex/TransformedColoredTextured
mul
add
conv.u4 <--------------- Difference
conv.u
stloc.s texturedPtr
If I compile this line removing the (byte) boxing, like that:
CustomVertex.TransformedColoredTextured* texturedPtr = (CustomVertex.TransformedColoredTextured*)(texture dRef + ((k * num2) + m));
I get those instructions (without final conv):
ldloc.s texturedRef
conv.i
ldloc.s num11
ldloc.1
mul
ldloc.s num12
add
conv.i
sizeof [Microsoft.DirectX.Direct3D]Microsoft.DirectX.Direct3D.CustomVertex/TransformedColoredTextured
mul
add
stloc.s texturedPtr
Those differences are making Texture rendering very very slow... with .NET Reflector Reflexil I injected the correct instructions and all is working fine, then I need to find a way to fix. Well... I can't get a stand alone "conv.u". Any ideas anyone?
Thanks in advance!
ldloc.s texturedRef
conv.i
ldloc.s num11
ldloc.1
mul
ldloc.s num12
add
conv.i
sizeof [Microsoft.DirectX.Direct3D]Microsoft.DirectX.Direct3D.CustomVertex/TransformedColoredTextured
mul
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 texturedRef
conv.i
ldloc.s num11
ldloc.1
mul
ldloc.s num12
add
conv.i
sizeof [Microsoft.DirectX.Direct3D]Microsoft.DirectX.Direct3D.CustomVertex/TransformedColoredTextured
mul
add
conv.u4 <--------------- Difference
conv.u
stloc.s texturedPtr
If I compile this line removing the (byte) boxing, like that:
CustomVertex.TransformedColoredTextured* texturedPtr = (CustomVertex.TransformedColoredTextured*)(texture dRef + ((k * num2) + m));
I get those instructions (without final conv):
ldloc.s texturedRef
conv.i
ldloc.s num11
ldloc.1
mul
ldloc.s num12
add
conv.i
sizeof [Microsoft.DirectX.Direct3D]Microsoft.DirectX.Direct3D.CustomVertex/TransformedColoredTextured
mul
add
stloc.s texturedPtr
Those differences are making Texture rendering very very slow... with .NET Reflector Reflexil I injected the correct instructions and all is working fine, then I need to find a way to fix. Well... I can't get a stand alone "conv.u". Any ideas anyone?
Thanks in advance!