Support GL_OES_texture_border_clamp

Added support for GL_TEXTURE_BORDER_COLOR and GL_CLAMP_TO_BORDER in
OpenGL/OpenGLES, Direct3D9 and Direct3D11 backends.
For integer textures in OpenGLES3 contexts these additional entry points
are available now:

void glTexParameterIivOES(enum target, enum pname, const int *params);
void glTexParameterIuivOES(enum target, enum pname, const uint *params);

void glGetTexParameterIivOES(enum target, enum pname, int *params);
void glGetTexParameterIuivOES(enum target, enum pname, uint *params);

void glSamplerParameterIivOES(uint sampler, enum pname, const int *params);
void glSamplerParameterIuivOES(uint sampler, enum pname, const uint *params);

void glGetSamplerParameterIivOES(uint sampler, enum pname, int *params);
void glGetSamplerParameterIuivOES(uint sampler, enum pname, uint *params);

BUG=angleproject:2890
TEST=angle_end2end_tests.TextureBorderClamp*

Change-Id: Iee3eeb399d8d7851b3b30694ad8f21a2111f5828
Reviewed-on: https://chromium-review.googlesource.com/c/1257824
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/Context.cpp b/src/libANGLE/Context.cpp
index f9a37c8..605a3bf 100644
--- a/src/libANGLE/Context.cpp
+++ b/src/libANGLE/Context.cpp
@@ -2074,7 +2074,7 @@
 
 void Context::getTexParameterfv(TextureType target, GLenum pname, GLfloat *params)
 {
-    Texture *texture = getTargetTexture(target);
+    const Texture *const texture = getTargetTexture(target);
     QueryTexParameterfv(texture, pname, params);
 }
 
@@ -2089,10 +2089,22 @@
 
 void Context::getTexParameteriv(TextureType target, GLenum pname, GLint *params)
 {
-    Texture *texture = getTargetTexture(target);
+    const Texture *const texture = getTargetTexture(target);
     QueryTexParameteriv(texture, pname, params);
 }
 
