d3dx11effect.h 54 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231
  1. //--------------------------------------------------------------------------------------
  2. // File: D3DX11Effect.h
  3. //
  4. // Direct3D 11 Effect Types & APIs Header
  5. //
  6. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  7. // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  8. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  9. // PARTICULAR PURPOSE.
  10. //
  11. // Copyright (c) Microsoft Corporation. All rights reserved.
  12. //
  13. // http://go.microsoft.com/fwlink/p/?LinkId=271568
  14. //--------------------------------------------------------------------------------------
  15. #pragma once
  16. #define D3DX11_EFFECTS_VERSION 1115
  17. #if defined(_XBOX_ONE) && defined(_TITLE)
  18. #include <d3d11_x.h>
  19. #define DCOMMON_H_INCLUDED
  20. #define NO_D3D11_DEBUG_NAME
  21. #elif (_WIN32_WINNT >= 0x0602) || defined(_WIN7_PLATFORM_UPDATE)
  22. #include <d3d11_1.h>
  23. #include <d3d11shader.h>
  24. #else
  25. #include <d3d11.h>
  26. #include <d3d11shader.h>
  27. #endif
  28. #pragma comment( lib, "d3dcompiler.lib" )
  29. #pragma comment( lib, "dxguid.lib" )
  30. // VS 2010's stdint.h conflicts with intsafe.h
  31. #pragma warning(push)
  32. #pragma warning(disable : 4005)
  33. #include <stdint.h>
  34. #pragma warning(pop)
  35. #if defined(_MSC_VER) && (_MSC_VER<1610) && !defined(_In_reads_)
  36. #define _Analysis_assume_(exp) __analysis_assume(exp)
  37. #define _In_reads_(exp) _In_count_x_(exp)
  38. #define _In_reads_opt_(exp) _In_opt_count_x_(exp)
  39. #define _In_reads_bytes_(exp) _In_bytecount_x_(exp)
  40. #define _Inout_updates_(exp) _Inout_cap_x_(exp)
  41. #define _Inout_updates_z_(exp) _Inout_z_cap_x_(exp)
  42. #define _Inout_updates_bytes_(exp) _Inout_bytecap_x_(exp)
  43. #define _Out_writes_(exp) _Out_cap_x_(exp)
  44. #define _Out_writes_bytes_(exp) _Out_bytecap_x_(exp)
  45. #define _Outptr_ _Deref_out_
  46. #define _Outptr_result_z_ _Deref_out_z_
  47. #define _Outptr_opt_result_maybenull_ _Deref_opt_out_opt_
  48. #define _Outptr_result_maybenull_z_ _Deref_opt_out_opt_z_
  49. #define _Outptr_result_buffer_(exp) _Deref_post_cap_x_(exp)
  50. #define _Outptr_result_buffer_all_maybenull_(exp) _Deref_post_opt_cap_x_(exp)
  51. #define _COM_Outptr_ _Deref_out_
  52. #define _When_(test,exp)
  53. #endif
  54. #ifndef _Use_decl_annotations_
  55. #define _Use_decl_annotations_
  56. #endif
  57. //////////////////////////////////////////////////////////////////////////////
  58. // File contents:
  59. //
  60. // 1) Stateblock enums, structs, interfaces, flat APIs
  61. // 2) Effect enums, structs, interfaces, flat APIs
  62. //////////////////////////////////////////////////////////////////////////////
  63. #ifndef D3DX11_BYTES_FROM_BITS
  64. #define D3DX11_BYTES_FROM_BITS(x) (((x) + 7) / 8)
  65. #endif // D3DX11_BYTES_FROM_BITS
  66. #ifndef D3DERR_INVALIDCALL
  67. #define D3DERR_INVALIDCALL MAKE_HRESULT( 1, 0x876, 2156 )
  68. #endif
  69. struct D3DX11_STATE_BLOCK_MASK
  70. {
  71. uint8_t VS;
  72. uint8_t VSSamplers[D3DX11_BYTES_FROM_BITS(D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT)];
  73. uint8_t VSShaderResources[D3DX11_BYTES_FROM_BITS(D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT)];
  74. uint8_t VSConstantBuffers[D3DX11_BYTES_FROM_BITS(D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT)];
  75. uint8_t VSInterfaces[D3DX11_BYTES_FROM_BITS(D3D11_SHADER_MAX_INTERFACES)];
  76. uint8_t HS;
  77. uint8_t HSSamplers[D3DX11_BYTES_FROM_BITS(D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT)];
  78. uint8_t HSShaderResources[D3DX11_BYTES_FROM_BITS(D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT)];
  79. uint8_t HSConstantBuffers[D3DX11_BYTES_FROM_BITS(D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT)];
  80. uint8_t HSInterfaces[D3DX11_BYTES_FROM_BITS(D3D11_SHADER_MAX_INTERFACES)];
  81. uint8_t DS;
  82. uint8_t DSSamplers[D3DX11_BYTES_FROM_BITS(D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT)];
  83. uint8_t DSShaderResources[D3DX11_BYTES_FROM_BITS(D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT)];
  84. uint8_t DSConstantBuffers[D3DX11_BYTES_FROM_BITS(D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT)];
  85. uint8_t DSInterfaces[D3DX11_BYTES_FROM_BITS(D3D11_SHADER_MAX_INTERFACES)];
  86. uint8_t GS;
  87. uint8_t GSSamplers[D3DX11_BYTES_FROM_BITS(D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT)];
  88. uint8_t GSShaderResources[D3DX11_BYTES_FROM_BITS(D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT)];
  89. uint8_t GSConstantBuffers[D3DX11_BYTES_FROM_BITS(D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT)];
  90. uint8_t GSInterfaces[D3DX11_BYTES_FROM_BITS(D3D11_SHADER_MAX_INTERFACES)];
  91. uint8_t PS;
  92. uint8_t PSSamplers[D3DX11_BYTES_FROM_BITS(D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT)];
  93. uint8_t PSShaderResources[D3DX11_BYTES_FROM_BITS(D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT)];
  94. uint8_t PSConstantBuffers[D3DX11_BYTES_FROM_BITS(D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT)];
  95. uint8_t PSInterfaces[D3DX11_BYTES_FROM_BITS(D3D11_SHADER_MAX_INTERFACES)];
  96. uint8_t PSUnorderedAccessViews;
  97. uint8_t CS;
  98. uint8_t CSSamplers[D3DX11_BYTES_FROM_BITS(D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT)];
  99. uint8_t CSShaderResources[D3DX11_BYTES_FROM_BITS(D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT)];
  100. uint8_t CSConstantBuffers[D3DX11_BYTES_FROM_BITS(D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT)];
  101. uint8_t CSInterfaces[D3DX11_BYTES_FROM_BITS(D3D11_SHADER_MAX_INTERFACES)];
  102. uint8_t CSUnorderedAccessViews;
  103. uint8_t IAVertexBuffers[D3DX11_BYTES_FROM_BITS(D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT)];
  104. uint8_t IAIndexBuffer;
  105. uint8_t IAInputLayout;
  106. uint8_t IAPrimitiveTopology;
  107. uint8_t OMRenderTargets;
  108. uint8_t OMDepthStencilState;
  109. uint8_t OMBlendState;
  110. uint8_t RSViewports;
  111. uint8_t RSScissorRects;
  112. uint8_t RSRasterizerState;
  113. uint8_t SOBuffers;
  114. uint8_t Predication;
  115. };
  116. //----------------------------------------------------------------------------
  117. // D3DX11_EFFECT flags:
  118. // -------------------------------------
  119. //
  120. // These flags are passed in when creating an effect, and affect
  121. // the runtime effect behavior:
  122. //
  123. // (Currently none)
  124. //
  125. //
  126. // These flags are set by the effect runtime:
  127. //
  128. // D3DX11_EFFECT_OPTIMIZED
  129. // This effect has been optimized. Reflection functions that rely on
  130. // names/semantics/strings should fail. This is set when Optimize() is
  131. // called, but CEffect::IsOptimized() should be used to test for this.
  132. //
  133. // D3DX11_EFFECT_CLONE
  134. // This effect is a clone of another effect. Single CBs will never be
  135. // updated when internal variable values are changed.
  136. // This flag is not set when the D3DX11_EFFECT_CLONE_FORCE_NONSINGLE flag
  137. // is used in cloning.
  138. //
  139. //----------------------------------------------------------------------------
  140. #define D3DX11_EFFECT_OPTIMIZED (1 << 21)
  141. #define D3DX11_EFFECT_CLONE (1 << 22)
  142. // Mask of valid D3DCOMPILE_EFFECT flags for D3DX11CreateEffect*
  143. #define D3DX11_EFFECT_RUNTIME_VALID_FLAGS (0)
  144. //----------------------------------------------------------------------------
  145. // D3DX11_EFFECT_VARIABLE flags:
  146. // ----------------------------
  147. //
  148. // These flags describe an effect variable (global or annotation),
  149. // and are returned in D3DX11_EFFECT_VARIABLE_DESC::Flags.
  150. //
  151. // D3DX11_EFFECT_VARIABLE_ANNOTATION
  152. // Indicates that this is an annotation on a technique, pass, or global
  153. // variable. Otherwise, this is a global variable. Annotations cannot
  154. // be shared.
  155. //
  156. // D3DX11_EFFECT_VARIABLE_EXPLICIT_BIND_POINT
  157. // Indicates that the variable has been explicitly bound using the
  158. // register keyword.
  159. //----------------------------------------------------------------------------
  160. #define D3DX11_EFFECT_VARIABLE_ANNOTATION (1 << 1)
  161. #define D3DX11_EFFECT_VARIABLE_EXPLICIT_BIND_POINT (1 << 2)
  162. //----------------------------------------------------------------------------
  163. // D3DX11_EFFECT_CLONE flags:
  164. // ----------------------------
  165. //
  166. // These flags modify the effect cloning process and are passed into Clone.
  167. //
  168. // D3DX11_EFFECT_CLONE_FORCE_NONSINGLE
  169. // Ignore all "single" qualifiers on cbuffers. All cbuffers will have their
  170. // own ID3D11Buffer's created in the cloned effect.
  171. //----------------------------------------------------------------------------
  172. #define D3DX11_EFFECT_CLONE_FORCE_NONSINGLE (1 << 0)
  173. //////////////////////////////////////////////////////////////////////////////
  174. // ID3DX11EffectType //////////////////////////////////////////////////////////
  175. //////////////////////////////////////////////////////////////////////////////
  176. //----------------------------------------------------------------------------
  177. // D3DX11_EFFECT_TYPE_DESC:
  178. //
  179. // Retrieved by ID3DX11EffectType::GetDesc()
  180. //----------------------------------------------------------------------------
  181. struct D3DX11_EFFECT_TYPE_DESC
  182. {
  183. LPCSTR TypeName; // Name of the type
  184. // (e.g. "float4" or "MyStruct")
  185. D3D_SHADER_VARIABLE_CLASS Class; // (e.g. scalar, vector, object, etc.)
  186. D3D_SHADER_VARIABLE_TYPE Type; // (e.g. float, texture, vertexshader, etc.)
  187. uint32_t Elements; // Number of elements in this type
  188. // (0 if not an array)
  189. uint32_t Members; // Number of members
  190. // (0 if not a structure)
  191. uint32_t Rows; // Number of rows in this type
  192. // (0 if not a numeric primitive)
  193. uint32_t Columns; // Number of columns in this type
  194. // (0 if not a numeric primitive)
  195. uint32_t PackedSize; // Number of bytes required to represent
  196. // this data type, when tightly packed
  197. uint32_t UnpackedSize; // Number of bytes occupied by this data
  198. // type, when laid out in a constant buffer
  199. uint32_t Stride; // Number of bytes to seek between elements,
  200. // when laid out in a constant buffer
  201. };
  202. typedef interface ID3DX11EffectType ID3DX11EffectType;
  203. typedef interface ID3DX11EffectType *LPD3D11EFFECTTYPE;
  204. // {4250D721-D5E5-491F-B62B-587C43186285}
  205. DEFINE_GUID(IID_ID3DX11EffectType,
  206. 0x4250d721, 0xd5e5, 0x491f, 0xb6, 0x2b, 0x58, 0x7c, 0x43, 0x18, 0x62, 0x85);
  207. #undef INTERFACE
  208. #define INTERFACE ID3DX11EffectType
  209. DECLARE_INTERFACE_(ID3DX11EffectType, IUnknown)
  210. {
  211. // IUnknown
  212. // ID3DX11EffectType
  213. STDMETHOD_(bool, IsValid)(THIS) PURE;
  214. STDMETHOD(GetDesc)(THIS_ _Out_ D3DX11_EFFECT_TYPE_DESC *pDesc) PURE;
  215. STDMETHOD_(ID3DX11EffectType*, GetMemberTypeByIndex)(THIS_ _In_ uint32_t Index) PURE;
  216. STDMETHOD_(ID3DX11EffectType*, GetMemberTypeByName)(THIS_ _In_z_ LPCSTR Name) PURE;
  217. STDMETHOD_(ID3DX11EffectType*, GetMemberTypeBySemantic)(THIS_ _In_z_ LPCSTR Semantic) PURE;
  218. STDMETHOD_(LPCSTR, GetMemberName)(THIS_ _In_ uint32_t Index) PURE;
  219. STDMETHOD_(LPCSTR, GetMemberSemantic)(THIS_ _In_ uint32_t Index) PURE;
  220. };
  221. //////////////////////////////////////////////////////////////////////////////
  222. // ID3DX11EffectVariable //////////////////////////////////////////////////////
  223. //////////////////////////////////////////////////////////////////////////////
  224. //----------------------------------------------------------------------------
  225. // D3DX11_EFFECT_VARIABLE_DESC:
  226. //
  227. // Retrieved by ID3DX11EffectVariable::GetDesc()
  228. //----------------------------------------------------------------------------
  229. struct D3DX11_EFFECT_VARIABLE_DESC
  230. {
  231. LPCSTR Name; // Name of this variable, annotation,
  232. // or structure member
  233. LPCSTR Semantic; // Semantic string of this variable
  234. // or structure member (nullptr for
  235. // annotations or if not present)
  236. uint32_t Flags; // D3DX11_EFFECT_VARIABLE_* flags
  237. uint32_t Annotations; // Number of annotations on this variable
  238. // (always 0 for annotations)
  239. uint32_t BufferOffset; // Offset into containing cbuffer or tbuffer
  240. // (always 0 for annotations or variables
  241. // not in constant buffers)
  242. uint32_t ExplicitBindPoint; // Used if the variable has been explicitly bound
  243. // using the register keyword. Check Flags for
  244. // D3DX11_EFFECT_VARIABLE_EXPLICIT_BIND_POINT;
  245. };
  246. typedef interface ID3DX11EffectVariable ID3DX11EffectVariable;
  247. typedef interface ID3DX11EffectVariable *LPD3D11EFFECTVARIABLE;
  248. // {036A777D-B56E-4B25-B313-CC3DDAB71873}
  249. DEFINE_GUID(IID_ID3DX11EffectVariable,
  250. 0x036a777d, 0xb56e, 0x4b25, 0xb3, 0x13, 0xcc, 0x3d, 0xda, 0xb7, 0x18, 0x73);
  251. #undef INTERFACE
  252. #define INTERFACE ID3DX11EffectVariable
  253. // Forward defines
  254. typedef interface ID3DX11EffectScalarVariable ID3DX11EffectScalarVariable;
  255. typedef interface ID3DX11EffectVectorVariable ID3DX11EffectVectorVariable;
  256. typedef interface ID3DX11EffectMatrixVariable ID3DX11EffectMatrixVariable;
  257. typedef interface ID3DX11EffectStringVariable ID3DX11EffectStringVariable;
  258. typedef interface ID3DX11EffectClassInstanceVariable ID3DX11EffectClassInstanceVariable;
  259. typedef interface ID3DX11EffectInterfaceVariable ID3DX11EffectInterfaceVariable;
  260. typedef interface ID3DX11EffectShaderResourceVariable ID3DX11EffectShaderResourceVariable;
  261. typedef interface ID3DX11EffectUnorderedAccessViewVariable ID3DX11EffectUnorderedAccessViewVariable;
  262. typedef interface ID3DX11EffectRenderTargetViewVariable ID3DX11EffectRenderTargetViewVariable;
  263. typedef interface ID3DX11EffectDepthStencilViewVariable ID3DX11EffectDepthStencilViewVariable;
  264. typedef interface ID3DX11EffectConstantBuffer ID3DX11EffectConstantBuffer;
  265. typedef interface ID3DX11EffectShaderVariable ID3DX11EffectShaderVariable;
  266. typedef interface ID3DX11EffectBlendVariable ID3DX11EffectBlendVariable;
  267. typedef interface ID3DX11EffectDepthStencilVariable ID3DX11EffectDepthStencilVariable;
  268. typedef interface ID3DX11EffectRasterizerVariable ID3DX11EffectRasterizerVariable;
  269. typedef interface ID3DX11EffectSamplerVariable ID3DX11EffectSamplerVariable;
  270. DECLARE_INTERFACE_(ID3DX11EffectVariable, IUnknown)
  271. {
  272. // IUnknown
  273. // ID3DX11EffectVariable
  274. STDMETHOD_(bool, IsValid)(THIS) PURE;
  275. STDMETHOD_(ID3DX11EffectType*, GetType)(THIS) PURE;
  276. STDMETHOD(GetDesc)(THIS_ _Out_ D3DX11_EFFECT_VARIABLE_DESC *pDesc) PURE;
  277. STDMETHOD_(ID3DX11EffectVariable*, GetAnnotationByIndex)(THIS_ _In_ uint32_t Index) PURE;
  278. STDMETHOD_(ID3DX11EffectVariable*, GetAnnotationByName)(THIS_ _In_z_ LPCSTR Name) PURE;
  279. STDMETHOD_(ID3DX11EffectVariable*, GetMemberByIndex)(THIS_ _In_ uint32_t Index) PURE;
  280. STDMETHOD_(ID3DX11EffectVariable*, GetMemberByName)(THIS_ _In_z_ LPCSTR Name) PURE;
  281. STDMETHOD_(ID3DX11EffectVariable*, GetMemberBySemantic)(THIS_ _In_z_ LPCSTR Semantic) PURE;
  282. STDMETHOD_(ID3DX11EffectVariable*, GetElement)(THIS_ _In_ uint32_t Index) PURE;
  283. STDMETHOD_(ID3DX11EffectConstantBuffer*, GetParentConstantBuffer)(THIS) PURE;
  284. STDMETHOD_(ID3DX11EffectScalarVariable*, AsScalar)(THIS) PURE;
  285. STDMETHOD_(ID3DX11EffectVectorVariable*, AsVector)(THIS) PURE;
  286. STDMETHOD_(ID3DX11EffectMatrixVariable*, AsMatrix)(THIS) PURE;
  287. STDMETHOD_(ID3DX11EffectStringVariable*, AsString)(THIS) PURE;
  288. STDMETHOD_(ID3DX11EffectClassInstanceVariable*, AsClassInstance)(THIS) PURE;
  289. STDMETHOD_(ID3DX11EffectInterfaceVariable*, AsInterface)(THIS) PURE;
  290. STDMETHOD_(ID3DX11EffectShaderResourceVariable*, AsShaderResource)(THIS) PURE;
  291. STDMETHOD_(ID3DX11EffectUnorderedAccessViewVariable*, AsUnorderedAccessView)(THIS) PURE;
  292. STDMETHOD_(ID3DX11EffectRenderTargetViewVariable*, AsRenderTargetView)(THIS) PURE;
  293. STDMETHOD_(ID3DX11EffectDepthStencilViewVariable*, AsDepthStencilView)(THIS) PURE;
  294. STDMETHOD_(ID3DX11EffectConstantBuffer*, AsConstantBuffer)(THIS) PURE;
  295. STDMETHOD_(ID3DX11EffectShaderVariable*, AsShader)(THIS) PURE;
  296. STDMETHOD_(ID3DX11EffectBlendVariable*, AsBlend)(THIS) PURE;
  297. STDMETHOD_(ID3DX11EffectDepthStencilVariable*, AsDepthStencil)(THIS) PURE;
  298. STDMETHOD_(ID3DX11EffectRasterizerVariable*, AsRasterizer)(THIS) PURE;
  299. STDMETHOD_(ID3DX11EffectSamplerVariable*, AsSampler)(THIS) PURE;
  300. STDMETHOD(SetRawValue)(THIS_ _In_reads_bytes_(ByteCount) const void *pData, _In_ uint32_t ByteOffset, _In_ uint32_t ByteCount) PURE;
  301. STDMETHOD(GetRawValue)(THIS_ _Out_writes_bytes_(ByteCount) void *pData, _In_ uint32_t ByteOffset, _In_ uint32_t ByteCount) PURE;
  302. };
  303. //////////////////////////////////////////////////////////////////////////////
  304. // ID3DX11EffectScalarVariable ////////////////////////////////////////////////
  305. //////////////////////////////////////////////////////////////////////////////
  306. typedef interface ID3DX11EffectScalarVariable ID3DX11EffectScalarVariable;
  307. typedef interface ID3DX11EffectScalarVariable *LPD3D11EFFECTSCALARVARIABLE;
  308. // {921EF2E5-A65D-4E92-9FC6-4E9CC09A4ADE}
  309. DEFINE_GUID(IID_ID3DX11EffectScalarVariable,
  310. 0x921ef2e5, 0xa65d, 0x4e92, 0x9f, 0xc6, 0x4e, 0x9c, 0xc0, 0x9a, 0x4a, 0xde);
  311. #undef INTERFACE
  312. #define INTERFACE ID3DX11EffectScalarVariable
  313. DECLARE_INTERFACE_(ID3DX11EffectScalarVariable, ID3DX11EffectVariable)
  314. {
  315. // IUnknown
  316. // ID3DX11EffectVariable
  317. // ID3DX11EffectScalarVariable
  318. STDMETHOD(SetFloat)(THIS_ _In_ const float Value) PURE;
  319. STDMETHOD(GetFloat)(THIS_ _Out_ float *pValue) PURE;
  320. STDMETHOD(SetFloatArray)(THIS_ _In_reads_(Count) const float *pData, _In_ uint32_t Offset, _In_ uint32_t Count) PURE;
  321. STDMETHOD(GetFloatArray)(THIS_ _Out_writes_(Count) float *pData, _In_ uint32_t Offset, _In_ uint32_t Count) PURE;
  322. STDMETHOD(SetInt)(THIS_ _In_ const int Value) PURE;
  323. STDMETHOD(GetInt)(THIS_ _Out_ int *pValue) PURE;
  324. STDMETHOD(SetIntArray)(THIS_ _In_reads_(Count) const int *pData, _In_ uint32_t Offset, _In_ uint32_t Count) PURE;
  325. STDMETHOD(GetIntArray)(THIS_ _Out_writes_(Count) int *pData, _In_ uint32_t Offset, _In_ uint32_t Count) PURE;
  326. STDMETHOD(SetBool)(THIS_ _In_ const bool Value) PURE;
  327. STDMETHOD(GetBool)(THIS_ _Out_ bool *pValue) PURE;
  328. STDMETHOD(SetBoolArray)(THIS_ _In_reads_(Count) const bool *pData, _In_ uint32_t Offset, _In_ uint32_t Count) PURE;
  329. STDMETHOD(GetBoolArray)(THIS_ _Out_writes_(Count) bool *pData, _In_ uint32_t Offset, _In_ uint32_t Count) PURE;
  330. };
  331. //////////////////////////////////////////////////////////////////////////////
  332. // ID3DX11EffectVectorVariable ////////////////////////////////////////////////
  333. //////////////////////////////////////////////////////////////////////////////
  334. typedef interface ID3DX11EffectVectorVariable ID3DX11EffectVectorVariable;
  335. typedef interface ID3DX11EffectVectorVariable *LPD3D11EFFECTVECTORVARIABLE;
  336. // {5E785D4A-D87B-48D8-B6E6-0F8CA7E7467A}
  337. DEFINE_GUID(IID_ID3DX11EffectVectorVariable,
  338. 0x5e785d4a, 0xd87b, 0x48d8, 0xb6, 0xe6, 0x0f, 0x8c, 0xa7, 0xe7, 0x46, 0x7a);
  339. #undef INTERFACE
  340. #define INTERFACE ID3DX11EffectVectorVariable
  341. DECLARE_INTERFACE_(ID3DX11EffectVectorVariable, ID3DX11EffectVariable)
  342. {
  343. // IUnknown
  344. // ID3DX11EffectVariable
  345. // ID3DX11EffectVectorVariable
  346. STDMETHOD(SetBoolVector) (THIS_ _In_reads_(4) const bool *pData) PURE;
  347. STDMETHOD(SetIntVector) (THIS_ _In_reads_(4) const int *pData) PURE;
  348. STDMETHOD(SetFloatVector)(THIS_ _In_reads_(4) const float *pData) PURE;
  349. STDMETHOD(GetBoolVector) (THIS_ _Out_writes_(4) bool *pData) PURE;
  350. STDMETHOD(GetIntVector) (THIS_ _Out_writes_(4) int *pData) PURE;
  351. STDMETHOD(GetFloatVector)(THIS_ _Out_writes_(4) float *pData) PURE;
  352. STDMETHOD(SetBoolVectorArray) (THIS_ _In_reads_(Count*4) const bool *pData, _In_ uint32_t Offset, _In_ uint32_t Count) PURE;
  353. STDMETHOD(SetIntVectorArray) (THIS_ _In_reads_(Count*4) const int *pData, _In_ uint32_t Offset, _In_ uint32_t Count) PURE;
  354. STDMETHOD(SetFloatVectorArray)(THIS_ _In_reads_(Count*4) const float *pData, _In_ uint32_t Offset, _In_ uint32_t Count) PURE;
  355. STDMETHOD(GetBoolVectorArray) (THIS_ _Out_writes_(Count*4) bool *pData, _In_ uint32_t Offset, _In_ uint32_t Count) PURE;
  356. STDMETHOD(GetIntVectorArray) (THIS_ _Out_writes_(Count*4) int *pData, _In_ uint32_t Offset, _In_ uint32_t Count) PURE;
  357. STDMETHOD(GetFloatVectorArray)(THIS_ _Out_writes_(Count*4) float *pData, _In_ uint32_t Offset, _In_ uint32_t Count) PURE;
  358. };
  359. //////////////////////////////////////////////////////////////////////////////
  360. // ID3DX11EffectMatrixVariable ////////////////////////////////////////////////
  361. //////////////////////////////////////////////////////////////////////////////
  362. typedef interface ID3DX11EffectMatrixVariable ID3DX11EffectMatrixVariable;
  363. typedef interface ID3DX11EffectMatrixVariable *LPD3D11EFFECTMATRIXVARIABLE;
  364. // {E1096CF4-C027-419A-8D86-D29173DC803E}
  365. DEFINE_GUID(IID_ID3DX11EffectMatrixVariable,
  366. 0xe1096cf4, 0xc027, 0x419a, 0x8d, 0x86, 0xd2, 0x91, 0x73, 0xdc, 0x80, 0x3e);
  367. #undef INTERFACE
  368. #define INTERFACE ID3DX11EffectMatrixVariable
  369. DECLARE_INTERFACE_(ID3DX11EffectMatrixVariable, ID3DX11EffectVariable)
  370. {
  371. // IUnknown
  372. // ID3DX11EffectVariable
  373. // ID3DX11EffectMatrixVariable
  374. STDMETHOD(SetMatrix)(THIS_ _In_reads_(16) const float *pData) PURE;
  375. STDMETHOD(GetMatrix)(THIS_ _Out_writes_(16) float *pData) PURE;
  376. STDMETHOD(SetMatrixArray)(THIS_ _In_reads_(Count*16) const float *pData, _In_ uint32_t Offset, _In_ uint32_t Count) PURE;
  377. STDMETHOD(GetMatrixArray)(THIS_ _Out_writes_(Count*16) float *pData, _In_ uint32_t Offset, _In_ uint32_t Count) PURE;
  378. STDMETHOD(SetMatrixPointerArray)(_In_reads_(Count*16) const float **ppData, uint32_t Offset, uint32_t Count) PURE;
  379. STDMETHOD(GetMatrixPointerArray)(_Out_writes_(Count*16) float **ppData, uint32_t Offset, uint32_t Count) PURE;
  380. STDMETHOD(SetMatrixTranspose)(THIS_ _In_reads_(16) const float *pData) PURE;
  381. STDMETHOD(GetMatrixTranspose)(THIS_ _Out_writes_(16) float *pData) PURE;
  382. STDMETHOD(SetMatrixTransposeArray)(THIS_ _In_reads_(Count*16) const float *pData, _In_ uint32_t Offset, _In_ uint32_t Count) PURE;
  383. STDMETHOD(GetMatrixTransposeArray)(THIS_ _Out_writes_(Count*16) float *pData, _In_ uint32_t Offset, _In_ uint32_t Count) PURE;
  384. STDMETHOD(SetMatrixTransposePointerArray)(_In_reads_(Count*16) const float **ppData, uint32_t Offset, uint32_t Count) PURE;
  385. STDMETHOD(GetMatrixTransposePointerArray)(_Out_writes_(Count*16) float **ppData, uint32_t Offset, uint32_t Count) PURE;
  386. };
  387. //////////////////////////////////////////////////////////////////////////////
  388. // ID3DX11EffectStringVariable ////////////////////////////////////////////////
  389. //////////////////////////////////////////////////////////////////////////////
  390. typedef interface ID3DX11EffectStringVariable ID3DX11EffectStringVariable;
  391. typedef interface ID3DX11EffectStringVariable *LPD3D11EFFECTSTRINGVARIABLE;
  392. // {F355C818-01BE-4653-A7CC-60FFFEDDC76D}
  393. DEFINE_GUID(IID_ID3DX11EffectStringVariable,
  394. 0xf355c818, 0x01be, 0x4653, 0xa7, 0xcc, 0x60, 0xff, 0xfe, 0xdd, 0xc7, 0x6d);
  395. #undef INTERFACE
  396. #define INTERFACE ID3DX11EffectStringVariable
  397. DECLARE_INTERFACE_(ID3DX11EffectStringVariable, ID3DX11EffectVariable)
  398. {
  399. // IUnknown
  400. // ID3DX11EffectVariable
  401. // ID3DX11EffectStringVariable
  402. STDMETHOD(GetString)(THIS_ _Outptr_result_z_ LPCSTR *ppString) PURE;
  403. STDMETHOD(GetStringArray)(THIS_ _Out_writes_(Count) LPCSTR *ppStrings, _In_ uint32_t Offset, _In_ uint32_t Count) PURE;
  404. };
  405. //////////////////////////////////////////////////////////////////////////////
  406. // ID3DX11EffectClassInstanceVariable ////////////////////////////////////////
  407. //////////////////////////////////////////////////////////////////////////////
  408. typedef interface ID3DX11EffectClassInstanceVariable ID3DX11EffectClassInstanceVariable;
  409. typedef interface ID3DX11EffectClassInstanceVariable *LPD3D11EFFECTCLASSINSTANCEVARIABLE;
  410. // {926A8053-2A39-4DB4-9BDE-CF649ADEBDC1}
  411. DEFINE_GUID(IID_ID3DX11EffectClassInstanceVariable,
  412. 0x926a8053, 0x2a39, 0x4db4, 0x9b, 0xde, 0xcf, 0x64, 0x9a, 0xde, 0xbd, 0xc1);
  413. #undef INTERFACE
  414. #define INTERFACE ID3DX11EffectClassInstanceVariable
  415. DECLARE_INTERFACE_(ID3DX11EffectClassInstanceVariable, ID3DX11EffectVariable)
  416. {
  417. // IUnknown
  418. // ID3DX11EffectVariable
  419. // ID3DX11EffectClassInstanceVariable
  420. STDMETHOD(GetClassInstance)(_Outptr_ ID3D11ClassInstance** ppClassInstance) PURE;
  421. };
  422. //////////////////////////////////////////////////////////////////////////////
  423. // ID3DX11EffectInterfaceVariable ////////////////////////////////////////
  424. //////////////////////////////////////////////////////////////////////////////
  425. typedef interface ID3DX11EffectInterfaceVariable ID3DX11EffectInterfaceVariable;
  426. typedef interface ID3DX11EffectInterfaceVariable *LPD3D11EFFECTINTERFACEVARIABLE;
  427. // {516C8CD8-1C80-40A4-B19B-0688792F11A5}
  428. DEFINE_GUID(IID_ID3DX11EffectInterfaceVariable,
  429. 0x516c8cd8, 0x1c80, 0x40a4, 0xb1, 0x9b, 0x06, 0x88, 0x79, 0x2f, 0x11, 0xa5);
  430. #undef INTERFACE
  431. #define INTERFACE ID3DX11EffectInterfaceVariable
  432. DECLARE_INTERFACE_(ID3DX11EffectInterfaceVariable, ID3DX11EffectVariable)
  433. {
  434. // IUnknown
  435. // ID3DX11EffectVariable
  436. // ID3DX11EffectInterfaceVariable
  437. STDMETHOD(SetClassInstance)(_In_ ID3DX11EffectClassInstanceVariable *pEffectClassInstance) PURE;
  438. STDMETHOD(GetClassInstance)(_Outptr_ ID3DX11EffectClassInstanceVariable **ppEffectClassInstance) PURE;
  439. };
  440. //////////////////////////////////////////////////////////////////////////////
  441. // ID3DX11EffectShaderResourceVariable ////////////////////////////////////////
  442. //////////////////////////////////////////////////////////////////////////////
  443. typedef interface ID3DX11EffectShaderResourceVariable ID3DX11EffectShaderResourceVariable;
  444. typedef interface ID3DX11EffectShaderResourceVariable *LPD3D11EFFECTSHADERRESOURCEVARIABLE;
  445. // {350DB233-BBE0-485C-9BFE-C0026B844F89}
  446. DEFINE_GUID(IID_ID3DX11EffectShaderResourceVariable,
  447. 0x350db233, 0xbbe0, 0x485c, 0x9b, 0xfe, 0xc0, 0x02, 0x6b, 0x84, 0x4f, 0x89);
  448. #undef INTERFACE
  449. #define INTERFACE ID3DX11EffectShaderResourceVariable
  450. DECLARE_INTERFACE_(ID3DX11EffectShaderResourceVariable, ID3DX11EffectVariable)
  451. {
  452. // IUnknown
  453. // ID3DX11EffectVariable
  454. // ID3DX11EffectShaderResourceVariable
  455. STDMETHOD(SetResource)(THIS_ _In_ ID3D11ShaderResourceView *pResource) PURE;
  456. STDMETHOD(GetResource)(THIS_ _Outptr_ ID3D11ShaderResourceView **ppResource) PURE;
  457. STDMETHOD(SetResourceArray)(THIS_ _In_reads_(Count) ID3D11ShaderResourceView **ppResources, _In_ uint32_t Offset, _In_ uint32_t Count) PURE;
  458. STDMETHOD(GetResourceArray)(THIS_ _Out_writes_(Count) ID3D11ShaderResourceView **ppResources, _In_ uint32_t Offset, _In_ uint32_t Count) PURE;
  459. };
  460. //////////////////////////////////////////////////////////////////////////////
  461. // ID3DX11EffectUnorderedAccessViewVariable ////////////////////////////////////////
  462. //////////////////////////////////////////////////////////////////////////////
  463. typedef interface ID3DX11EffectUnorderedAccessViewVariable ID3DX11EffectUnorderedAccessViewVariable;
  464. typedef interface ID3DX11EffectUnorderedAccessViewVariable *LPD3D11EFFECTUNORDEREDACCESSVIEWVARIABLE;
  465. // {79B4AC8C-870A-47D2-B05A-8BD5CC3EE6C9}
  466. DEFINE_GUID(IID_ID3DX11EffectUnorderedAccessViewVariable,
  467. 0x79b4ac8c, 0x870a, 0x47d2, 0xb0, 0x5a, 0x8b, 0xd5, 0xcc, 0x3e, 0xe6, 0xc9);
  468. #undef INTERFACE
  469. #define INTERFACE ID3DX11EffectUnorderedAccessViewVariable
  470. DECLARE_INTERFACE_(ID3DX11EffectUnorderedAccessViewVariable, ID3DX11EffectVariable)
  471. {
  472. // IUnknown
  473. // ID3DX11EffectVariable
  474. // ID3DX11EffectUnorderedAccessViewVariable
  475. STDMETHOD(SetUnorderedAccessView)(THIS_ _In_ ID3D11UnorderedAccessView *pResource) PURE;
  476. STDMETHOD(GetUnorderedAccessView)(THIS_ _Outptr_ ID3D11UnorderedAccessView **ppResource) PURE;
  477. STDMETHOD(SetUnorderedAccessViewArray)(THIS_ _In_reads_(Count) ID3D11UnorderedAccessView **ppResources, _In_ uint32_t Offset, _In_ uint32_t Count) PURE;
  478. STDMETHOD(GetUnorderedAccessViewArray)(THIS_ _Out_writes_(Count) ID3D11UnorderedAccessView **ppResources, _In_ uint32_t Offset, _In_ uint32_t Count) PURE;
  479. };
  480. //////////////////////////////////////////////////////////////////////////////
  481. // ID3DX11EffectRenderTargetViewVariable //////////////////////////////////////
  482. //////////////////////////////////////////////////////////////////////////////
  483. typedef interface ID3DX11EffectRenderTargetViewVariable ID3DX11EffectRenderTargetViewVariable;
  484. typedef interface ID3DX11EffectRenderTargetViewVariable *LPD3D11EFFECTRENDERTARGETVIEWVARIABLE;
  485. // {D5066909-F40C-43F8-9DB5-057C2A208552}
  486. DEFINE_GUID(IID_ID3DX11EffectRenderTargetViewVariable,
  487. 0xd5066909, 0xf40c, 0x43f8, 0x9d, 0xb5, 0x05, 0x7c, 0x2a, 0x20, 0x85, 0x52);
  488. #undef INTERFACE
  489. #define INTERFACE ID3DX11EffectRenderTargetViewVariable
  490. DECLARE_INTERFACE_(ID3DX11EffectRenderTargetViewVariable, ID3DX11EffectVariable)
  491. {
  492. // IUnknown
  493. // ID3DX11EffectVariable
  494. // ID3DX11EffectRenderTargetViewVariable
  495. STDMETHOD(SetRenderTarget)(THIS_ _In_ ID3D11RenderTargetView *pResource) PURE;
  496. STDMETHOD(GetRenderTarget)(THIS_ _Outptr_ ID3D11RenderTargetView **ppResource) PURE;
  497. STDMETHOD(SetRenderTargetArray)(THIS_ _In_reads_(Count) ID3D11RenderTargetView **ppResources, _In_ uint32_t Offset, _In_ uint32_t Count) PURE;
  498. STDMETHOD(GetRenderTargetArray)(THIS_ _Out_writes_(Count) ID3D11RenderTargetView **ppResources, _In_ uint32_t Offset, _In_ uint32_t Count) PURE;
  499. };
  500. //////////////////////////////////////////////////////////////////////////////
  501. // ID3DX11EffectDepthStencilViewVariable //////////////////////////////////////
  502. //////////////////////////////////////////////////////////////////////////////
  503. typedef interface ID3DX11EffectDepthStencilViewVariable ID3DX11EffectDepthStencilViewVariable;
  504. typedef interface ID3DX11EffectDepthStencilViewVariable *LPD3D11EFFECTDEPTHSTENCILVIEWVARIABLE;
  505. // {33C648AC-2E9E-4A2E-9CD6-DE31ACC5B347}
  506. DEFINE_GUID(IID_ID3DX11EffectDepthStencilViewVariable,
  507. 0x33c648ac, 0x2e9e, 0x4a2e, 0x9c, 0xd6, 0xde, 0x31, 0xac, 0xc5, 0xb3, 0x47);
  508. #undef INTERFACE
  509. #define INTERFACE ID3DX11EffectDepthStencilViewVariable
  510. DECLARE_INTERFACE_(ID3DX11EffectDepthStencilViewVariable, ID3DX11EffectVariable)
  511. {
  512. // IUnknown
  513. // ID3DX11EffectVariable
  514. // ID3DX11EffectDepthStencilViewVariable
  515. STDMETHOD(SetDepthStencil)(THIS_ _In_ ID3D11DepthStencilView *pResource) PURE;
  516. STDMETHOD(GetDepthStencil)(THIS_ _Outptr_ ID3D11DepthStencilView **ppResource) PURE;
  517. STDMETHOD(SetDepthStencilArray)(THIS_ _In_reads_(Count) ID3D11DepthStencilView **ppResources, _In_ uint32_t Offset, _In_ uint32_t Count) PURE;
  518. STDMETHOD(GetDepthStencilArray)(THIS_ _Out_writes_(Count) ID3D11DepthStencilView **ppResources, _In_ uint32_t Offset, _In_ uint32_t Count) PURE;
  519. };
  520. //////////////////////////////////////////////////////////////////////////////
  521. // ID3DX11EffectConstantBuffer ////////////////////////////////////////////////
  522. //////////////////////////////////////////////////////////////////////////////
  523. typedef interface ID3DX11EffectConstantBuffer ID3DX11EffectConstantBuffer;
  524. typedef interface ID3DX11EffectConstantBuffer *LPD3D11EFFECTCONSTANTBUFFER;
  525. // {2CB6C733-82D2-4000-B3DA-6219D9A99BF2}
  526. DEFINE_GUID(IID_ID3DX11EffectConstantBuffer,
  527. 0x2cb6c733, 0x82d2, 0x4000, 0xb3, 0xda, 0x62, 0x19, 0xd9, 0xa9, 0x9b, 0xf2);
  528. #undef INTERFACE
  529. #define INTERFACE ID3DX11EffectConstantBuffer
  530. DECLARE_INTERFACE_(ID3DX11EffectConstantBuffer, ID3DX11EffectVariable)
  531. {
  532. // IUnknown
  533. // ID3DX11EffectVariable
  534. // ID3DX11EffectConstantBuffer
  535. STDMETHOD(SetConstantBuffer)(THIS_ _In_ ID3D11Buffer *pConstantBuffer) PURE;
  536. STDMETHOD(UndoSetConstantBuffer)(THIS) PURE;
  537. STDMETHOD(GetConstantBuffer)(THIS_ _Outptr_ ID3D11Buffer **ppConstantBuffer) PURE;
  538. STDMETHOD(SetTextureBuffer)(THIS_ _In_ ID3D11ShaderResourceView *pTextureBuffer) PURE;
  539. STDMETHOD(UndoSetTextureBuffer)(THIS) PURE;
  540. STDMETHOD(GetTextureBuffer)(THIS_ _Outptr_ ID3D11ShaderResourceView **ppTextureBuffer) PURE;
  541. };
  542. //////////////////////////////////////////////////////////////////////////////
  543. // ID3DX11EffectShaderVariable ////////////////////////////////////////////////
  544. //////////////////////////////////////////////////////////////////////////////
  545. //----------------------------------------------------------------------------
  546. // D3DX11_EFFECT_SHADER_DESC:
  547. //
  548. // Retrieved by ID3DX11EffectShaderVariable::GetShaderDesc()
  549. //----------------------------------------------------------------------------
  550. struct D3DX11_EFFECT_SHADER_DESC
  551. {
  552. const uint8_t *pInputSignature; // Passed into CreateInputLayout,
  553. // valid on VS and GS only
  554. bool IsInline; // Is this an anonymous shader variable
  555. // resulting from an inline shader assignment?
  556. // -- The following fields are not valid after Optimize() --
  557. const uint8_t *pBytecode; // Shader bytecode
  558. uint32_t BytecodeLength;
  559. LPCSTR SODecls[D3D11_SO_STREAM_COUNT]; // Stream out declaration string (for GS with SO)
  560. uint32_t RasterizedStream;
  561. uint32_t NumInputSignatureEntries; // Number of entries in the input signature
  562. uint32_t NumOutputSignatureEntries; // Number of entries in the output signature
  563. uint32_t NumPatchConstantSignatureEntries; // Number of entries in the patch constant signature
  564. };
  565. typedef interface ID3DX11EffectShaderVariable ID3DX11EffectShaderVariable;
  566. typedef interface ID3DX11EffectShaderVariable *LPD3D11EFFECTSHADERVARIABLE;
  567. // {7508B344-020A-4EC7-9118-62CDD36C88D7}
  568. DEFINE_GUID(IID_ID3DX11EffectShaderVariable,
  569. 0x7508b344, 0x020a, 0x4ec7, 0x91, 0x18, 0x62, 0xcd, 0xd3, 0x6c, 0x88, 0xd7);
  570. #undef INTERFACE
  571. #define INTERFACE ID3DX11EffectShaderVariable
  572. DECLARE_INTERFACE_(ID3DX11EffectShaderVariable, ID3DX11EffectVariable)
  573. {
  574. // IUnknown
  575. // ID3DX11EffectVariable
  576. // ID3DX11EffectShaderVariable
  577. STDMETHOD(GetShaderDesc)(THIS_ _In_ uint32_t ShaderIndex, _Out_ D3DX11_EFFECT_SHADER_DESC *pDesc) PURE;
  578. STDMETHOD(GetVertexShader)(THIS_ _In_ uint32_t ShaderIndex, _Outptr_ ID3D11VertexShader **ppVS) PURE;
  579. STDMETHOD(GetGeometryShader)(THIS_ _In_ uint32_t ShaderIndex, _Outptr_ ID3D11GeometryShader **ppGS) PURE;
  580. STDMETHOD(GetPixelShader)(THIS_ _In_ uint32_t ShaderIndex, _Outptr_ ID3D11PixelShader **ppPS) PURE;
  581. STDMETHOD(GetHullShader)(THIS_ _In_ uint32_t ShaderIndex, _Outptr_ ID3D11HullShader **ppHS) PURE;
  582. STDMETHOD(GetDomainShader)(THIS_ _In_ uint32_t ShaderIndex, _Outptr_ ID3D11DomainShader **ppDS) PURE;
  583. STDMETHOD(GetComputeShader)(THIS_ _In_ uint32_t ShaderIndex, _Outptr_ ID3D11ComputeShader **ppCS) PURE;
  584. STDMETHOD(GetInputSignatureElementDesc)(THIS_ _In_ uint32_t ShaderIndex, _In_ uint32_t Element, _Out_ D3D11_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
  585. STDMETHOD(GetOutputSignatureElementDesc)(THIS_ _In_ uint32_t ShaderIndex, _In_ uint32_t Element, _Out_ D3D11_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
  586. STDMETHOD(GetPatchConstantSignatureElementDesc)(THIS_ _In_ uint32_t ShaderIndex, _In_ uint32_t Element, _Out_ D3D11_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
  587. };
  588. //////////////////////////////////////////////////////////////////////////////
  589. // ID3DX11EffectBlendVariable /////////////////////////////////////////////////
  590. //////////////////////////////////////////////////////////////////////////////
  591. typedef interface ID3DX11EffectBlendVariable ID3DX11EffectBlendVariable;
  592. typedef interface ID3DX11EffectBlendVariable *LPD3D11EFFECTBLENDVARIABLE;
  593. // {D664F4D7-3B81-4805-B277-C1DF58C39F53}
  594. DEFINE_GUID(IID_ID3DX11EffectBlendVariable,
  595. 0xd664f4d7, 0x3b81, 0x4805, 0xb2, 0x77, 0xc1, 0xdf, 0x58, 0xc3, 0x9f, 0x53);
  596. #undef INTERFACE
  597. #define INTERFACE ID3DX11EffectBlendVariable
  598. DECLARE_INTERFACE_(ID3DX11EffectBlendVariable, ID3DX11EffectVariable)
  599. {
  600. // IUnknown
  601. // ID3DX11EffectVariable
  602. // ID3DX11EffectBlendVariable
  603. STDMETHOD(GetBlendState)(THIS_ _In_ uint32_t Index, _Outptr_ ID3D11BlendState **ppState) PURE;
  604. STDMETHOD(SetBlendState)(THIS_ _In_ uint32_t Index, _In_ ID3D11BlendState *pState) PURE;
  605. STDMETHOD(UndoSetBlendState)(THIS_ _In_ uint32_t Index) PURE;
  606. STDMETHOD(GetBackingStore)(THIS_ _In_ uint32_t Index, _Out_ D3D11_BLEND_DESC *pDesc) PURE;
  607. };
  608. //////////////////////////////////////////////////////////////////////////////
  609. // ID3DX11EffectDepthStencilVariable //////////////////////////////////////////
  610. //////////////////////////////////////////////////////////////////////////////
  611. typedef interface ID3DX11EffectDepthStencilVariable ID3DX11EffectDepthStencilVariable;
  612. typedef interface ID3DX11EffectDepthStencilVariable *LPD3D11EFFECTDEPTHSTENCILVARIABLE;
  613. // {69B5751B-61A5-48E5-BD41-D93988111563}
  614. DEFINE_GUID(IID_ID3DX11EffectDepthStencilVariable,
  615. 0x69b5751b, 0x61a5, 0x48e5, 0xbd, 0x41, 0xd9, 0x39, 0x88, 0x11, 0x15, 0x63);
  616. #undef INTERFACE
  617. #define INTERFACE ID3DX11EffectDepthStencilVariable
  618. DECLARE_INTERFACE_(ID3DX11EffectDepthStencilVariable, ID3DX11EffectVariable)
  619. {
  620. // IUnknown
  621. // ID3DX11EffectVariable
  622. // ID3DX11EffectDepthStencilVariable
  623. STDMETHOD(GetDepthStencilState)(THIS_ _In_ uint32_t Index, _Outptr_ ID3D11DepthStencilState **ppState) PURE;
  624. STDMETHOD(SetDepthStencilState)(THIS_ _In_ uint32_t Index, _In_ ID3D11DepthStencilState *pState) PURE;
  625. STDMETHOD(UndoSetDepthStencilState)(THIS_ _In_ uint32_t Index) PURE;
  626. STDMETHOD(GetBackingStore)(THIS_ _In_ uint32_t Index, _Out_ D3D11_DEPTH_STENCIL_DESC *pDesc) PURE;
  627. };
  628. //////////////////////////////////////////////////////////////////////////////
  629. // ID3DX11EffectRasterizerVariable ////////////////////////////////////////////
  630. //////////////////////////////////////////////////////////////////////////////
  631. typedef interface ID3DX11EffectRasterizerVariable ID3DX11EffectRasterizerVariable;
  632. typedef interface ID3DX11EffectRasterizerVariable *LPD3D11EFFECTRASTERIZERVARIABLE;
  633. // {53A262F6-5F74-4151-A132-E3DD19A62C9D}
  634. DEFINE_GUID(IID_ID3DX11EffectRasterizerVariable,
  635. 0x53a262f6, 0x5f74, 0x4151, 0xa1, 0x32, 0xe3, 0xdd, 0x19, 0xa6, 0x2c, 0x9d);
  636. #undef INTERFACE
  637. #define INTERFACE ID3DX11EffectRasterizerVariable
  638. DECLARE_INTERFACE_(ID3DX11EffectRasterizerVariable, ID3DX11EffectVariable)
  639. {
  640. // IUnknown
  641. // ID3DX11EffectVariable
  642. // ID3DX11EffectRasterizerVariable
  643. STDMETHOD(GetRasterizerState)(THIS_ _In_ uint32_t Index, _Outptr_ ID3D11RasterizerState **ppState) PURE;
  644. STDMETHOD(SetRasterizerState)(THIS_ _In_ uint32_t Index, _In_ ID3D11RasterizerState *pState) PURE;
  645. STDMETHOD(UndoSetRasterizerState)(THIS_ _In_ uint32_t Index) PURE;
  646. STDMETHOD(GetBackingStore)(THIS_ _In_ uint32_t Index, _Out_ D3D11_RASTERIZER_DESC *pDesc) PURE;
  647. };
  648. //////////////////////////////////////////////////////////////////////////////
  649. // ID3DX11EffectSamplerVariable ///////////////////////////////////////////////
  650. //////////////////////////////////////////////////////////////////////////////
  651. typedef interface ID3DX11EffectSamplerVariable ID3DX11EffectSamplerVariable;
  652. typedef interface ID3DX11EffectSamplerVariable *LPD3D11EFFECTSAMPLERVARIABLE;
  653. // {C6402E55-1095-4D95-8931-F92660513DD9}
  654. DEFINE_GUID(IID_ID3DX11EffectSamplerVariable,
  655. 0xc6402e55, 0x1095, 0x4d95, 0x89, 0x31, 0xf9, 0x26, 0x60, 0x51, 0x3d, 0xd9);
  656. #undef INTERFACE
  657. #define INTERFACE ID3DX11EffectSamplerVariable
  658. DECLARE_INTERFACE_(ID3DX11EffectSamplerVariable, ID3DX11EffectVariable)
  659. {
  660. // IUnknown
  661. // ID3DX11EffectVariable
  662. // ID3DX11EffectSamplerVariable
  663. STDMETHOD(GetSampler)(THIS_ _In_ uint32_t Index, _Outptr_ ID3D11SamplerState **ppSampler) PURE;
  664. STDMETHOD(SetSampler)(THIS_ _In_ uint32_t Index, _In_ ID3D11SamplerState *pSampler) PURE;
  665. STDMETHOD(UndoSetSampler)(THIS_ _In_ uint32_t Index) PURE;
  666. STDMETHOD(GetBackingStore)(THIS_ _In_ uint32_t Index, _Out_ D3D11_SAMPLER_DESC *pDesc) PURE;
  667. };
  668. //////////////////////////////////////////////////////////////////////////////
  669. // ID3DX11EffectPass //////////////////////////////////////////////////////////
  670. //////////////////////////////////////////////////////////////////////////////
  671. //----------------------------------------------------------------------------
  672. // D3DX11_PASS_DESC:
  673. //
  674. // Retrieved by ID3DX11EffectPass::GetDesc()
  675. //----------------------------------------------------------------------------
  676. struct D3DX11_PASS_DESC
  677. {
  678. LPCSTR Name; // Name of this pass (nullptr if not anonymous)
  679. uint32_t Annotations; // Number of annotations on this pass
  680. uint8_t *pIAInputSignature; // Signature from VS or GS (if there is no VS)
  681. // or nullptr if neither exists
  682. size_t IAInputSignatureSize; // Singature size in bytes
  683. uint32_t StencilRef; // Specified in SetDepthStencilState()
  684. uint32_t SampleMask; // Specified in SetBlendState()
  685. FLOAT BlendFactor[4]; // Specified in SetBlendState()
  686. };
  687. //----------------------------------------------------------------------------
  688. // D3DX11_PASS_SHADER_DESC:
  689. //
  690. // Retrieved by ID3DX11EffectPass::Get**ShaderDesc()
  691. //----------------------------------------------------------------------------
  692. struct D3DX11_PASS_SHADER_DESC
  693. {
  694. ID3DX11EffectShaderVariable *pShaderVariable; // The variable that this shader came from.
  695. // If this is an inline shader assignment,
  696. // the returned interface will be an
  697. // anonymous shader variable, which is
  698. // not retrievable any other way. It's
  699. // name in the variable description will
  700. // be "$Anonymous".
  701. // If there is no assignment of this type in
  702. // the pass block, pShaderVariable != nullptr,
  703. // but pShaderVariable->IsValid() == false.
  704. uint32_t ShaderIndex; // The element of pShaderVariable (if an array)
  705. // or 0 if not applicable
  706. };
  707. typedef interface ID3DX11EffectPass ID3DX11EffectPass;
  708. typedef interface ID3DX11EffectPass *LPD3D11EFFECTPASS;
  709. // {3437CEC4-4AC1-4D87-8916-F4BD5A41380C}
  710. DEFINE_GUID(IID_ID3DX11EffectPass,
  711. 0x3437cec4, 0x4ac1, 0x4d87, 0x89, 0x16, 0xf4, 0xbd, 0x5a, 0x41, 0x38, 0x0c);
  712. #undef INTERFACE
  713. #define INTERFACE ID3DX11EffectPass
  714. DECLARE_INTERFACE_(ID3DX11EffectPass, IUnknown)
  715. {
  716. // IUnknown
  717. // ID3DX11EffectPass
  718. STDMETHOD_(bool, IsValid)(THIS) PURE;
  719. STDMETHOD(GetDesc)(THIS_ _Out_ D3DX11_PASS_DESC *pDesc) PURE;
  720. STDMETHOD(GetVertexShaderDesc)(THIS_ _Out_ D3DX11_PASS_SHADER_DESC *pDesc) PURE;
  721. STDMETHOD(GetGeometryShaderDesc)(THIS_ _Out_ D3DX11_PASS_SHADER_DESC *pDesc) PURE;
  722. STDMETHOD(GetPixelShaderDesc)(THIS_ _Out_ D3DX11_PASS_SHADER_DESC *pDesc) PURE;
  723. STDMETHOD(GetHullShaderDesc)(THIS_ _Out_ D3DX11_PASS_SHADER_DESC *pDesc) PURE;
  724. STDMETHOD(GetDomainShaderDesc)(THIS_ _Out_ D3DX11_PASS_SHADER_DESC *pDesc) PURE;
  725. STDMETHOD(GetComputeShaderDesc)(THIS_ _Out_ D3DX11_PASS_SHADER_DESC *pDesc) PURE;
  726. STDMETHOD_(ID3DX11EffectVariable*, GetAnnotationByIndex)(THIS_ _In_ uint32_t Index) PURE;
  727. STDMETHOD_(ID3DX11EffectVariable*, GetAnnotationByName)(THIS_ _In_z_ LPCSTR Name) PURE;
  728. STDMETHOD(Apply)(THIS_ _In_ uint32_t Flags, _In_ ID3D11DeviceContext* pContext) PURE;
  729. STDMETHOD(ComputeStateBlockMask)(THIS_ _Inout_ D3DX11_STATE_BLOCK_MASK *pStateBlockMask) PURE;
  730. };
  731. //////////////////////////////////////////////////////////////////////////////
  732. // ID3DX11EffectTechnique /////////////////////////////////////////////////////
  733. //////////////////////////////////////////////////////////////////////////////
  734. //----------------------------------------------------------------------------
  735. // D3DX11_TECHNIQUE_DESC:
  736. //
  737. // Retrieved by ID3DX11EffectTechnique::GetDesc()
  738. //----------------------------------------------------------------------------
  739. struct D3DX11_TECHNIQUE_DESC
  740. {
  741. LPCSTR Name; // Name of this technique (nullptr if not anonymous)
  742. uint32_t Passes; // Number of passes contained within
  743. uint32_t Annotations; // Number of annotations on this technique
  744. };
  745. typedef interface ID3DX11EffectTechnique ID3DX11EffectTechnique;
  746. typedef interface ID3DX11EffectTechnique *LPD3D11EFFECTTECHNIQUE;
  747. // {51198831-1F1D-4F47-BD76-41CB0835B1DE}
  748. DEFINE_GUID(IID_ID3DX11EffectTechnique,
  749. 0x51198831, 0x1f1d, 0x4f47, 0xbd, 0x76, 0x41, 0xcb, 0x08, 0x35, 0xb1, 0xde);
  750. #undef INTERFACE
  751. #define INTERFACE ID3DX11EffectTechnique
  752. DECLARE_INTERFACE_(ID3DX11EffectTechnique, IUnknown)
  753. {
  754. // IUnknown
  755. // ID3DX11EffectTechnique
  756. STDMETHOD_(bool, IsValid)(THIS) PURE;
  757. STDMETHOD(GetDesc)(THIS_ _Out_ D3DX11_TECHNIQUE_DESC *pDesc) PURE;
  758. STDMETHOD_(ID3DX11EffectVariable*, GetAnnotationByIndex)(THIS_ _In_ uint32_t Index) PURE;
  759. STDMETHOD_(ID3DX11EffectVariable*, GetAnnotationByName)(THIS_ _In_z_ LPCSTR Name) PURE;
  760. STDMETHOD_(ID3DX11EffectPass*, GetPassByIndex)(THIS_ _In_ uint32_t Index) PURE;
  761. STDMETHOD_(ID3DX11EffectPass*, GetPassByName)(THIS_ _In_z_ LPCSTR Name) PURE;
  762. STDMETHOD(ComputeStateBlockMask)(THIS_ _Inout_ D3DX11_STATE_BLOCK_MASK *pStateBlockMask) PURE;
  763. };
  764. //////////////////////////////////////////////////////////////////////////////
  765. // ID3DX11EffectTechnique /////////////////////////////////////////////////////
  766. //////////////////////////////////////////////////////////////////////////////
  767. //----------------------------------------------------------------------------
  768. // D3DX11_GROUP_DESC:
  769. //
  770. // Retrieved by ID3DX11EffectTechnique::GetDesc()
  771. //----------------------------------------------------------------------------
  772. struct D3DX11_GROUP_DESC
  773. {
  774. LPCSTR Name; // Name of this group (only nullptr if global)
  775. uint32_t Techniques; // Number of techniques contained within
  776. uint32_t Annotations; // Number of annotations on this group
  777. };
  778. typedef interface ID3DX11EffectGroup ID3DX11EffectGroup;
  779. typedef interface ID3DX11EffectGroup *LPD3D11EFFECTGROUP;
  780. // {03074acf-97de-485f-b201-cb775264afd6}
  781. DEFINE_GUID(IID_ID3DX11EffectGroup,
  782. 0x03074acf, 0x97de, 0x485f, 0xb2, 0x01, 0xcb, 0x77, 0x52, 0x64, 0xaf, 0xd6);
  783. #undef INTERFACE
  784. #define INTERFACE ID3DX11EffectGroup
  785. DECLARE_INTERFACE_(ID3DX11EffectGroup, IUnknown)
  786. {
  787. // IUnknown
  788. // ID3DX11EffectGroup
  789. STDMETHOD_(bool, IsValid)(THIS) PURE;
  790. STDMETHOD(GetDesc)(THIS_ _Out_ D3DX11_GROUP_DESC *pDesc) PURE;
  791. STDMETHOD_(ID3DX11EffectVariable*, GetAnnotationByIndex)(THIS_ _In_ uint32_t Index) PURE;
  792. STDMETHOD_(ID3DX11EffectVariable*, GetAnnotationByName)(THIS_ _In_z_ LPCSTR Name) PURE;
  793. STDMETHOD_(ID3DX11EffectTechnique*, GetTechniqueByIndex)(THIS_ _In_ uint32_t Index) PURE;
  794. STDMETHOD_(ID3DX11EffectTechnique*, GetTechniqueByName)(THIS_ _In_z_ LPCSTR Name) PURE;
  795. };
  796. //////////////////////////////////////////////////////////////////////////////
  797. // ID3DX11Effect //////////////////////////////////////////////////////////////
  798. //////////////////////////////////////////////////////////////////////////////
  799. //----------------------------------------------------------------------------
  800. // D3DX11_EFFECT_DESC:
  801. //
  802. // Retrieved by ID3DX11Effect::GetDesc()
  803. //----------------------------------------------------------------------------
  804. struct D3DX11_EFFECT_DESC
  805. {
  806. uint32_t ConstantBuffers; // Number of constant buffers in this effect
  807. uint32_t GlobalVariables; // Number of global variables in this effect
  808. uint32_t InterfaceVariables; // Number of global interfaces in this effect
  809. uint32_t Techniques; // Number of techniques in this effect
  810. uint32_t Groups; // Number of groups in this effect
  811. };
  812. typedef interface ID3DX11Effect ID3DX11Effect;
  813. typedef interface ID3DX11Effect *LPD3D11EFFECT;
  814. // {FA61CA24-E4BA-4262-9DB8-B132E8CAE319}
  815. DEFINE_GUID(IID_ID3DX11Effect,
  816. 0xfa61ca24, 0xe4ba, 0x4262, 0x9d, 0xb8, 0xb1, 0x32, 0xe8, 0xca, 0xe3, 0x19);
  817. #undef INTERFACE
  818. #define INTERFACE ID3DX11Effect
  819. DECLARE_INTERFACE_(ID3DX11Effect, IUnknown)
  820. {
  821. // IUnknown
  822. // ID3DX11Effect
  823. STDMETHOD_(bool, IsValid)(THIS) PURE;
  824. STDMETHOD(GetDevice)(THIS_ _Outptr_ ID3D11Device** ppDevice) PURE;
  825. STDMETHOD(GetDesc)(THIS_ _Out_ D3DX11_EFFECT_DESC *pDesc) PURE;
  826. STDMETHOD_(ID3DX11EffectConstantBuffer*, GetConstantBufferByIndex)(THIS_ _In_ uint32_t Index) PURE;
  827. STDMETHOD_(ID3DX11EffectConstantBuffer*, GetConstantBufferByName)(THIS_ _In_z_ LPCSTR Name) PURE;
  828. STDMETHOD_(ID3DX11EffectVariable*, GetVariableByIndex)(THIS_ _In_ uint32_t Index) PURE;
  829. STDMETHOD_(ID3DX11EffectVariable*, GetVariableByName)(THIS_ _In_z_ LPCSTR Name) PURE;
  830. STDMETHOD_(ID3DX11EffectVariable*, GetVariableBySemantic)(THIS_ _In_z_ LPCSTR Semantic) PURE;
  831. STDMETHOD_(ID3DX11EffectGroup*, GetGroupByIndex)(THIS_ _In_ uint32_t Index) PURE;
  832. STDMETHOD_(ID3DX11EffectGroup*, GetGroupByName)(THIS_ _In_z_ LPCSTR Name) PURE;
  833. STDMETHOD_(ID3DX11EffectTechnique*, GetTechniqueByIndex)(THIS_ _In_ uint32_t Index) PURE;
  834. STDMETHOD_(ID3DX11EffectTechnique*, GetTechniqueByName)(THIS_ _In_z_ LPCSTR Name) PURE;
  835. STDMETHOD_(ID3D11ClassLinkage*, GetClassLinkage)(THIS) PURE;
  836. STDMETHOD(CloneEffect)(THIS_ _In_ uint32_t Flags, _Outptr_ ID3DX11Effect** ppClonedEffect ) PURE;
  837. STDMETHOD(Optimize)(THIS) PURE;
  838. STDMETHOD_(bool, IsOptimized)(THIS) PURE;
  839. };
  840. //////////////////////////////////////////////////////////////////////////////
  841. // APIs //////////////////////////////////////////////////////////////////////
  842. //////////////////////////////////////////////////////////////////////////////
  843. #ifdef __cplusplus
  844. extern "C" {
  845. #endif //__cplusplus
  846. //----------------------------------------------------------------------------
  847. // D3DX11CreateEffectFromMemory
  848. //
  849. // Creates an effect instance from a compiled effect in memory
  850. //
  851. // Parameters:
  852. //
  853. // [in]
  854. //
  855. // pData
  856. // Blob of compiled effect data
  857. // DataLength
  858. // Length of the data blob
  859. // FXFlags
  860. // Flags pertaining to Effect creation
  861. // pDevice
  862. // Pointer to the D3D11 device on which to create Effect resources
  863. // srcName [optional]
  864. // ASCII string to use for debug object naming
  865. //
  866. // [out]
  867. //
  868. // ppEffect
  869. // Address of the newly created Effect interface
  870. //
  871. //----------------------------------------------------------------------------
  872. HRESULT WINAPI D3DX11CreateEffectFromMemory( _In_reads_bytes_(DataLength) LPCVOID pData,
  873. _In_ SIZE_T DataLength,
  874. _In_ UINT FXFlags,
  875. _In_ ID3D11Device *pDevice,
  876. _Outptr_ ID3DX11Effect **ppEffect,
  877. _In_opt_z_ LPCSTR srcName = nullptr );
  878. //----------------------------------------------------------------------------
  879. // D3DX11CreateEffectFromFile
  880. //
  881. // Creates an effect instance from a compiled effect data file
  882. //
  883. // Parameters:
  884. //
  885. // [in]
  886. //
  887. // pFileName
  888. // Compiled effect file
  889. // FXFlags
  890. // Flags pertaining to Effect creation
  891. // pDevice
  892. // Pointer to the D3D11 device on which to create Effect resources
  893. //
  894. // [out]
  895. //
  896. // ppEffect
  897. // Address of the newly created Effect interface
  898. //
  899. //----------------------------------------------------------------------------
  900. HRESULT WINAPI D3DX11CreateEffectFromFile( _In_z_ LPCWSTR pFileName,
  901. _In_ UINT FXFlags,
  902. _In_ ID3D11Device *pDevice,
  903. _Outptr_ ID3DX11Effect **ppEffect );
  904. //----------------------------------------------------------------------------
  905. // D3DX11CompileEffectFromMemory
  906. //
  907. // Complies an effect shader source file in memory and then creates an effect instance
  908. //
  909. // Parameters:
  910. //
  911. // [in]
  912. //
  913. // pData
  914. // Pointer to FX shader as an ASCII string
  915. // DataLength
  916. // Length of the FX shader ASCII string
  917. // srcName [optional]
  918. // ASCII string to use for debug object naming
  919. // pDefines [optional]
  920. // A NULL-terminated array of shader macros
  921. // pInclude [optional]
  922. // A pointer to an include interface
  923. // HLSLFlags
  924. // HLSL compile options (see D3DCOMPILE flags)
  925. // FXFlags
  926. // Flags pertaining to Effect compilation (see D3DCOMPILE_EFFECT flags)
  927. // pDevice
  928. // Pointer to the D3D11 device on which to create Effect resources
  929. //
  930. // [out]
  931. //
  932. // ppEffect
  933. // Address of the newly created Effect interface
  934. //
  935. //----------------------------------------------------------------------------
  936. HRESULT D3DX11CompileEffectFromMemory( _In_reads_bytes_(DataLength) LPCVOID pData,
  937. _In_ SIZE_T DataLength,
  938. _In_opt_z_ LPCSTR srcName,
  939. _In_opt_ const D3D_SHADER_MACRO *pDefines,
  940. _In_opt_ ID3DInclude *pInclude,
  941. _In_ UINT HLSLFlags,
  942. _In_ UINT FXFlags,
  943. _In_ ID3D11Device *pDevice,
  944. _Out_ ID3DX11Effect **ppEffect,
  945. _Outptr_opt_result_maybenull_ ID3DBlob **ppErrors );
  946. //----------------------------------------------------------------------------
  947. // D3DX11CompileEffectFromFile
  948. //
  949. // Complies an effect shader source file and then creates an effect instance
  950. //
  951. // Parameters:
  952. //
  953. // [in]
  954. //
  955. // pFileName
  956. // FX shader source file
  957. // pDefines [optional]
  958. // A NULL-terminated array of shader macros
  959. // pInclude [optional]
  960. // A pointer to an include interface
  961. // HLSLFlags
  962. // HLSL compile options (see D3DCOMPILE flags)
  963. // FXFlags
  964. // Flags pertaining to Effect compilation (see D3DCOMPILE_EFFECT flags)
  965. // pDevice
  966. // Pointer to the D3D11 device on which to create Effect resources
  967. //
  968. // [out]
  969. //
  970. // ppEffect
  971. // Address of the newly created Effect interface
  972. //
  973. //----------------------------------------------------------------------------
  974. HRESULT D3DX11CompileEffectFromFile( _In_z_ LPCWSTR pFileName,
  975. _In_opt_ const D3D_SHADER_MACRO *pDefines,
  976. _In_opt_ ID3DInclude *pInclude,
  977. _In_ UINT HLSLFlags,
  978. _In_ UINT FXFlags,
  979. _In_ ID3D11Device *pDevice,
  980. _Out_ ID3DX11Effect **ppEffect,
  981. _Outptr_opt_result_maybenull_ ID3DBlob **ppErrors );
  982. #ifdef __cplusplus
  983. }
  984. #endif //__cplusplus