aras-p/hlsl2glslfork — Issue #7: float mul(vec3, vec3)
Author: GregorGullwi
Created: 2012-02-01 13:22:04+00:00
State: open

The library converts all mul() calls to regular multiplication operations, but there's a special case that doesn't work and that's when it's assigned to a scalar and not a vector.

The example I have is:
float3 aVector = float3(1, 2, 3);
float a = mul(aVector, aVector);

it currently converts to:
float a = ( aVector * aVector );

which doesn't compile... it should be a dot product instead:
float a = dot(aVector, aVector);