Add textureGather and textureGatherOffset
The patch adds new built-ins and extends the semantic parser to add
support for textureGather and textureGatherOffset.
BUG=angleproject:1442
TEST=angle_unittests
TEST=angle_deqp_gles31_tests.exe
--deqp-case=dEQP-GLES31.functional.texture.gather*
--deqp-egl-display-type=angle-gl
Change-Id: Iaf98c3420fbd61193072fdec8f5a61ac4c574101
Reviewed-on: https://chromium-review.googlesource.com/660124
Commit-Queue: Martin Radev <mradev@nvidia.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/compiler/translator/ShaderLang.cpp b/src/compiler/translator/ShaderLang.cpp
index 75e5490..003c40f 100644
--- a/src/compiler/translator/ShaderLang.cpp
+++ b/src/compiler/translator/ShaderLang.cpp
@@ -202,6 +202,14 @@
resources->MaxFunctionParameters = 1024;
// ES 3.1 Revision 4, 7.2 Built-in Constants
+
+ // ES 3.1, Revision 4, 8.13 Texture minification
+ // "The value of MIN_PROGRAM_TEXTURE_GATHER_OFFSET must be less than or equal to the value of
+ // MIN_PROGRAM_TEXEL_OFFSET. The value of MAX_PROGRAM_TEXTURE_GATHER_OFFSET must be greater than
+ // or equal to the value of MAX_PROGRAM_TEXEL_OFFSET"
+ resources->MinProgramTextureGatherOffset = -8;
+ resources->MaxProgramTextureGatherOffset = 7;
+
resources->MaxImageUnits = 4;
resources->MaxVertexImageUniforms = 0;
resources->MaxFragmentImageUniforms = 0;