• Create Account

### #ActualHodgman

Posted 21 September 2012 - 05:05 AM

If the compiler is stubbornly optimizing out variables like this, you can force it to include them by making sure they affect the output in some (very small) way, e.g.
float4x4 temp1 = FirstTenSkeleton[0]
+ FirstTenSkeleton[1]
+ FirstTenSkeleton[2]
+ FirstTenSkeleton[3];//etc
float4 temp2 = Bones[0]+Bones[1]+Bones[2]+Bones[3];
float temp3 = dot(temp2, (float4)1);
Out.Texture.x += temp3 * 0.0001;

### #1Hodgman

Posted 21 September 2012 - 05:04 AM

If the compiler is stubbornly optimizing out variables like this, you can force it to include them by making sure they affect the output in some (very small) way, e.g.
float4x4 temp1 = FirstTenSkeleton[0]
+ FirstTenSkeleton[1]
+ FirstTenSkeleton[2]
+ FirstTenSkeleton[3];//etc
float4 temp2 = Bones[0]+Bones[1]+Bones[2]+Bones[3];
float temp3 = dot(temp2, (float4)0.0001);
Out.Texture.x += temp3 * 0.0001;

PARTNERS