Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace hardcoded values with proper generated strings. #192

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Unity.Mathematics.CodeGen~/VectorGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1482,7 +1482,7 @@ public void GenerateFastInverseFunction(StringBuilder str)
{0}4 c2 = m.c2;
{0}4 pos = m.c3;

{0}4 zero = {0}4(0);
{0}4 zero = {0}4({1});

{0}4 t0 = unpacklo(c0, c2);
{0}4 t1 = unpacklo(c1, zero);
Expand All @@ -1494,7 +1494,7 @@ public void GenerateFastInverseFunction(StringBuilder str)
{0}4 r2 = unpacklo(t2, t3);

pos = -(r0 * pos.x + r1 * pos.y + r2 * pos.z);
pos.w = 1.0f;
pos.w = {2};

return {0}4x4(r0, r1, r2, pos);
}}
Expand Down
4 changes: 2 additions & 2 deletions src/Unity.Mathematics/double4x4.gen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ public static double4x4 fastinverse(double4x4 m)
double4 c2 = m.c2;
double4 pos = m.c3;

double4 zero = double4(0);
double4 zero = double4(0.0);

double4 t0 = unpacklo(c0, c2);
double4 t1 = unpacklo(c1, zero);
Expand All @@ -769,7 +769,7 @@ public static double4x4 fastinverse(double4x4 m)
double4 r2 = unpacklo(t2, t3);

pos = -(r0 * pos.x + r1 * pos.y + r2 * pos.z);
pos.w = 1.0f;
pos.w = 1.0;

return double4x4(r0, r1, r2, pos);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Unity.Mathematics/float4x4.gen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ public static float4x4 fastinverse(float4x4 m)
float4 c2 = m.c2;
float4 pos = m.c3;

float4 zero = float4(0);
float4 zero = float4(0.0f);

float4 t0 = unpacklo(c0, c2);
float4 t1 = unpacklo(c1, zero);
Expand Down