summaryrefslogtreecommitdiffstats
path: root/source/slang/slang.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-07-19 11:49:42 -0700
committerGitHub <noreply@github.com>2024-07-19 11:49:42 -0700
commitf114433debfba67cbe1db239b6e92278d41ed438 (patch)
tree3a8ff78deb657d203c87bd22bc2ee83575e834f6 /source/slang/slang.cpp
parentadf758c8c4032afcd96d995840bd697d2adef34c (diff)
Support parameter block in metal shader objects. (#4671)
* Support parameter block in metal shader objects. * Ingore parameter block tests on devices without tier2 argument buffer. * Fix warning. * Fix texture subscript test. --------- Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang.cpp')
-rw-r--r--source/slang/slang.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp
index f440ce3cb..c6e460d02 100644
--- a/source/slang/slang.cpp
+++ b/source/slang/slang.cpp
@@ -1368,7 +1368,7 @@ SLANG_NO_THROW slang::TypeLayoutReflection* SLANG_MCALL Linkage::getTypeLayout(
//
SLANG_UNUSED(rules);
- auto typeLayout = target->getTypeLayout(type);
+ auto typeLayout = target->getTypeLayout(type, rules);
// TODO: We currently don't have a path for capturing
// errors that occur during layout (e.g., types that
@@ -1827,7 +1827,7 @@ CapabilitySet TargetRequest::getTargetCaps()
}
-TypeLayout* TargetRequest::getTypeLayout(Type* type)
+TypeLayout* TargetRequest::getTypeLayout(Type* type, slang::LayoutRules rules)
{
SLANG_AST_BUILDER_RAII(getLinkage()->getASTBuilder());
@@ -1841,13 +1841,14 @@ TypeLayout* TargetRequest::getTypeLayout(Type* type)
// parameter instead (leaving the user to figure out how that
// maps to the ordering via some API on the program layout).
//
- auto layoutContext = getInitialLayoutContextForTarget(this, nullptr);
+ auto layoutContext = getInitialLayoutContextForTarget(this, nullptr, rules);
RefPtr<TypeLayout> result;
- if (getTypeLayouts().tryGetValue(type, result))
+ auto key = TypeLayoutKey{ type, rules };
+ if (getTypeLayouts().tryGetValue(key, result))
return result.Ptr();
result = createTypeLayout(layoutContext, type);
- getTypeLayouts()[type] = result;
+ getTypeLayouts()[key] = result;
return result.Ptr();
}