mojoshader.c
branchtrunk
changeset 184 5d196ad56b25
parent 183 2aacea2477f6
child 185 ea719ad60d81
equal deleted inserted replaced
183:2aacea2477f6 184:5d196ad56b25
  1641     const DestArgInfo *arg = &ctx->dest_arg;
  1641     const DestArgInfo *arg = &ctx->dest_arg;
  1642 
  1642 
  1643     if (arg->writemask == 0x0)
  1643     if (arg->writemask == 0x0)
  1644         fail(ctx, "BUG: empty writemask");  // !!! FIXME: make this a no-op?
  1644         fail(ctx, "BUG: empty writemask");  // !!! FIXME: make this a no-op?
  1645 
  1645 
  1646     char clampbuf[16] = { '\0' };
  1646     char clampbuf[32] = { '\0' };
  1647     const char *clampleft = "";
  1647     const char *clampleft = "";
  1648     const char *clampright = "";
  1648     const char *clampright = "";
  1649     if (arg->result_mod & MOD_SATURATE)
  1649     if (arg->result_mod & MOD_SATURATE)
  1650     {
  1650     {
  1651         const int vecsize = vecsize_from_writemask(arg->writemask);
  1651         const int vecsize = vecsize_from_writemask(arg->writemask);
  1654             clampright = ", 0.0, 1.0)";
  1654             clampright = ", 0.0, 1.0)";
  1655         else
  1655         else
  1656         {
  1656         {
  1657             snprintf(clampbuf, sizeof (clampbuf),
  1657             snprintf(clampbuf, sizeof (clampbuf),
  1658                      ", vec%d(0.0), vec%d(1.0))", vecsize, vecsize);
  1658                      ", vec%d(0.0), vec%d(1.0))", vecsize, vecsize);
       
  1659             clampright = clampbuf;
  1659         } // else
  1660         } // else
  1660     } // if
  1661     } // if
  1661 
  1662 
  1662     // MSDN says MOD_PP is a hint and many implementations ignore it. So do we.
  1663     // MSDN says MOD_PP is a hint and many implementations ignore it. So do we.
  1663 
  1664