summaryrefslogtreecommitdiffstats
path: root/source/slang/emit.cpp
diff options
context:
space:
mode:
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 b2366f564..309a356f4 100644
--- a/source/slang/emit.cpp
+++ b/source/slang/emit.cpp
@@ -1816,9 +1816,9 @@ struct EmitVisitor
// Try to find a suitable sampler-type shader parameter in the global scope
// (fingers crossed)
RefPtr<VarDeclBase> samplerVar;
- for (auto d : context->shared->program->Members)
+ for (auto dd : context->shared->program->Members)
{
- if (auto varDecl = d.As<VarDeclBase>())
+ if (auto varDecl = dd.As<VarDeclBase>())
{
if (auto samplerType = varDecl->Type.type->As<SamplerStateType>())
{
@@ -3203,6 +3203,14 @@ struct EmitVisitor
void visitVarDeclBase(RefPtr<VarDeclBase> decl, DeclEmitArg const& arg)
{
+ // Skip fields that have been tuple-ified and don't contribute
+ // any fields of "ordinary" type.
+ if (auto tupleFieldMod = decl->FindModifier<TupleFieldModifier>())
+ {
+ if (!tupleFieldMod->hasAnyNonTupleFields)
+ return;
+ }
+
RefPtr<VarLayout> layout = arg.layout;
layout = maybeFetchLayout(decl, layout);