diff options
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/emit.cpp | 26 | ||||
| -rw-r--r-- | source/slang/parameter-binding.cpp | 9 | ||||
| -rw-r--r-- | source/slang/slang-stdlib.cpp | 2 |
3 files changed, 30 insertions, 7 deletions
diff --git a/source/slang/emit.cpp b/source/slang/emit.cpp index 7ffce2acd..8c6a46196 100644 --- a/source/slang/emit.cpp +++ b/source/slang/emit.cpp @@ -1495,14 +1495,28 @@ struct EmitVisitor outerPrec.rightPrecedence = rightPrec; } + void visitGenericAppExpr(GenericAppExpr* expr, ExprEmitArg const& arg) + { + auto prec = kEOp_Postfix; + auto outerPrec = arg.outerPrec; + bool needClose = MaybeEmitParens(outerPrec, prec); -#define UNEXPECTED(NAME) \ - void visit##NAME(NAME*, ExprEmitArg const&) \ - { Emit(#NAME); } - - UNEXPECTED(GenericAppExpr); + EmitExprWithPrecedence(expr->FunctionExpr, leftSide(outerPrec, prec)); + Emit("<"); + bool first = true; + for(auto aa : expr->Arguments) + { + if(!first) Emit(", "); + EmitExpr(aa); + first = false; + } + Emit(" >"); -#undef UNEXPECTED + if(needClose) + { + Emit(")"); + } + } void visitSharedTypeExpr(SharedTypeExpr* expr, ExprEmitArg const&) { diff --git a/source/slang/parameter-binding.cpp b/source/slang/parameter-binding.cpp index 007c023e2..8a8a993cd 100644 --- a/source/slang/parameter-binding.cpp +++ b/source/slang/parameter-binding.cpp @@ -994,6 +994,11 @@ static RefPtr<TypeLayout> processEntryPointParameter( assert(!"unimplemented"); } } + // If we ran into an error in checking the user's code, then skip this parameter + else if( auto errorType = type->As<ErrorType>() ) + { + return nullptr; + } else { assert(!"unimplemented"); @@ -1090,6 +1095,10 @@ static void collectEntryPointParameters( state, paramVarLayout); + // Skip parameters for which we could not compute a layout + if(!paramTypeLayout) + continue; + paramVarLayout->typeLayout = paramTypeLayout; for (auto rr : paramTypeLayout->resourceInfos) diff --git a/source/slang/slang-stdlib.cpp b/source/slang/slang-stdlib.cpp index d266c0560..1c1bcceaf 100644 --- a/source/slang/slang-stdlib.cpp +++ b/source/slang/slang-stdlib.cpp @@ -264,7 +264,7 @@ __generic<T> __magic_type(HLSLLineStreamType) struct LineStream void RestartStrip(); }; -__generic<T> __magic_type(HLSLLineStreamType) struct TriangleStream +__generic<T> __magic_type(HLSLTriangleStreamType) struct TriangleStream { void Append(T value); void RestartStrip(); |
