mojoshader.c
changeset 1095 bc3d2c6e06cf
parent 1094 c2009ce6278d
child 1097 cc3b4d123312
equal deleted inserted replaced
1094:c2009ce6278d 1095:bc3d2c6e06cf
  1931     {
  1931     {
  1932         fail(ctx, "Too many source args");
  1932         fail(ctx, "Too many source args");
  1933         return buf;
  1933         return buf;
  1934     } // if
  1934     } // if
  1935 
  1935 
  1936 // !!! FIXME: not right.
       
  1937     const SourceArgInfo *arg = &ctx->source_args[idx];
  1936     const SourceArgInfo *arg = &ctx->source_args[idx];
  1938 
  1937 
  1939     const char *premod_str = "";
  1938     const char *premod_str = "";
  1940     const char *postmod_str = "";
  1939     const char *postmod_str = "";
  1941     switch (arg->src_mod)
  1940     switch (arg->src_mod)
  1953             premod_str = "(";
  1952             premod_str = "(";
  1954             postmod_str = " - 0.5)";
  1953             postmod_str = " - 0.5)";
  1955             break;
  1954             break;
  1956 
  1955 
  1957         case SRCMOD_SIGNNEGATE:
  1956         case SRCMOD_SIGNNEGATE:
  1958             premod_str = "-";
  1957             premod_str = "-((";
  1959             // fall through.
  1958             postmod_str = " - 0.5) * 2.0)";
       
  1959             break;
       
  1960 
  1960         case SRCMOD_SIGN:
  1961         case SRCMOD_SIGN:
  1961             fail(ctx, "SRCMOD_SIGN unsupported"); return buf; // !!! FIXME
  1962             premod_str = "((";
  1962             postmod_str = "_bx2";
  1963             postmod_str = " - 0.5) * 2.0)";
  1963             break;
  1964             break;
  1964 
  1965 
  1965         case SRCMOD_COMPLEMENT:
  1966         case SRCMOD_COMPLEMENT:
  1966             fail(ctx, "SRCMOD_COMPLEMENT unsupported"); return buf; // !!! FIXME  (need to handle vecsize)
  1967             premod_str = "(1.0 - ";
  1967             premod_str = "(1.0 - (";
  1968             postmod_str = ")";
  1968             postmod_str = "))";
       
  1969             break;
  1969             break;
  1970 
  1970 
  1971         case SRCMOD_X2NEGATE:
  1971         case SRCMOD_X2NEGATE:
  1972             fail(ctx, "SRCMOD_X2NEGATE unsupported"); return buf; // !!! FIXME  (need to handle vecsize)
       
  1973             premod_str = "-(";
  1972             premod_str = "-(";
  1974             postmod_str = " * 2.0)";
  1973             postmod_str = " * 2.0)";
  1975             break;
  1974             break;
  1976 
  1975 
  1977         case SRCMOD_X2:
  1976         case SRCMOD_X2:
  1978             fail(ctx, "SRCMOD_X2 unsupported"); return buf; // !!! FIXME  (need to handle vecsize)
       
  1979             premod_str = "(";
  1977             premod_str = "(";
  1980             postmod_str = " * 2.0)";
  1978             postmod_str = " * 2.0)";
  1981             break;
  1979             break;
  1982 
  1980 
  1983         case SRCMOD_DZ:
  1981         case SRCMOD_DZ: