Keep vec1.x l-value in HLSL

Changes in hlsl.shapeConv.frag are just renumbering,
duplicated load (80) has disappeared for whatever reason.
This commit is contained in:
Pavel Asyutchenko 2024-04-19 22:54:52 +02:00 committed by arcady-lunarg
parent d4d821272b
commit e46c1b725c
5 changed files with 149 additions and 68 deletions

View file

@ -962,14 +962,11 @@ TIntermTyped* HlslParseContext::handleDotDereference(const TSourceLoc& loc, TInt
return addConstructor(loc, base, type);
}
}
if (base->getVectorSize() == 1) {
// Use EOpIndexDirect (below) with vec1.x so that it remains l-value (Test/hlsl.swizzle.vec1.comp)
if (base->getVectorSize() == 1 && selectors.size() > 1) {
TType scalarType(base->getBasicType(), EvqTemporary, 1);
if (selectors.size() == 1)
return addConstructor(loc, base, scalarType);
else {
TType vectorType(base->getBasicType(), EvqTemporary, selectors.size());
return addConstructor(loc, addConstructor(loc, base, scalarType), vectorType);
}
TType vectorType(base->getBasicType(), EvqTemporary, selectors.size());
return addConstructor(loc, addConstructor(loc, base, scalarType), vectorType);
}
if (base->getType().getQualifier().isFrontEndConstant())