1 module directx.d3dx11async; 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 import directx.d3d11; 12 import directx.d3dcommon; 13 import directx.win32; 14 import directx.d3dx11core; 15 import directx.d3dcommon; 16 import directx.d3dx11tex; 17 18 // declared in d3d10shader.h 19 alias LPD3DINCLUDE LPD3D10INCLUDE; 20 alias D3D_SHADER_MACRO D3D10_SHADER_MACRO; 21 22 extern (Windows) { 23 24 //---------------------------------------------------------------------------- 25 // D3DX11Compile: 26 // ------------------ 27 // Compiles an effect or shader. 28 // 29 // Parameters: 30 // pSrcFile 31 // Source file name. 32 // hSrcModule 33 // Module handle. if NULL, current module will be used. 34 // pSrcResource 35 // Resource name in module. 36 // pSrcData 37 // Pointer to source code. 38 // SrcDataLen 39 // Size of source code, in bytes. 40 // pDefines 41 // Optional NULL-terminated array of preprocessor macro definitions. 42 // pInclude 43 // Optional interface pointer to use for handling #include directives. 44 // If this parameter is NULL, #includes will be honored when compiling 45 // from file, and will error when compiling from resource or memory. 46 // pFunctionName 47 // Name of the entrypoint function where execution should begin. 48 // pProfile 49 // Instruction set to be used when generating code. Currently supported 50 // profiles are "vs_1_1", "vs_2_0", "vs_2_a", "vs_2_sw", "vs_3_0", 51 // "vs_3_sw", "vs_4_0", "vs_4_1", 52 // "ps_2_0", "ps_2_a", "ps_2_b", "ps_2_sw", "ps_3_0", 53 // "ps_3_sw", "ps_4_0", "ps_4_1", 54 // "gs_4_0", "gs_4_1", 55 // "tx_1_0", 56 // "fx_4_0", "fx_4_1" 57 // Note that this entrypoint does not compile fx_2_0 targets, for that 58 // you need to use the D3DX9 function. 59 // Flags1 60 // See D3D10_SHADER_xxx flags. 61 // Flags2 62 // See D3D10_EFFECT_xxx flags. 63 // ppShader 64 // Returns a buffer containing the created shader. This buffer contains 65 // the compiled shader code, as well as any embedded debug and symbol 66 // table info. (See D3D10GetShaderConstantTable) 67 // ppErrorMsgs 68 // Returns a buffer containing a listing of errors and warnings that were 69 // encountered during the compile. If you are running in a debugger, 70 // these are the same messages you will see in your debug output. 71 // pHResult 72 // Pointer to a memory location to receive the return value upon completion. 73 // Maybe NULL if not needed. 74 // If pPump != NULL, pHResult must be a valid memory location until the 75 // the asynchronous execution completes. 76 //---------------------------------------------------------------------------- 77 78 HRESULT D3DX11CompileFromFileA(LPCSTR 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 HRESULT D3DX11CompileFromFileW(LPCWSTR pSrcFile, const(D3D10_SHADER_MACRO)* pDefines, LPD3D10INCLUDE pInclude, 82 LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump pPump, ID3D10Blob* ppShader, ID3D10Blob* ppErrorMsgs, HRESULT* pHResult); 83 84 // TODO: make sure this matches phobos win32 style 85 alias D3DX11CompileFromFileW D3DX11CompileFromFile; 86 87 88 HRESULT D3DX11CompileFromResourceA(HMODULE hSrcModule, LPCSTR pSrcResource, LPCSTR pSrcFileName, const(D3D10_SHADER_MACRO)* pDefines, 89 LPD3D10INCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump pPump, ID3D10Blob* ppShader, ID3D10Blob* ppErrorMsgs, HRESULT* pHResult); 90 91 HRESULT D3DX11CompileFromResourceW(HMODULE hSrcModule, LPCWSTR pSrcResource, LPCWSTR pSrcFileName, const(D3D10_SHADER_MACRO)* pDefines, 92 LPD3D10INCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump pPump, ID3D10Blob* ppShader, ID3D10Blob* ppErrorMsgs, HRESULT* pHResult); 93 94 alias D3DX11CompileFromResourceW D3DX11CompileFromResource; 95 96 97 HRESULT D3DX11CompileFromMemory(LPCSTR pSrcData, SIZE_T SrcDataLen, LPCSTR pFileName, const(D3D10_SHADER_MACRO)* pDefines, LPD3D10INCLUDE pInclude, 98 LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump pPump, ID3D10Blob* ppShader, ID3D10Blob* ppErrorMsgs, HRESULT* pHResult); 99 100 HRESULT D3DX11PreprocessShaderFromFileA(LPCSTR pFileName, const(D3D10_SHADER_MACRO)* pDefines, 101 LPD3D10INCLUDE pInclude, ID3DX11ThreadPump pPump, ID3D10Blob* ppShaderText, ID3D10Blob* ppErrorMsgs, HRESULT* pHResult); 102 103 HRESULT D3DX11PreprocessShaderFromFileW(LPCWSTR pFileName, const(D3D10_SHADER_MACRO)* pDefines, 104 LPD3D10INCLUDE pInclude, ID3DX11ThreadPump pPump, ID3D10Blob* ppShaderText, ID3D10Blob* ppErrorMsgs, HRESULT* pHResult); 105 106 HRESULT D3DX11PreprocessShaderFromMemory(LPCSTR pSrcData, SIZE_T SrcDataSize, LPCSTR pFileName, const(D3D10_SHADER_MACRO)* pDefines, 107 LPD3D10INCLUDE pInclude, ID3DX11ThreadPump pPump, ID3D10Blob* ppShaderText, ID3D10Blob* ppErrorMsgs, HRESULT* pHResult); 108 109 HRESULT D3DX11PreprocessShaderFromResourceA(HMODULE hModule, LPCSTR pResourceName, LPCSTR pSrcFileName, const(D3D10_SHADER_MACRO)* pDefines, 110 LPD3D10INCLUDE pInclude, ID3DX11ThreadPump pPump, ID3D10Blob* ppShaderText, ID3D10Blob* ppErrorMsgs, HRESULT* pHResult); 111 112 HRESULT D3DX11PreprocessShaderFromResourceW(HMODULE hModule, LPCWSTR pResourceName, LPCWSTR pSrcFileName, const(D3D10_SHADER_MACRO)* pDefines, 113 LPD3D10INCLUDE pInclude, ID3DX11ThreadPump pPump, ID3D10Blob* ppShaderText, ID3D10Blob* ppErrorMsgs, HRESULT* pHResult); 114 115 alias D3DX11PreprocessShaderFromFileW D3DX11PreprocessShaderFromFile; 116 alias D3DX11PreprocessShaderFromResourceW D3DX11PreprocessShaderFromResource; 117 118 119 //---------------------------------------------------------------------------- 120 // Async processors 121 //---------------------------------------------------------------------------- 122 123 HRESULT D3DX11CreateAsyncCompilerProcessor(LPCSTR pFileName, const(D3D10_SHADER_MACRO)* pDefines, LPD3D10INCLUDE pInclude, 124 LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, 125 ID3D10Blob* ppCompiledShader, ID3D10Blob* ppErrorBuffer, ID3DX11DataProcessor* ppProcessor); 126 127 HRESULT D3DX11CreateAsyncShaderPreprocessProcessor(LPCSTR pFileName, const(D3D10_SHADER_MACRO)* pDefines, LPD3D10INCLUDE pInclude, 128 ID3D10Blob* ppShaderText, ID3D10Blob* ppErrorBuffer, ID3DX11DataProcessor* ppProcessor); 129 130 //---------------------------------------------------------------------------- 131 // D3DX11 Asynchronous texture I/O (advanced mode) 132 //---------------------------------------------------------------------------- 133 134 HRESULT D3DX11CreateAsyncFileLoaderW(LPCWSTR pFileName, ID3DX11DataLoader* ppDataLoader); 135 HRESULT D3DX11CreateAsyncFileLoaderA(LPCSTR pFileName, ID3DX11DataLoader* ppDataLoader); 136 HRESULT D3DX11CreateAsyncMemoryLoader(LPCVOID pData, SIZE_T cbData, ID3DX11DataLoader* ppDataLoader); 137 HRESULT D3DX11CreateAsyncResourceLoaderW(HMODULE hSrcModule, LPCWSTR pSrcResource, ID3DX11DataLoader* ppDataLoader); 138 HRESULT D3DX11CreateAsyncResourceLoaderA(HMODULE hSrcModule, LPCSTR pSrcResource, ID3DX11DataLoader* ppDataLoader); 139 140 alias D3DX11CreateAsyncFileLoaderW D3DX11CreateAsyncFileLoader; 141 alias D3DX11CreateAsyncResourceLoaderW D3DX11CreateAsyncResourceLoader; 142 143 144 HRESULT D3DX11CreateAsyncTextureProcessor(ID3D11Device pDevice, D3DX11_IMAGE_LOAD_INFO* pLoadInfo, ID3DX11DataProcessor* ppDataProcessor); 145 HRESULT D3DX11CreateAsyncTextureInfoProcessor(D3DX11_IMAGE_INFO* pImageInfo, ID3DX11DataProcessor* ppDataProcessor); 146 HRESULT D3DX11CreateAsyncShaderResourceViewProcessor(ID3D11Device pDevice, D3DX11_IMAGE_LOAD_INFO* pLoadInfo, ID3DX11DataProcessor* ppDataProcessor); 147 148 }