Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
arb1 TEXM3X3SPEC fix: apparently, arb1 doesn't have a DIV instruction.
  • Loading branch information
icculus committed May 19, 2012
1 parent 9d6b62c commit c41d6b4
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions mojoshader.c
Expand Up @@ -5664,7 +5664,15 @@ static void emit_ARB1_TEXM3X3SPEC(Context *ctx)
output_line(ctx, "DP3 %s.y, %s, %s;", dst, src2, src3);
output_line(ctx, "MUL %s, %s, %s;", tmp, dst, dst); // normal * normal
output_line(ctx, "MUL %s, %s, %s;", tmp2, dst, src5); // normal * eyeray
output_line(ctx, "DIV %s, %s, %s;", tmp, tmp, tmp2);

// !!! FIXME: This is goofy. There's got to be a way to do vector-wide
// !!! FIXME: divides or reciprocals...right?
output_line(ctx, "RCP %s.x, %s.x;", tmp2, tmp2);
output_line(ctx, "RCP %s.y, %s.y;", tmp2, tmp2);
output_line(ctx, "RCP %s.z, %s.z;", tmp2, tmp2);
output_line(ctx, "RCP %s.w, %s.w;", tmp2, tmp2);
output_line(ctx, "MUL %s, %s, %s;", tmp, tmp, tmp2);

output_line(ctx, "MUL %s, %s, { 2.0, 2.0, 2.0, 2.0 };", tmp, tmp);
output_line(ctx, "MAD %s, %s, %s, -%s;", tmp, tmp, dst, src5);
output_line(ctx, "TEX %s, %s, texture[%d], 3D;", dst, tmp, stage);
Expand Down Expand Up @@ -5711,7 +5719,15 @@ static void emit_ARB1_TEXM3X3VSPEC(Context *ctx)
output_line(ctx, "DP3 %s.y, %s, %s;", dst, src2, src3);
output_line(ctx, "MUL %s, %s, %s;", tmp, dst, dst); // normal * normal
output_line(ctx, "MUL %s, %s, %s;", tmp2, dst, tmp3); // normal * eyeray
output_line(ctx, "DIV %s, %s, %s;", tmp, tmp, tmp2);

// !!! FIXME: This is goofy. There's got to be a way to do vector-wide
// !!! FIXME: divides or reciprocals...right?
output_line(ctx, "RCP %s.x, %s.x;", tmp2, tmp2);
output_line(ctx, "RCP %s.y, %s.y;", tmp2, tmp2);
output_line(ctx, "RCP %s.z, %s.z;", tmp2, tmp2);
output_line(ctx, "RCP %s.w, %s.w;", tmp2, tmp2);
output_line(ctx, "MUL %s, %s, %s;", tmp, tmp, tmp2);

output_line(ctx, "MUL %s, %s, { 2.0, 2.0, 2.0, 2.0 };", tmp, tmp);
output_line(ctx, "MAD %s, %s, %s, -%s;", tmp, tmp, dst, tmp3);
output_line(ctx, "TEX %s, %s, texture[%d], 3D;", dst, tmp, stage);
Expand Down

0 comments on commit c41d6b4

Please sign in to comment.