+void Context::getTexParameterIiv(TextureType target, GLenum pname, GLint *params)
+{
+    const Texture *const texture = getTargetTexture(target);
+    QueryTexParameterIiv(texture, pname, params);
+}
+
+void Context::getTexParameterIuiv(TextureType target, GLenum pname, GLuint *params)
+{
+    const Texture *const texture = getTargetTexture(target);
+    QueryTexParameterIuiv(texture, pname, params);
+}
+
 void Context::getTexParameterivRobust(TextureType target,
                                       GLenum pname,
                                       GLsizei bufSize,
@@ -2157,14 +2169,14 @@
 
 void Context::texParameterf(TextureType target, GLenum pname, GLfloat param)
 {
-    Texture *texture = getTargetTexture(target);
+    Texture *const texture = getTargetTexture(target);
     SetTexParameterf(this, texture, pname, param);
     onTextureChange(texture);
 }
 
 void Context::texParameterfv(TextureType target, GLenum pname, const GLfloat *params)
 {
-    Texture *texture = getTargetTexture(target);
+    Texture *const texture = getTargetTexture(target);
     SetTexParameterfv(this, texture, pname, params);
     onTextureChange(texture);
 }
@@ -2179,18 +2191,32 @@
 
 void Context::texParameteri(TextureType target, GLenum pname, GLint param)
 {
-    Texture *texture = getTargetTexture(target);
+    Texture *const texture = getTargetTexture(target);
     SetTexParameteri(this, texture, pname, param);
     onTextureChange(texture);
 }
 
 void Context::texParameteriv(TextureType target, GLenum pname, const GLint *params)
 {
-    Texture *texture = getTargetTexture(target);
+    Texture *const texture = getTargetTexture(target);
     SetTexParameteriv(this, texture, pname, params);
     onTextureChange(texture);
 }
 
+void Context::texParameterIiv(TextureType target, GLenum pname, const GLint *params)
+{
+    Texture *const texture = getTargetTexture(target);
+    SetTexParameterIiv(this, texture, pname, params);
+    onTextureChange(texture);
+}
+
+void Context::texParameterIuiv(TextureType target, GLenum pname, const GLuint *params)
+{
+    Texture *const texture = getTargetTexture(target);
+    SetTexParameterIuiv(this, texture, pname, params);
+    onTextureChange(texture);
+}
+
 void Context::texParameterivRobust(TextureType target,
                                    GLenum pname,
                                    GLsizei bufSize,
@@ -2869,18 +2895,32 @@
 
 void Context::samplerParameteri(GLuint sampler, GLenum pname, GLint param)
 {
-    Sampler *samplerObject =
+    Sampler *const samplerObject =
         mState.mSamplers->checkSamplerAllocation(mImplementation.get(), sampler);
     SetSamplerParameteri(this, samplerObject, pname, param);
 }
 
 void Context::samplerParameteriv(GLuint sampler, GLenum pname, const GLint *param)
 {
-    Sampler *samplerObject =
+    Sampler *const samplerObject =
         mState.mSamplers->checkSamplerAllocation(mImplementation.get(), sampler);
     SetSamplerParameteriv(this, samplerObject, pname, param);
 }
 
+void Context::samplerParameterIiv(GLuint sampler, GLenum pname, const GLint *param)
+{
+    Sampler *const samplerObject =
+        mState.mSamplers->checkSamplerAllocation(mImplementation.get(), sampler);
+    SetSamplerParameterIiv(this, samplerObject, pname, param);
+}
+
+void Context::samplerParameterIuiv(GLuint sampler, GLenum pname, const GLuint *param)
+{
+    Sampler *const samplerObject =
+        mState.mSamplers->checkSamplerAllocation(mImplementation.get(), sampler);
+    SetSamplerParameterIuiv(this, samplerObject, pname, param);
+}
+
 void Context::samplerParameterivRobust(GLuint sampler,
                                        GLenum pname,
                                        GLsizei bufSize,
@@ -2907,14 +2947,14 @@
 
 void Context::samplerParameterf(GLuint sampler, GLenum pname, GLfloat param)
 {
-    Sampler *samplerObject =
+    Sampler *const samplerObject =
         mState.mSamplers->checkSamplerAllocation(mImplementation.get(), sampler);
     SetSamplerParameterf(this, samplerObject, pname, param);
 }
 
 void Context::samplerParameterfv(GLuint sampler, GLenum pname, const GLfloat *param)
 {
-    Sampler *samplerObject =
+    Sampler *const samplerObject =
         mState.mSamplers->checkSamplerAllocation(mImplementation.get(), sampler);
     SetSamplerParameterfv(this, samplerObject, pname, param);
 }
@@ -2929,11 +2969,25 @@
 
 void Context::getSamplerParameteriv(GLuint sampler, GLenum pname, GLint *params)
 {
-    const Sampler *samplerObject =
+    const Sampler *const samplerObject =
         mState.mSamplers->checkSamplerAllocation(mImplementation.get(), sampler);
     QuerySamplerParameteriv(samplerObject, pname, params);
 }
 
+void Context::getSamplerParameterIiv(GLuint sampler, GLenum pname, GLint *params)
+{
+    const Sampler *const samplerObject =
+        mState.mSamplers->checkSamplerAllocation(mImplementation.get(), sampler);
+    QuerySamplerParameterIiv(samplerObject, pname, params);
+}
+
+void Context::getSamplerParameterIuiv(GLuint sampler, GLenum pname, GLuint *params)
+{
+    const Sampler *const samplerObject =
+        mState.mSamplers->checkSamplerAllocation(mImplementation.get(), sampler);
+    QuerySamplerParameterIuiv(samplerObject, pname, params);
+}
+
 void Context::getSamplerParameterivRobust(GLuint sampler,
                                           GLenum pname,
                                           GLsizei bufSize,
@@ -2963,7 +3017,7 @@
 
 void Context::getSamplerParameterfv(GLuint sampler, GLenum pname, GLfloat *params)
 {
-    const Sampler *samplerObject =
+    const Sampler *const samplerObject =
         mState.mSamplers->checkSamplerAllocation(mImplementation.get(), sampler);
     QuerySamplerParameterfv(samplerObject, pname, params);
 }