DxilModule.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // //
  3. // DxilModule.h //
  4. // Copyright (C) Microsoft Corporation. All rights reserved. //
  5. // This file is distributed under the University of Illinois Open Source //
  6. // License. See LICENSE.TXT for details. //
  7. // //
  8. // The main class to work with DXIL, similar to LLVM module. //
  9. // //
  10. ///////////////////////////////////////////////////////////////////////////////
  11. #pragma once
  12. #include "dxc/HLSL/DxilMetadataHelper.h"
  13. #include "dxc/HLSL/DxilCBuffer.h"
  14. #include "dxc/HLSL/DxilResource.h"
  15. #include "dxc/HLSL/DxilSampler.h"
  16. #include "dxc/HLSL/DxilSignature.h"
  17. #include "dxc/HLSL/DxilConstants.h"
  18. #include "dxc/HLSL/DxilTypeSystem.h"
  19. #include "dxc/HLSL/ComputeViewIdState.h"
  20. #include <memory>
  21. #include <string>
  22. #include <vector>
  23. #include <unordered_map>
  24. namespace llvm {
  25. class LLVMContext;
  26. class Module;
  27. class Function;
  28. class Instruction;
  29. class MDTuple;
  30. class MDOperand;
  31. class DebugInfoFinder;
  32. };
  33. namespace hlsl {
  34. class ShaderModel;
  35. class OP;
  36. class RootSignatureHandle;
  37. struct DxilFunctionProps;
  38. /// Use this class to manipulate DXIL of a shader.
  39. class DxilModule {
  40. public:
  41. DxilModule(llvm::Module *pModule);
  42. ~DxilModule();
  43. // Subsystems.
  44. llvm::LLVMContext &GetCtx() const;
  45. llvm::Module *GetModule() const;
  46. OP *GetOP() const;
  47. void SetShaderModel(const ShaderModel *pSM);
  48. const ShaderModel *GetShaderModel() const;
  49. void GetDxilVersion(unsigned &DxilMajor, unsigned &DxilMinor) const;
  50. void SetValidatorVersion(unsigned ValMajor, unsigned ValMinor);
  51. bool UpgradeValidatorVersion(unsigned ValMajor, unsigned ValMinor);
  52. void GetValidatorVersion(unsigned &ValMajor, unsigned &ValMinor) const;
  53. // Return true on success, requires valid shader model and CollectShaderFlags to have been set
  54. bool GetMinValidatorVersion(unsigned &ValMajor, unsigned &ValMinor) const;
  55. // Update validator version to minimum if higher than current (ex: after CollectShaderFlags)
  56. bool UpgradeToMinValidatorVersion();
  57. // Entry functions.
  58. llvm::Function *GetEntryFunction();
  59. const llvm::Function *GetEntryFunction() const;
  60. void SetEntryFunction(llvm::Function *pEntryFunc);
  61. const std::string &GetEntryFunctionName() const;
  62. void SetEntryFunctionName(const std::string &name);
  63. llvm::Function *GetPatchConstantFunction();
  64. const llvm::Function *GetPatchConstantFunction() const;
  65. void SetPatchConstantFunction(llvm::Function *pFunc);
  66. // Flags.
  67. unsigned GetGlobalFlags() const;
  68. // TODO: move out of DxilModule as a util.
  69. void CollectShaderFlags();
  70. // Resources.
  71. unsigned AddCBuffer(std::unique_ptr<DxilCBuffer> pCB);
  72. DxilCBuffer &GetCBuffer(unsigned idx);
  73. const DxilCBuffer &GetCBuffer(unsigned idx) const;
  74. const std::vector<std::unique_ptr<DxilCBuffer> > &GetCBuffers() const;
  75. unsigned AddSampler(std::unique_ptr<DxilSampler> pSampler);
  76. DxilSampler &GetSampler(unsigned idx);
  77. const DxilSampler &GetSampler(unsigned idx) const;
  78. const std::vector<std::unique_ptr<DxilSampler> > &GetSamplers() const;
  79. unsigned AddSRV(std::unique_ptr<DxilResource> pSRV);
  80. DxilResource &GetSRV(unsigned idx);
  81. const DxilResource &GetSRV(unsigned idx) const;
  82. const std::vector<std::unique_ptr<DxilResource> > &GetSRVs() const;
  83. unsigned AddUAV(std::unique_ptr<DxilResource> pUAV);
  84. DxilResource &GetUAV(unsigned idx);
  85. const DxilResource &GetUAV(unsigned idx) const;
  86. const std::vector<std::unique_ptr<DxilResource> > &GetUAVs() const;
  87. void CreateResourceLinkInfo();
  88. struct ResourceLinkInfo;
  89. const ResourceLinkInfo &GetResourceLinkInfo(DXIL::ResourceClass resClass,
  90. unsigned rangeID) const;
  91. void LoadDxilResourceBaseFromMDNode(llvm::MDNode *MD, DxilResourceBase &R);
  92. void LoadDxilResourceFromMDNode(llvm::MDNode *MD, DxilResource &R);
  93. void LoadDxilSamplerFromMDNode(llvm::MDNode *MD, DxilSampler &S);
  94. void RemoveUnusedResources();
  95. void RemoveFunction(llvm::Function *F);
  96. // Signatures.
  97. DxilSignature &GetInputSignature();
  98. const DxilSignature &GetInputSignature() const;
  99. DxilSignature &GetOutputSignature();
  100. const DxilSignature &GetOutputSignature() const;
  101. DxilSignature &GetPatchConstantSignature();
  102. const DxilSignature &GetPatchConstantSignature() const;
  103. const RootSignatureHandle &GetRootSignature() const;
  104. bool HasDxilEntrySignature(llvm::Function *F) const;
  105. DxilEntrySignature &GetDxilEntrySignature(llvm::Function *F);
  106. // Move DxilEntrySignature of F to NewF.
  107. void ReplaceDxilEntrySignature(llvm::Function *F, llvm::Function *NewF);
  108. // DxilFunctionProps.
  109. bool HasDxilFunctionProps(llvm::Function *F) const;
  110. DxilFunctionProps &GetDxilFunctionProps(llvm::Function *F);
  111. // Move DxilFunctionProps of F to NewF.
  112. void ReplaceDxilFunctionProps(llvm::Function *F, llvm::Function *NewF);
  113. // Remove Root Signature from module metadata
  114. void StripRootSignatureFromMetadata();
  115. // Update validator version metadata to current setting
  116. void UpdateValidatorVersionMetadata();
  117. // DXIL type system.
  118. DxilTypeSystem &GetTypeSystem();
  119. /// Emit llvm.used array to make sure that optimizations do not remove unreferenced globals.
  120. void EmitLLVMUsed();
  121. std::vector<llvm::GlobalVariable* > &GetLLVMUsed();
  122. // ViewId state.
  123. DxilViewIdState &GetViewIdState();
  124. const DxilViewIdState &GetViewIdState() const;
  125. // DXIL metadata manipulation.
  126. /// Clear all DXIL data that exists in in-memory form.
  127. static void ClearDxilMetadata(llvm::Module &M);
  128. /// Serialize DXIL in-memory form to metadata form.
  129. void EmitDxilMetadata();
  130. /// Update resource metadata.
  131. void ReEmitDxilResources();
  132. /// Deserialize DXIL metadata form into in-memory form.
  133. void LoadDxilMetadata();
  134. /// Check if a Named meta data node is known by dxil module.
  135. static bool IsKnownNamedMetaData(llvm::NamedMDNode &Node);
  136. // Reset functions used to transfer ownership.
  137. void ResetEntrySignature(DxilEntrySignature *pValue);
  138. void ResetRootSignature(RootSignatureHandle *pValue);
  139. void ResetTypeSystem(DxilTypeSystem *pValue);
  140. void ResetOP(hlsl::OP *hlslOP);
  141. void ResetFunctionPropsMap(
  142. std::unordered_map<llvm::Function *, std::unique_ptr<DxilFunctionProps>>
  143. &&propsMap);
  144. void ResetEntrySignatureMap(
  145. std::unordered_map<llvm::Function *, std::unique_ptr<DxilEntrySignature>>
  146. &&SigMap);
  147. void StripDebugRelatedCode();
  148. llvm::DebugInfoFinder &GetOrCreateDebugInfoFinder();
  149. static DxilModule *TryGetDxilModule(llvm::Module *pModule);
  150. // Helpers for working with precise.
  151. // Return true if the instruction should be considered precise.
  152. //
  153. // An instruction can be marked precise in the following ways:
  154. //
  155. // 1. Global refactoring is disabled.
  156. // 2. The instruction has a precise metadata annotation.
  157. // 3. The instruction has precise fast math flags set.
  158. //
  159. bool IsPrecise(const llvm::Instruction *inst) const;
  160. // Check if the instruction has fast math flags configured to indicate
  161. // the instruction is precise.
  162. static bool HasPreciseFastMathFlags(const llvm::Instruction *inst);
  163. // Set fast math flags configured to indicate the instruction is precise.
  164. static void SetPreciseFastMathFlags(llvm::Instruction *inst);
  165. // True if fast math flags are preserved across serialize/deserialize.
  166. static bool PreservesFastMathFlags(const llvm::Instruction *inst);
  167. public:
  168. // Shader properties.
  169. class ShaderFlags {
  170. public:
  171. ShaderFlags();
  172. unsigned GetGlobalFlags() const;
  173. void SetDisableOptimizations(bool flag) { m_bDisableOptimizations = flag; }
  174. bool GetDisableOptimizations() const { return m_bDisableOptimizations; }
  175. void SetDisableMathRefactoring(bool flag) { m_bDisableMathRefactoring = flag; }
  176. bool GetDisableMathRefactoring() const { return m_bDisableMathRefactoring; }
  177. void SetEnableDoublePrecision(bool flag) { m_bEnableDoublePrecision = flag; }
  178. bool GetEnableDoublePrecision() const { return m_bEnableDoublePrecision; }
  179. void SetForceEarlyDepthStencil(bool flag) { m_bForceEarlyDepthStencil = flag; }
  180. bool GetForceEarlyDepthStencil() const { return m_bForceEarlyDepthStencil; }
  181. void SetEnableRawAndStructuredBuffers(bool flag) { m_bEnableRawAndStructuredBuffers = flag; }
  182. bool GetEnableRawAndStructuredBuffers() const { return m_bEnableRawAndStructuredBuffers; }
  183. void SetLowPrecisionPresent(bool flag) { m_bLowPrecisionPresent = flag; }
  184. bool GetLowPrecisionPresent() const { return m_bLowPrecisionPresent; }
  185. void SetEnableDoubleExtensions(bool flag) { m_bEnableDoubleExtensions = flag; }
  186. bool GetEnableDoubleExtensions() const { return m_bEnableDoubleExtensions; }
  187. void SetEnableMSAD(bool flag) { m_bEnableMSAD = flag; }
  188. bool GetEnableMSAD() const { return m_bEnableMSAD; }
  189. void SetAllResourcesBound(bool flag) { m_bAllResourcesBound = flag; }
  190. bool GetAllResourcesBound() const { return m_bAllResourcesBound; }
  191. uint64_t GetFeatureInfo() const;
  192. void SetCSRawAndStructuredViaShader4X(bool flag) { m_bCSRawAndStructuredViaShader4X = flag; }
  193. bool GetCSRawAndStructuredViaShader4X() const { return m_bCSRawAndStructuredViaShader4X; }
  194. void SetROVs(bool flag) { m_bROVS = flag; }
  195. bool GetROVs() const { return m_bROVS; }
  196. void SetWaveOps(bool flag) { m_bWaveOps = flag; }
  197. bool GetWaveOps() const { return m_bWaveOps; }
  198. void SetInt64Ops(bool flag) { m_bInt64Ops = flag; }
  199. bool GetInt64Ops() const { return m_bInt64Ops; }
  200. void SetTiledResources(bool flag) { m_bTiledResources = flag; }
  201. bool GetTiledResources() const { return m_bTiledResources; }
  202. void SetStencilRef(bool flag) { m_bStencilRef = flag; }
  203. bool GetStencilRef() const { return m_bStencilRef; }
  204. void SetInnerCoverage(bool flag) { m_bInnerCoverage = flag; }
  205. bool GetInnerCoverage() const { return m_bInnerCoverage; }
  206. void SetViewportAndRTArrayIndex(bool flag) { m_bViewportAndRTArrayIndex = flag; }
  207. bool GetViewportAndRTArrayIndex() const { return m_bViewportAndRTArrayIndex; }
  208. void SetUAVLoadAdditionalFormats(bool flag) { m_bUAVLoadAdditionalFormats = flag; }
  209. bool GetUAVLoadAdditionalFormats() const { return m_bUAVLoadAdditionalFormats; }
  210. void SetLevel9ComparisonFiltering(bool flag) { m_bLevel9ComparisonFiltering = flag; }
  211. bool GetLevel9ComparisonFiltering() const { return m_bLevel9ComparisonFiltering; }
  212. void Set64UAVs(bool flag) { m_b64UAVs = flag; }
  213. bool Get64UAVs() const { return m_b64UAVs; }
  214. void SetUAVsAtEveryStage(bool flag) { m_UAVsAtEveryStage = flag; }
  215. bool GetUAVsAtEveryStage() const { return m_UAVsAtEveryStage; }
  216. void SetViewID(bool flag) { m_bViewID = flag; }
  217. bool GetViewID() const { return m_bViewID; }
  218. void SetBarycentrics(bool flag) { m_bBarycentrics = flag; }
  219. bool GetBarycentrics() const { return m_bBarycentrics; }
  220. void SetUseNativeLowPrecision(bool flag) { m_bUseNativeLowPrecision = flag; }
  221. bool GetUseNativeLowPrecision() const { return m_bUseNativeLowPrecision; }
  222. static uint64_t GetShaderFlagsRawForCollection(); // some flags are collected (eg use 64-bit), some provided (eg allow refactoring)
  223. uint64_t GetShaderFlagsRaw() const;
  224. void SetShaderFlagsRaw(uint64_t data);
  225. private:
  226. unsigned m_bDisableOptimizations :1; // D3D11_1_SB_GLOBAL_FLAG_SKIP_OPTIMIZATION
  227. unsigned m_bDisableMathRefactoring :1; //~D3D10_SB_GLOBAL_FLAG_REFACTORING_ALLOWED
  228. unsigned m_bEnableDoublePrecision :1; // D3D11_SB_GLOBAL_FLAG_ENABLE_DOUBLE_PRECISION_FLOAT_OPS
  229. unsigned m_bForceEarlyDepthStencil :1; // D3D11_SB_GLOBAL_FLAG_FORCE_EARLY_DEPTH_STENCIL
  230. unsigned m_bEnableRawAndStructuredBuffers :1; // D3D11_SB_GLOBAL_FLAG_ENABLE_RAW_AND_STRUCTURED_BUFFERS
  231. unsigned m_bLowPrecisionPresent :1; // D3D11_1_SB_GLOBAL_FLAG_ENABLE_MINIMUM_PRECISION
  232. unsigned m_bEnableDoubleExtensions :1; // D3D11_1_SB_GLOBAL_FLAG_ENABLE_DOUBLE_EXTENSIONS
  233. unsigned m_bEnableMSAD :1; // D3D11_1_SB_GLOBAL_FLAG_ENABLE_SHADER_EXTENSIONS
  234. unsigned m_bAllResourcesBound :1; // D3D12_SB_GLOBAL_FLAG_ALL_RESOURCES_BOUND
  235. unsigned m_bViewportAndRTArrayIndex :1; // SHADER_FEATURE_VIEWPORT_AND_RT_ARRAY_INDEX_FROM_ANY_SHADER_FEEDING_RASTERIZER
  236. unsigned m_bInnerCoverage :1; // SHADER_FEATURE_INNER_COVERAGE
  237. unsigned m_bStencilRef :1; // SHADER_FEATURE_STENCIL_REF
  238. unsigned m_bTiledResources :1; // SHADER_FEATURE_TILED_RESOURCES
  239. unsigned m_bUAVLoadAdditionalFormats :1; // SHADER_FEATURE_TYPED_UAV_LOAD_ADDITIONAL_FORMATS
  240. unsigned m_bLevel9ComparisonFiltering :1; // SHADER_FEATURE_LEVEL_9_COMPARISON_FILTERING
  241. // SHADER_FEATURE_11_1_SHADER_EXTENSIONS shared with EnableMSAD
  242. unsigned m_b64UAVs :1; // SHADER_FEATURE_64_UAVS
  243. unsigned m_UAVsAtEveryStage :1; // SHADER_FEATURE_UAVS_AT_EVERY_STAGE
  244. unsigned m_bCSRawAndStructuredViaShader4X : 1; // SHADER_FEATURE_COMPUTE_SHADERS_PLUS_RAW_AND_STRUCTURED_BUFFERS_VIA_SHADER_4_X
  245. // SHADER_FEATURE_COMPUTE_SHADERS_PLUS_RAW_AND_STRUCTURED_BUFFERS_VIA_SHADER_4_X is specifically
  246. // about shader model 4.x.
  247. unsigned m_bROVS :1; // SHADER_FEATURE_ROVS
  248. unsigned m_bWaveOps :1; // SHADER_FEATURE_WAVE_OPS
  249. unsigned m_bInt64Ops :1; // SHADER_FEATURE_INT64_OPS
  250. unsigned m_bViewID : 1; // SHADER_FEATURE_VIEWID
  251. unsigned m_bBarycentrics : 1; // SHADER_FEATURE_BARYCENTRICS
  252. unsigned m_bUseNativeLowPrecision : 1;
  253. unsigned m_align0 : 8; // align to 32 bit.
  254. uint32_t m_align1; // align to 64 bit.
  255. };
  256. ShaderFlags m_ShaderFlags;
  257. void CollectShaderFlags(ShaderFlags &Flags);
  258. // Check if DxilModule contains multi component UAV Loads.
  259. // This funciton must be called after unused resources are removed from DxilModule
  260. bool ModuleHasMulticomponentUAVLoads();
  261. // Compute shader.
  262. unsigned m_NumThreads[3];
  263. // Geometry shader.
  264. DXIL::InputPrimitive GetInputPrimitive() const;
  265. void SetInputPrimitive(DXIL::InputPrimitive IP);
  266. unsigned GetMaxVertexCount() const;
  267. void SetMaxVertexCount(unsigned Count);
  268. DXIL::PrimitiveTopology GetStreamPrimitiveTopology() const;
  269. void SetStreamPrimitiveTopology(DXIL::PrimitiveTopology Topology);
  270. bool HasMultipleOutputStreams() const;
  271. unsigned GetOutputStream() const;
  272. unsigned GetGSInstanceCount() const;
  273. void SetGSInstanceCount(unsigned Count);
  274. bool IsStreamActive(unsigned Stream) const;
  275. void SetStreamActive(unsigned Stream, bool bActive);
  276. void SetActiveStreamMask(unsigned Mask);
  277. unsigned GetActiveStreamMask() const;
  278. // Hull and Domain shaders.
  279. unsigned GetInputControlPointCount() const;
  280. void SetInputControlPointCount(unsigned NumICPs);
  281. DXIL::TessellatorDomain GetTessellatorDomain() const;
  282. void SetTessellatorDomain(DXIL::TessellatorDomain TessDomain);
  283. // Hull shader.
  284. unsigned GetOutputControlPointCount() const;
  285. void SetOutputControlPointCount(unsigned NumOCPs);
  286. DXIL::TessellatorPartitioning GetTessellatorPartitioning() const;
  287. void SetTessellatorPartitioning(DXIL::TessellatorPartitioning TessPartitioning);
  288. DXIL::TessellatorOutputPrimitive GetTessellatorOutputPrimitive() const;
  289. void SetTessellatorOutputPrimitive(DXIL::TessellatorOutputPrimitive TessOutputPrimitive);
  290. float GetMaxTessellationFactor() const;
  291. void SetMaxTessellationFactor(float MaxTessellationFactor);
  292. void SetShaderProperties(DxilFunctionProps *props);
  293. // Shader resource information only needed before linking.
  294. // Use constant as rangeID for resource in a library.
  295. // When link the library, replace these constants with real rangeID.
  296. struct ResourceLinkInfo {
  297. llvm::Constant *ResRangeID;
  298. };
  299. private:
  300. // Signatures.
  301. std::unique_ptr<DxilEntrySignature> m_EntrySignature;
  302. std::unique_ptr<RootSignatureHandle> m_RootSignature;
  303. // Shader resources.
  304. std::vector<std::unique_ptr<DxilResource> > m_SRVs;
  305. std::vector<std::unique_ptr<DxilResource> > m_UAVs;
  306. std::vector<std::unique_ptr<DxilCBuffer> > m_CBuffers;
  307. std::vector<std::unique_ptr<DxilSampler> > m_Samplers;
  308. // Save resource link for library, when link replace it with real resource ID.
  309. std::vector<ResourceLinkInfo> m_SRVsLinkInfo;
  310. std::vector<ResourceLinkInfo> m_UAVsLinkInfo;
  311. std::vector<ResourceLinkInfo> m_CBuffersLinkInfo;
  312. std::vector<ResourceLinkInfo> m_SamplersLinkInfo;
  313. // Geometry shader.
  314. DXIL::InputPrimitive m_InputPrimitive;
  315. unsigned m_MaxVertexCount;
  316. DXIL::PrimitiveTopology m_StreamPrimitiveTopology;
  317. unsigned m_ActiveStreamMask;
  318. unsigned m_NumGSInstances;
  319. // Hull and Domain shaders.
  320. unsigned m_InputControlPointCount;
  321. DXIL::TessellatorDomain m_TessellatorDomain;
  322. // Hull shader.
  323. unsigned m_OutputControlPointCount;
  324. DXIL::TessellatorPartitioning m_TessellatorPartitioning;
  325. DXIL::TessellatorOutputPrimitive m_TessellatorOutputPrimitive;
  326. float m_MaxTessellationFactor;
  327. private:
  328. llvm::LLVMContext &m_Ctx;
  329. llvm::Module *m_pModule;
  330. llvm::Function *m_pEntryFunc;
  331. llvm::Function *m_pPatchConstantFunc;
  332. std::string m_EntryName;
  333. std::unique_ptr<DxilMDHelper> m_pMDHelper;
  334. std::unique_ptr<llvm::DebugInfoFinder> m_pDebugInfoFinder;
  335. const ShaderModel *m_pSM;
  336. unsigned m_DxilMajor;
  337. unsigned m_DxilMinor;
  338. unsigned m_ValMajor;
  339. unsigned m_ValMinor;
  340. std::unique_ptr<OP> m_pOP;
  341. size_t m_pUnused;
  342. // LLVM used.
  343. std::vector<llvm::GlobalVariable*> m_LLVMUsed;
  344. // Type annotations.
  345. std::unique_ptr<DxilTypeSystem> m_pTypeSystem;
  346. // Function properties for shader functions.
  347. std::unordered_map<llvm::Function *, std::unique_ptr<DxilFunctionProps>>
  348. m_DxilFunctionPropsMap;
  349. // EntrySig for shader functions.
  350. std::unordered_map<llvm::Function *, std::unique_ptr<DxilEntrySignature>>
  351. m_DxilEntrySignatureMap;
  352. // ViewId state.
  353. std::unique_ptr<DxilViewIdState> m_pViewIdState;
  354. // DXIL metadata serialization/deserialization.
  355. llvm::MDTuple *EmitDxilResources();
  356. void LoadDxilResources(const llvm::MDOperand &MDO);
  357. void EmitDxilResourcesLinkInfo();
  358. void LoadDxilResourcesLinkInfo();
  359. llvm::MDTuple *EmitDxilShaderProperties();
  360. void LoadDxilShaderProperties(const llvm::MDOperand &MDO);
  361. // Helpers.
  362. template<typename T> unsigned AddResource(std::vector<std::unique_ptr<T> > &Vec, std::unique_ptr<T> pRes);
  363. void LoadDxilSignature(const llvm::MDTuple *pSigTuple, DxilSignature &Sig, bool bInput);
  364. };
  365. } // namespace hlsl