mojoshader.c
changeset 1078 cbfa46c1fda6
parent 1077 57e18783574e
child 1079 a9a27872b73c
equal deleted inserted replaced
1077:57e18783574e 1078:cbfa46c1fda6
  4560     } // else
  4560     } // else
  4561 } // emit_ARB1_LRP
  4561 } // emit_ARB1_LRP
  4562 
  4562 
  4563 EMIT_ARB1_OPCODE_DS_FUNC(FRC)
  4563 EMIT_ARB1_OPCODE_DS_FUNC(FRC)
  4564 
  4564 
  4565 // !!! FIXME: these could be implemented with vector opcodes, but it looks
  4565 static void arb1_MxXy(Context *ctx, const int x, const int y)
  4566 // !!! FIXME:  like the Microsoft HLSL compiler never generates matrix
  4566 {
  4567 // !!! FIXME:  operations for some reason.
  4567     DestArgInfo *dstarg = &ctx->dest_arg;
  4568 EMIT_ARB1_OPCODE_UNIMPLEMENTED_FUNC(M4X4)
  4568     const int origmask = dstarg->writemask;
  4569 EMIT_ARB1_OPCODE_UNIMPLEMENTED_FUNC(M4X3)
  4569     char src0[64];
  4570 EMIT_ARB1_OPCODE_UNIMPLEMENTED_FUNC(M3X4)
  4570     int i;
  4571 EMIT_ARB1_OPCODE_UNIMPLEMENTED_FUNC(M3X3)
  4571 
  4572 EMIT_ARB1_OPCODE_UNIMPLEMENTED_FUNC(M3X2)
  4572     make_ARB1_srcarg_string(ctx, 0, src0, sizeof (src0));
       
  4573 
       
  4574     for (i = 0; i < y; i++)
       
  4575     {
       
  4576         char dst[64];
       
  4577         char row[64];
       
  4578         make_ARB1_srcarg_string(ctx, i + 1, row, sizeof (row));
       
  4579         set_dstarg_writemask(dstarg, 1 << i);
       
  4580         make_ARB1_destarg_string(ctx, dst, sizeof (dst));
       
  4581         output_line(ctx, "DP%d%s, %s, %s;", x, dst, src0, row);
       
  4582     } // for
       
  4583 
       
  4584     set_dstarg_writemask(dstarg, origmask);
       
  4585     emit_ARB1_dest_modifiers(ctx);
       
  4586 } // arb1_MxXy
       
  4587 
       
  4588 static void emit_ARB1_M4X4(Context *ctx) { arb1_MxXy(ctx, 4, 4); }
       
  4589 static void emit_ARB1_M4X3(Context *ctx) { arb1_MxXy(ctx, 4, 3); }
       
  4590 static void emit_ARB1_M3X4(Context *ctx) { arb1_MxXy(ctx, 3, 4); }
       
  4591 static void emit_ARB1_M3X3(Context *ctx) { arb1_MxXy(ctx, 3, 3); }
       
  4592 static void emit_ARB1_M3X2(Context *ctx) { arb1_MxXy(ctx, 3, 2); }
  4573 
  4593 
  4574 static void emit_ARB1_CALL(Context *ctx)
  4594 static void emit_ARB1_CALL(Context *ctx)
  4575 {
  4595 {
  4576     if (!support_nv2(ctx))  // no branching in stock ARB1.
  4596     if (!support_nv2(ctx))  // no branching in stock ARB1.
  4577     {
  4597     {