Add GLSL Ceil support.

This CL adds Ceil support to the type determiner

Bug: tint:5
Change-Id: Iba785dbea412cc94f9b0faa3e6d38f02453d5215
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/19945
Reviewed-by: David Neto <dneto@google.com>
This commit is contained in:
dan sinclair 2020-04-20 15:48:56 +00:00 committed by dan sinclair
parent d0f0edf8b6
commit f1c7f0c779
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 == "fsign" || name == "floor") {
name == "fabs" || name == "fsign" || name == "floor" || name == "ceil") {
if (params.size() != 1) {
error_ = "incorrect number of parameters for " + name +
". Expected 1 got " + std::to_string(params.size());
@ -601,6 +601,8 @@ ast::type::Type* TypeDeterminer::GetImportData(
*id = GLSLstd450FSign;
} else if (name == "floor") {
*id = GLSLstd450Floor;
} else if (name == "ceil") {
*id = GLSLstd450Ceil;
}
return params[0]->result_type();

View File

@ -1593,7 +1593,8 @@ INSTANTIATE_TEST_SUITE_P(TypeDeterminerTest,
GLSLData{"trunc", GLSLstd450Trunc},
GLSLData{"fabs", GLSLstd450FAbs},
GLSLData{"fsign", GLSLstd450FSign},
GLSLData{"floor", GLSLstd450Floor}));
GLSLData{"floor", GLSLstd450Floor},
GLSLData{"ceil", GLSLstd450Ceil}));
} // namespace
} // namespace tint