Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

168 lines
8.3 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) Microsoft Corporation. All rights reserved.
  4. //
  5. // File: D3DX11Async.h
  6. // Content: D3DX11 Asynchronous Effect / Shader loaders / compilers
  7. //
  8. //////////////////////////////////////////////////////////////////////////////
  9. #ifndef __D3DX11ASYNC_H__
  10. #define __D3DX11ASYNC_H__
  11. #include "d3dx11.h"
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif //__cplusplus
  15. //----------------------------------------------------------------------------
  16. // D3DX11Compile:
  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 D3DX11CompileFromFileA(LPCSTR pSrcFile,CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
  69. LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
  70. HRESULT WINAPI D3DX11CompileFromFileW(LPCWSTR pSrcFile, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
  71. LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
  72. #ifdef UNICODE
  73. #define D3DX11CompileFromFile D3DX11CompileFromFileW
  74. #else
  75. #define D3DX11CompileFromFile D3DX11CompileFromFileA
  76. #endif
  77. HRESULT WINAPI D3DX11CompileFromResourceA(HMODULE hSrcModule, LPCSTR pSrcResource, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines,
  78. LPD3D10INCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
  79. HRESULT WINAPI D3DX11CompileFromResourceW(HMODULE hSrcModule, LPCWSTR pSrcResource, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines,
  80. LPD3D10INCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
  81. #ifdef UNICODE
  82. #define D3DX11CompileFromResource D3DX11CompileFromResourceW
  83. #else
  84. #define D3DX11CompileFromResource D3DX11CompileFromResourceA
  85. #endif
  86. HRESULT WINAPI D3DX11CompileFromMemory(LPCSTR pSrcData, SIZE_T SrcDataLen, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
  87. LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
  88. HRESULT WINAPI D3DX11PreprocessShaderFromFileA(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines,
  89. LPD3D10INCLUDE pInclude, ID3DX11ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
  90. HRESULT WINAPI D3DX11PreprocessShaderFromFileW(LPCWSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines,
  91. LPD3D10INCLUDE pInclude, ID3DX11ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
  92. HRESULT WINAPI D3DX11PreprocessShaderFromMemory(LPCSTR pSrcData, SIZE_T SrcDataSize, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines,
  93. LPD3D10INCLUDE pInclude, ID3DX11ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
  94. HRESULT WINAPI D3DX11PreprocessShaderFromResourceA(HMODULE hModule, LPCSTR pResourceName, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines,
  95. LPD3D10INCLUDE pInclude, ID3DX11ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
  96. HRESULT WINAPI D3DX11PreprocessShaderFromResourceW(HMODULE hModule, LPCWSTR pResourceName, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines,
  97. LPD3D10INCLUDE pInclude, ID3DX11ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
  98. #ifdef UNICODE
  99. #define D3DX11PreprocessShaderFromFile D3DX11PreprocessShaderFromFileW
  100. #define D3DX11PreprocessShaderFromResource D3DX11PreprocessShaderFromResourceW
  101. #else
  102. #define D3DX11PreprocessShaderFromFile D3DX11PreprocessShaderFromFileA
  103. #define D3DX11PreprocessShaderFromResource D3DX11PreprocessShaderFromResourceA
  104. #endif
  105. //----------------------------------------------------------------------------
  106. // Async processors
  107. //----------------------------------------------------------------------------
  108. HRESULT WINAPI D3DX11CreateAsyncCompilerProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
  109. LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2,
  110. ID3D10Blob **ppCompiledShader, ID3D10Blob **ppErrorBuffer, ID3DX11DataProcessor **ppProcessor);
  111. HRESULT WINAPI D3DX11CreateAsyncShaderPreprocessProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
  112. ID3D10Blob** ppShaderText, ID3D10Blob **ppErrorBuffer, ID3DX11DataProcessor **ppProcessor);
  113. //----------------------------------------------------------------------------
  114. // D3DX11 Asynchronous texture I/O (advanced mode)
  115. //----------------------------------------------------------------------------
  116. HRESULT WINAPI D3DX11CreateAsyncFileLoaderW(LPCWSTR pFileName, ID3DX11DataLoader **ppDataLoader);
  117. HRESULT WINAPI D3DX11CreateAsyncFileLoaderA(LPCSTR pFileName, ID3DX11DataLoader **ppDataLoader);
  118. HRESULT WINAPI D3DX11CreateAsyncMemoryLoader(LPCVOID pData, SIZE_T cbData, ID3DX11DataLoader **ppDataLoader);
  119. HRESULT WINAPI D3DX11CreateAsyncResourceLoaderW(HMODULE hSrcModule, LPCWSTR pSrcResource, ID3DX11DataLoader **ppDataLoader);
  120. HRESULT WINAPI D3DX11CreateAsyncResourceLoaderA(HMODULE hSrcModule, LPCSTR pSrcResource, ID3DX11DataLoader **ppDataLoader);
  121. #ifdef UNICODE
  122. #define D3DX11CreateAsyncFileLoader D3DX11CreateAsyncFileLoaderW
  123. #define D3DX11CreateAsyncResourceLoader D3DX11CreateAsyncResourceLoaderW
  124. #else
  125. #define D3DX11CreateAsyncFileLoader D3DX11CreateAsyncFileLoaderA
  126. #define D3DX11CreateAsyncResourceLoader D3DX11CreateAsyncResourceLoaderA
  127. #endif
  128. HRESULT WINAPI D3DX11CreateAsyncTextureProcessor(ID3D11Device *pDevice, D3DX11_IMAGE_LOAD_INFO *pLoadInfo, ID3DX11DataProcessor **ppDataProcessor);
  129. HRESULT WINAPI D3DX11CreateAsyncTextureInfoProcessor(D3DX11_IMAGE_INFO *pImageInfo, ID3DX11DataProcessor **ppDataProcessor);
  130. HRESULT WINAPI D3DX11CreateAsyncShaderResourceViewProcessor(ID3D11Device *pDevice, D3DX11_IMAGE_LOAD_INFO *pLoadInfo, ID3DX11DataProcessor **ppDataProcessor);
  131. #ifdef __cplusplus
  132. }
  133. #endif //__cplusplus
  134. #endif //__D3DX11ASYNC_H__