summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/slang/slang-ir-glsl-legalize.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/slang/slang-ir-glsl-legalize.cpp b/source/slang/slang-ir-glsl-legalize.cpp
index f001384a4..ac4d5c336 100644
--- a/source/slang/slang-ir-glsl-legalize.cpp
+++ b/source/slang/slang-ir-glsl-legalize.cpp
@@ -2094,6 +2094,18 @@ ScalarizedVal adaptType(IRBuilder* builder, IRInst* val, IRType* toType, IRType*
}
}
}
+ else if (auto toArray = as<IRArrayType>(toType))
+ {
+ // Handle scalar-to-array conversion for tessellation factors
+ if (as<IRBasicType>(fromType))
+ {
+ // Convert the scalar value to the array's element type first
+ auto arrayElementType = toArray->getElementType();
+ auto convertedVal = builder->emitCast(arrayElementType, val);
+ val = builder->emitMakeArrayFromElement(toType, convertedVal);
+ return ScalarizedVal::value(val);
+ }
+ }
// TODO: actually consider what needs to go on here...
return ScalarizedVal::value(builder->emitCast(toType, val));
}