summaryrefslogtreecommitdiffstats
path: root/source/slang/emit.cpp
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2017-07-11 15:10:24 -0700
committerGitHub <noreply@github.com>2017-07-11 15:10:24 -0700
commitd8d8fefb9693e83bea215629f3a77f8a48d2f50f (patch)
tree509f77ecb1c2ee3849e42e74f88ad44a46687d29 /source/slang/emit.cpp
parentfa48d2d59abb7e2e5f92ab1477e0700cb8a76680 (diff)
parent5d06d42bbcbf4983bd75f4dd19b89e792698cd14 (diff)
Merge pull request #74 from tfoleyNV/resources-in-structs
Resources in structs
Diffstat (limited to 'source/slang/emit.cpp')
-rw-r--r--source/slang/emit.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/source/slang/emit.cpp b/source/slang/emit.cpp
index 309a356f4..0c39a98bd 100644
--- a/source/slang/emit.cpp
+++ b/source/slang/emit.cpp
@@ -2812,8 +2812,16 @@ struct EmitVisitor
// TODO(tfoley): technically have to apply substitution here too...
if (auto initExpr = declRef.getDecl()->Expr)
{
- Emit(" = ");
- EmitExpr(initExpr);
+ if (declRef.As<ParameterSyntaxNode>()
+ && context->shared->target == CodeGenTarget::GLSL)
+ {
+ // Don't emit default parameter values when lowering to GLSL
+ }
+ else
+ {
+ Emit(" = ");
+ EmitExpr(initExpr);
+ }
}
}