From dd9d24d29c4a9e05a4510eb9959fafa0ed36618b Mon Sep 17 00:00:00 2001 From: Yong He Date: Fri, 28 Feb 2025 22:46:56 -0800 Subject: Allow partial specialization of existential arguments. (#6487) * Allow partial specialization of existential arguments. * Fix. * Add test case for improved diagnostics. * Fix compile error. * Fix tests. * Fix. * Fix test. * Fix compile issue. * Fix typo. * Address comment. --- source/slang/slang-ir-generics-lowering-context.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'source/slang/slang-ir-generics-lowering-context.cpp') diff --git a/source/slang/slang-ir-generics-lowering-context.cpp b/source/slang/slang-ir-generics-lowering-context.cpp index 097fa58b8..199eae2fc 100644 --- a/source/slang/slang-ir-generics-lowering-context.cpp +++ b/source/slang/slang-ir-generics-lowering-context.cpp @@ -405,12 +405,23 @@ bool SharedGenericsLoweringContext::doesTypeFitInAnyValue( IRType* concreteType, IRInterfaceType* interfaceType, IRIntegerValue* outTypeSize, - IRIntegerValue* outLimit) + IRIntegerValue* outLimit, + bool* outIsTypeOpaque) { auto anyValueSize = getInterfaceAnyValueSize(interfaceType, interfaceType->sourceLoc); if (outLimit) *outLimit = anyValueSize; + if (!areResourceTypesBindlessOnTarget(targetProgram->getTargetReq())) + { + IRType* opaqueType = nullptr; + if (isOpaqueType(concreteType, &opaqueType)) + { + if (outIsTypeOpaque) + *outIsTypeOpaque = true; + return false; + } + } IRSizeAndAlignment sizeAndAlignment; Result result = getNaturalSizeAndAlignment(targetProgram->getOptionSet(), concreteType, &sizeAndAlignment); -- cgit v1.2.3