HLSL: Recognize POSITION semantic et al in DX9 compatibility mode (#2255)

This commit is contained in:
rdb
2020-06-02 08:30:50 +02:00
committed by GitHub
parent d8edfd8e66
commit b56e0e441b
3 changed files with 29 additions and 2 deletions

View File

@@ -6129,6 +6129,32 @@ void HlslParseContext::handleSemantic(TSourceLoc loc, TQualifier& qualifier, TBu
return semanticNum;
};
if (builtIn == EbvNone && hlslDX9Compatible()) {
if (language == EShLangVertex) {
if (qualifier.isParamOutput()) {
if (upperCase == "POSITION") {
builtIn = EbvPosition;
}
if (upperCase == "PSIZE") {
builtIn = EbvPointSize;
}
}
} else if (language == EShLangFragment) {
if (qualifier.isParamInput() && upperCase == "VPOS") {
builtIn = EbvFragCoord;
}
if (qualifier.isParamOutput()) {
if (upperCase.compare(0, 5, "COLOR") == 0) {
qualifier.layoutLocation = getSemanticNumber(upperCase, 0, nullptr);
nextOutLocation = std::max(nextOutLocation, qualifier.layoutLocation + 1u);
}
if (upperCase == "DEPTH") {
builtIn = EbvFragDepth;
}
}
}
}
switch(builtIn) {
case EbvNone:
// Get location numbers from fragment outputs, instead of