d3d11shader.h 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. #undef INTERFACE
  2. /*
  3. * Copyright 2010 Matteo Bruni for CodeWeavers
  4. *
  5. * This library is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU Lesser General Public
  7. * License as published by the Free Software Foundation; either
  8. * version 2.1 of the License, or (at your option) any later version.
  9. *
  10. * This library is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * Lesser General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Lesser General Public
  16. * License along with this library; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  18. */
  19. #ifndef __D3D11SHADER_H__
  20. #define __D3D11SHADER_H__
  21. #include "d3dcommon.h"
  22. /* These are defined as version-neutral in d3dcommon.h */
  23. typedef D3D_CBUFFER_TYPE D3D11_CBUFFER_TYPE;
  24. typedef D3D_RESOURCE_RETURN_TYPE D3D11_RESOURCE_RETURN_TYPE;
  25. typedef D3D_TESSELLATOR_DOMAIN D3D11_TESSELLATOR_DOMAIN;
  26. typedef D3D_TESSELLATOR_PARTITIONING D3D11_TESSELLATOR_PARTITIONING;
  27. typedef D3D_TESSELLATOR_OUTPUT_PRIMITIVE D3D11_TESSELLATOR_OUTPUT_PRIMITIVE;
  28. typedef struct _D3D11_SHADER_DESC
  29. {
  30. UINT Version;
  31. const char *Creator;
  32. UINT Flags;
  33. UINT ConstantBuffers;
  34. UINT BoundResources;
  35. UINT InputParameters;
  36. UINT OutputParameters;
  37. UINT InstructionCount;
  38. UINT TempRegisterCount;
  39. UINT TempArrayCount;
  40. UINT DefCount;
  41. UINT DclCount;
  42. UINT TextureNormalInstructions;
  43. UINT TextureLoadInstructions;
  44. UINT TextureCompInstructions;
  45. UINT TextureBiasInstructions;
  46. UINT TextureGradientInstructions;
  47. UINT FloatInstructionCount;
  48. UINT IntInstructionCount;
  49. UINT UintInstructionCount;
  50. UINT StaticFlowControlCount;
  51. UINT DynamicFlowControlCount;
  52. UINT MacroInstructionCount;
  53. UINT ArrayInstructionCount;
  54. UINT CutInstructionCount;
  55. UINT EmitInstructionCount;
  56. D3D_PRIMITIVE_TOPOLOGY GSOutputTopology;
  57. UINT GSMaxOutputVertexCount;
  58. D3D_PRIMITIVE InputPrimitive;
  59. UINT PatchConstantParameters;
  60. UINT cGSInstanceCount;
  61. UINT cControlPoints;
  62. D3D_TESSELLATOR_OUTPUT_PRIMITIVE HSOutputPrimitive;
  63. D3D_TESSELLATOR_PARTITIONING HSPartitioning;
  64. D3D_TESSELLATOR_DOMAIN TessellatorDomain;
  65. UINT cBarrierInstructions;
  66. UINT cInterlockedInstructions;
  67. UINT cTextureStoreInstructions;
  68. } D3D11_SHADER_DESC;
  69. typedef struct _D3D11_SHADER_VARIABLE_DESC
  70. {
  71. const char *Name;
  72. UINT StartOffset;
  73. UINT Size;
  74. UINT uFlags;
  75. void *DefaultValue;
  76. UINT StartTexture;
  77. UINT TextureSize;
  78. UINT StartSampler;
  79. UINT SamplerSize;
  80. } D3D11_SHADER_VARIABLE_DESC;
  81. typedef struct _D3D11_SHADER_TYPE_DESC
  82. {
  83. D3D_SHADER_VARIABLE_CLASS Class;
  84. D3D_SHADER_VARIABLE_TYPE Type;
  85. UINT Rows;
  86. UINT Columns;
  87. UINT Elements;
  88. UINT Members;
  89. UINT Offset;
  90. const char *Name;
  91. } D3D11_SHADER_TYPE_DESC;
  92. typedef struct _D3D11_SHADER_BUFFER_DESC
  93. {
  94. const char *Name;
  95. D3D_CBUFFER_TYPE Type;
  96. UINT Variables;
  97. UINT Size;
  98. UINT uFlags;
  99. } D3D11_SHADER_BUFFER_DESC;
  100. typedef struct _D3D11_SHADER_INPUT_BIND_DESC
  101. {
  102. const char *Name;
  103. D3D_SHADER_INPUT_TYPE Type;
  104. UINT BindPoint;
  105. UINT BindCount;
  106. UINT uFlags;
  107. D3D_RESOURCE_RETURN_TYPE ReturnType;
  108. D3D_SRV_DIMENSION Dimension;
  109. UINT NumSamples;
  110. } D3D11_SHADER_INPUT_BIND_DESC;
  111. typedef struct _D3D11_SIGNATURE_PARAMETER_DESC
  112. {
  113. const char *SemanticName;
  114. UINT SemanticIndex;
  115. UINT Register;
  116. D3D_NAME SystemValueType;
  117. D3D_REGISTER_COMPONENT_TYPE ComponentType;
  118. BYTE Mask;
  119. BYTE ReadWriteMask;
  120. UINT Stream;
  121. } D3D11_SIGNATURE_PARAMETER_DESC;
  122. DEFINE_GUID(IID_ID3D11ShaderReflectionType, 0x6e6ffa6a, 0x9bae, 0x4613, 0xa5, 0x1e, 0x91, 0x65, 0x2d, 0x50, 0x8c, 0x21);
  123. #define INTERFACE ID3D11ShaderReflectionType
  124. DECLARE_INTERFACE(ID3D11ShaderReflectionType)
  125. {
  126. STDMETHOD(GetDesc)(THIS_ D3D11_SHADER_TYPE_DESC *desc) PURE;
  127. STDMETHOD_(struct ID3D11ShaderReflectionType *, GetMemberTypeByIndex)(THIS_ UINT index) PURE;
  128. STDMETHOD_(struct ID3D11ShaderReflectionType *, GetMemberTypeByName)(THIS_ const char *name) PURE;
  129. STDMETHOD_(const char *, GetMemberTypeName)(THIS_ UINT index) PURE;
  130. STDMETHOD(IsEqual)(THIS_ struct ID3D11ShaderReflectionType *type) PURE;
  131. STDMETHOD_(struct ID3D11ShaderReflectionType *, GetSubType)(THIS) PURE;
  132. STDMETHOD_(struct ID3D11ShaderReflectionType *, GetBaseClass)(THIS) PURE;
  133. STDMETHOD_(UINT, GetNumInterfaces)(THIS) PURE;
  134. STDMETHOD_(struct ID3D11ShaderReflectionType *, GetInterfaceByIndex)(THIS_ UINT index) PURE;
  135. STDMETHOD(IsOfType)(THIS_ struct ID3D11ShaderReflectionType *type) PURE;
  136. STDMETHOD(ImplementsInterface)(THIS_ ID3D11ShaderReflectionType *base) PURE;
  137. };
  138. #undef INTERFACE
  139. DEFINE_GUID(IID_ID3D11ShaderReflectionVariable, 0x51f23923, 0xf3e5, 0x4bd1, 0x91, 0xcb, 0x60, 0x61, 0x77, 0xd8, 0xdb, 0x4c);
  140. #define INTERFACE ID3D11ShaderReflectionVariable
  141. DECLARE_INTERFACE(ID3D11ShaderReflectionVariable)
  142. {
  143. STDMETHOD(GetDesc)(THIS_ D3D11_SHADER_VARIABLE_DESC *desc) PURE;
  144. STDMETHOD_(struct ID3D11ShaderReflectionType *, GetType)(THIS) PURE;
  145. STDMETHOD_(struct ID3D11ShaderReflectionConstantBuffer *, GetBuffer)(THIS) PURE;
  146. STDMETHOD_(UINT, GetInterfaceSlot)(THIS_ UINT index) PURE;
  147. };
  148. #undef INTERFACE
  149. DEFINE_GUID(IID_ID3D11ShaderReflectionConstantBuffer, 0xeb62d63d, 0x93dd, 0x4318, 0x8a, 0xe8, 0xc6, 0xf8, 0x3a, 0xd3, 0x71, 0xb8);
  150. #define INTERFACE ID3D11ShaderReflectionConstantBuffer
  151. DECLARE_INTERFACE(ID3D11ShaderReflectionConstantBuffer)
  152. {
  153. STDMETHOD(GetDesc)(THIS_ D3D11_SHADER_BUFFER_DESC *desc) PURE;
  154. STDMETHOD_(struct ID3D11ShaderReflectionVariable *, GetVariableByIndex)(THIS_ UINT index) PURE;
  155. STDMETHOD_(struct ID3D11ShaderReflectionVariable *, GetVariableByName)(THIS_ const char *name) PURE;
  156. };
  157. #undef INTERFACE
  158. DEFINE_GUID(IID_ID3D11ShaderReflection, 0x0a233719, 0x3960, 0x4578, 0x9d, 0x7c, 0x20, 0x3b, 0x8b, 0x1d, 0x9c, 0xc1);
  159. #define INTERFACE ID3D11ShaderReflection
  160. DECLARE_INTERFACE_(ID3D11ShaderReflection, IUnknown)
  161. {
  162. /* IUnknown methods */
  163. STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE;
  164. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  165. STDMETHOD_(ULONG, Release)(THIS) PURE;
  166. /* ID3D11ShaderReflection methods */
  167. STDMETHOD(GetDesc)(THIS_ D3D11_SHADER_DESC *desc) PURE;
  168. STDMETHOD_(struct ID3D11ShaderReflectionConstantBuffer *, GetConstantBufferByIndex)(THIS_ UINT index) PURE;
  169. STDMETHOD_(struct ID3D11ShaderReflectionConstantBuffer *, GetConstantBufferByName)(THIS_ const char *name) PURE;
  170. STDMETHOD(GetResourceBindingDesc)(THIS_ UINT index, D3D11_SHADER_INPUT_BIND_DESC *desc) PURE;
  171. STDMETHOD(GetInputParameterDesc)(THIS_ UINT index, D3D11_SIGNATURE_PARAMETER_DESC *desc) PURE;
  172. STDMETHOD(GetOutputParameterDesc)(THIS_ UINT index, D3D11_SIGNATURE_PARAMETER_DESC *desc) PURE;
  173. STDMETHOD(GetPatchConstantParameterDesc)(THIS_ UINT index, D3D11_SIGNATURE_PARAMETER_DESC *desc) PURE;
  174. STDMETHOD_(struct ID3D11ShaderReflectionVariable *, GetVariableByName)(THIS_ const char *name) PURE;
  175. STDMETHOD(GetResourceBindingDescByName)(THIS_ const char *name, D3D11_SHADER_INPUT_BIND_DESC *desc) PURE;
  176. STDMETHOD_(UINT, GetMovInstructionCount)(THIS) PURE;
  177. STDMETHOD_(UINT, GetMovcInstructionCount)(THIS) PURE;
  178. STDMETHOD_(UINT, GetConversionInstructionCount)(THIS) PURE;
  179. STDMETHOD_(UINT, GetBitwiseInstructionCount)(THIS) PURE;
  180. STDMETHOD_(D3D_PRIMITIVE, GetGSInputPrimitive)(THIS) PURE;
  181. STDMETHOD_(WINBOOL, IsSampleFrequencyShader)(THIS) PURE;
  182. STDMETHOD_(UINT, GetNumInterfaceSlots)(THIS) PURE;
  183. STDMETHOD(GetMinFeatureLevel)(THIS_ enum D3D_FEATURE_LEVEL *level) PURE;
  184. STDMETHOD_(UINT, GetThreadGroupSize)(THIS_ UINT *sizex, UINT *sizey, UINT *sizez) PURE;
  185. };
  186. #undef INTERFACE
  187. DEFINE_GUID(IID_ID3D11ModuleInstance, 0x469e07f7, 0x45a, 0x48d5, 0xaa, 0x12, 0x68, 0xa4, 0x78, 0xcd, 0xf7, 0x5d);
  188. #define INTERFACE ID3D11ModuleInstance
  189. DECLARE_INTERFACE_(ID3D11ModuleInstance, IUnknown)
  190. {
  191. STDMETHOD(QueryInterface)(THIS_ REFIID iid, void **out) PURE;
  192. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  193. STDMETHOD_(ULONG, Release)(THIS) PURE;
  194. /* ID3D11ModuleInstance methods */
  195. STDMETHOD(BindConstantBuffer)(THIS_ UINT srcslot, UINT dstslot, UINT dstoffset) PURE;
  196. STDMETHOD(BindConstantBufferByName)(THIS_ const char *name, UINT dstslot, UINT dstoffset) PURE;
  197. STDMETHOD(BindResource)(THIS_ UINT srcslot, UINT dstslot, UINT count) PURE;
  198. STDMETHOD(BindResourceByName)(THIS_ const char *name, UINT dstslot, UINT count) PURE;
  199. STDMETHOD(BindSampler)(THIS_ UINT srcslot, UINT dstslot, UINT count) PURE;
  200. STDMETHOD(BindSamplerByName)(THIS_ const char *name, UINT dstslot, UINT count) PURE;
  201. STDMETHOD(BindUnorderedAccessView)(THIS_ UINT srcslot, UINT dstslot, UINT count) PURE;
  202. STDMETHOD(BindUnorderedAccessViewByName)(THIS_ const char *name, UINT dstslot, UINT count) PURE;
  203. STDMETHOD(BindResourceAsUnorderedAccessView)(THIS_ UINT srcslot, UINT dstslot, UINT count) PURE;
  204. STDMETHOD(BindResourceAsUnorderedAccessViewByName)(THIS_ const char *name, UINT dstslot, UINT count) PURE;
  205. };
  206. #undef INTERFACE
  207. DEFINE_GUID(IID_ID3D11Module, 0xcac701ee, 0x80fc, 0x4122, 0x82, 0x42, 0x10, 0xb3, 0x9c, 0x8c, 0xec, 0x34);
  208. #define INTERFACE ID3D11Module
  209. DECLARE_INTERFACE_(ID3D11Module, IUnknown)
  210. {
  211. STDMETHOD(QueryInterface)(THIS_ REFIID iid, void **out) PURE;
  212. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  213. STDMETHOD_(ULONG, Release)(THIS) PURE;
  214. /* ID3D11Module methods */
  215. STDMETHOD(CreateInstance)(THIS_ const char *instnamespace, ID3D11ModuleInstance **moduleinstance) PURE;
  216. };
  217. #undef INTERFACE
  218. #endif