d3d10shader.h 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. #undef INTERFACE
  2. /*
  3. * Copyright 2009 Henri Verbeet 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. */
  20. #ifndef __WINE_D3D10SHADER_H
  21. #define __WINE_D3D10SHADER_H
  22. #include "d3d10.h"
  23. #define D3D10_SHADER_DEBUG 0x0001
  24. #define D3D10_SHADER_SKIP_VALIDATION 0x0002
  25. #define D3D10_SHADER_SKIP_OPTIMIZATION 0x0004
  26. #define D3D10_SHADER_PACK_MATRIX_ROW_MAJOR 0x0008
  27. #define D3D10_SHADER_PACK_MATRIX_COLUMN_MAJOR 0x0010
  28. #define D3D10_SHADER_PARTIAL_PRECISION 0x0020
  29. #define D3D10_SHADER_FORCE_VS_SOFTWARE_NO_OPT 0x0040
  30. #define D3D10_SHADER_FORCE_PS_SOFTWARE_NO_OPT 0x0080
  31. #define D3D10_SHADER_NO_PRESHADER 0x0100
  32. #define D3D10_SHADER_AVOID_FLOW_CONTROL 0x0200
  33. #define D3D10_SHADER_PREFER_FLOW_CONTROL 0x0400
  34. #define D3D10_SHADER_ENABLE_STRICTNESS 0x0800
  35. #define D3D10_SHADER_ENABLE_BACKWARDS_COMPATIBILITY 0x1000
  36. #define D3D10_SHADER_IEEE_STRICTNESS 0x2000
  37. #define D3D10_SHADER_WARNINGS_ARE_ERRORS 0x40000
  38. #define D3D10_SHADER_OPTIMIZATION_LEVEL0 0x4000
  39. #define D3D10_SHADER_OPTIMIZATION_LEVEL1 0x0000
  40. #define D3D10_SHADER_OPTIMIZATION_LEVEL2 0xC000
  41. #define D3D10_SHADER_OPTIMIZATION_LEVEL3 0x8000
  42. /* These are defined as version-neutral in d3dcommon.h */
  43. typedef D3D_SHADER_MACRO D3D10_SHADER_MACRO;
  44. typedef D3D_SHADER_MACRO *LPD3D10_SHADER_MACRO;
  45. typedef D3D_SHADER_VARIABLE_CLASS D3D10_SHADER_VARIABLE_CLASS;
  46. typedef D3D_SHADER_VARIABLE_CLASS *LPD3D10_SHADER_VARIABLE_CLASS;
  47. typedef D3D_CBUFFER_TYPE D3D10_CBUFFER_TYPE;
  48. typedef D3D_CBUFFER_TYPE *LPD3D10_CBUFFER_TYPE;
  49. typedef D3D_REGISTER_COMPONENT_TYPE D3D10_REGISTER_COMPONENT_TYPE;
  50. typedef D3D_RESOURCE_RETURN_TYPE D3D10_RESOURCE_RETURN_TYPE;
  51. typedef D3D_NAME D3D10_NAME;
  52. typedef D3D_SHADER_INPUT_TYPE D3D10_SHADER_INPUT_TYPE;
  53. typedef D3D_SHADER_INPUT_TYPE *LPD3D10_SHADER_INPUT_TYPE;
  54. typedef D3D_SHADER_VARIABLE_TYPE D3D10_SHADER_VARIABLE_TYPE;
  55. typedef D3D_SHADER_VARIABLE_TYPE *LPD3D10_SHADER_VARIABLE_TYPE;
  56. typedef D3D_INCLUDE_TYPE D3D10_INCLUDE_TYPE;
  57. typedef ID3DInclude ID3D10Include;
  58. typedef ID3DInclude *LPD3D10INCLUDE;
  59. #define IID_ID3D10Include IID_ID3DInclude
  60. typedef struct _D3D10_SHADER_INPUT_BIND_DESC
  61. {
  62. const char *Name;
  63. D3D10_SHADER_INPUT_TYPE Type;
  64. UINT BindPoint;
  65. UINT BindCount;
  66. UINT uFlags;
  67. D3D10_RESOURCE_RETURN_TYPE ReturnType;
  68. D3D10_SRV_DIMENSION Dimension;
  69. UINT NumSamples;
  70. } D3D10_SHADER_INPUT_BIND_DESC;
  71. typedef struct _D3D10_SIGNATURE_PARAMETER_DESC
  72. {
  73. const char *SemanticName;
  74. UINT SemanticIndex;
  75. UINT Register;
  76. D3D10_NAME SystemValueType;
  77. D3D10_REGISTER_COMPONENT_TYPE ComponentType;
  78. BYTE Mask;
  79. BYTE ReadWriteMask;
  80. } D3D10_SIGNATURE_PARAMETER_DESC;
  81. typedef struct _D3D10_SHADER_DESC
  82. {
  83. UINT Version;
  84. const char *Creator;
  85. UINT Flags;
  86. UINT ConstantBuffers;
  87. UINT BoundResources;
  88. UINT InputParameters;
  89. UINT OutputParameters;
  90. UINT InstructionCount;
  91. UINT TempRegisterCount;
  92. UINT TempArrayCount;
  93. UINT DefCount;
  94. UINT DclCount;
  95. UINT TextureNormalInstructions;
  96. UINT TextureLoadInstructions;
  97. UINT TextureCompInstructions;
  98. UINT TextureBiasInstructions;
  99. UINT TextureGradientInstructions;
  100. UINT FloatInstructionCount;
  101. UINT IntInstructionCount;
  102. UINT UintInstructionCount;
  103. UINT StaticFlowControlCount;
  104. UINT DynamicFlowControlCount;
  105. UINT MacroInstructionCount;
  106. UINT ArrayInstructionCount;
  107. UINT CutInstructionCount;
  108. UINT EmitInstructionCount;
  109. D3D10_PRIMITIVE_TOPOLOGY GSOutputTopology;
  110. UINT GSMaxOutputVertexCount;
  111. } D3D10_SHADER_DESC;
  112. typedef struct _D3D10_SHADER_BUFFER_DESC
  113. {
  114. const char *Name;
  115. D3D10_CBUFFER_TYPE Type;
  116. UINT Variables;
  117. UINT Size;
  118. UINT uFlags;
  119. } D3D10_SHADER_BUFFER_DESC;
  120. typedef struct _D3D10_SHADER_VARIABLE_DESC
  121. {
  122. const char *Name;
  123. UINT StartOffset;
  124. UINT Size;
  125. UINT uFlags;
  126. void *DefaultValue;
  127. } D3D10_SHADER_VARIABLE_DESC;
  128. typedef struct _D3D10_SHADER_TYPE_DESC
  129. {
  130. D3D10_SHADER_VARIABLE_CLASS Class;
  131. D3D10_SHADER_VARIABLE_TYPE Type;
  132. UINT Rows;
  133. UINT Columns;
  134. UINT Elements;
  135. UINT Members;
  136. UINT Offset;
  137. } D3D10_SHADER_TYPE_DESC;
  138. DEFINE_GUID(IID_ID3D10ShaderReflectionType, 0xc530ad7d, 0x9b16, 0x4395, 0xa9, 0x79, 0xba, 0x2e, 0xcf, 0xf8, 0x3a, 0xdd);
  139. #define INTERFACE ID3D10ShaderReflectionType
  140. DECLARE_INTERFACE(ID3D10ShaderReflectionType)
  141. {
  142. STDMETHOD(GetDesc)(THIS_ D3D10_SHADER_TYPE_DESC *desc) PURE;
  143. STDMETHOD_(struct ID3D10ShaderReflectionType *, GetMemberTypeByIndex)(THIS_ UINT index) PURE;
  144. STDMETHOD_(struct ID3D10ShaderReflectionType *, GetMemberTypeByName)(THIS_ const char *name) PURE;
  145. STDMETHOD_(const char *, GetMemberTypeName)(THIS_ UINT index) PURE;
  146. };
  147. #undef INTERFACE
  148. DEFINE_GUID(IID_ID3D10ShaderReflectionVariable, 0x1bf63c95, 0x2650, 0x405d, 0x99, 0xc1, 0x36, 0x36, 0xbd, 0x1d, 0xa0, 0xa1);
  149. #define INTERFACE ID3D10ShaderReflectionVariable
  150. DECLARE_INTERFACE(ID3D10ShaderReflectionVariable)
  151. {
  152. STDMETHOD(GetDesc)(THIS_ D3D10_SHADER_VARIABLE_DESC *desc) PURE;
  153. STDMETHOD_(struct ID3D10ShaderReflectionType *, GetType)(THIS) PURE;
  154. };
  155. #undef INTERFACE
  156. DEFINE_GUID(IID_ID3D10ShaderReflectionConstantBuffer, 0x66c66a94, 0xdddd, 0x4b62, 0xa6, 0x6a, 0xf0, 0xda, 0x33, 0xc2, 0xb4, 0xd0);
  157. #define INTERFACE ID3D10ShaderReflectionConstantBuffer
  158. DECLARE_INTERFACE(ID3D10ShaderReflectionConstantBuffer)
  159. {
  160. STDMETHOD(GetDesc)(THIS_ D3D10_SHADER_BUFFER_DESC *desc) PURE;
  161. STDMETHOD_(struct ID3D10ShaderReflectionVariable *, GetVariableByIndex)(THIS_ UINT index) PURE;
  162. STDMETHOD_(struct ID3D10ShaderReflectionVariable *, GetVariableByName)(THIS_ const char *name) PURE;
  163. };
  164. #undef INTERFACE
  165. DEFINE_GUID(IID_ID3D10ShaderReflection, 0xd40e20b6, 0xf8f7, 0x42ad, 0xab, 0x20, 0x4b, 0xaf, 0x8f, 0x15, 0xdf, 0xaa);
  166. #define INTERFACE ID3D10ShaderReflection
  167. DECLARE_INTERFACE_(ID3D10ShaderReflection, IUnknown)
  168. {
  169. /* IUnknown methods */
  170. STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE;
  171. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  172. STDMETHOD_(ULONG, Release)(THIS) PURE;
  173. /* ID3D10ShaderReflection methods */
  174. STDMETHOD(GetDesc)(THIS_ D3D10_SHADER_DESC *desc) PURE;
  175. STDMETHOD_(struct ID3D10ShaderReflectionConstantBuffer *, GetConstantBufferByIndex)(THIS_ UINT index) PURE;
  176. STDMETHOD_(struct ID3D10ShaderReflectionConstantBuffer *, GetConstantBufferByName)(THIS_ const char *name) PURE;
  177. STDMETHOD(GetResourceBindingDesc)(THIS_ UINT index, D3D10_SHADER_INPUT_BIND_DESC *desc) PURE;
  178. STDMETHOD(GetInputParameterDesc)(THIS_ UINT index, D3D10_SIGNATURE_PARAMETER_DESC *desc) PURE;
  179. STDMETHOD(GetOutputParameterDesc)(THIS_ UINT index, D3D10_SIGNATURE_PARAMETER_DESC *desc) PURE;
  180. };
  181. #undef INTERFACE
  182. #ifdef __cplusplus
  183. extern "C" {
  184. #endif
  185. HRESULT WINAPI D3D10CompileShader(const char *data, SIZE_T data_size, const char *filename,
  186. const D3D10_SHADER_MACRO *defines, ID3D10Include *include, const char *entrypoint,
  187. const char *profile, UINT flags, ID3D10Blob **shader, ID3D10Blob **error_messages);
  188. HRESULT WINAPI D3D10DisassembleShader(const void *data, SIZE_T data_size,
  189. WINBOOL color_code, const char *comments, ID3D10Blob **disassembly);
  190. const char * WINAPI D3D10GetVertexShaderProfile(ID3D10Device *device);
  191. const char * WINAPI D3D10GetGeometryShaderProfile(ID3D10Device *device);
  192. const char * WINAPI D3D10GetPixelShaderProfile(ID3D10Device *device);
  193. HRESULT WINAPI D3D10ReflectShader(const void *data, SIZE_T data_size, ID3D10ShaderReflection **reflector);
  194. HRESULT WINAPI D3D10GetInputSignatureBlob(const void *data, SIZE_T data_size, ID3D10Blob **blob);
  195. HRESULT WINAPI D3D10GetOutputSignatureBlob(const void *data, SIZE_T data_size, ID3D10Blob **blob);
  196. HRESULT WINAPI D3D10GetInputAndOutputSignatureBlob(const void *data, SIZE_T data_size, ID3D10Blob **blob);
  197. HRESULT WINAPI D3D10GetShaderDebugInfo(const void *data, SIZE_T data_size, ID3D10Blob **blob);
  198. #ifdef __cplusplus
  199. }
  200. #endif
  201. #endif /* __WINE_D3D10SHADER_H */