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:       D3DX11Async.h | ||
| 7 | //  Content:    D3DX11 Asynchronous Shader loaders / compilers | ||
| 8 | // | ||
| 9 | ////////////////////////////////////////////////////////////////////////////// | ||
| 10 | |||
| 11 | #ifndef __D3DX11ASYNC_H__ | ||
| 12 | #define __D3DX11ASYNC_H__ | ||
| 13 | |||
| 14 | #include "d3dx11.h" | ||
| 15 | |||
| 16 | #ifdef __cplusplus | ||
| 17 | extern "C" { | ||
| 18 | #endif //__cplusplus | ||
| 19 | |||
| 20 | |||
| 21 | //---------------------------------------------------------------------------- | ||
| 22 | // D3DX11Compile: | ||
| 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 D3DX11CompileFromFileA(LPCSTR pSrcFile,CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, | ||
| 76 | LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); | ||
| 77 | |||
| 78 | HRESULT WINAPI D3DX11CompileFromFileW(LPCWSTR pSrcFile, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, | ||
| 79 | LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); | ||
| 80 | |||
| 81 | #ifdef UNICODE | ||
| 82 | #define D3DX11CompileFromFile D3DX11CompileFromFileW | ||
| 83 | #else | ||
| 84 | #define D3DX11CompileFromFile D3DX11CompileFromFileA | ||
| 85 | #endif | ||
| 86 | |||
| 87 | HRESULT WINAPI D3DX11CompileFromResourceA(HMODULE hSrcModule, LPCSTR pSrcResource, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines, | ||
| 88 | LPD3D10INCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); | ||
| 89 | |||
| 90 | HRESULT WINAPI D3DX11CompileFromResourceW(HMODULE hSrcModule, LPCWSTR pSrcResource, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines, | ||
| 91 | LPD3D10INCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); | ||
| 92 | |||
| 93 | #ifdef UNICODE | ||
| 94 | #define D3DX11CompileFromResource D3DX11CompileFromResourceW | ||
| 95 | #else | ||
| 96 | #define D3DX11CompileFromResource D3DX11CompileFromResourceA | ||
| 97 | #endif | ||
| 98 | |||
| 99 | HRESULT WINAPI D3DX11CompileFromMemory(LPCSTR pSrcData, SIZE_T SrcDataLen, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, | ||
| 100 | LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); | ||
| 101 | |||
| 102 | HRESULT WINAPI D3DX11PreprocessShaderFromFileA(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, | ||
| 103 | LPD3D10INCLUDE pInclude, ID3DX11ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); | ||
| 104 | |||
| 105 | HRESULT WINAPI D3DX11PreprocessShaderFromFileW(LPCWSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, | ||
| 106 | LPD3D10INCLUDE pInclude, ID3DX11ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); | ||
| 107 | |||
| 108 | HRESULT WINAPI D3DX11PreprocessShaderFromMemory(LPCSTR pSrcData, SIZE_T SrcDataSize, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, | ||
| 109 | LPD3D10INCLUDE pInclude, ID3DX11ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); | ||
| 110 | |||
| 111 | HRESULT WINAPI D3DX11PreprocessShaderFromResourceA(HMODULE hModule, LPCSTR pResourceName, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines, | ||
| 112 | LPD3D10INCLUDE pInclude, ID3DX11ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); | ||
| 113 | |||
| 114 | HRESULT WINAPI D3DX11PreprocessShaderFromResourceW(HMODULE hModule, LPCWSTR pResourceName, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines, | ||
| 115 | LPD3D10INCLUDE pInclude, ID3DX11ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); | ||
| 116 | |||
| 117 | #ifdef UNICODE | ||
| 118 | #define D3DX11PreprocessShaderFromFile      D3DX11PreprocessShaderFromFileW | ||
| 119 | #define D3DX11PreprocessShaderFromResource  D3DX11PreprocessShaderFromResourceW | ||
| 120 | #else | ||
| 121 | #define D3DX11PreprocessShaderFromFile      D3DX11PreprocessShaderFromFileA | ||
| 122 | #define D3DX11PreprocessShaderFromResource  D3DX11PreprocessShaderFromResourceA | ||
| 123 | #endif | ||
| 124 | |||
| 125 | //---------------------------------------------------------------------------- | ||
| 126 | // Async processors | ||
| 127 | //---------------------------------------------------------------------------- | ||
| 128 | |||
| 129 | HRESULT WINAPI D3DX11CreateAsyncCompilerProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, | ||
| 130 | LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, | ||
| 131 | ID3D10Blob **ppCompiledShader, ID3D10Blob **ppErrorBuffer, ID3DX11DataProcessor **ppProcessor); | ||
| 132 | |||
| 133 | HRESULT WINAPI D3DX11CreateAsyncShaderPreprocessProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, | ||
| 134 | ID3D10Blob** ppShaderText, ID3D10Blob **ppErrorBuffer, ID3DX11DataProcessor **ppProcessor); | ||
| 135 | |||
| 136 | //---------------------------------------------------------------------------- | ||
| 137 | // D3DX11 Asynchronous texture I/O (advanced mode) | ||
| 138 | //---------------------------------------------------------------------------- | ||
| 139 | |||
| 140 | HRESULT WINAPI D3DX11CreateAsyncFileLoaderW(LPCWSTR pFileName, ID3DX11DataLoader **ppDataLoader); | ||
| 141 | HRESULT WINAPI D3DX11CreateAsyncFileLoaderA(LPCSTR pFileName, ID3DX11DataLoader **ppDataLoader); | ||
| 142 | HRESULT WINAPI D3DX11CreateAsyncMemoryLoader(LPCVOID pData, SIZE_T cbData, ID3DX11DataLoader **ppDataLoader); | ||
| 143 | HRESULT WINAPI D3DX11CreateAsyncResourceLoaderW(HMODULE hSrcModule, LPCWSTR pSrcResource, ID3DX11DataLoader **ppDataLoader); | ||
| 144 | HRESULT WINAPI D3DX11CreateAsyncResourceLoaderA(HMODULE hSrcModule, LPCSTR pSrcResource, ID3DX11DataLoader **ppDataLoader); | ||
| 145 | |||
| 146 | #ifdef UNICODE | ||
| 147 | #define D3DX11CreateAsyncFileLoader D3DX11CreateAsyncFileLoaderW | ||
| 148 | #define D3DX11CreateAsyncResourceLoader D3DX11CreateAsyncResourceLoaderW | ||
| 149 | #else | ||
| 150 | #define D3DX11CreateAsyncFileLoader D3DX11CreateAsyncFileLoaderA | ||
| 151 | #define D3DX11CreateAsyncResourceLoader D3DX11CreateAsyncResourceLoaderA | ||
| 152 | #endif | ||
| 153 | |||
| 154 | HRESULT WINAPI D3DX11CreateAsyncTextureProcessor(ID3D11Device *pDevice, D3DX11_IMAGE_LOAD_INFO *pLoadInfo, ID3DX11DataProcessor **ppDataProcessor); | ||
| 155 | HRESULT WINAPI D3DX11CreateAsyncTextureInfoProcessor(D3DX11_IMAGE_INFO *pImageInfo, ID3DX11DataProcessor **ppDataProcessor); | ||
| 156 | HRESULT WINAPI D3DX11CreateAsyncShaderResourceViewProcessor(ID3D11Device *pDevice, D3DX11_IMAGE_LOAD_INFO *pLoadInfo, ID3DX11DataProcessor **ppDataProcessor); | ||
| 157 | |||
| 158 | #ifdef __cplusplus | ||
| 159 | } | ||
| 160 | #endif //__cplusplus | ||
| 161 | |||
| 162 | #endif //__D3DX11ASYNC_H__ | ||
| 163 | |||
| 164 |