Hash :
3935e51d
Author :
Date :
2014-09-23T13:15:19
Refactor HLSLCompiler to use stl objects and encapulate workarounds. * Pass std::strings for the source and profile. * Create a wrapper struct for storing the compile configurations and pass them to the compiler with an std::vector. * Remove function typedefs, they're available from the platform.h header. BUG=angle:755 Change-Id: I19dd2be1655a12f76fc5718450db974a7ec324ec Reviewed-on: https://chromium-review.googlesource.com/219287 Reviewed-by: Brandon Jones <bajones@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
#ifndef LIBGLESV2_RENDERER_HLSL_D3DCOMPILER_H_
#define LIBGLESV2_RENDERER_HLSL_D3DCOMPILER_H_
#include "common/angleutils.h"
#include "common/platform.h"
#include <vector>
#include <string>
namespace gl
{
class InfoLog;
}
namespace rx
{
struct CompileConfig
{
UINT flags;
std::string name;
CompileConfig();
CompileConfig(UINT flags, const std::string &name);
};
class HLSLCompiler
{
public:
HLSLCompiler();
~HLSLCompiler();
bool initialize();
void release();
ID3DBlob *compileToBinary(gl::InfoLog &infoLog, const std::string &hlsl, const std::string &profile,
const std::vector<CompileConfig> &configs) const;
private:
DISALLOW_COPY_AND_ASSIGN(HLSLCompiler);
HMODULE mD3DCompilerModule;
pD3DCompile mD3DCompileFunc;
};
}
#endif // LIBGLESV2_RENDERER_HLSL_D3DCOMPILER_H_