Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / angle / src / libGLESv2 / renderer / d3d / HLSLCompiler.h
1 #ifndef LIBGLESV2_RENDERER_HLSL_D3DCOMPILER_H_
2 #define LIBGLESV2_RENDERER_HLSL_D3DCOMPILER_H_
3
4 #include "libGLESv2/Error.h"
5
6 #include "common/angleutils.h"
7 #include "common/platform.h"
8
9 #include <vector>
10 #include <string>
11
12 namespace gl
13 {
14 class InfoLog;
15 }
16
17 namespace rx
18 {
19
20 struct CompileConfig
21 {
22     UINT flags;
23     std::string name;
24
25     CompileConfig();
26     CompileConfig(UINT flags, const std::string &name);
27 };
28
29 class HLSLCompiler
30 {
31   public:
32     HLSLCompiler();
33     ~HLSLCompiler();
34
35     bool initialize();
36     void release();
37
38     // Attempt to compile a HLSL shader using the supplied configurations, may output a NULL compiled blob
39     // even if no GL errors are returned.
40     gl::Error compileToBinary(gl::InfoLog &infoLog, const std::string &hlsl, const std::string &profile,
41                               const std::vector<CompileConfig> &configs, const D3D_SHADER_MACRO *overrideMacros,
42                               ID3DBlob **outCompiledBlob, std::string *outDebugInfo) const;
43
44     std::string disassembleBinary(ID3DBlob* shaderBinary) const;
45
46   private:
47     DISALLOW_COPY_AND_ASSIGN(HLSLCompiler);
48
49     HMODULE mD3DCompilerModule;
50     pD3DCompile mD3DCompileFunc;
51     pD3DDisassemble mD3DDisassembleFunc;
52 };
53
54 }
55
56 #endif // LIBGLESV2_RENDERER_HLSL_D3DCOMPILER_H_