aras-p / hlsl2glslfork

HLSL to GLSL language translator based on ATI's HLSL2GLSL. Used in Unity.
Other
558 stars 143 forks source link

Assigning values to xll_matrixindex_mf3x3_i() #55

Open l0ne5tar opened 10 years ago

l0ne5tar commented 10 years ago

Hi,

I'm seeing some weird code being generated where hlsl2glsl is attempting to assign a value to a function return: xll_matrixindex_mf3x3_i (TangentToWorld, 0) = test;

xll_matrixindex_mf3x3_i is implemented at the top of the generated GLSL as:

vec3 xll_matrixindex_mf3x3_i (mat3 m, int i) { vec3 v; v.x=m[0][i]; v.y=m[1][i]; v.z=m[2][i]; return v; }

so in my case the assignment is a nop :(

for reference my hlsl code fragment is: float3 test = a_Tangent; float3x3 TangentToWorld = float3x3(WorldTangent, WorldBinormal, WorldNormal); TangentToWorld[0] = test;