aboutsummaryrefslogtreecommitdiff
path: root/src/pipeline.cc
diff options
context:
space:
mode:
authoralan-baker <alanbaker@google.com>2019-07-23 14:50:34 -0400
committerGitHub <noreply@github.com>2019-07-23 14:50:34 -0400
commit7bc793fa18d8f8a518492ed75ed414683c704236 (patch)
tree63996f212526d1cdc3372e85d636587a58fed5f5 /src/pipeline.cc
parent1c7b905284129c4a9f2f735e08da6f53b4eb4d9b (diff)
downloadamber-7bc793fa18d8f8a518492ed75ed414683c704236.tar.gz
Add support for specifying compile options (#592)
Fixes #433 * Adds COMPILE_OPTIONS command * currently only supported for OPENCL-C shaders * plumbed to Clspv * Added tests * Add docs
Diffstat (limited to 'src/pipeline.cc')
-rw-r--r--src/pipeline.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/pipeline.cc b/src/pipeline.cc
index 08a8469..87ff88b 100644
--- a/src/pipeline.cc
+++ b/src/pipeline.cc
@@ -108,6 +108,23 @@ Result Pipeline::SetShaderOptimizations(const Shader* shader,
shader->GetName());
}
+Result Pipeline::SetShaderCompileOptions(const Shader* shader,
+ const std::vector<std::string>& opts) {
+ if (!shader)
+ return Result("invalid shader specified for compile options");
+
+ for (auto& info : shaders_) {
+ const auto* is = info.GetShader();
+ if (is == shader) {
+ info.SetCompileOptions(opts);
+ return {};
+ }
+ }
+
+ return Result("unknown shader specified for compile options: " +
+ shader->GetName());
+}
+
Result Pipeline::SetShaderEntryPoint(const Shader* shader,
const std::string& name) {
if (!shader)