title: glsl vector*matrix different to hlsl
body: <p>I have two (identical) shaders, one in hlsl and one in glsl. In the pixel shader, I am multiplying a vector by a matrix for normal transformations.
  The code is essentially:</p>
  
  <p>HLSL</p>
  
  <pre><code>float3 v = ...;
  float3x3 m = ...;
  float3 n = mul(v, m);
  </code></pre>
  
  <p>GLSL</p>
  
  <pre><code>vec3 v = ...;
  mat3 m = ...;
  vec3 n = v * m;
  </code></pre>
  
  <p>This should do a row vector multiplication, yet in glsl it doesn't. If I explicitly type out the algorithm, it works for both.
  Both the glsl and hlsl spec, from what I can tell, says they should do a row vector multiply if the vector is on the left hand side, which it is.</p>
  
  <p>The other confusing thing is that I multiply a vector by a matrix in the vertex shader with the vector on the left, yet that works fine in both glsl and hlsl. This leads me to guess that it is only an issue in the fragment/pixel shader.</p>
  
  <p>I pass the matrix from the vertex shader to the fragment shader using:</p>
  
  <pre><code>out vec3 out_vs_TangentToWorldX;
  out vec3 out_vs_TangentToWorldY;
  out vec3 out_vs_TangentToWorldZ;
  
  out_vs_TangentToWorldX = tangent * world3D;
  out_vs_TangentToWorldY = binormal * world3D;
  out_vs_TangentToWorldZ = normal * world3D;
  </code></pre>
  
  <p>and in the fragment shader I reconstruct it with:</p>
  
  <pre><code>in vec3 out_vs_TangentToWorldX;
  in vec3 out_vs_TangentToWorldY;
  in vec3 out_vs_TangentToWorldZ;
  
  mat3 tangentToWorld;
  tangentToWorld[0] = out_vs_TangentToWorldX;
  tangentToWorld[1] = out_vs_TangentToWorldY;
  tangentToWorld[2] = out_vs_TangentToWorldZ;
  </code></pre>