From 117f5e554839efc13066517461eafaf8f2fd96c6 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Fri, 6 May 2022 16:35:15 -0400 Subject: Initial work around groupshared (#2224) * #include an absolute path didn't work - because paths were taken to always be relative. * Allow rate modifier on parameter. * Add test. * Disable test for now as breaks on source comparison because around nvAPI. --- source/slang/slang-emit-hlsl.cpp | 2 ++ source/slang/slang-lower-to-ir.cpp | 6 ++++++ 2 files changed, 8 insertions(+) (limited to 'source') diff --git a/source/slang/slang-emit-hlsl.cpp b/source/slang/slang-emit-hlsl.cpp index 945f00499..c319f2738 100644 --- a/source/slang/slang-emit-hlsl.cpp +++ b/source/slang/slang-emit-hlsl.cpp @@ -1041,6 +1041,8 @@ void HLSLSourceEmitter::_emitPrefixTypeAttr(IRAttr* attr) void HLSLSourceEmitter::emitSimpleFuncParamImpl(IRParam* param) { + emitRateQualifiers(param); + if (auto decor = param->findDecoration()) { switch (decor->getOp()) diff --git a/source/slang/slang-lower-to-ir.cpp b/source/slang/slang-lower-to-ir.cpp index a185efba9..9fec8f839 100644 --- a/source/slang/slang-lower-to-ir.cpp +++ b/source/slang/slang-lower-to-ir.cpp @@ -2489,6 +2489,7 @@ IRLoweringParameterInfo getParameterInfo( DeclRef const& paramDecl) { IRLoweringParameterInfo info; + info.type = getType(context->astBuilder, paramDecl); info.decl = paramDecl; info.direction = getParameterDirection(paramDecl); @@ -2698,6 +2699,11 @@ void _lowerFuncDeclBaseTypeInfo( irParamType = maybeGetConstExprType(builder, irParamType, paramInfo.decl); } + if (paramInfo.decl && paramInfo.decl->hasModifier()) + { + irParamType = builder->getRateQualifiedType(builder->getGroupSharedRate(), irParamType); + } + paramTypes.add(irParamType); } -- cgit v1.2.3