d3d12shader.h 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) Microsoft Corporation. All rights reserved.
  4. //
  5. // File: D3D12Shader.h
  6. // Content: D3D12 Shader Types and APIs
  7. //
  8. //////////////////////////////////////////////////////////////////////////////
  9. #ifndef __D3D12SHADER_H__
  10. #define __D3D12SHADER_H__
  11. #include "d3dcommon.h"
  12. typedef enum D3D12_SHADER_VERSION_TYPE
  13. {
  14. D3D12_SHVER_PIXEL_SHADER = 0,
  15. D3D12_SHVER_VERTEX_SHADER = 1,
  16. D3D12_SHVER_GEOMETRY_SHADER = 2,
  17. // D3D11 Shaders
  18. D3D12_SHVER_HULL_SHADER = 3,
  19. D3D12_SHVER_DOMAIN_SHADER = 4,
  20. D3D12_SHVER_COMPUTE_SHADER = 5,
  21. D3D12_SHVER_RESERVED0 = 0xFFF0,
  22. } D3D12_SHADER_VERSION_TYPE;
  23. #define D3D12_SHVER_GET_TYPE(_Version) \
  24. (((_Version) >> 16) & 0xffff)
  25. #define D3D12_SHVER_GET_MAJOR(_Version) \
  26. (((_Version) >> 4) & 0xf)
  27. #define D3D12_SHVER_GET_MINOR(_Version) \
  28. (((_Version) >> 0) & 0xf)
  29. // Slot ID for library function return
  30. #define D3D_RETURN_PARAMETER_INDEX (-1)
  31. typedef D3D_RESOURCE_RETURN_TYPE D3D12_RESOURCE_RETURN_TYPE;
  32. typedef D3D_CBUFFER_TYPE D3D12_CBUFFER_TYPE;
  33. typedef struct _D3D12_SIGNATURE_PARAMETER_DESC
  34. {
  35. LPCSTR SemanticName; // Name of the semantic
  36. UINT SemanticIndex; // Index of the semantic
  37. UINT Register; // Number of member variables
  38. D3D_NAME SystemValueType;// A predefined system value, or D3D_NAME_UNDEFINED if not applicable
  39. D3D_REGISTER_COMPONENT_TYPE ComponentType; // Scalar type (e.g. uint, float, etc.)
  40. BYTE Mask; // Mask to indicate which components of the register
  41. // are used (combination of D3D10_COMPONENT_MASK values)
  42. BYTE ReadWriteMask; // Mask to indicate whether a given component is
  43. // never written (if this is an output signature) or
  44. // always read (if this is an input signature).
  45. // (combination of D3D_MASK_* values)
  46. UINT Stream; // Stream index
  47. D3D_MIN_PRECISION MinPrecision; // Minimum desired interpolation precision
  48. } D3D12_SIGNATURE_PARAMETER_DESC;
  49. typedef struct _D3D12_SHADER_BUFFER_DESC
  50. {
  51. LPCSTR Name; // Name of the constant buffer
  52. D3D_CBUFFER_TYPE Type; // Indicates type of buffer content
  53. UINT Variables; // Number of member variables
  54. UINT Size; // Size of CB (in bytes)
  55. UINT uFlags; // Buffer description flags
  56. } D3D12_SHADER_BUFFER_DESC;
  57. typedef struct _D3D12_SHADER_VARIABLE_DESC
  58. {
  59. LPCSTR Name; // Name of the variable
  60. UINT StartOffset; // Offset in constant buffer's backing store
  61. UINT Size; // Size of variable (in bytes)
  62. UINT uFlags; // Variable flags
  63. LPVOID DefaultValue; // Raw pointer to default value
  64. UINT StartTexture; // First texture index (or -1 if no textures used)
  65. UINT TextureSize; // Number of texture slots possibly used.
  66. UINT StartSampler; // First sampler index (or -1 if no textures used)
  67. UINT SamplerSize; // Number of sampler slots possibly used.
  68. } D3D12_SHADER_VARIABLE_DESC;
  69. typedef struct _D3D12_SHADER_TYPE_DESC
  70. {
  71. D3D_SHADER_VARIABLE_CLASS Class; // Variable class (e.g. object, matrix, etc.)
  72. D3D_SHADER_VARIABLE_TYPE Type; // Variable type (e.g. float, sampler, etc.)
  73. UINT Rows; // Number of rows (for matrices, 1 for other numeric, 0 if not applicable)
  74. UINT Columns; // Number of columns (for vectors & matrices, 1 for other numeric, 0 if not applicable)
  75. UINT Elements; // Number of elements (0 if not an array)
  76. UINT Members; // Number of members (0 if not a structure)
  77. UINT Offset; // Offset from the start of structure (0 if not a structure member)
  78. LPCSTR Name; // Name of type, can be NULL
  79. } D3D12_SHADER_TYPE_DESC;
  80. typedef D3D_TESSELLATOR_DOMAIN D3D12_TESSELLATOR_DOMAIN;
  81. typedef D3D_TESSELLATOR_PARTITIONING D3D12_TESSELLATOR_PARTITIONING;
  82. typedef D3D_TESSELLATOR_OUTPUT_PRIMITIVE D3D12_TESSELLATOR_OUTPUT_PRIMITIVE;
  83. typedef struct _D3D12_SHADER_DESC
  84. {
  85. UINT Version; // Shader version
  86. LPCSTR Creator; // Creator string
  87. UINT Flags; // Shader compilation/parse flags
  88. UINT ConstantBuffers; // Number of constant buffers
  89. UINT BoundResources; // Number of bound resources
  90. UINT InputParameters; // Number of parameters in the input signature
  91. UINT OutputParameters; // Number of parameters in the output signature
  92. UINT InstructionCount; // Number of emitted instructions
  93. UINT TempRegisterCount; // Number of temporary registers used
  94. UINT TempArrayCount; // Number of temporary arrays used
  95. UINT DefCount; // Number of constant defines
  96. UINT DclCount; // Number of declarations (input + output)
  97. UINT TextureNormalInstructions; // Number of non-categorized texture instructions
  98. UINT TextureLoadInstructions; // Number of texture load instructions
  99. UINT TextureCompInstructions; // Number of texture comparison instructions
  100. UINT TextureBiasInstructions; // Number of texture bias instructions
  101. UINT TextureGradientInstructions; // Number of texture gradient instructions
  102. UINT FloatInstructionCount; // Number of floating point arithmetic instructions used
  103. UINT IntInstructionCount; // Number of signed integer arithmetic instructions used
  104. UINT UintInstructionCount; // Number of unsigned integer arithmetic instructions used
  105. UINT StaticFlowControlCount; // Number of static flow control instructions used
  106. UINT DynamicFlowControlCount; // Number of dynamic flow control instructions used
  107. UINT MacroInstructionCount; // Number of macro instructions used
  108. UINT ArrayInstructionCount; // Number of array instructions used
  109. UINT CutInstructionCount; // Number of cut instructions used
  110. UINT EmitInstructionCount; // Number of emit instructions used
  111. D3D_PRIMITIVE_TOPOLOGY GSOutputTopology; // Geometry shader output topology
  112. UINT GSMaxOutputVertexCount; // Geometry shader maximum output vertex count
  113. D3D_PRIMITIVE InputPrimitive; // GS/HS input primitive
  114. UINT PatchConstantParameters; // Number of parameters in the patch constant signature
  115. UINT cGSInstanceCount; // Number of Geometry shader instances
  116. UINT cControlPoints; // Number of control points in the HS->DS stage
  117. D3D_TESSELLATOR_OUTPUT_PRIMITIVE HSOutputPrimitive; // Primitive output by the tessellator
  118. D3D_TESSELLATOR_PARTITIONING HSPartitioning; // Partitioning mode of the tessellator
  119. D3D_TESSELLATOR_DOMAIN TessellatorDomain; // Domain of the tessellator (quad, tri, isoline)
  120. // instruction counts
  121. UINT cBarrierInstructions; // Number of barrier instructions in a compute shader
  122. UINT cInterlockedInstructions; // Number of interlocked instructions
  123. UINT cTextureStoreInstructions; // Number of texture writes
  124. } D3D12_SHADER_DESC;
  125. typedef struct _D3D12_SHADER_INPUT_BIND_DESC
  126. {
  127. LPCSTR Name; // Name of the resource
  128. D3D_SHADER_INPUT_TYPE Type; // Type of resource (e.g. texture, cbuffer, etc.)
  129. UINT BindPoint; // Starting bind point
  130. UINT BindCount; // Number of contiguous bind points (for arrays)
  131. UINT uFlags; // Input binding flags
  132. D3D_RESOURCE_RETURN_TYPE ReturnType; // Return type (if texture)
  133. D3D_SRV_DIMENSION Dimension; // Dimension (if texture)
  134. UINT NumSamples; // Number of samples (0 if not MS texture)
  135. UINT Space; // Register space
  136. UINT uID; // Range ID in the bytecode
  137. } D3D12_SHADER_INPUT_BIND_DESC;
  138. #define D3D_SHADER_REQUIRES_DOUBLES 0x00000001
  139. #define D3D_SHADER_REQUIRES_EARLY_DEPTH_STENCIL 0x00000002
  140. #define D3D_SHADER_REQUIRES_UAVS_AT_EVERY_STAGE 0x00000004
  141. #define D3D_SHADER_REQUIRES_64_UAVS 0x00000008
  142. #define D3D_SHADER_REQUIRES_MINIMUM_PRECISION 0x00000010
  143. #define D3D_SHADER_REQUIRES_11_1_DOUBLE_EXTENSIONS 0x00000020
  144. #define D3D_SHADER_REQUIRES_11_1_SHADER_EXTENSIONS 0x00000040
  145. #define D3D_SHADER_REQUIRES_LEVEL_9_COMPARISON_FILTERING 0x00000080
  146. #define D3D_SHADER_REQUIRES_TILED_RESOURCES 0x00000100
  147. #define D3D_SHADER_REQUIRES_STENCIL_REF 0x00000200
  148. #define D3D_SHADER_REQUIRES_INNER_COVERAGE 0x00000400
  149. #define D3D_SHADER_REQUIRES_TYPED_UAV_LOAD_ADDITIONAL_FORMATS 0x00000800
  150. #define D3D_SHADER_REQUIRES_ROVS 0x00001000
  151. #define D3D_SHADER_REQUIRES_VIEWPORT_AND_RT_ARRAY_INDEX_FROM_ANY_SHADER_FEEDING_RASTERIZER 0x00002000
  152. typedef struct _D3D12_LIBRARY_DESC
  153. {
  154. LPCSTR Creator; // The name of the originator of the library.
  155. UINT Flags; // Compilation flags.
  156. UINT FunctionCount; // Number of functions exported from the library.
  157. } D3D12_LIBRARY_DESC;
  158. typedef struct _D3D12_FUNCTION_DESC
  159. {
  160. UINT Version; // Shader version
  161. LPCSTR Creator; // Creator string
  162. UINT Flags; // Shader compilation/parse flags
  163. UINT ConstantBuffers; // Number of constant buffers
  164. UINT BoundResources; // Number of bound resources
  165. UINT InstructionCount; // Number of emitted instructions
  166. UINT TempRegisterCount; // Number of temporary registers used
  167. UINT TempArrayCount; // Number of temporary arrays used
  168. UINT DefCount; // Number of constant defines
  169. UINT DclCount; // Number of declarations (input + output)
  170. UINT TextureNormalInstructions; // Number of non-categorized texture instructions
  171. UINT TextureLoadInstructions; // Number of texture load instructions
  172. UINT TextureCompInstructions; // Number of texture comparison instructions
  173. UINT TextureBiasInstructions; // Number of texture bias instructions
  174. UINT TextureGradientInstructions; // Number of texture gradient instructions
  175. UINT FloatInstructionCount; // Number of floating point arithmetic instructions used
  176. UINT IntInstructionCount; // Number of signed integer arithmetic instructions used
  177. UINT UintInstructionCount; // Number of unsigned integer arithmetic instructions used
  178. UINT StaticFlowControlCount; // Number of static flow control instructions used
  179. UINT DynamicFlowControlCount; // Number of dynamic flow control instructions used
  180. UINT MacroInstructionCount; // Number of macro instructions used
  181. UINT ArrayInstructionCount; // Number of array instructions used
  182. UINT MovInstructionCount; // Number of mov instructions used
  183. UINT MovcInstructionCount; // Number of movc instructions used
  184. UINT ConversionInstructionCount; // Number of type conversion instructions used
  185. UINT BitwiseInstructionCount; // Number of bitwise arithmetic instructions used
  186. D3D_FEATURE_LEVEL MinFeatureLevel; // Min target of the function byte code
  187. UINT64 RequiredFeatureFlags; // Required feature flags
  188. LPCSTR Name; // Function name
  189. INT FunctionParameterCount; // Number of logical parameters in the function signature (not including return)
  190. BOOL HasReturn; // TRUE, if function returns a value, false - it is a subroutine
  191. BOOL Has10Level9VertexShader; // TRUE, if there is a 10L9 VS blob
  192. BOOL Has10Level9PixelShader; // TRUE, if there is a 10L9 PS blob
  193. } D3D12_FUNCTION_DESC;
  194. typedef struct _D3D12_PARAMETER_DESC
  195. {
  196. LPCSTR Name; // Parameter name.
  197. LPCSTR SemanticName; // Parameter semantic name (+index).
  198. D3D_SHADER_VARIABLE_TYPE Type; // Element type.
  199. D3D_SHADER_VARIABLE_CLASS Class; // Scalar/Vector/Matrix.
  200. UINT Rows; // Rows are for matrix parameters.
  201. UINT Columns; // Components or Columns in matrix.
  202. D3D_INTERPOLATION_MODE InterpolationMode; // Interpolation mode.
  203. D3D_PARAMETER_FLAGS Flags; // Parameter modifiers.
  204. UINT FirstInRegister; // The first input register for this parameter.
  205. UINT FirstInComponent; // The first input register component for this parameter.
  206. UINT FirstOutRegister; // The first output register for this parameter.
  207. UINT FirstOutComponent; // The first output register component for this parameter.
  208. } D3D12_PARAMETER_DESC;
  209. //////////////////////////////////////////////////////////////////////////////
  210. // Interfaces ////////////////////////////////////////////////////////////////
  211. //////////////////////////////////////////////////////////////////////////////
  212. typedef interface ID3D12ShaderReflectionType ID3D12ShaderReflectionType;
  213. typedef interface ID3D12ShaderReflectionType *LPD3D12SHADERREFLECTIONTYPE;
  214. typedef interface ID3D12ShaderReflectionVariable ID3D12ShaderReflectionVariable;
  215. typedef interface ID3D12ShaderReflectionVariable *LPD3D12SHADERREFLECTIONVARIABLE;
  216. typedef interface ID3D12ShaderReflectionConstantBuffer ID3D12ShaderReflectionConstantBuffer;
  217. typedef interface ID3D12ShaderReflectionConstantBuffer *LPD3D12SHADERREFLECTIONCONSTANTBUFFER;
  218. typedef interface ID3D12ShaderReflection ID3D12ShaderReflection;
  219. typedef interface ID3D12ShaderReflection *LPD3D12SHADERREFLECTION;
  220. typedef interface ID3D12LibraryReflection ID3D12LibraryReflection;
  221. typedef interface ID3D12LibraryReflection *LPD3D12LIBRARYREFLECTION;
  222. typedef interface ID3D12FunctionReflection ID3D12FunctionReflection;
  223. typedef interface ID3D12FunctionReflection *LPD3D12FUNCTIONREFLECTION;
  224. typedef interface ID3D12FunctionParameterReflection ID3D12FunctionParameterReflection;
  225. typedef interface ID3D12FunctionParameterReflection *LPD3D12FUNCTIONPARAMETERREFLECTION;
  226. // {E913C351-783D-48CA-A1D1-4F306284AD56}
  227. interface DECLSPEC_UUID("E913C351-783D-48CA-A1D1-4F306284AD56") ID3D12ShaderReflectionType;
  228. DEFINE_GUID(IID_ID3D12ShaderReflectionType,
  229. 0xe913c351, 0x783d, 0x48ca, 0xa1, 0xd1, 0x4f, 0x30, 0x62, 0x84, 0xad, 0x56);
  230. #undef INTERFACE
  231. #define INTERFACE ID3D12ShaderReflectionType
  232. DECLARE_INTERFACE(ID3D12ShaderReflectionType)
  233. {
  234. STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_SHADER_TYPE_DESC *pDesc) PURE;
  235. STDMETHOD_(ID3D12ShaderReflectionType*, GetMemberTypeByIndex)(THIS_ _In_ UINT Index) PURE;
  236. STDMETHOD_(ID3D12ShaderReflectionType*, GetMemberTypeByName)(THIS_ _In_ LPCSTR Name) PURE;
  237. STDMETHOD_(LPCSTR, GetMemberTypeName)(THIS_ _In_ UINT Index) PURE;
  238. STDMETHOD(IsEqual)(THIS_ _In_ ID3D12ShaderReflectionType* pType) PURE;
  239. STDMETHOD_(ID3D12ShaderReflectionType*, GetSubType)(THIS) PURE;
  240. STDMETHOD_(ID3D12ShaderReflectionType*, GetBaseClass)(THIS) PURE;
  241. STDMETHOD_(UINT, GetNumInterfaces)(THIS) PURE;
  242. STDMETHOD_(ID3D12ShaderReflectionType*, GetInterfaceByIndex)(THIS_ _In_ UINT uIndex) PURE;
  243. STDMETHOD(IsOfType)(THIS_ _In_ ID3D12ShaderReflectionType* pType) PURE;
  244. STDMETHOD(ImplementsInterface)(THIS_ _In_ ID3D12ShaderReflectionType* pBase) PURE;
  245. };
  246. // {8337A8A6-A216-444A-B2F4-314733A73AEA}
  247. interface DECLSPEC_UUID("8337A8A6-A216-444A-B2F4-314733A73AEA") ID3D12ShaderReflectionVariable;
  248. DEFINE_GUID(IID_ID3D12ShaderReflectionVariable,
  249. 0x8337a8a6, 0xa216, 0x444a, 0xb2, 0xf4, 0x31, 0x47, 0x33, 0xa7, 0x3a, 0xea);
  250. #undef INTERFACE
  251. #define INTERFACE ID3D12ShaderReflectionVariable
  252. DECLARE_INTERFACE(ID3D12ShaderReflectionVariable)
  253. {
  254. STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_SHADER_VARIABLE_DESC *pDesc) PURE;
  255. STDMETHOD_(ID3D12ShaderReflectionType*, GetType)(THIS) PURE;
  256. STDMETHOD_(ID3D12ShaderReflectionConstantBuffer*, GetBuffer)(THIS) PURE;
  257. STDMETHOD_(UINT, GetInterfaceSlot)(THIS_ _In_ UINT uArrayIndex) PURE;
  258. };
  259. // {C59598B4-48B3-4869-B9B1-B1618B14A8B7}
  260. interface DECLSPEC_UUID("C59598B4-48B3-4869-B9B1-B1618B14A8B7") ID3D12ShaderReflectionConstantBuffer;
  261. DEFINE_GUID(IID_ID3D12ShaderReflectionConstantBuffer,
  262. 0xc59598b4, 0x48b3, 0x4869, 0xb9, 0xb1, 0xb1, 0x61, 0x8b, 0x14, 0xa8, 0xb7);
  263. #undef INTERFACE
  264. #define INTERFACE ID3D12ShaderReflectionConstantBuffer
  265. DECLARE_INTERFACE(ID3D12ShaderReflectionConstantBuffer)
  266. {
  267. STDMETHOD(GetDesc)(THIS_ D3D12_SHADER_BUFFER_DESC *pDesc) PURE;
  268. STDMETHOD_(ID3D12ShaderReflectionVariable*, GetVariableByIndex)(THIS_ _In_ UINT Index) PURE;
  269. STDMETHOD_(ID3D12ShaderReflectionVariable*, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE;
  270. };
  271. // The ID3D12ShaderReflection IID may change from SDK version to SDK version
  272. // if the reflection API changes. This prevents new code with the new API
  273. // from working with an old binary. Recompiling with the new header
  274. // will pick up the new IID.
  275. // {5A58797D-A72C-478D-8BA2-EFC6B0EFE88E}
  276. interface DECLSPEC_UUID("5A58797D-A72C-478D-8BA2-EFC6B0EFE88E") ID3D12ShaderReflection;
  277. DEFINE_GUID(IID_ID3D12ShaderReflection,
  278. 0x5a58797d, 0xa72c, 0x478d, 0x8b, 0xa2, 0xef, 0xc6, 0xb0, 0xef, 0xe8, 0x8e);
  279. #undef INTERFACE
  280. #define INTERFACE ID3D12ShaderReflection
  281. DECLARE_INTERFACE_(ID3D12ShaderReflection, IUnknown)
  282. {
  283. STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid,
  284. _Out_ LPVOID *ppv) PURE;
  285. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  286. STDMETHOD_(ULONG, Release)(THIS) PURE;
  287. STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_SHADER_DESC *pDesc) PURE;
  288. STDMETHOD_(ID3D12ShaderReflectionConstantBuffer*, GetConstantBufferByIndex)(THIS_ _In_ UINT Index) PURE;
  289. STDMETHOD_(ID3D12ShaderReflectionConstantBuffer*, GetConstantBufferByName)(THIS_ _In_ LPCSTR Name) PURE;
  290. STDMETHOD(GetResourceBindingDesc)(THIS_ _In_ UINT ResourceIndex,
  291. _Out_ D3D12_SHADER_INPUT_BIND_DESC *pDesc) PURE;
  292. STDMETHOD(GetInputParameterDesc)(THIS_ _In_ UINT ParameterIndex,
  293. _Out_ D3D12_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
  294. STDMETHOD(GetOutputParameterDesc)(THIS_ _In_ UINT ParameterIndex,
  295. _Out_ D3D12_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
  296. STDMETHOD(GetPatchConstantParameterDesc)(THIS_ _In_ UINT ParameterIndex,
  297. _Out_ D3D12_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
  298. STDMETHOD_(ID3D12ShaderReflectionVariable*, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE;
  299. STDMETHOD(GetResourceBindingDescByName)(THIS_ _In_ LPCSTR Name,
  300. _Out_ D3D12_SHADER_INPUT_BIND_DESC *pDesc) PURE;
  301. STDMETHOD_(UINT, GetMovInstructionCount)(THIS) PURE;
  302. STDMETHOD_(UINT, GetMovcInstructionCount)(THIS) PURE;
  303. STDMETHOD_(UINT, GetConversionInstructionCount)(THIS) PURE;
  304. STDMETHOD_(UINT, GetBitwiseInstructionCount)(THIS) PURE;
  305. STDMETHOD_(D3D_PRIMITIVE, GetGSInputPrimitive)(THIS) PURE;
  306. STDMETHOD_(BOOL, IsSampleFrequencyShader)(THIS) PURE;
  307. STDMETHOD_(UINT, GetNumInterfaceSlots)(THIS) PURE;
  308. STDMETHOD(GetMinFeatureLevel)(THIS_ _Out_ enum D3D_FEATURE_LEVEL* pLevel) PURE;
  309. STDMETHOD_(UINT, GetThreadGroupSize)(THIS_
  310. _Out_opt_ UINT* pSizeX,
  311. _Out_opt_ UINT* pSizeY,
  312. _Out_opt_ UINT* pSizeZ) PURE;
  313. STDMETHOD_(UINT64, GetRequiresFlags)(THIS) PURE;
  314. };
  315. // {8E349D19-54DB-4A56-9DC9-119D87BDB804}
  316. interface DECLSPEC_UUID("8E349D19-54DB-4A56-9DC9-119D87BDB804") ID3D12LibraryReflection;
  317. DEFINE_GUID(IID_ID3D12LibraryReflection,
  318. 0x8e349d19, 0x54db, 0x4a56, 0x9d, 0xc9, 0x11, 0x9d, 0x87, 0xbd, 0xb8, 0x4);
  319. #undef INTERFACE
  320. #define INTERFACE ID3D12LibraryReflection
  321. DECLARE_INTERFACE_(ID3D12LibraryReflection, IUnknown)
  322. {
  323. STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid, _Out_ LPVOID * ppv) PURE;
  324. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  325. STDMETHOD_(ULONG, Release)(THIS) PURE;
  326. STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_LIBRARY_DESC * pDesc) PURE;
  327. STDMETHOD_(ID3D12FunctionReflection *, GetFunctionByIndex)(THIS_ _In_ INT FunctionIndex) PURE;
  328. };
  329. // {1108795C-2772-4BA9-B2A8-D464DC7E2799}
  330. interface DECLSPEC_UUID("1108795C-2772-4BA9-B2A8-D464DC7E2799") ID3D12FunctionReflection;
  331. DEFINE_GUID(IID_ID3D12FunctionReflection,
  332. 0x1108795c, 0x2772, 0x4ba9, 0xb2, 0xa8, 0xd4, 0x64, 0xdc, 0x7e, 0x27, 0x99);
  333. #undef INTERFACE
  334. #define INTERFACE ID3D12FunctionReflection
  335. DECLARE_INTERFACE(ID3D12FunctionReflection)
  336. {
  337. STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_FUNCTION_DESC * pDesc) PURE;
  338. STDMETHOD_(ID3D12ShaderReflectionConstantBuffer *, GetConstantBufferByIndex)(THIS_ _In_ UINT BufferIndex) PURE;
  339. STDMETHOD_(ID3D12ShaderReflectionConstantBuffer *, GetConstantBufferByName)(THIS_ _In_ LPCSTR Name) PURE;
  340. STDMETHOD(GetResourceBindingDesc)(THIS_ _In_ UINT ResourceIndex,
  341. _Out_ D3D12_SHADER_INPUT_BIND_DESC * pDesc) PURE;
  342. STDMETHOD_(ID3D12ShaderReflectionVariable *, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE;
  343. STDMETHOD(GetResourceBindingDescByName)(THIS_ _In_ LPCSTR Name,
  344. _Out_ D3D12_SHADER_INPUT_BIND_DESC * pDesc) PURE;
  345. // Use D3D_RETURN_PARAMETER_INDEX to get description of the return value.
  346. STDMETHOD_(ID3D12FunctionParameterReflection *, GetFunctionParameter)(THIS_ _In_ INT ParameterIndex) PURE;
  347. };
  348. // {EC25F42D-7006-4F2B-B33E-02CC3375733F}
  349. interface DECLSPEC_UUID("EC25F42D-7006-4F2B-B33E-02CC3375733F") ID3D12FunctionParameterReflection;
  350. DEFINE_GUID(IID_ID3D12FunctionParameterReflection,
  351. 0xec25f42d, 0x7006, 0x4f2b, 0xb3, 0x3e, 0x2, 0xcc, 0x33, 0x75, 0x73, 0x3f);
  352. #undef INTERFACE
  353. #define INTERFACE ID3D12FunctionParameterReflection
  354. DECLARE_INTERFACE(ID3D12FunctionParameterReflection)
  355. {
  356. STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_PARAMETER_DESC * pDesc) PURE;
  357. };
  358. //////////////////////////////////////////////////////////////////////////////
  359. // APIs //////////////////////////////////////////////////////////////////////
  360. //////////////////////////////////////////////////////////////////////////////
  361. #ifdef __cplusplus
  362. extern "C" {
  363. #endif //__cplusplus
  364. #ifdef __cplusplus
  365. }
  366. #endif //__cplusplus
  367. #endif //__D3D12SHADER_H__