mojoshader.c
changeset 1103 8b7c29c019d5
parent 1102 0af2fb8af7fc
child 1104 9147482e1ec7
equal deleted inserted replaced
1102:0af2fb8af7fc 1103:8b7c29c019d5
  5662     output_line(ctx, "DP3 %s.z, %s, %s;", dst, dst, src4);
  5662     output_line(ctx, "DP3 %s.z, %s, %s;", dst, dst, src4);
  5663     output_line(ctx, "DP3 %s.x, %s, %s;", dst, src0, src1);
  5663     output_line(ctx, "DP3 %s.x, %s, %s;", dst, src0, src1);
  5664     output_line(ctx, "DP3 %s.y, %s, %s;", dst, src2, src3);
  5664     output_line(ctx, "DP3 %s.y, %s, %s;", dst, src2, src3);
  5665     output_line(ctx, "MUL %s, %s, %s;", tmp, dst, dst);    // normal * normal
  5665     output_line(ctx, "MUL %s, %s, %s;", tmp, dst, dst);    // normal * normal
  5666     output_line(ctx, "MUL %s, %s, %s;", tmp2, dst, src5);  // normal * eyeray
  5666     output_line(ctx, "MUL %s, %s, %s;", tmp2, dst, src5);  // normal * eyeray
  5667     output_line(ctx, "DIV %s, %s, %s;", tmp, tmp, tmp2);
  5667 
       
  5668     // !!! FIXME: This is goofy. There's got to be a way to do vector-wide
       
  5669     // !!! FIXME:  divides or reciprocals...right?
       
  5670     output_line(ctx, "RCP %s.x, %s.x;", tmp2, tmp2);
       
  5671     output_line(ctx, "RCP %s.y, %s.y;", tmp2, tmp2);
       
  5672     output_line(ctx, "RCP %s.z, %s.z;", tmp2, tmp2);
       
  5673     output_line(ctx, "RCP %s.w, %s.w;", tmp2, tmp2);
       
  5674     output_line(ctx, "MUL %s, %s, %s;", tmp, tmp, tmp2);
       
  5675 
  5668     output_line(ctx, "MUL %s, %s, { 2.0, 2.0, 2.0, 2.0 };", tmp, tmp);
  5676     output_line(ctx, "MUL %s, %s, { 2.0, 2.0, 2.0, 2.0 };", tmp, tmp);
  5669     output_line(ctx, "MAD %s, %s, %s, -%s;", tmp, tmp, dst, src5);
  5677     output_line(ctx, "MAD %s, %s, %s, -%s;", tmp, tmp, dst, src5);
  5670     output_line(ctx, "TEX %s, %s, texture[%d], 3D;", dst, tmp, stage);
  5678     output_line(ctx, "TEX %s, %s, texture[%d], 3D;", dst, tmp, stage);
  5671     emit_ARB1_dest_modifiers(ctx);
  5679     emit_ARB1_dest_modifiers(ctx);
  5672 } // emit_ARB1_TEXM3X3SPEC
  5680 } // emit_ARB1_TEXM3X3SPEC
  5709     output_line(ctx, "DP3 %s.z, %s, %s;", dst, dst, src4);
  5717     output_line(ctx, "DP3 %s.z, %s, %s;", dst, dst, src4);
  5710     output_line(ctx, "DP3 %s.x, %s, %s;", dst, src0, src1);
  5718     output_line(ctx, "DP3 %s.x, %s, %s;", dst, src0, src1);
  5711     output_line(ctx, "DP3 %s.y, %s, %s;", dst, src2, src3);
  5719     output_line(ctx, "DP3 %s.y, %s, %s;", dst, src2, src3);
  5712     output_line(ctx, "MUL %s, %s, %s;", tmp, dst, dst);    // normal * normal
  5720     output_line(ctx, "MUL %s, %s, %s;", tmp, dst, dst);    // normal * normal
  5713     output_line(ctx, "MUL %s, %s, %s;", tmp2, dst, tmp3);  // normal * eyeray
  5721     output_line(ctx, "MUL %s, %s, %s;", tmp2, dst, tmp3);  // normal * eyeray
  5714     output_line(ctx, "DIV %s, %s, %s;", tmp, tmp, tmp2);
  5722 
       
  5723     // !!! FIXME: This is goofy. There's got to be a way to do vector-wide
       
  5724     // !!! FIXME:  divides or reciprocals...right?
       
  5725     output_line(ctx, "RCP %s.x, %s.x;", tmp2, tmp2);
       
  5726     output_line(ctx, "RCP %s.y, %s.y;", tmp2, tmp2);
       
  5727     output_line(ctx, "RCP %s.z, %s.z;", tmp2, tmp2);
       
  5728     output_line(ctx, "RCP %s.w, %s.w;", tmp2, tmp2);
       
  5729     output_line(ctx, "MUL %s, %s, %s;", tmp, tmp, tmp2);
       
  5730 
  5715     output_line(ctx, "MUL %s, %s, { 2.0, 2.0, 2.0, 2.0 };", tmp, tmp);
  5731     output_line(ctx, "MUL %s, %s, { 2.0, 2.0, 2.0, 2.0 };", tmp, tmp);
  5716     output_line(ctx, "MAD %s, %s, %s, -%s;", tmp, tmp, dst, tmp3);
  5732     output_line(ctx, "MAD %s, %s, %s, -%s;", tmp, tmp, dst, tmp3);
  5717     output_line(ctx, "TEX %s, %s, texture[%d], 3D;", dst, tmp, stage);
  5733     output_line(ctx, "TEX %s, %s, texture[%d], 3D;", dst, tmp, stage);
  5718     emit_ARB1_dest_modifiers(ctx);
  5734     emit_ARB1_dest_modifiers(ctx);
  5719 } // emit_ARB1_TEXM3X3VSPEC
  5735 } // emit_ARB1_TEXM3X3VSPEC