From 405d438bf176411247bfd2937fcbb8c0684b0ed7 Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Tue, 10 Jun 2025 17:33:38 +0800 Subject: Legalise out parameters for vertex shaders on metal (#6943) * Handle pointer types when getting type cast style Closes https://github.com/shader-slang/slang/issues/6025 * Move vertex shader out parameters to return type for Metal Closes https://github.com/shader-slang/slang/issues/6025 * More asserts * Make struct instead of tuple * More layout preservation * Handle same function result * more layout * remove layout * a * more debug code * more debug code * a * layout working * refactored * more tests * more tests * fuse loops * remove unused comments * Correct filecheck usage * debug code * correct name and order of filecheck vars * simplify * Address review comments fix warning * simplify handling of simple vertex shaders --- source/slang/slang-ir.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/slang/slang-ir.cpp') diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp index 89d7a666e..bf332aaf7 100644 --- a/source/slang/slang-ir.cpp +++ b/source/slang/slang-ir.cpp @@ -4156,7 +4156,10 @@ static TypeCastStyle _getTypeStyleId(IRType* type) { return _getTypeStyleId(matrixType->getElementType()); } + // Try to simplify style if we can, otherwise just handle it unsimplified auto style = getTypeStyle(type->getOp()); + if (style == kIROp_Invalid) + style = type->getOp(); switch (style) { case kIROp_IntType: -- cgit v1.2.3