From 17fa424a195ed562e0c9d87cee57577c90c1fc37 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Wed, 18 Apr 2018 17:22:44 -0700 Subject: 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`. 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. --- source/slang/emit.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source/slang/emit.cpp') 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(type); emitTypeImpl(rateQualifiedType->getValueType(), declarator); } + break; case kIROp_ArrayType: emitArrayTypeImpl(cast(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()) -- cgit v1.2.3