mojoshader.c
changeset 1299 02d36217591b
parent 1291 db27fb09421a
child 1309 b7f37f047a81
equal deleted inserted replaced
1298:b70ccc2c7a51 1299:02d36217591b
  1734     if (dims)
  1734     if (dims)
  1735     {
  1735     {
  1736         TextureType ttyp = (dims == 2) ? TEXTURE_TYPE_2D : TEXTURE_TYPE_CUBE;
  1736         TextureType ttyp = (dims == 2) ? TEXTURE_TYPE_2D : TEXTURE_TYPE_CUBE;
  1737         add_sampler(ctx, dst->regnum, ttyp, texbem);
  1737         add_sampler(ctx, dst->regnum, ttyp, texbem);
  1738     } // if
  1738     } // if
  1739 
       
  1740     add_attribute_register(ctx, REG_TYPE_TEXTURE, dst->regnum,
       
  1741                            MOJOSHADER_USAGE_TEXCOORD, dst->regnum, 0xF, 0);
       
  1742 
       
  1743     // Strictly speaking, there should be a TEX opcode prior to this call that
       
  1744     //  should fill in this metadata, but I'm not sure that's required for the
       
  1745     //  shader to assemble in D3D, so we'll do this so we don't fail with a
       
  1746     //  cryptic error message even if the developer didn't do the TEX.
       
  1747     add_attribute_register(ctx, REG_TYPE_TEXTURE, src->regnum,
       
  1748                            MOJOSHADER_USAGE_TEXCOORD, src->regnum, 0xF, 0);
       
  1749 } // state_texops
  1739 } // state_texops
  1750 
  1740 
  1751 static void state_texbem(Context *ctx, const char *opcode)
  1741 static void state_texbem(Context *ctx, const char *opcode)
  1752 {
  1742 {
  1753     // The TEXBEM equasion, according to MSDN:
  1743     // The TEXBEM equasion, according to MSDN: