Add GLSL FSign support

This CL adds FSign to the type determination.

Bug: tint:5
Change-Id: I8e3a7e94f367c4aaa510e72f774097946382a968
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/19943
Reviewed-by: David Neto <dneto@google.com>
This commit is contained in:
dan sinclair 2020-04-20 15:48:20 +00:00 committed by dan sinclair
parent de50e5298d
commit e9661fbe9b
2 changed files with 5 additions and 2 deletions

View File

@ -577,7 +577,7 @@ ast::type::Type* TypeDeterminer::GetImportData(
}
if (name == "round" || name == "roundeven" || name == "trunc" ||
name == "fabs") {
name == "fabs" || name == "fsign") {
if (params.size() != 1) {
error_ = "incorrect number of parameters for " + name +
". Expected 1 got " + std::to_string(params.size());
@ -597,6 +597,8 @@ ast::type::Type* TypeDeterminer::GetImportData(
*id = GLSLstd450Trunc;
} else if (name == "fabs") {
*id = GLSLstd450FAbs;
} else if (name == "fsign") {
*id = GLSLstd450FSign;
}
return params[0]->result_type();

View File

@ -1591,7 +1591,8 @@ INSTANTIATE_TEST_SUITE_P(TypeDeterminerTest,
GLSLData{"roundeven",
GLSLstd450RoundEven},
GLSLData{"trunc", GLSLstd450Trunc},
GLSLData{"fabs", GLSLstd450FAbs}));
GLSLData{"fabs", GLSLstd450FAbs},
GLSLData{"fsign", GLSLstd450FSign}));
} // namespace
} // namespace tint