summaryrefslogtreecommitdiffstats
path: root/source/slang/emit.cpp
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2018-04-18 17:22:44 -0700
committerGitHub <noreply@github.com>2018-04-18 17:22:44 -0700
commit17fa424a195ed562e0c9d87cee57577c90c1fc37 (patch)
tree710d045b7b4228d750dd989689d5a1a63044bb93 /source/slang/emit.cpp
parentc3a27c0e5a5b36b5a14566394d1694419632b76c (diff)
Fix output of `groupshared` with IR type system (#492)
The basic problem was that the lowering logic was constructing (more or less) `Ptr<@GroupShared X>` instead of `@GroupShared Ptr<X>`. There were also problems with passes not propagating through rates that should have been (e.g., legalization). I've added a test case to actually validate `groupshared` support.
Diffstat (limited to 'source/slang/emit.cpp')
-rw-r--r--source/slang/emit.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/slang/emit.cpp b/source/slang/emit.cpp
index 008ddb270..e93dfbbb5 100644
--- a/source/slang/emit.cpp
+++ b/source/slang/emit.cpp
@@ -1243,6 +1243,7 @@ struct EmitVisitor
auto rateQualifiedType = cast<IRRateQualifiedType>(type);
emitTypeImpl(rateQualifiedType->getValueType(), declarator);
}
+ break;
case kIROp_ArrayType:
emitArrayTypeImpl(cast<IRArrayType>(type), declarator);
@@ -3249,6 +3250,7 @@ struct EmitVisitor
auto valType = ptrType->getValueType();
auto name = getIRName(inst);
+ emitIRRateQualifiers(ctx, inst);
emitIRType(ctx, valType, name);
emit(";\n");
}
@@ -4155,7 +4157,7 @@ struct EmitVisitor
{
for (auto pp = bb->getFirstParam(); pp; pp = pp->getNextParam())
{
- emitIRType(ctx, pp->getDataType(), getIRName(pp));
+ emitIRType(ctx, pp->getFullType(), getIRName(pp));
emit(";\n");
}
}
@@ -5165,6 +5167,7 @@ struct EmitVisitor
emitIRVarModifiers(ctx, layout, varDecl, varType);
+ emitIRRateQualifiers(ctx, varDecl);
emitIRType(ctx, varType, getIRName(varDecl));
emitIRSemantics(ctx, varDecl);
@@ -5212,6 +5215,7 @@ struct EmitVisitor
emit("static ");
}
emit("const ");
+ emitIRRateQualifiers(ctx, valDecl);
emitIRType(ctx, valType, getIRName(valDecl));
if (valDecl->getFirstBlock())