public static void Decompile(string sFileName) { Initialize(); ID3DXEffect *pD3DEffect = null; ID3DXBuffer *pD3DError = null; ID3DXBuffer *pDisassembler = null; D3DXCreateEffectFromFile(g_D3DDevice, sFileName, IntPtr.Zero, IntPtr.Zero, 0, IntPtr.Zero, &pD3DEffect, &pD3DError); D3DXDisassembleEffect(pD3DEffect, false, &pDisassembler); var sShaderSource = Marshal.PtrToStringAnsi(ID3DXBuffer_GetBufferPointer(pDisassembler)); var sOutFile = Common.OutputPath + "/Shaders/mb.fx"; if (!Directory.Exists(Common.OutputPath + "/Shaders")) { Directory.CreateDirectory(Common.OutputPath + "/Shaders"); } Win32FileWriter.WriteAllText(sOutFile, Header.Shaders + sShaderSource); Release(); }
private static extern int D3DXDisassembleEffect( ID3DXEffect *pEffect, [MarshalAs(UnmanagedType.Bool)] bool EnableColorCode, ID3DXBuffer **ppDisassembly );
public unsafe Effect(ID3DXEffect *pData, Device device) : base((ID3DXBaseEffect *)pData) { throw new NotImplementedException(); }
public unsafe void UpdateUnmanagedPointer(ID3DXEffect *pInterface) { throw new NotImplementedException(); }
public unsafe Effect(ID3DXEffect *pInterop) : base(null) { throw new NotImplementedException(); }