ES31: Add shader version check for CS and GS
This patch adds the missing check on the shader version for compute
and geometry shaders, which can fix a bug that ANGLE GLSL compiler
doesn't report a compile error when compiling an empty compute or
geometry shader in version 100 or 300.
This patch also updates the original compiler tests on the check of
shader version. In these tests, the compile errors are all caused by
illegal layouts instead of shader versions, which is against the
purpose of the tests.
This patch also fixes an incorrect case that used an empty compute
shader in version 300.
BUG=angleproject:1442, angleproject:1941
TEST=angle_unittests
Change-Id: Ic26bb8eb312dbc0cec6a879997d0ae7a2e625a0f
Reviewed-on: https://chromium-review.googlesource.com/910715
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/compiler/translator/Compiler.h b/src/compiler/translator/Compiler.h
index 753cfb8..2de32e9 100644
--- a/src/compiler/translator/Compiler.h
+++ b/src/compiler/translator/Compiler.h
@@ -228,6 +228,9 @@
// version.
void setASTMetadata(const TParseContext &parseContext);
+ // Check if shader version meets the requirement.
+ bool checkShaderVersion(TParseContext *parseContext);
+
// Does checks that need to be run after parsing is complete and returns true if they pass.
bool checkAndSimplifyAST(TIntermBlock *root,
const TParseContext &parseContext,