I'm new to HLSL programming and I want to use a struct variable to init another one, i.e. to use a "copy constructor" in C++.
Since struct is customized data structure, I wonder if we can use a "=" to do the copy initialization?
e.g.
struct MyStruct {
int a;
float4 n;
}
MyStruct s1;
s1.a = 1;
s1.b = float4(1.f);
MyStruct s2 = s1;
Is the above code usable?