d3d12shader.idl 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. /*
  2. * Copyright 2020 Paul Gofman for CodeWeavers
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2.1 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with this library; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  17. */
  18. import "oaidl.idl";
  19. import "ocidl.idl";
  20. import "d3dcommon.idl";
  21. typedef enum D3D12_SHADER_VERSION_TYPE
  22. {
  23. D3D12_SHVER_PIXEL_SHADER = 0x0,
  24. D3D12_SHVER_VERTEX_SHADER = 0x1,
  25. D3D12_SHVER_GEOMETRY_SHADER = 0x2,
  26. D3D12_SHVER_HULL_SHADER = 0x3,
  27. D3D12_SHVER_DOMAIN_SHADER = 0x4,
  28. D3D12_SHVER_COMPUTE_SHADER = 0x5,
  29. D3D12_SHVER_RESERVED0 = 0xfff0,
  30. } D3D12_SHADER_VERSION_TYPE;
  31. typedef struct _D3D12_SHADER_DESC
  32. {
  33. UINT Version;
  34. const char *Creator;
  35. UINT Flags;
  36. UINT ConstantBuffers;
  37. UINT BoundResources;
  38. UINT InputParameters;
  39. UINT OutputParameters;
  40. UINT InstructionCount;
  41. UINT TempRegisterCount;
  42. UINT TempArrayCount;
  43. UINT DefCount;
  44. UINT DclCount;
  45. UINT TextureNormalInstructions;
  46. UINT TextureLoadInstructions;
  47. UINT TextureCompInstructions;
  48. UINT TextureBiasInstructions;
  49. UINT TextureGradientInstructions;
  50. UINT FloatInstructionCount;
  51. UINT IntInstructionCount;
  52. UINT UintInstructionCount;
  53. UINT StaticFlowControlCount;
  54. UINT DynamicFlowControlCount;
  55. UINT MacroInstructionCount;
  56. UINT ArrayInstructionCount;
  57. UINT CutInstructionCount;
  58. UINT EmitInstructionCount;
  59. D3D_PRIMITIVE_TOPOLOGY GSOutputTopology;
  60. UINT GSMaxOutputVertexCount;
  61. D3D_PRIMITIVE InputPrimitive;
  62. UINT PatchConstantParameters;
  63. UINT cGSInstanceCount;
  64. UINT cControlPoints;
  65. D3D_TESSELLATOR_OUTPUT_PRIMITIVE HSOutputPrimitive;
  66. D3D_TESSELLATOR_PARTITIONING HSPartitioning;
  67. D3D_TESSELLATOR_DOMAIN TessellatorDomain;
  68. UINT cBarrierInstructions;
  69. UINT cInterlockedInstructions;
  70. UINT cTextureStoreInstructions;
  71. } D3D12_SHADER_DESC;
  72. typedef struct _D3D12_SHADER_VARIABLE_DESC
  73. {
  74. const char *Name;
  75. UINT StartOffset;
  76. UINT Size;
  77. UINT uFlags;
  78. void *DefaultValue;
  79. UINT StartTexture;
  80. UINT TextureSize;
  81. UINT StartSampler;
  82. UINT SamplerSize;
  83. } D3D12_SHADER_VARIABLE_DESC;
  84. typedef struct _D3D12_SHADER_TYPE_DESC
  85. {
  86. D3D_SHADER_VARIABLE_CLASS Class;
  87. D3D_SHADER_VARIABLE_TYPE Type;
  88. UINT Rows;
  89. UINT Columns;
  90. UINT Elements;
  91. UINT Members;
  92. UINT Offset;
  93. const char *Name;
  94. } D3D12_SHADER_TYPE_DESC;
  95. typedef struct _D3D12_SHADER_BUFFER_DESC
  96. {
  97. const char *Name;
  98. D3D_CBUFFER_TYPE Type;
  99. UINT Variables;
  100. UINT Size;
  101. UINT uFlags;
  102. } D3D12_SHADER_BUFFER_DESC;
  103. typedef struct _D3D12_SHADER_INPUT_BIND_DESC
  104. {
  105. const char *Name;
  106. D3D_SHADER_INPUT_TYPE Type;
  107. UINT BindPoint;
  108. UINT BindCount;
  109. UINT uFlags;
  110. D3D_RESOURCE_RETURN_TYPE ReturnType;
  111. D3D_SRV_DIMENSION Dimension;
  112. UINT NumSamples;
  113. UINT Space;
  114. UINT uID;
  115. } D3D12_SHADER_INPUT_BIND_DESC;
  116. typedef struct _D3D12_SIGNATURE_PARAMETER_DESC
  117. {
  118. const char *SemanticName;
  119. UINT SemanticIndex;
  120. UINT Register;
  121. D3D_NAME SystemValueType;
  122. D3D_REGISTER_COMPONENT_TYPE ComponentType;
  123. BYTE Mask;
  124. BYTE ReadWriteMask;
  125. UINT Stream;
  126. D3D_MIN_PRECISION MinPrecision;
  127. } D3D12_SIGNATURE_PARAMETER_DESC;
  128. typedef struct _D3D12_PARAMETER_DESC
  129. {
  130. const char *Name;
  131. const char *SemanticName;
  132. D3D_SHADER_VARIABLE_TYPE Type;
  133. D3D_SHADER_VARIABLE_CLASS Class;
  134. UINT Rows;
  135. UINT Columns;
  136. D3D_INTERPOLATION_MODE InterpolationMode;
  137. D3D_PARAMETER_FLAGS Flags;
  138. UINT FirstInRegister;
  139. UINT FirstInComponent;
  140. UINT FirstOutRegister;
  141. UINT FirstOutComponent;
  142. } D3D12_PARAMETER_DESC;
  143. typedef struct _D3D12_FUNCTION_DESC
  144. {
  145. UINT Version;
  146. const char *Creator;
  147. UINT Flags;
  148. UINT ConstantBuffers;
  149. UINT BoundResources;
  150. UINT InstructionCount;
  151. UINT TempRegisterCount;
  152. UINT TempArrayCount;
  153. UINT DefCount;
  154. UINT DclCount;
  155. UINT TextureNormalInstructions;
  156. UINT TextureLoadInstructions;
  157. UINT TextureCompInstructions;
  158. UINT TextureBiasInstructions;
  159. UINT TextureGradientInstructions;
  160. UINT FloatInstructionCount;
  161. UINT IntInstructionCount;
  162. UINT UintInstructionCount;
  163. UINT StaticFlowControlCount;
  164. UINT DynamicFlowControlCount;
  165. UINT MacroInstructionCount;
  166. UINT ArrayInstructionCount;
  167. UINT MovInstructionCount;
  168. UINT MovcInstructionCount;
  169. UINT ConversionInstructionCount;
  170. UINT BitwiseInstructionCount;
  171. D3D_FEATURE_LEVEL MinFeatureLevel;
  172. UINT64 RequiredFeatureFlags;
  173. const char *Name;
  174. INT FunctionParameterCount;
  175. BOOL HasReturn;
  176. BOOL Has10Level9VertexShader;
  177. BOOL Has10Level9PixelShader;
  178. } D3D12_FUNCTION_DESC;
  179. typedef struct _D3D12_LIBRARY_DESC
  180. {
  181. const char *Creator;
  182. UINT Flags;
  183. UINT FunctionCount;
  184. } D3D12_LIBRARY_DESC;
  185. interface ID3D12ShaderReflectionConstantBuffer;
  186. [
  187. uuid(e913c351-783d-48ca-a1d1-4f306284ad56),
  188. object,
  189. local,
  190. ]
  191. interface ID3D12ShaderReflectionType
  192. {
  193. HRESULT GetDesc(D3D12_SHADER_TYPE_DESC *desc);
  194. ID3D12ShaderReflectionType *GetMemberTypeByIndex(UINT index);
  195. ID3D12ShaderReflectionType *GetMemberTypeByName(const char *name);
  196. const char *GetMemberTypeName(UINT index);
  197. HRESULT IsEqual(ID3D12ShaderReflectionType *type);
  198. ID3D12ShaderReflectionType *GetSubType();
  199. ID3D12ShaderReflectionType *GetBaseClass();
  200. UINT GetNumInterfaces();
  201. ID3D12ShaderReflectionType *GetInterfaceByIndex(UINT index);
  202. HRESULT IsOfType(ID3D12ShaderReflectionType *type);
  203. HRESULT ImplementsInterface(ID3D12ShaderReflectionType *base);
  204. }
  205. [
  206. uuid(8337a8a6-a216-444a-b2f4-314733a73aea),
  207. object,
  208. local,
  209. ]
  210. interface ID3D12ShaderReflectionVariable
  211. {
  212. HRESULT GetDesc(D3D12_SHADER_VARIABLE_DESC *desc);
  213. ID3D12ShaderReflectionType *GetType();
  214. ID3D12ShaderReflectionConstantBuffer *GetBuffer();
  215. UINT GetInterfaceSlot(UINT index);
  216. }
  217. [
  218. uuid(c59598b4-48b3-4869-b9b1-b1618b14a8b7),
  219. object,
  220. local,
  221. ]
  222. interface ID3D12ShaderReflectionConstantBuffer
  223. {
  224. HRESULT GetDesc(D3D12_SHADER_BUFFER_DESC *desc);
  225. ID3D12ShaderReflectionVariable *GetVariableByIndex(UINT index);
  226. ID3D12ShaderReflectionVariable *GetVariableByName(const char *name);
  227. }
  228. [
  229. uuid(5a58797d-a72c-478d-8ba2-efc6b0efe88e),
  230. object,
  231. local,
  232. ]
  233. interface ID3D12ShaderReflection : IUnknown
  234. {
  235. HRESULT GetDesc(D3D12_SHADER_DESC *desc);
  236. ID3D12ShaderReflectionConstantBuffer *GetConstantBufferByIndex(UINT index);
  237. ID3D12ShaderReflectionConstantBuffer *GetConstantBufferByName(const char *name);
  238. HRESULT GetResourceBindingDesc(UINT index, D3D12_SHADER_INPUT_BIND_DESC *desc);
  239. HRESULT GetInputParameterDesc(UINT index, D3D12_SIGNATURE_PARAMETER_DESC *desc);
  240. HRESULT GetOutputParameterDesc(UINT index, D3D12_SIGNATURE_PARAMETER_DESC *desc);
  241. HRESULT GetPatchConstantParameterDesc(UINT index, D3D12_SIGNATURE_PARAMETER_DESC *desc);
  242. ID3D12ShaderReflectionVariable *GetVariableByName(const char *name);
  243. HRESULT GetResourceBindingDescByName(const char *name, D3D12_SHADER_INPUT_BIND_DESC *desc);
  244. UINT GetMovInstructionCount();
  245. UINT GetMovcInstructionCount();
  246. UINT GetConversionInstructionCount();
  247. UINT GetBitwiseInstructionCount();
  248. D3D_PRIMITIVE GetGSInputPrimitive();
  249. BOOL IsSampleFrequencyShader();
  250. UINT GetNumInterfaceSlots();
  251. HRESULT GetMinFeatureLevel(D3D_FEATURE_LEVEL *level);
  252. UINT GetThreadGroupSize(UINT *sizex, UINT *sizey, UINT *sizez);
  253. UINT64 GetRequiresFlags();
  254. }
  255. [
  256. uuid(ec25f42d-7006-4f2b-b33e-02cc3375733f),
  257. object,
  258. local,
  259. ]
  260. interface ID3D12FunctionParameterReflection
  261. {
  262. HRESULT GetDesc(D3D12_PARAMETER_DESC *desc);
  263. }
  264. [
  265. uuid(1108795c-2772-4ba9-b2a8-d464dc7e2799),
  266. object,
  267. local,
  268. ]
  269. interface ID3D12FunctionReflection
  270. {
  271. HRESULT GetDesc(D3D12_FUNCTION_DESC *desc);
  272. ID3D12ShaderReflectionConstantBuffer *GetConstantBufferByIndex(UINT index);
  273. ID3D12ShaderReflectionConstantBuffer *GetConstantBufferByName(const char *name);
  274. HRESULT GetResourceBindingDesc(UINT index, D3D12_SHADER_INPUT_BIND_DESC *desc);
  275. ID3D12ShaderReflectionVariable *GetVariableByName(const char *name);
  276. HRESULT GetResourceBindingDescByName(const char *name, D3D12_SHADER_INPUT_BIND_DESC *desc);
  277. ID3D12FunctionParameterReflection *GetFunctionParameter(INT index);
  278. }
  279. [
  280. uuid(8e349d19-54db-4a56-9dc9-119d87bdb804),
  281. object,
  282. local,
  283. ]
  284. interface ID3D12LibraryReflection : IUnknown
  285. {
  286. HRESULT GetDesc(D3D12_LIBRARY_DESC *desc);
  287. ID3D12FunctionReflection *GetFunctionByIndex(INT index);
  288. }