Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.9 KiB

  1. #ifndef __PIPELN_H_
  2. #define __PIPELN_H_
  3. /*==========================================================================;
  4. *
  5. * Copyright (C) 1999 Microsoft Corporation. All Rights Reserved.
  6. *
  7. * File: pipeln.h
  8. * Content: Common definitions between Microsoft PSGP and the front-end
  9. *
  10. ***************************************************************************/
  11. //-----------------------------------------------------------------------------
  12. // Prototype of a function to copy data from input vertex stream to an input
  13. // register
  14. typedef void (*PFN_D3DCOPYELEMENT)(LPVOID pInputStream,
  15. UINT InputStreamStride,
  16. UINT count,
  17. VVM_WORD * pVertexRegister);
  18. //---------------------------------------------------------------------
  19. inline void ComputeOutputVertexOffsets(LPD3DFE_PROCESSVERTICES pv)
  20. {
  21. DWORD i = 4*sizeof(D3DVALUE);
  22. pv->pointSizeOffsetOut = i;
  23. if (pv->dwVIDOut & D3DFVF_PSIZE)
  24. i += sizeof(DWORD);
  25. pv->diffuseOffsetOut = i;
  26. if (pv->dwVIDOut & D3DFVF_DIFFUSE)
  27. i += sizeof(DWORD);
  28. pv->specularOffsetOut = i;
  29. if (pv->dwVIDOut & D3DFVF_SPECULAR)
  30. i += sizeof(DWORD);
  31. pv->fogOffsetOut = i;
  32. if (pv->dwVIDOut & D3DFVF_FOG)
  33. i += sizeof(DWORD);
  34. pv->texOffsetOut = i;
  35. }
  36. //----------------------------------------------------------------------
  37. inline DWORD MakeTexTransformFuncIndex(DWORD dwNumInpTexCoord, DWORD dwNumOutTexCoord)
  38. {
  39. DDASSERT(dwNumInpTexCoord <= 4 && dwNumOutTexCoord <= 4);
  40. return (dwNumInpTexCoord - 1) + ((dwNumOutTexCoord - 1) << 2);
  41. }
  42. //----------------------------------------------------------------------
  43. // Returns TRUE if the token is instruction token, FALSE if the token is
  44. // an operand token
  45. inline BOOL IsInstructionToken(DWORD token)
  46. {
  47. return (token & 0x80000000) == 0;
  48. }
  49. #endif // __PIPELN_H_