Merge pull request #797 from steve-lunarg/scalar-length

HLSL: allow length() on scalars
This commit is contained in:
John Kessenich
2017-03-31 09:26:47 -06:00
committed by GitHub
5 changed files with 123 additions and 8 deletions

View File

@@ -359,7 +359,7 @@ inline bool IsValid(const char* cname, char retOrder, char retType, char argOrde
const std::string name(cname);
// these do not have vec1 versions
if (dim0 == 1 && (name == "length" || name == "normalize" || name == "reflect" || name == "refract"))
if (dim0 == 1 && (name == "normalize" || name == "reflect" || name == "refract"))
return false;
if (!IsTextureType(argOrder) && (isVec && dim0 == 1)) // avoid vec1
@@ -625,7 +625,7 @@ void TBuiltInParseablesHlsl::initialize(int /*version*/, EProfile /*profile*/, c
{ "isinf", nullptr, "B" , "SVM", "F", EShLangAll, false },
{ "isnan", nullptr, "B" , "SVM", "F", EShLangAll, false },
{ "ldexp", nullptr, nullptr, "SVM,", "F,", EShLangAll, false },
{ "length", "S", "F", "V", "F", EShLangAll, false },
{ "length", "S", "F", "SV", "F", EShLangAll, false },
{ "lerp", nullptr, nullptr, "VM,,", "F,,", EShLangAll, false },
{ "lerp", nullptr, nullptr, "SVM,,S", "F,,", EShLangAll, false },
{ "lit", "V4", "F", "S,,", "F,,", EShLangAll, false },