Skip to content

Commit

Permalink
Add missing operators float1 + floatN
Browse files Browse the repository at this point in the history
  • Loading branch information
redorav committed May 16, 2020
1 parent 1b9b62b commit 1656b51
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions include/hlsl++_vector_float.h
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,10 @@ namespace hlslpp
hlslpp_inline float3 operator + (const float3& f1, const float1& f2) { return float3(_hlslpp_add_ps(f1.vec, _hlslpp_perm_xxxx_ps(f2.vec))); }
hlslpp_inline float4 operator + (const float4& f1, const float1& f2) { return float4(_hlslpp_add_ps(f1.vec, _hlslpp_perm_xxxx_ps(f2.vec))); }

hlslpp_inline float2 operator + (const float1& f1, const float2& f2) { return float2(_hlslpp_add_ps(f2.vec, _hlslpp_perm_xxxx_ps(f1.vec))); }
hlslpp_inline float3 operator + (const float1& f1, const float3& f2) { return float3(_hlslpp_add_ps(f2.vec, _hlslpp_perm_xxxx_ps(f1.vec))); }
hlslpp_inline float4 operator + (const float1& f1, const float4& f2) { return float4(_hlslpp_add_ps(f2.vec, _hlslpp_perm_xxxx_ps(f1.vec))); }

hlslpp_inline float1 operator - (const float1& f1, const float1& f2) { return float1(_hlslpp_sub_ps(f1.vec, f2.vec)); }
hlslpp_inline float2 operator - (const float2& f1, const float2& f2) { return float2(_hlslpp_sub_ps(f1.vec, f2.vec)); }
hlslpp_inline float3 operator - (const float3& f1, const float3& f2) { return float3(_hlslpp_sub_ps(f1.vec, f2.vec)); }
Expand All @@ -866,6 +870,10 @@ namespace hlslpp
hlslpp_inline float3 operator - (const float3& f1, const float1& f2) { return float3(_hlslpp_sub_ps(f1.vec, _hlslpp_perm_xxxx_ps(f2.vec))); }
hlslpp_inline float4 operator - (const float4& f1, const float1& f2) { return float4(_hlslpp_sub_ps(f1.vec, _hlslpp_perm_xxxx_ps(f2.vec))); }

hlslpp_inline float2 operator - (const float1& f1, const float2& f2) { return float2(_hlslpp_sub_ps(f2.vec, _hlslpp_perm_xxxx_ps(f1.vec))); }
hlslpp_inline float3 operator - (const float1& f1, const float3& f2) { return float3(_hlslpp_sub_ps(f2.vec, _hlslpp_perm_xxxx_ps(f1.vec))); }
hlslpp_inline float4 operator - (const float1& f1, const float4& f2) { return float4(_hlslpp_sub_ps(f2.vec, _hlslpp_perm_xxxx_ps(f1.vec))); }

hlslpp_inline float1 operator * (const float1& f1, const float1& f2) { return float1(_hlslpp_mul_ps(f1.vec, f2.vec)); }
hlslpp_inline float2 operator * (const float2& f1, const float2& f2) { return float2(_hlslpp_mul_ps(f1.vec, f2.vec)); }
hlslpp_inline float3 operator * (const float3& f1, const float3& f2) { return float3(_hlslpp_mul_ps(f1.vec, f2.vec)); }
Expand All @@ -875,6 +883,10 @@ namespace hlslpp
hlslpp_inline float3 operator * (const float3& f1, const float1& f2) { return float3(_hlslpp_mul_ps(f1.vec, _hlslpp_perm_xxxx_ps(f2.vec))); }
hlslpp_inline float4 operator * (const float4& f1, const float1& f2) { return float4(_hlslpp_mul_ps(f1.vec, _hlslpp_perm_xxxx_ps(f2.vec))); }

hlslpp_inline float2 operator * (const float1& f1, const float2& f2) { return float2(_hlslpp_mul_ps(f2.vec, _hlslpp_perm_xxxx_ps(f1.vec))); }
hlslpp_inline float3 operator * (const float1& f1, const float3& f2) { return float3(_hlslpp_mul_ps(f2.vec, _hlslpp_perm_xxxx_ps(f1.vec))); }
hlslpp_inline float4 operator * (const float1& f1, const float4& f2) { return float4(_hlslpp_mul_ps(f2.vec, _hlslpp_perm_xxxx_ps(f1.vec))); }

hlslpp_inline float1 operator / (const float1& f1, const float1& f2) { return float1(_hlslpp_div_ps(f1.vec, f2.vec)); }
hlslpp_inline float2 operator / (const float2& f1, const float2& f2) { return float2(_hlslpp_div_ps(f1.vec, f2.vec)); }
hlslpp_inline float3 operator / (const float3& f1, const float3& f2) { return float3(_hlslpp_div_ps(f1.vec, f2.vec)); }
Expand All @@ -884,6 +896,10 @@ namespace hlslpp
hlslpp_inline float3 operator / (const float3& f1, const float1& f2) { return float3(_hlslpp_div_ps(f1.vec, _hlslpp_perm_xxxx_ps(f2.vec))); }
hlslpp_inline float4 operator / (const float4& f1, const float1& f2) { return float4(_hlslpp_div_ps(f1.vec, _hlslpp_perm_xxxx_ps(f2.vec))); }

hlslpp_inline float2 operator / (const float1& f1, const float2& f2) { return float2(_hlslpp_div_ps(f2.vec, _hlslpp_perm_xxxx_ps(f1.vec))); }
hlslpp_inline float3 operator / (const float1& f1, const float3& f2) { return float3(_hlslpp_div_ps(f2.vec, _hlslpp_perm_xxxx_ps(f1.vec))); }
hlslpp_inline float4 operator / (const float1& f1, const float4& f2) { return float4(_hlslpp_div_ps(f2.vec, _hlslpp_perm_xxxx_ps(f1.vec))); }

hlslpp_inline float1 operator - (const float1& f) { return float1(_hlslpp_neg_ps(f.vec)); }
hlslpp_inline float2 operator - (const float2& f) { return float2(_hlslpp_neg_ps(f.vec)); }
hlslpp_inline float3 operator - (const float3& f) { return float3(_hlslpp_neg_ps(f.vec)); }
Expand Down

0 comments on commit 1656b51

Please sign in to comment.