d3dx10async.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) Microsoft Corporation. All rights reserved.
  4. //
  5. // File: D3DX10Async.h
  6. // Content: D3DX10 Asynchronous Effect / Shader loaders / compilers
  7. //
  8. //////////////////////////////////////////////////////////////////////////////
  9. #ifndef __D3DX10ASYNC_H__
  10. #define __D3DX10ASYNC_H__
  11. #include "d3dx10.h"
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif //__cplusplus
  15. //----------------------------------------------------------------------------
  16. // D3DX10Compile:
  17. // ------------------
  18. // Compiles an effect or shader.
  19. //
  20. // Parameters:
  21. // pSrcFile
  22. // Source file name.
  23. // hSrcModule
  24. // Module handle. if NULL, current module will be used.
  25. // pSrcResource
  26. // Resource name in module.
  27. // pSrcData
  28. // Pointer to source code.
  29. // SrcDataLen
  30. // Size of source code, in bytes.
  31. // pDefines
  32. // Optional NULL-terminated array of preprocessor macro definitions.
  33. // pInclude
  34. // Optional interface pointer to use for handling #include directives.
  35. // If this parameter is NULL, #includes will be honored when compiling
  36. // from file, and will error when compiling from resource or memory.
  37. // pFunctionName
  38. // Name of the entrypoint function where execution should begin.
  39. // pProfile
  40. // Instruction set to be used when generating code. Currently supported
  41. // profiles are "vs_1_1", "vs_2_0", "vs_2_a", "vs_2_sw", "vs_3_0",
  42. // "vs_3_sw", "vs_4_0", "vs_4_1",
  43. // "ps_2_0", "ps_2_a", "ps_2_b", "ps_2_sw", "ps_3_0",
  44. // "ps_3_sw", "ps_4_0", "ps_4_1",
  45. // "gs_4_0", "gs_4_1",
  46. // "tx_1_0",
  47. // "fx_4_0", "fx_4_1"
  48. // Note that this entrypoint does not compile fx_2_0 targets, for that
  49. // you need to use the D3DX9 function.
  50. // Flags1
  51. // See D3D10_SHADER_xxx flags.
  52. // Flags2
  53. // See D3D10_EFFECT_xxx flags.
  54. // ppShader
  55. // Returns a buffer containing the created shader. This buffer contains
  56. // the compiled shader code, as well as any embedded debug and symbol
  57. // table info. (See D3D10GetShaderConstantTable)
  58. // ppErrorMsgs
  59. // Returns a buffer containing a listing of errors and warnings that were
  60. // encountered during the compile. If you are running in a debugger,
  61. // these are the same messages you will see in your debug output.
  62. // pHResult
  63. // Pointer to a memory location to receive the return value upon completion.
  64. // Maybe NULL if not needed.
  65. // If pPump != NULL, pHResult must be a valid memory location until the
  66. // the asynchronous execution completes.
  67. //----------------------------------------------------------------------------
  68. HRESULT WINAPI D3DX10CompileFromFileA(LPCSTR pSrcFile,CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
  69. LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
  70. HRESULT WINAPI D3DX10CompileFromFileW(LPCWSTR pSrcFile, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
  71. LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
  72. #ifdef UNICODE
  73. #define D3DX10CompileFromFile D3DX10CompileFromFileW
  74. #else
  75. #define D3DX10CompileFromFile D3DX10CompileFromFileA
  76. #endif
  77. HRESULT WINAPI D3DX10CompileFromResourceA(HMODULE hSrcModule, LPCSTR pSrcResource, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines,
  78. LPD3D10INCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
  79. HRESULT WINAPI D3DX10CompileFromResourceW(HMODULE hSrcModule, LPCWSTR pSrcResource, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines,
  80. LPD3D10INCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
  81. #ifdef UNICODE
  82. #define D3DX10CompileFromResource D3DX10CompileFromResourceW
  83. #else
  84. #define D3DX10CompileFromResource D3DX10CompileFromResourceA
  85. #endif
  86. HRESULT WINAPI D3DX10CompileFromMemory(LPCSTR pSrcData, SIZE_T SrcDataLen, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
  87. LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
  88. //----------------------------------------------------------------------------
  89. // D3DX10CreateEffectFromXXXX:
  90. // --------------------------
  91. // Creates an effect from a binary effect or file
  92. //
  93. // Parameters:
  94. //
  95. // [in]
  96. //
  97. //
  98. // pFileName
  99. // Name of the ASCII (uncompiled) or binary (compiled) Effect file to load
  100. //
  101. // hModule
  102. // Handle to the module containing the resource to compile from
  103. // pResourceName
  104. // Name of the resource within hModule to compile from
  105. //
  106. // pData
  107. // Blob of effect data, either ASCII (uncompiled) or binary (compiled)
  108. // DataLength
  109. // Length of the data blob
  110. //
  111. // pDefines
  112. // Optional NULL-terminated array of preprocessor macro definitions.
  113. // pInclude
  114. // Optional interface pointer to use for handling #include directives.
  115. // If this parameter is NULL, #includes will be honored when compiling
  116. // from file, and will error when compiling from resource or memory.
  117. // pProfile
  118. // Profile to use when compiling the effect.
  119. // HLSLFlags
  120. // Compilation flags pertaining to shaders and data types, honored by
  121. // the HLSL compiler
  122. // FXFlags
  123. // Compilation flags pertaining to Effect compilation, honored
  124. // by the Effect compiler
  125. // pDevice
  126. // Pointer to the D3D10 device on which to create Effect resources
  127. // pEffectPool
  128. // Pointer to an Effect pool to share variables with or NULL
  129. //
  130. // [out]
  131. //
  132. // ppEffect
  133. // Address of the newly created Effect interface
  134. // ppEffectPool
  135. // Address of the newly created Effect pool interface
  136. // ppErrors
  137. // If non-NULL, address of a buffer with error messages that occurred
  138. // during parsing or compilation
  139. // pHResult
  140. // Pointer to a memory location to receive the return value upon completion.
  141. // Maybe NULL if not needed.
  142. // If pPump != NULL, pHResult must be a valid memory location until the
  143. // the asynchronous execution completes.
  144. //----------------------------------------------------------------------------
  145. HRESULT WINAPI D3DX10CreateEffectFromFileA(LPCSTR pFileName, CONST D3D10_SHADER_MACRO *pDefines,
  146. ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
  147. ID3D10EffectPool *pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors, HRESULT* pHResult);
  148. HRESULT WINAPI D3DX10CreateEffectFromFileW(LPCWSTR pFileName, CONST D3D10_SHADER_MACRO *pDefines,
  149. ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
  150. ID3D10EffectPool *pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors, HRESULT* pHResult);
  151. HRESULT WINAPI D3DX10CreateEffectFromMemory(LPCVOID pData, SIZE_T DataLength, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines,
  152. ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
  153. ID3D10EffectPool *pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors, HRESULT* pHResult);
  154. HRESULT WINAPI D3DX10CreateEffectFromResourceA(HMODULE hModule, LPCSTR pResourceName, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines,
  155. ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
  156. ID3D10EffectPool *pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors, HRESULT* pHResult);
  157. HRESULT WINAPI D3DX10CreateEffectFromResourceW(HMODULE hModule, LPCWSTR pResourceName, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines,
  158. ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
  159. ID3D10EffectPool *pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors, HRESULT* pHResult);
  160. #ifdef UNICODE
  161. #define D3DX10CreateEffectFromFile D3DX10CreateEffectFromFileW
  162. #define D3DX10CreateEffectFromResource D3DX10CreateEffectFromResourceW
  163. #else
  164. #define D3DX10CreateEffectFromFile D3DX10CreateEffectFromFileA
  165. #define D3DX10CreateEffectFromResource D3DX10CreateEffectFromResourceA
  166. #endif
  167. HRESULT WINAPI D3DX10CreateEffectPoolFromFileA(LPCSTR pFileName, CONST D3D10_SHADER_MACRO *pDefines,
  168. ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice, ID3DX10ThreadPump* pPump,
  169. ID3D10EffectPool **ppEffectPool, ID3D10Blob **ppErrors, HRESULT* pHResult);
  170. HRESULT WINAPI D3DX10CreateEffectPoolFromFileW(LPCWSTR pFileName, CONST D3D10_SHADER_MACRO *pDefines,
  171. ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice, ID3DX10ThreadPump* pPump,
  172. ID3D10EffectPool **ppEffectPool, ID3D10Blob **ppErrors, HRESULT* pHResult);
  173. HRESULT WINAPI D3DX10CreateEffectPoolFromMemory(LPCVOID pData, SIZE_T DataLength, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines,
  174. ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
  175. ID3DX10ThreadPump* pPump, ID3D10EffectPool **ppEffectPool, ID3D10Blob **ppErrors, HRESULT* pHResult);
  176. HRESULT WINAPI D3DX10CreateEffectPoolFromResourceA(HMODULE hModule, LPCSTR pResourceName, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines,
  177. ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
  178. ID3DX10ThreadPump* pPump, ID3D10EffectPool **ppEffectPool, ID3D10Blob **ppErrors, HRESULT* pHResult);
  179. HRESULT WINAPI D3DX10CreateEffectPoolFromResourceW(HMODULE hModule, LPCWSTR pResourceName, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines,
  180. ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
  181. ID3DX10ThreadPump* pPump, ID3D10EffectPool **ppEffectPool, ID3D10Blob **ppErrors, HRESULT* pHResult);
  182. #ifdef UNICODE
  183. #define D3DX10CreateEffectPoolFromFile D3DX10CreateEffectPoolFromFileW
  184. #define D3DX10CreateEffectPoolFromResource D3DX10CreateEffectPoolFromResourceW
  185. #else
  186. #define D3DX10CreateEffectPoolFromFile D3DX10CreateEffectPoolFromFileA
  187. #define D3DX10CreateEffectPoolFromResource D3DX10CreateEffectPoolFromResourceA
  188. #endif
  189. HRESULT WINAPI D3DX10PreprocessShaderFromFileA(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines,
  190. LPD3D10INCLUDE pInclude, ID3DX10ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
  191. HRESULT WINAPI D3DX10PreprocessShaderFromFileW(LPCWSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines,
  192. LPD3D10INCLUDE pInclude, ID3DX10ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
  193. HRESULT WINAPI D3DX10PreprocessShaderFromMemory(LPCSTR pSrcData, SIZE_T SrcDataSize, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines,
  194. LPD3D10INCLUDE pInclude, ID3DX10ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
  195. HRESULT WINAPI D3DX10PreprocessShaderFromResourceA(HMODULE hModule, LPCSTR pResourceName, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines,
  196. LPD3D10INCLUDE pInclude, ID3DX10ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
  197. HRESULT WINAPI D3DX10PreprocessShaderFromResourceW(HMODULE hModule, LPCWSTR pResourceName, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines,
  198. LPD3D10INCLUDE pInclude, ID3DX10ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
  199. #ifdef UNICODE
  200. #define D3DX10PreprocessShaderFromFile D3DX10PreprocessShaderFromFileW
  201. #define D3DX10PreprocessShaderFromResource D3DX10PreprocessShaderFromResourceW
  202. #else
  203. #define D3DX10PreprocessShaderFromFile D3DX10PreprocessShaderFromFileA
  204. #define D3DX10PreprocessShaderFromResource D3DX10PreprocessShaderFromResourceA
  205. #endif
  206. //----------------------------------------------------------------------------
  207. // Async processors
  208. //----------------------------------------------------------------------------
  209. HRESULT WINAPI D3DX10CreateAsyncCompilerProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
  210. LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2,
  211. ID3D10Blob **ppCompiledShader, ID3D10Blob **ppErrorBuffer, ID3DX10DataProcessor **ppProcessor);
  212. HRESULT WINAPI D3DX10CreateAsyncEffectCreateProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
  213. LPCSTR pProfile, UINT Flags, UINT FXFlags, ID3D10Device *pDevice,
  214. ID3D10EffectPool *pPool, ID3D10Blob **ppErrorBuffer, ID3DX10DataProcessor **ppProcessor);
  215. HRESULT WINAPI D3DX10CreateAsyncEffectPoolCreateProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
  216. LPCSTR pProfile, UINT Flags, UINT FXFlags, ID3D10Device *pDevice,
  217. ID3D10Blob **ppErrorBuffer, ID3DX10DataProcessor **ppProcessor);
  218. HRESULT WINAPI D3DX10CreateAsyncShaderPreprocessProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
  219. ID3D10Blob** ppShaderText, ID3D10Blob **ppErrorBuffer, ID3DX10DataProcessor **ppProcessor);
  220. //----------------------------------------------------------------------------
  221. // D3DX10 Asynchronous texture I/O (advanced mode)
  222. //----------------------------------------------------------------------------
  223. HRESULT WINAPI D3DX10CreateAsyncFileLoaderW(LPCWSTR pFileName, ID3DX10DataLoader **ppDataLoader);
  224. HRESULT WINAPI D3DX10CreateAsyncFileLoaderA(LPCSTR pFileName, ID3DX10DataLoader **ppDataLoader);
  225. HRESULT WINAPI D3DX10CreateAsyncMemoryLoader(LPCVOID pData, SIZE_T cbData, ID3DX10DataLoader **ppDataLoader);
  226. HRESULT WINAPI D3DX10CreateAsyncResourceLoaderW(HMODULE hSrcModule, LPCWSTR pSrcResource, ID3DX10DataLoader **ppDataLoader);
  227. HRESULT WINAPI D3DX10CreateAsyncResourceLoaderA(HMODULE hSrcModule, LPCSTR pSrcResource, ID3DX10DataLoader **ppDataLoader);
  228. #ifdef UNICODE
  229. #define D3DX10CreateAsyncFileLoader D3DX10CreateAsyncFileLoaderW
  230. #define D3DX10CreateAsyncResourceLoader D3DX10CreateAsyncResourceLoaderW
  231. #else
  232. #define D3DX10CreateAsyncFileLoader D3DX10CreateAsyncFileLoaderA
  233. #define D3DX10CreateAsyncResourceLoader D3DX10CreateAsyncResourceLoaderA
  234. #endif
  235. HRESULT WINAPI D3DX10CreateAsyncTextureProcessor(ID3D10Device *pDevice, D3DX10_IMAGE_LOAD_INFO *pLoadInfo, ID3DX10DataProcessor **ppDataProcessor);
  236. HRESULT WINAPI D3DX10CreateAsyncTextureInfoProcessor(D3DX10_IMAGE_INFO *pImageInfo, ID3DX10DataProcessor **ppDataProcessor);
  237. HRESULT WINAPI D3DX10CreateAsyncShaderResourceViewProcessor(ID3D10Device *pDevice, D3DX10_IMAGE_LOAD_INFO *pLoadInfo, ID3DX10DataProcessor **ppDataProcessor);
  238. #ifdef __cplusplus
  239. }
  240. #endif //__cplusplus
  241. #endif //__D3DX10ASYNC_H__