Original Post
I am wondering how to set float2 and float3 values in an HLSL Effect. The method exposed by the Dx Effects framework "SetValue" has 16 overloads, two of which have signatures: void SetValue(EffectHandle handle, Vector4 v4) void SetValue(EffectHandle handle, void* data, int dataSize) Unfortunately, I cannot figure out how to set the value of a float2 or a float3 using either of these (none of the other overloads seem helpful either). For the first overload listed I tried having a dummy Vector4 and setting its X and Y components to the X and Y of the intended Vector2; an exception was thrown as a result (presumably since the Effect parameter did not have a Z or W component to work with, but who knows since Dx error messages are worthless). Using the second listed overload I tried: unsafe { fixed ( void* pointer = &myVector2 ) { myEffect.SetValue(myEffectHandle, pointer, 8); } } which also threw an exception. If anyone knows how to do this I would appreciate any help. I would prefer a "safe" implementation, but will be glad to have anything that works. Thanks in advance.