mojoshader.c
changeset 1092 b669c293992b
parent 1091 4edfe78c14f8
child 1093 81cf6fbca68d
equal deleted inserted replaced
1091:4edfe78c14f8 1092:b669c293992b
  5287 EMIT_ARB1_OPCODE_UNIMPLEMENTED_FUNC(TEXM3X3VSPEC)
  5287 EMIT_ARB1_OPCODE_UNIMPLEMENTED_FUNC(TEXM3X3VSPEC)
  5288 
  5288 
  5289 static void emit_ARB1_EXPP(Context *ctx) { emit_ARB1_opcode_ds(ctx, "EX2"); }
  5289 static void emit_ARB1_EXPP(Context *ctx) { emit_ARB1_opcode_ds(ctx, "EX2"); }
  5290 static void emit_ARB1_LOGP(Context *ctx) { arb1_log(ctx, "LG2"); }
  5290 static void emit_ARB1_LOGP(Context *ctx) { arb1_log(ctx, "LG2"); }
  5291 
  5291 
  5292 EMIT_ARB1_OPCODE_UNIMPLEMENTED_FUNC(CND)
  5292 static void emit_ARB1_CND(Context *ctx)
       
  5293 {
       
  5294     char dst[64]; make_ARB1_destarg_string(ctx, dst, sizeof (dst));
       
  5295     char src0[64]; make_ARB1_srcarg_string(ctx, 0, src0, sizeof (src0));
       
  5296     char src1[64]; make_ARB1_srcarg_string(ctx, 1, src1, sizeof (src1));
       
  5297     char src2[64]; make_ARB1_srcarg_string(ctx, 2, src2, sizeof (src2));
       
  5298     char tmp[64]; allocate_ARB1_scratch_reg_name(ctx, tmp, sizeof (tmp));
       
  5299 
       
  5300     // CND compares against 0.5, but we need to compare against 0.0...
       
  5301     //  ...subtract to make up the difference.
       
  5302     output_line(ctx, "SUB %s, %s, { 0.5, 0.5, 0.5, 0.5 };", tmp, src0);
       
  5303     // D3D tests (src0 >= 0.0), but ARB1 tests (src0 < 0.0) ... so just
       
  5304     //  switch src1 and src2 to get the same results.
       
  5305     output_line(ctx, "CMP%s, %s, %s, %s;", dst, tmp, src2, src1);
       
  5306     emit_ARB1_dest_modifiers(ctx);
       
  5307 } // emit_ARB1_CND
       
  5308 
  5293 EMIT_ARB1_OPCODE_UNIMPLEMENTED_FUNC(TEXREG2RGB)
  5309 EMIT_ARB1_OPCODE_UNIMPLEMENTED_FUNC(TEXREG2RGB)
  5294 EMIT_ARB1_OPCODE_UNIMPLEMENTED_FUNC(TEXDP3TEX)
  5310 EMIT_ARB1_OPCODE_UNIMPLEMENTED_FUNC(TEXDP3TEX)
  5295 EMIT_ARB1_OPCODE_UNIMPLEMENTED_FUNC(TEXM3X2DEPTH)
  5311 EMIT_ARB1_OPCODE_UNIMPLEMENTED_FUNC(TEXM3X2DEPTH)
  5296 EMIT_ARB1_OPCODE_UNIMPLEMENTED_FUNC(TEXDP3)
  5312 EMIT_ARB1_OPCODE_UNIMPLEMENTED_FUNC(TEXDP3)
  5297 EMIT_ARB1_OPCODE_UNIMPLEMENTED_FUNC(TEXM3X3)
  5313 EMIT_ARB1_OPCODE_UNIMPLEMENTED_FUNC(TEXM3X3)