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.

72 lines
2.6 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. // Copyright (C) Microsoft Corporation, 2000.
  3. //
  4. // vshdrval.hpp
  5. //
  6. // Direct3D Reference Device - VertexShader validation
  7. //
  8. ///////////////////////////////////////////////////////////////////////////////
  9. #ifndef __VSHDRVAL_HPP__
  10. #define __VSHDRVAL_HPP__
  11. #define VS_INST_TOKEN_RESERVED_MASK 0xffff0000 // bits 16-23, 24-29, 30, 31 must be 0
  12. #define VS_DSTPARAM_TOKEN_RESERVED_MASK 0x0ff0e000 // bits 13-15, 20-23, 24-27 must be 0
  13. #define VS_SRCPARAM_TOKEN_RESERVED_MASK 0x40000000 // bit 30 must be 0
  14. //-----------------------------------------------------------------------------
  15. // CVSInstruction
  16. //-----------------------------------------------------------------------------
  17. class CVSInstruction : public CBaseInstruction
  18. {
  19. public:
  20. CVSInstruction(CVSInstruction* pPrevInst) : CBaseInstruction(pPrevInst) {};
  21. void CalculateComponentReadMasks(DWORD dwVersion);
  22. };
  23. //-----------------------------------------------------------------------------
  24. // CVShaderValidator
  25. //-----------------------------------------------------------------------------
  26. class CVShaderValidator : public CBaseShaderValidator
  27. {
  28. private:
  29. void ValidateDeclaration();
  30. const DWORD* m_pDecl;
  31. BOOL m_bFixedFunction;
  32. DWORD m_dwMaxVertexShaderConst; // d3d8 cap
  33. BOOL m_bIgnoreConstantInitializationChecks;
  34. CRegisterFile* m_pTempRegFile;
  35. CRegisterFile* m_pInputRegFile;
  36. CRegisterFile* m_pConstRegFile;
  37. CRegisterFile* m_pAddrRegFile;
  38. CRegisterFile* m_pTexCrdOutputRegFile;
  39. CRegisterFile* m_pAttrOutputRegFile;
  40. CRegisterFile* m_pRastOutputRegFile;
  41. CBaseInstruction* AllocateNewInstruction(CBaseInstruction*pPrevInst);
  42. BOOL DecodeNextInstruction();
  43. BOOL InitValidation();
  44. BOOL ApplyPerInstructionRules();
  45. void ApplyPostInstructionsRules();
  46. BOOL Rule_InstructionRecognized();
  47. BOOL Rule_InstructionSupportedByVersion();
  48. BOOL Rule_ValidParamCount();
  49. BOOL Rule_ValidSrcParams();
  50. BOOL Rule_SrcInitialized();
  51. BOOL Rule_ValidAddressRegWrite();
  52. BOOL Rule_ValidDstParam();
  53. BOOL Rule_ValidFRCInstruction();
  54. BOOL Rule_ValidRegisterPortUsage();
  55. BOOL Rule_ValidInstructionCount(); // Call per instruction AND after all instructions seen
  56. BOOL Rule_oPosWritten(); // Call after all instructions seen
  57. public:
  58. CVShaderValidator( const DWORD* pCode,
  59. const DWORD* pDecl,
  60. const D3DCAPS8* pCaps,
  61. DWORD Flags );
  62. ~CVShaderValidator();
  63. };
  64. #endif __VSHDRVAL_HPP__