00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #pragma once
00023
00024 #include <d3dx9shader.h>
00025
00026 class CPixelShaderCompiler
00027 {
00028 typedef HRESULT (WINAPI * D3DXCompileShaderPtr) (
00029 LPCSTR pSrcData,
00030 UINT SrcDataLen,
00031 CONST D3DXMACRO* pDefines,
00032 LPD3DXINCLUDE pInclude,
00033 LPCSTR pFunctionName,
00034 LPCSTR pProfile,
00035 DWORD Flags,
00036 LPD3DXBUFFER* ppShader,
00037 LPD3DXBUFFER* ppErrorMsgs,
00038 LPD3DXCONSTANTTABLE* ppConstantTable);
00039
00040 typedef HRESULT (WINAPI * D3DXDisassembleShaderPtr) (
00041 CONST DWORD* pShader,
00042 BOOL EnableColorCode,
00043 LPCSTR pComments,
00044 LPD3DXBUFFER* ppDisassembly);
00045
00046 HMODULE m_hDll;
00047 D3DXCompileShaderPtr m_pD3DXCompileShader;
00048 D3DXDisassembleShaderPtr m_pD3DXDisassembleShader;
00049
00050 CComPtr<IDirect3DDevice9> m_pD3DDev;
00051
00052 public:
00053 CPixelShaderCompiler(IDirect3DDevice9* pD3DDev, bool fStaySilent = false);
00054 virtual ~CPixelShaderCompiler();
00055
00056 HRESULT CompileShader(
00057 LPCSTR pSrcData,
00058 LPCSTR pFunctionName,
00059 LPCSTR pProfile,
00060 DWORD Flags,
00061 IDirect3DPixelShader9** ppPixelShader,
00062 CString* disasm = NULL,
00063 CString* errmsg = NULL);
00064 };