From f1c7f0c779e79ae12566af9ea8604495b537d6c5 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Mon, 20 Apr 2020 15:48:56 +0000 Subject: [PATCH] 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 --- src/type_determiner.cc | 4 +++- src/type_determiner_test.cc | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/type_determiner.cc b/src/type_determiner.cc index 356363462b..121a790dc5 100644 --- a/src/type_determiner.cc +++ b/src/type_determiner.cc @@ -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(); diff --git a/src/type_determiner_test.cc b/src/type_determiner_test.cc index c2d91555fd..bf183b9546 100644 --- a/src/type_determiner_test.cc +++ b/src/type_determiner_test.cc @@ -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