aboutsummaryrefslogtreecommitdiff
path: root/src/shader_compiler.h
diff options
context:
space:
mode:
authordan sinclair <dj2@everburning.com>2019-02-07 15:26:45 -0500
committerGitHub <noreply@github.com>2019-02-07 15:26:45 -0500
commitde7c1aa073f241093e730f6f44e034a73cb58d02 (patch)
tree3aecd33992cbd793dff8664bc3b783ff4c89e49a /src/shader_compiler.h
parent43c8b2d2e187c7c81ac47d63314ee019191c5cd6 (diff)
downloadamber-de7c1aa073f241093e730f6f44e034a73cb58d02.tar.gz
Allow setting SPIR-V target environment. (#273)
This CL adds an option to the amber sample application to set the SPIR-V target environment. The environment name matches the names accepted by the other spirv-tools applications. The environment is set into the script and used by the shader compiler.
Diffstat (limited to 'src/shader_compiler.h')
-rw-r--r--src/shader_compiler.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/shader_compiler.h b/src/shader_compiler.h
index 7c0c265..2636bfc 100644
--- a/src/shader_compiler.h
+++ b/src/shader_compiler.h
@@ -28,6 +28,7 @@ namespace amber {
class ShaderCompiler {
public:
ShaderCompiler();
+ explicit ShaderCompiler(const std::string& env);
~ShaderCompiler();
std::pair<Result, std::vector<uint32_t>> Compile(
@@ -37,6 +38,8 @@ class ShaderCompiler {
private:
Result ParseHex(const std::string& data, std::vector<uint32_t>* result) const;
Result CompileGlsl(Shader* shader, std::vector<uint32_t>* result) const;
+
+ std::string spv_env_;
};
} // namespace amber