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