GLES1: Texture environments setup

- Revise entry point definitions to use packed enums

BUG=angleproject:2306

Change-Id: I06ad95f475d1dbaf07ec24ff2544503c4a44e826
Reviewed-on: https://chromium-review.googlesource.com/1090996
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Lingfeng Yang <lfy@google.com>
diff --git a/src/common/PackedGLEnums_autogen.cpp b/src/common/PackedGLEnums_autogen.cpp
index c79831a..b578d46 100644
--- a/src/common/PackedGLEnums_autogen.cpp
+++ b/src/common/PackedGLEnums_autogen.cpp
@@ -824,6 +824,74 @@
 }
 
 template <>
+TextureEnvParameter FromGLenum<TextureEnvParameter>(GLenum from)
+{
+    switch (from)
+    {
+        case GL_TEXTURE_ENV_MODE:
+            return TextureEnvParameter::Mode;
+        case GL_TEXTURE_ENV_COLOR:
+            return TextureEnvParameter::Color;
+        case GL_COMBINE_RGB:
+            return TextureEnvParameter::CombineRgb;
+        case GL_COMBINE_ALPHA:
+            return TextureEnvParameter::CombineAlpha;
+        case GL_RGB_SCALE:
+            return TextureEnvParameter::RgbScale;
+        case GL_ALPHA_SCALE:
+            return TextureEnvParameter::AlphaScale;
+        default:
+            return TextureEnvParameter::InvalidEnum;
+    }
+}
+
+GLenum ToGLenum(TextureEnvParameter from)
+{
+    switch (from)
+    {
+        case TextureEnvParameter::Mode:
+            return GL_TEXTURE_ENV_MODE;
+        case TextureEnvParameter::Color:
+            return GL_TEXTURE_ENV_COLOR;
+        case TextureEnvParameter::CombineRgb:
+            return GL_COMBINE_RGB;
+        case TextureEnvParameter::CombineAlpha:
+            return GL_COMBINE_ALPHA;
+        case TextureEnvParameter::RgbScale:
+            return GL_RGB_SCALE;
+        case TextureEnvParameter::AlphaScale:
+            return GL_ALPHA_SCALE;
+        default:
+            UNREACHABLE();
+            return 0;
+    }
+}
+
+template <>
+TextureEnvTarget FromGLenum<TextureEnvTarget>(GLenum from)
+{
+    switch (from)
+    {
+        case GL_TEXTURE_ENV:
+            return TextureEnvTarget::Env;
+        default:
+            return TextureEnvTarget::InvalidEnum;
+    }
+}
+
+GLenum ToGLenum(TextureEnvTarget from)
+{
+    switch (from)
+    {
+        case TextureEnvTarget::Env:
+            return GL_TEXTURE_ENV;
+        default:
+            UNREACHABLE();
+            return 0;
+    }
+}
+
+template <>
 TextureOp FromGLenum<TextureOp>(GLenum from)
 {
     switch (from)
diff --git a/src/common/PackedGLEnums_autogen.h b/src/common/PackedGLEnums_autogen.h
index 1ffe2a7..98642dd 100644
--- a/src/common/PackedGLEnums_autogen.h
+++ b/src/common/PackedGLEnums_autogen.h
@@ -328,6 +328,35 @@
 TextureEnvMode FromGLenum<TextureEnvMode>(GLenum from);
 GLenum ToGLenum(TextureEnvMode from);
 
+enum class TextureEnvParameter : uint8_t
+{
+    Mode         = 0,
+    Color        = 1,
+    CombineRgb   = 2,
+    CombineAlpha = 3,
+    RgbScale     = 4,
+    AlphaScale   = 5,
+
+    InvalidEnum = 6,
+    EnumCount   = 6,
+};
+
+template <>
+TextureEnvParameter FromGLenum<TextureEnvParameter>(GLenum from);
+GLenum ToGLenum(TextureEnvParameter from);
+
+enum class TextureEnvTarget : uint8_t
+{
+    Env = 0,
+
+    InvalidEnum = 1,
+    EnumCount   = 1,
+};
+
+template <>
+TextureEnvTarget FromGLenum<TextureEnvTarget>(GLenum from);
+GLenum ToGLenum(TextureEnvTarget from);
+
 enum class TextureOp : uint8_t
 {
     OneMinusSrcAlpha = 0,
diff --git a/src/common/packed_gl_enums.json b/src/common/packed_gl_enums.json
index e385b1a..04fe239 100644
--- a/src/common/packed_gl_enums.json
+++ b/src/common/packed_gl_enums.json
@@ -130,6 +130,19 @@
         "Modulate": "GL_MODULATE",
         "Replace": "GL_REPLACE"
     },
+    "TextureEnvTarget":
+    {
+        "Env": "GL_TEXTURE_ENV"
+    },
+    "TextureEnvParameter":
+    {
+        "Mode": "GL_TEXTURE_ENV_MODE",
+        "Color": "GL_TEXTURE_ENV_COLOR",
+        "CombineRgb": "GL_COMBINE_RGB",
+        "CombineAlpha": "GL_COMBINE_ALPHA",
+        "RgbScale": "GL_RGB_SCALE",
+        "AlphaScale": "GL_ALPHA_SCALE"
+    },
     "TextureOp":
     {
         "OneMinusSrcAlpha": "GL_ONE_MINUS_SRC_ALPHA",
diff --git a/src/libANGLE/Context_gles_1_0.cpp b/src/libANGLE/Context_gles_1_0.cpp
index 6afd53b..6cce051 100644
--- a/src/libANGLE/Context_gles_1_0.cpp
+++ b/src/libANGLE/Context_gles_1_0.cpp
@@ -224,17 +224,17 @@
     }
 }
 
-void Context::getTexEnvfv(GLenum env, GLenum pname, GLfloat *params)
+void Context::getTexEnvfv(TextureEnvTarget env, TextureEnvParameter pname, GLfloat *params)
 {
     UNIMPLEMENTED();
 }
 
-void Context::getTexEnviv(GLenum env, GLenum pname, GLint *params)
+void Context::getTexEnviv(TextureEnvTarget env, TextureEnvParameter pname, GLint *params)
 {
     UNIMPLEMENTED();
 }
 
-void Context::getTexEnvxv(GLenum target, GLenum pname, GLfixed *params)
+void Context::getTexEnvxv(TextureEnvTarget target, TextureEnvParameter pname, GLfixed *params)
 {
     UNIMPLEMENTED();
 }
@@ -496,32 +496,32 @@
                         stride, ptr);
 }
 
-void Context::texEnvf(GLenum target, GLenum pname, GLfloat param)
+void Context::texEnvf(TextureEnvTarget target, TextureEnvParameter pname, GLfloat param)
 {
     UNIMPLEMENTED();
 }
 
-void Context::texEnvfv(GLenum target, GLenum pname, const GLfloat *params)
+void Context::texEnvfv(TextureEnvTarget target, TextureEnvParameter pname, const GLfloat *params)
 {
     UNIMPLEMENTED();
 }
 
-void Context::texEnvi(GLenum target, GLenum pname, GLint param)
+void Context::texEnvi(TextureEnvTarget target, TextureEnvParameter pname, GLint param)
 {
     UNIMPLEMENTED();
 }
 
-void Context::texEnviv(GLenum target, GLenum pname, const GLint *params)
+void Context::texEnviv(TextureEnvTarget target, TextureEnvParameter pname, const GLint *params)
 {
     UNIMPLEMENTED();
 }
 
-void Context::texEnvx(GLenum target, GLenum pname, GLfixed param)
+void Context::texEnvx(TextureEnvTarget target, TextureEnvParameter pname, GLfixed param)
 {
     UNIMPLEMENTED();
 }
 
-void Context::texEnvxv(GLenum target, GLenum pname, const GLfixed *params)
+void Context::texEnvxv(TextureEnvTarget target, TextureEnvParameter pname, const GLfixed *params)
 {
     UNIMPLEMENTED();
 }
diff --git a/src/libANGLE/Context_gles_1_0_autogen.h b/src/libANGLE/Context_gles_1_0_autogen.h
index fbde893..342cf5a 100644
--- a/src/libANGLE/Context_gles_1_0_autogen.h
+++ b/src/libANGLE/Context_gles_1_0_autogen.h
@@ -10,120 +10,126 @@
 #ifndef ANGLE_CONTEXT_GLES_1_0_AUTOGEN_H_
 #define ANGLE_CONTEXT_GLES_1_0_AUTOGEN_H_
 
-#define ANGLE_GLES1_CONTEXT_API                                                            \
-    void alphaFunc(AlphaTestFunc funcPacked, GLfloat ref);                                 \
-    void alphaFuncx(AlphaTestFunc funcPacked, GLfixed ref);                                \
-    void clearColorx(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);             \
-    void clearDepthx(GLfixed depth);                                                       \
-    void clientActiveTexture(GLenum texture);                                              \
-    void clipPlanef(GLenum p, const GLfloat *eqn);                                         \
-    void clipPlanex(GLenum plane, const GLfixed *equation);                                \
-    void color4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);                 \
-    void color4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);                \
-    void color4x(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);                 \
-    void colorPointer(GLint size, GLenum type, GLsizei stride, const void *pointer);       \
-    void depthRangex(GLfixed n, GLfixed f);                                                \
-    void disableClientState(ClientVertexArrayType arrayPacked);                            \
-    void enableClientState(ClientVertexArrayType arrayPacked);                             \
-    void fogf(GLenum pname, GLfloat param);                                                \
-    void fogfv(GLenum pname, const GLfloat *params);                                       \
-    void fogx(GLenum pname, GLfixed param);                                                \
-    void fogxv(GLenum pname, const GLfixed *param);                                        \
-    void frustumf(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f);       \
-    void frustumx(GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f);       \
-    void getClipPlanef(GLenum plane, GLfloat *equation);                                   \
-    void getClipPlanex(GLenum plane, GLfixed *equation);                                   \
-    void getFixedv(GLenum pname, GLfixed *params);                                         \
-    void getLightfv(GLenum light, LightParameter pnamePacked, GLfloat *params);            \
-    void getLightxv(GLenum light, LightParameter pnamePacked, GLfixed *params);            \
-    void getMaterialfv(GLenum face, MaterialParameter pnamePacked, GLfloat *params);       \
-    void getMaterialxv(GLenum face, MaterialParameter pnamePacked, GLfixed *params);       \
-    void getTexEnvfv(GLenum target, GLenum pname, GLfloat *params);                        \
-    void getTexEnviv(GLenum target, GLenum pname, GLint *params);                          \
-    void getTexEnvxv(GLenum target, GLenum pname, GLfixed *params);                        \
-    void getTexParameterxv(TextureType targetPacked, GLenum pname, GLfixed *params);       \
-    void lightModelf(GLenum pname, GLfloat param);                                         \
-    void lightModelfv(GLenum pname, const GLfloat *params);                                \
-    void lightModelx(GLenum pname, GLfixed param);                                         \
-    void lightModelxv(GLenum pname, const GLfixed *param);                                 \
-    void lightf(GLenum light, LightParameter pnamePacked, GLfloat param);                  \
-    void lightfv(GLenum light, LightParameter pnamePacked, const GLfloat *params);         \
-    void lightx(GLenum light, LightParameter pnamePacked, GLfixed param);                  \
-    void lightxv(GLenum light, LightParameter pnamePacked, const GLfixed *params);         \
-    void lineWidthx(GLfixed width);                                                        \
-    void loadIdentity();                                                                   \
-    void loadMatrixf(const GLfloat *m);                                                    \
-    void loadMatrixx(const GLfixed *m);                                                    \
-    void logicOp(GLenum opcode);                                                           \
-    void materialf(GLenum face, MaterialParameter pnamePacked, GLfloat param);             \
-    void materialfv(GLenum face, MaterialParameter pnamePacked, const GLfloat *params);    \
-    void materialx(GLenum face, MaterialParameter pnamePacked, GLfixed param);             \
-    void materialxv(GLenum face, MaterialParameter pnamePacked, const GLfixed *param);     \
-    void matrixMode(MatrixType modePacked);                                                \
-    void multMatrixf(const GLfloat *m);                                                    \
-    void multMatrixx(const GLfixed *m);                                                    \
-    void multiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);       \
-    void multiTexCoord4x(GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q);      \
-    void normal3f(GLfloat nx, GLfloat ny, GLfloat nz);                                     \
-    void normal3x(GLfixed nx, GLfixed ny, GLfixed nz);                                     \
-    void normalPointer(GLenum type, GLsizei stride, const void *pointer);                  \
-    void orthof(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f);         \
-    void orthox(GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f);         \
-    void pointParameterf(GLenum pname, GLfloat param);                                     \
-    void pointParameterfv(GLenum pname, const GLfloat *params);                            \
-    void pointParameterx(GLenum pname, GLfixed param);                                     \
-    void pointParameterxv(GLenum pname, const GLfixed *params);                            \
-    void pointSize(GLfloat size);                                                          \
-    void pointSizex(GLfixed size);                                                         \
-    void polygonOffsetx(GLfixed factor, GLfixed units);                                    \
-    void popMatrix();                                                                      \
-    void pushMatrix();                                                                     \
-    void rotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);                          \
-    void rotatex(GLfixed angle, GLfixed x, GLfixed y, GLfixed z);                          \
-    void sampleCoveragex(GLclampx value, GLboolean invert);                                \
-    void scalef(GLfloat x, GLfloat y, GLfloat z);                                          \
-    void scalex(GLfixed x, GLfixed y, GLfixed z);                                          \
-    void shadeModel(ShadingModel modePacked);                                              \
-    void texCoordPointer(GLint size, GLenum type, GLsizei stride, const void *pointer);    \
-    void texEnvf(GLenum target, GLenum pname, GLfloat param);                              \
-    void texEnvfv(GLenum target, GLenum pname, const GLfloat *params);                     \
-    void texEnvi(GLenum target, GLenum pname, GLint param);                                \
-    void texEnviv(GLenum target, GLenum pname, const GLint *params);                       \
-    void texEnvx(GLenum target, GLenum pname, GLfixed param);                              \
-    void texEnvxv(GLenum target, GLenum pname, const GLfixed *params);                     \
-    void texParameterx(TextureType targetPacked, GLenum pname, GLfixed param);             \
-    void texParameterxv(TextureType targetPacked, GLenum pname, const GLfixed *params);    \
-    void translatef(GLfloat x, GLfloat y, GLfloat z);                                      \
-    void translatex(GLfixed x, GLfixed y, GLfixed z);                                      \
-    void vertexPointer(GLint size, GLenum type, GLsizei stride, const void *pointer);      \
-    /* GL_OES_draw_texture */                                                              \
-    void drawTexf(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height);         \
-    void drawTexfv(const GLfloat *coords);                                                 \
-    void drawTexi(GLint x, GLint y, GLint z, GLint width, GLint height);                   \
-    void drawTexiv(const GLint *coords);                                                   \
-    void drawTexs(GLshort x, GLshort y, GLshort z, GLshort width, GLshort height);         \
-    void drawTexsv(const GLshort *coords);                                                 \
-    void drawTexx(GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height);         \
-    void drawTexxv(const GLfixed *coords);                                                 \
-    /* GL_OES_framebuffer_object */                                                        \
-    /* GL_OES_matrix_palette */                                                            \
-    void currentPaletteMatrix(GLuint matrixpaletteindex);                                  \
-    void loadPaletteFromModelViewMatrix();                                                 \
-    void matrixIndexPointer(GLint size, GLenum type, GLsizei stride, const void *pointer); \
-    void weightPointer(GLint size, GLenum type, GLsizei stride, const void *pointer);      \
-    /* GL_OES_point_size_array */                                                          \
-    void pointSizePointer(GLenum type, GLsizei stride, const void *pointer);               \
-    /* GL_OES_query_matrix */                                                              \
-    GLbitfield queryMatrixx(GLfixed *mantissa, GLint *exponent);                           \
-    /* GL_OES_texture_cube_map */                                                          \
-    void getTexGenfv(GLenum coord, GLenum pname, GLfloat *params);                         \
-    void getTexGeniv(GLenum coord, GLenum pname, GLint *params);                           \
-    void getTexGenxv(GLenum coord, GLenum pname, GLfixed *params);                         \
-    void texGenf(GLenum coord, GLenum pname, GLfloat param);                               \
-    void texGenfv(GLenum coord, GLenum pname, const GLfloat *params);                      \
-    void texGeni(GLenum coord, GLenum pname, GLint param);                                 \
-    void texGeniv(GLenum coord, GLenum pname, const GLint *params);                        \
-    void texGenx(GLenum coord, GLenum pname, GLfixed param);                               \
+#define ANGLE_GLES1_CONTEXT_API                                                                  \
+    void alphaFunc(AlphaTestFunc funcPacked, GLfloat ref);                                       \
+    void alphaFuncx(AlphaTestFunc funcPacked, GLfixed ref);                                      \
+    void clearColorx(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);                   \
+    void clearDepthx(GLfixed depth);                                                             \
+    void clientActiveTexture(GLenum texture);                                                    \
+    void clipPlanef(GLenum p, const GLfloat *eqn);                                               \
+    void clipPlanex(GLenum plane, const GLfixed *equation);                                      \
+    void color4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);                       \
+    void color4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);                      \
+    void color4x(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);                       \
+    void colorPointer(GLint size, GLenum type, GLsizei stride, const void *pointer);             \
+    void depthRangex(GLfixed n, GLfixed f);                                                      \
+    void disableClientState(ClientVertexArrayType arrayPacked);                                  \
+    void enableClientState(ClientVertexArrayType arrayPacked);                                   \
+    void fogf(GLenum pname, GLfloat param);                                                      \
+    void fogfv(GLenum pname, const GLfloat *params);                                             \
+    void fogx(GLenum pname, GLfixed param);                                                      \
+    void fogxv(GLenum pname, const GLfixed *param);                                              \
+    void frustumf(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f);             \
+    void frustumx(GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f);             \
+    void getClipPlanef(GLenum plane, GLfloat *equation);                                         \
+    void getClipPlanex(GLenum plane, GLfixed *equation);                                         \
+    void getFixedv(GLenum pname, GLfixed *params);                                               \
+    void getLightfv(GLenum light, LightParameter pnamePacked, GLfloat *params);                  \
+    void getLightxv(GLenum light, LightParameter pnamePacked, GLfixed *params);                  \
+    void getMaterialfv(GLenum face, MaterialParameter pnamePacked, GLfloat *params);             \
+    void getMaterialxv(GLenum face, MaterialParameter pnamePacked, GLfixed *params);             \
+    void getTexEnvfv(TextureEnvTarget targetPacked, TextureEnvParameter pnamePacked,             \
+                     GLfloat *params);                                                           \
+    void getTexEnviv(TextureEnvTarget targetPacked, TextureEnvParameter pnamePacked,             \
+                     GLint *params);                                                             \
+    void getTexEnvxv(TextureEnvTarget targetPacked, TextureEnvParameter pnamePacked,             \
+                     GLfixed *params);                                                           \
+    void getTexParameterxv(TextureType targetPacked, GLenum pname, GLfixed *params);             \
+    void lightModelf(GLenum pname, GLfloat param);                                               \
+    void lightModelfv(GLenum pname, const GLfloat *params);                                      \
+    void lightModelx(GLenum pname, GLfixed param);                                               \
+    void lightModelxv(GLenum pname, const GLfixed *param);                                       \
+    void lightf(GLenum light, LightParameter pnamePacked, GLfloat param);                        \
+    void lightfv(GLenum light, LightParameter pnamePacked, const GLfloat *params);               \
+    void lightx(GLenum light, LightParameter pnamePacked, GLfixed param);                        \
+    void lightxv(GLenum light, LightParameter pnamePacked, const GLfixed *params);               \
+    void lineWidthx(GLfixed width);                                                              \
+    void loadIdentity();                                                                         \
+    void loadMatrixf(const GLfloat *m);                                                          \
+    void loadMatrixx(const GLfixed *m);                                                          \
+    void logicOp(GLenum opcode);                                                                 \
+    void materialf(GLenum face, MaterialParameter pnamePacked, GLfloat param);                   \
+    void materialfv(GLenum face, MaterialParameter pnamePacked, const GLfloat *params);          \
+    void materialx(GLenum face, MaterialParameter pnamePacked, GLfixed param);                   \
+    void materialxv(GLenum face, MaterialParameter pnamePacked, const GLfixed *param);           \
+    void matrixMode(MatrixType modePacked);                                                      \
+    void multMatrixf(const GLfloat *m);                                                          \
+    void multMatrixx(const GLfixed *m);                                                          \
+    void multiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);             \
+    void multiTexCoord4x(GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q);            \
+    void normal3f(GLfloat nx, GLfloat ny, GLfloat nz);                                           \
+    void normal3x(GLfixed nx, GLfixed ny, GLfixed nz);                                           \
+    void normalPointer(GLenum type, GLsizei stride, const void *pointer);                        \
+    void orthof(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f);               \
+    void orthox(GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f);               \
+    void pointParameterf(GLenum pname, GLfloat param);                                           \
+    void pointParameterfv(GLenum pname, const GLfloat *params);                                  \
+    void pointParameterx(GLenum pname, GLfixed param);                                           \
+    void pointParameterxv(GLenum pname, const GLfixed *params);                                  \
+    void pointSize(GLfloat size);                                                                \
+    void pointSizex(GLfixed size);                                                               \
+    void polygonOffsetx(GLfixed factor, GLfixed units);                                          \
+    void popMatrix();                                                                            \
+    void pushMatrix();                                                                           \
+    void rotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);                                \
+    void rotatex(GLfixed angle, GLfixed x, GLfixed y, GLfixed z);                                \
+    void sampleCoveragex(GLclampx value, GLboolean invert);                                      \
+    void scalef(GLfloat x, GLfloat y, GLfloat z);                                                \
+    void scalex(GLfixed x, GLfixed y, GLfixed z);                                                \
+    void shadeModel(ShadingModel modePacked);                                                    \
+    void texCoordPointer(GLint size, GLenum type, GLsizei stride, const void *pointer);          \
+    void texEnvf(TextureEnvTarget targetPacked, TextureEnvParameter pnamePacked, GLfloat param); \
+    void texEnvfv(TextureEnvTarget targetPacked, TextureEnvParameter pnamePacked,                \
+                  const GLfloat *params);                                                        \
+    void texEnvi(TextureEnvTarget targetPacked, TextureEnvParameter pnamePacked, GLint param);   \
+    void texEnviv(TextureEnvTarget targetPacked, TextureEnvParameter pnamePacked,                \
+                  const GLint *params);                                                          \
+    void texEnvx(TextureEnvTarget targetPacked, TextureEnvParameter pnamePacked, GLfixed param); \
+    void texEnvxv(TextureEnvTarget targetPacked, TextureEnvParameter pnamePacked,                \
+                  const GLfixed *params);                                                        \
+    void texParameterx(TextureType targetPacked, GLenum pname, GLfixed param);                   \
+    void texParameterxv(TextureType targetPacked, GLenum pname, const GLfixed *params);          \
+    void translatef(GLfloat x, GLfloat y, GLfloat z);                                            \
+    void translatex(GLfixed x, GLfixed y, GLfixed z);                                            \
+    void vertexPointer(GLint size, GLenum type, GLsizei stride, const void *pointer);            \
+    /* GL_OES_draw_texture */                                                                    \
+    void drawTexf(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height);               \
+    void drawTexfv(const GLfloat *coords);                                                       \
+    void drawTexi(GLint x, GLint y, GLint z, GLint width, GLint height);                         \
+    void drawTexiv(const GLint *coords);                                                         \
+    void drawTexs(GLshort x, GLshort y, GLshort z, GLshort width, GLshort height);               \
+    void drawTexsv(const GLshort *coords);                                                       \
+    void drawTexx(GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height);               \
+    void drawTexxv(const GLfixed *coords);                                                       \
+    /* GL_OES_framebuffer_object */                                                              \
+    /* GL_OES_matrix_palette */                                                                  \
+    void currentPaletteMatrix(GLuint matrixpaletteindex);                                        \
+    void loadPaletteFromModelViewMatrix();                                                       \
+    void matrixIndexPointer(GLint size, GLenum type, GLsizei stride, const void *pointer);       \
+    void weightPointer(GLint size, GLenum type, GLsizei stride, const void *pointer);            \
+    /* GL_OES_point_size_array */                                                                \
+    void pointSizePointer(GLenum type, GLsizei stride, const void *pointer);                     \
+    /* GL_OES_query_matrix */                                                                    \
+    GLbitfield queryMatrixx(GLfixed *mantissa, GLint *exponent);                                 \
+    /* GL_OES_texture_cube_map */                                                                \
+    void getTexGenfv(GLenum coord, GLenum pname, GLfloat *params);                               \
+    void getTexGeniv(GLenum coord, GLenum pname, GLint *params);                                 \
+    void getTexGenxv(GLenum coord, GLenum pname, GLfixed *params);                               \
+    void texGenf(GLenum coord, GLenum pname, GLfloat param);                                     \
+    void texGenfv(GLenum coord, GLenum pname, const GLfloat *params);                            \
+    void texGeni(GLenum coord, GLenum pname, GLint param);                                       \
+    void texGeniv(GLenum coord, GLenum pname, const GLint *params);                              \
+    void texGenx(GLenum coord, GLenum pname, GLfixed param);                                     \
     void texGenxv(GLenum coord, GLenum pname, const GLfixed *params);
 
 #endif  // ANGLE_CONTEXT_API_1_0_AUTOGEN_H_
diff --git a/src/libANGLE/validationES1.cpp b/src/libANGLE/validationES1.cpp
index 8183715..64638eb 100644
--- a/src/libANGLE/validationES1.cpp
+++ b/src/libANGLE/validationES1.cpp
@@ -587,19 +587,28 @@
     }
 }
 
-bool ValidateGetTexEnvfv(Context *context, GLenum target, GLenum pname, GLfloat *params)
+bool ValidateGetTexEnvfv(Context *context,
+                         TextureEnvTarget target,
+                         TextureEnvParameter pname,
+                         GLfloat *params)
 {
     UNIMPLEMENTED();
     return true;
 }
 
-bool ValidateGetTexEnviv(Context *context, GLenum target, GLenum pname, GLint *params)
+bool ValidateGetTexEnviv(Context *context,
+                         TextureEnvTarget target,
+                         TextureEnvParameter pname,
+                         GLint *params)
 {
     UNIMPLEMENTED();
     return true;
 }
 
-bool ValidateGetTexEnvxv(Context *context, GLenum target, GLenum pname, GLfixed *params)
+bool ValidateGetTexEnvxv(Context *context,
+                         TextureEnvTarget target,
+                         TextureEnvParameter pname,
+                         GLfixed *params)
 {
     UNIMPLEMENTED();
     return true;
@@ -939,37 +948,55 @@
                                                 type, stride, pointer);
 }
 
-bool ValidateTexEnvf(Context *context, GLenum target, GLenum pname, GLfloat param)
+bool ValidateTexEnvf(Context *context,
+                     TextureEnvTarget target,
+                     TextureEnvParameter pname,
+                     GLfloat param)
 {
     UNIMPLEMENTED();
     return true;
 }
 
-bool ValidateTexEnvfv(Context *context, GLenum target, GLenum pname, const GLfloat *params)
+bool ValidateTexEnvfv(Context *context,
+                      TextureEnvTarget target,
+                      TextureEnvParameter pname,
+                      const GLfloat *params)
 {
     UNIMPLEMENTED();
     return true;
 }
 
-bool ValidateTexEnvi(Context *context, GLenum target, GLenum pname, GLint param)
+bool ValidateTexEnvi(Context *context,
+                     TextureEnvTarget target,
+                     TextureEnvParameter pname,
+                     GLint param)
 {
     UNIMPLEMENTED();
     return true;
 }
 
-bool ValidateTexEnviv(Context *context, GLenum target, GLenum pname, const GLint *params)
+bool ValidateTexEnviv(Context *context,
+                      TextureEnvTarget target,
+                      TextureEnvParameter pname,
+                      const GLint *params)
 {
     UNIMPLEMENTED();
     return true;
 }
 
-bool ValidateTexEnvx(Context *context, GLenum target, GLenum pname, GLfixed param)
+bool ValidateTexEnvx(Context *context,
+                     TextureEnvTarget target,
+                     TextureEnvParameter pname,
+                     GLfixed param)
 {
     UNIMPLEMENTED();
     return true;
 }
 
-bool ValidateTexEnvxv(Context *context, GLenum target, GLenum pname, const GLfixed *params)
+bool ValidateTexEnvxv(Context *context,
+                      TextureEnvTarget target,
+                      TextureEnvParameter pname,
+                      const GLfixed *params)
 {
     UNIMPLEMENTED();
     return true;
diff --git a/src/libANGLE/validationES1.h b/src/libANGLE/validationES1.h
index 6c3b593..dfdbf46 100644
--- a/src/libANGLE/validationES1.h
+++ b/src/libANGLE/validationES1.h
@@ -64,9 +64,18 @@
 bool ValidateGetMaterialfv(Context *context, GLenum face, MaterialParameter pname, GLfloat *params);
 bool ValidateGetMaterialxv(Context *context, GLenum face, MaterialParameter pname, GLfixed *params);
 bool ValidateGetPointerv(Context *context, GLenum pname, void **params);
-bool ValidateGetTexEnvfv(Context *context, GLenum target, GLenum pname, GLfloat *params);
-bool ValidateGetTexEnviv(Context *context, GLenum target, GLenum pname, GLint *params);
-bool ValidateGetTexEnvxv(Context *context, GLenum target, GLenum pname, GLfixed *params);
+bool ValidateGetTexEnvfv(Context *context,
+                         TextureEnvTarget target,
+                         TextureEnvParameter pname,
+                         GLfloat *params);
+bool ValidateGetTexEnviv(Context *context,
+                         TextureEnvTarget target,
+                         TextureEnvParameter pname,
+                         GLint *params);
+bool ValidateGetTexEnvxv(Context *context,
+                         TextureEnvTarget target,
+                         TextureEnvParameter pname,
+                         GLfixed *params);
 bool ValidateGetTexParameterxv(Context *context, TextureType target, GLenum pname, GLfixed *params);
 bool ValidateLightModelf(Context *context, GLenum pname, GLfloat param);
 bool ValidateLightModelfv(Context *context, GLenum pname, const GLfloat *params);
@@ -143,12 +152,30 @@
                              GLenum type,
                              GLsizei stride,
                              const void *pointer);
-bool ValidateTexEnvf(Context *context, GLenum target, GLenum pname, GLfloat param);
-bool ValidateTexEnvfv(Context *context, GLenum target, GLenum pname, const GLfloat *params);
-bool ValidateTexEnvi(Context *context, GLenum target, GLenum pname, GLint param);
-bool ValidateTexEnviv(Context *context, GLenum target, GLenum pname, const GLint *params);
-bool ValidateTexEnvx(Context *context, GLenum target, GLenum pname, GLfixed param);
-bool ValidateTexEnvxv(Context *context, GLenum target, GLenum pname, const GLfixed *params);
+bool ValidateTexEnvf(Context *context,
+                     TextureEnvTarget target,
+                     TextureEnvParameter pname,
+                     GLfloat param);
+bool ValidateTexEnvfv(Context *context,
+                      TextureEnvTarget target,
+                      TextureEnvParameter pname,
+                      const GLfloat *params);
+bool ValidateTexEnvi(Context *context,
+                     TextureEnvTarget target,
+                     TextureEnvParameter pname,
+                     GLint param);
+bool ValidateTexEnviv(Context *context,
+                      TextureEnvTarget target,
+                      TextureEnvParameter pname,
+                      const GLint *params);
+bool ValidateTexEnvx(Context *context,
+                     TextureEnvTarget target,
+                     TextureEnvParameter pname,
+                     GLfixed param);
+bool ValidateTexEnvxv(Context *context,
+                      TextureEnvTarget target,
+                      TextureEnvParameter pname,
+                      const GLfixed *params);
 bool ValidateTexParameterx(Context *context, TextureType target, GLenum pname, GLfixed param);
 bool ValidateTexParameterxv(Context *context,
                             TextureType target,
diff --git a/src/libGLESv2/entry_points_gles_1_0_autogen.cpp b/src/libGLESv2/entry_points_gles_1_0_autogen.cpp
index a677c10..e130b3d 100644
--- a/src/libGLESv2/entry_points_gles_1_0_autogen.cpp
+++ b/src/libGLESv2/entry_points_gles_1_0_autogen.cpp
@@ -496,11 +496,14 @@
     Context *context = GetValidGlobalContext();
     if (context)
     {
-        context->gatherParams<EntryPoint::GetTexEnvfv>(target, pname, params);
+        TextureEnvTarget targetPacked   = FromGLenum<TextureEnvTarget>(target);
+        TextureEnvParameter pnamePacked = FromGLenum<TextureEnvParameter>(pname);
+        context->gatherParams<EntryPoint::GetTexEnvfv>(targetPacked, pnamePacked, params);
 
-        if (context->skipValidation() || ValidateGetTexEnvfv(context, target, pname, params))
+        if (context->skipValidation() ||
+            ValidateGetTexEnvfv(context, targetPacked, pnamePacked, params))
         {
-            context->getTexEnvfv(target, pname, params);
+            context->getTexEnvfv(targetPacked, pnamePacked, params);
         }
     }
 }
@@ -513,11 +516,14 @@
     Context *context = GetValidGlobalContext();
     if (context)
     {
-        context->gatherParams<EntryPoint::GetTexEnviv>(target, pname, params);
+        TextureEnvTarget targetPacked   = FromGLenum<TextureEnvTarget>(target);
+        TextureEnvParameter pnamePacked = FromGLenum<TextureEnvParameter>(pname);
+        context->gatherParams<EntryPoint::GetTexEnviv>(targetPacked, pnamePacked, params);
 
-        if (context->skipValidation() || ValidateGetTexEnviv(context, target, pname, params))
+        if (context->skipValidation() ||
+            ValidateGetTexEnviv(context, targetPacked, pnamePacked, params))
         {
-            context->getTexEnviv(target, pname, params);
+            context->getTexEnviv(targetPacked, pnamePacked, params);
         }
     }
 }
@@ -530,11 +536,14 @@
     Context *context = GetValidGlobalContext();
     if (context)
     {
-        context->gatherParams<EntryPoint::GetTexEnvxv>(target, pname, params);
+        TextureEnvTarget targetPacked   = FromGLenum<TextureEnvTarget>(target);
+        TextureEnvParameter pnamePacked = FromGLenum<TextureEnvParameter>(pname);
+        context->gatherParams<EntryPoint::GetTexEnvxv>(targetPacked, pnamePacked, params);
 
-        if (context->skipValidation() || ValidateGetTexEnvxv(context, target, pname, params))
+        if (context->skipValidation() ||
+            ValidateGetTexEnvxv(context, targetPacked, pnamePacked, params))
         {
-            context->getTexEnvxv(target, pname, params);
+            context->getTexEnvxv(targetPacked, pnamePacked, params);
         }
     }
 }
@@ -1282,11 +1291,13 @@
     Context *context = GetValidGlobalContext();
     if (context)
     {
-        context->gatherParams<EntryPoint::TexEnvf>(target, pname, param);
+        TextureEnvTarget targetPacked   = FromGLenum<TextureEnvTarget>(target);
+        TextureEnvParameter pnamePacked = FromGLenum<TextureEnvParameter>(pname);
+        context->gatherParams<EntryPoint::TexEnvf>(targetPacked, pnamePacked, param);
 
-        if (context->skipValidation() || ValidateTexEnvf(context, target, pname, param))
+        if (context->skipValidation() || ValidateTexEnvf(context, targetPacked, pnamePacked, param))
         {
-            context->texEnvf(target, pname, param);
+            context->texEnvf(targetPacked, pnamePacked, param);
         }
     }
 }
@@ -1299,11 +1310,14 @@
     Context *context = GetValidGlobalContext();
     if (context)
     {
-        context->gatherParams<EntryPoint::TexEnvfv>(target, pname, params);
+        TextureEnvTarget targetPacked   = FromGLenum<TextureEnvTarget>(target);
+        TextureEnvParameter pnamePacked = FromGLenum<TextureEnvParameter>(pname);
+        context->gatherParams<EntryPoint::TexEnvfv>(targetPacked, pnamePacked, params);
 
-        if (context->skipValidation() || ValidateTexEnvfv(context, target, pname, params))
+        if (context->skipValidation() ||
+            ValidateTexEnvfv(context, targetPacked, pnamePacked, params))
         {
-            context->texEnvfv(target, pname, params);
+            context->texEnvfv(targetPacked, pnamePacked, params);
         }
     }
 }
@@ -1315,11 +1329,13 @@
     Context *context = GetValidGlobalContext();
     if (context)
     {
-        context->gatherParams<EntryPoint::TexEnvi>(target, pname, param);
+        TextureEnvTarget targetPacked   = FromGLenum<TextureEnvTarget>(target);
+        TextureEnvParameter pnamePacked = FromGLenum<TextureEnvParameter>(pname);
+        context->gatherParams<EntryPoint::TexEnvi>(targetPacked, pnamePacked, param);
 
-        if (context->skipValidation() || ValidateTexEnvi(context, target, pname, param))
+        if (context->skipValidation() || ValidateTexEnvi(context, targetPacked, pnamePacked, param))
         {
-            context->texEnvi(target, pname, param);
+            context->texEnvi(targetPacked, pnamePacked, param);
         }
     }
 }
@@ -1332,11 +1348,14 @@
     Context *context = GetValidGlobalContext();
     if (context)
     {
-        context->gatherParams<EntryPoint::TexEnviv>(target, pname, params);
+        TextureEnvTarget targetPacked   = FromGLenum<TextureEnvTarget>(target);
+        TextureEnvParameter pnamePacked = FromGLenum<TextureEnvParameter>(pname);
+        context->gatherParams<EntryPoint::TexEnviv>(targetPacked, pnamePacked, params);
 
-        if (context->skipValidation() || ValidateTexEnviv(context, target, pname, params))
+        if (context->skipValidation() ||
+            ValidateTexEnviv(context, targetPacked, pnamePacked, params))
         {
-            context->texEnviv(target, pname, params);
+            context->texEnviv(targetPacked, pnamePacked, params);
         }
     }
 }
@@ -1349,11 +1368,13 @@
     Context *context = GetValidGlobalContext();
     if (context)
     {
-        context->gatherParams<EntryPoint::TexEnvx>(target, pname, param);
+        TextureEnvTarget targetPacked   = FromGLenum<TextureEnvTarget>(target);
+        TextureEnvParameter pnamePacked = FromGLenum<TextureEnvParameter>(pname);
+        context->gatherParams<EntryPoint::TexEnvx>(targetPacked, pnamePacked, param);
 
-        if (context->skipValidation() || ValidateTexEnvx(context, target, pname, param))
+        if (context->skipValidation() || ValidateTexEnvx(context, targetPacked, pnamePacked, param))
         {
-            context->texEnvx(target, pname, param);
+            context->texEnvx(targetPacked, pnamePacked, param);
         }
     }
 }
@@ -1366,11 +1387,14 @@
     Context *context = GetValidGlobalContext();
     if (context)
     {
-        context->gatherParams<EntryPoint::TexEnvxv>(target, pname, params);
+        TextureEnvTarget targetPacked   = FromGLenum<TextureEnvTarget>(target);
+        TextureEnvParameter pnamePacked = FromGLenum<TextureEnvParameter>(pname);
+        context->gatherParams<EntryPoint::TexEnvxv>(targetPacked, pnamePacked, params);
 
-        if (context->skipValidation() || ValidateTexEnvxv(context, target, pname, params))
+        if (context->skipValidation() ||
+            ValidateTexEnvxv(context, targetPacked, pnamePacked, params))
         {
-            context->texEnvxv(target, pname, params);
+            context->texEnvxv(targetPacked, pnamePacked, params);
         }
     }
 }
diff --git a/src/libGLESv2/entry_points_gles_ext_autogen.cpp b/src/libGLESv2/entry_points_gles_ext_autogen.cpp
index b16d2a0..ca30e82 100644
--- a/src/libGLESv2/entry_points_gles_ext_autogen.cpp
+++ b/src/libGLESv2/entry_points_gles_ext_autogen.cpp
@@ -9306,11 +9306,14 @@
     if (context)
     {
         ASSERT(context == GetValidGlobalContext());
-        context->gatherParams<EntryPoint::GetTexEnvfv>(target, pname, params);
+        TextureEnvTarget targetPacked   = FromGLenum<TextureEnvTarget>(target);
+        TextureEnvParameter pnamePacked = FromGLenum<TextureEnvParameter>(pname);
+        context->gatherParams<EntryPoint::GetTexEnvfv>(targetPacked, pnamePacked, params);
 
-        if (context->skipValidation() || ValidateGetTexEnvfv(context, target, pname, params))
+        if (context->skipValidation() ||
+            ValidateGetTexEnvfv(context, targetPacked, pnamePacked, params))
         {
-            context->getTexEnvfv(target, pname, params);
+            context->getTexEnvfv(targetPacked, pnamePacked, params);
         }
     }
 }
@@ -9327,11 +9330,14 @@
     if (context)
     {
         ASSERT(context == GetValidGlobalContext());
-        context->gatherParams<EntryPoint::GetTexEnviv>(target, pname, params);
+        TextureEnvTarget targetPacked   = FromGLenum<TextureEnvTarget>(target);
+        TextureEnvParameter pnamePacked = FromGLenum<TextureEnvParameter>(pname);
+        context->gatherParams<EntryPoint::GetTexEnviv>(targetPacked, pnamePacked, params);
 
-        if (context->skipValidation() || ValidateGetTexEnviv(context, target, pname, params))
+        if (context->skipValidation() ||
+            ValidateGetTexEnviv(context, targetPacked, pnamePacked, params))
         {
-            context->getTexEnviv(target, pname, params);
+            context->getTexEnviv(targetPacked, pnamePacked, params);
         }
     }
 }
@@ -9348,11 +9354,14 @@
     if (context)
     {
         ASSERT(context == GetValidGlobalContext());
-        context->gatherParams<EntryPoint::GetTexEnvxv>(target, pname, params);
+        TextureEnvTarget targetPacked   = FromGLenum<TextureEnvTarget>(target);
+        TextureEnvParameter pnamePacked = FromGLenum<TextureEnvParameter>(pname);
+        context->gatherParams<EntryPoint::GetTexEnvxv>(targetPacked, pnamePacked, params);
 
-        if (context->skipValidation() || ValidateGetTexEnvxv(context, target, pname, params))
+        if (context->skipValidation() ||
+            ValidateGetTexEnvxv(context, targetPacked, pnamePacked, params))
         {
-            context->getTexEnvxv(target, pname, params);
+            context->getTexEnvxv(targetPacked, pnamePacked, params);
         }
     }
 }
@@ -13002,11 +13011,13 @@
     if (context)
     {
         ASSERT(context == GetValidGlobalContext());
-        context->gatherParams<EntryPoint::TexEnvf>(target, pname, param);
+        TextureEnvTarget targetPacked   = FromGLenum<TextureEnvTarget>(target);
+        TextureEnvParameter pnamePacked = FromGLenum<TextureEnvParameter>(pname);
+        context->gatherParams<EntryPoint::TexEnvf>(targetPacked, pnamePacked, param);
 
-        if (context->skipValidation() || ValidateTexEnvf(context, target, pname, param))
+        if (context->skipValidation() || ValidateTexEnvf(context, targetPacked, pnamePacked, param))
         {
-            context->texEnvf(target, pname, param);
+            context->texEnvf(targetPacked, pnamePacked, param);
         }
     }
 }
@@ -13023,11 +13034,14 @@
     if (context)
     {
         ASSERT(context == GetValidGlobalContext());
-        context->gatherParams<EntryPoint::TexEnvfv>(target, pname, params);
+        TextureEnvTarget targetPacked   = FromGLenum<TextureEnvTarget>(target);
+        TextureEnvParameter pnamePacked = FromGLenum<TextureEnvParameter>(pname);
+        context->gatherParams<EntryPoint::TexEnvfv>(targetPacked, pnamePacked, params);
 
-        if (context->skipValidation() || ValidateTexEnvfv(context, target, pname, params))
+        if (context->skipValidation() ||
+            ValidateTexEnvfv(context, targetPacked, pnamePacked, params))
         {
-            context->texEnvfv(target, pname, params);
+            context->texEnvfv(targetPacked, pnamePacked, params);
         }
     }
 }
@@ -13040,11 +13054,13 @@
     if (context)
     {
         ASSERT(context == GetValidGlobalContext());
-        context->gatherParams<EntryPoint::TexEnvi>(target, pname, param);
+        TextureEnvTarget targetPacked   = FromGLenum<TextureEnvTarget>(target);
+        TextureEnvParameter pnamePacked = FromGLenum<TextureEnvParameter>(pname);
+        context->gatherParams<EntryPoint::TexEnvi>(targetPacked, pnamePacked, param);
 
-        if (context->skipValidation() || ValidateTexEnvi(context, target, pname, param))
+        if (context->skipValidation() || ValidateTexEnvi(context, targetPacked, pnamePacked, param))
         {
-            context->texEnvi(target, pname, param);
+            context->texEnvi(targetPacked, pnamePacked, param);
         }
     }
 }
@@ -13061,11 +13077,14 @@
     if (context)
     {
         ASSERT(context == GetValidGlobalContext());
-        context->gatherParams<EntryPoint::TexEnviv>(target, pname, params);
+        TextureEnvTarget targetPacked   = FromGLenum<TextureEnvTarget>(target);
+        TextureEnvParameter pnamePacked = FromGLenum<TextureEnvParameter>(pname);
+        context->gatherParams<EntryPoint::TexEnviv>(targetPacked, pnamePacked, params);
 
-        if (context->skipValidation() || ValidateTexEnviv(context, target, pname, params))
+        if (context->skipValidation() ||
+            ValidateTexEnviv(context, targetPacked, pnamePacked, params))
         {
-            context->texEnviv(target, pname, params);
+            context->texEnviv(targetPacked, pnamePacked, params);
         }
     }
 }
@@ -13079,11 +13098,13 @@
     if (context)
     {
         ASSERT(context == GetValidGlobalContext());
-        context->gatherParams<EntryPoint::TexEnvx>(target, pname, param);
+        TextureEnvTarget targetPacked   = FromGLenum<TextureEnvTarget>(target);
+        TextureEnvParameter pnamePacked = FromGLenum<TextureEnvParameter>(pname);
+        context->gatherParams<EntryPoint::TexEnvx>(targetPacked, pnamePacked, param);
 
-        if (context->skipValidation() || ValidateTexEnvx(context, target, pname, param))
+        if (context->skipValidation() || ValidateTexEnvx(context, targetPacked, pnamePacked, param))
         {
-            context->texEnvx(target, pname, param);
+            context->texEnvx(targetPacked, pnamePacked, param);
         }
     }
 }
@@ -13100,11 +13121,14 @@
     if (context)
     {
         ASSERT(context == GetValidGlobalContext());
-        context->gatherParams<EntryPoint::TexEnvxv>(target, pname, params);
+        TextureEnvTarget targetPacked   = FromGLenum<TextureEnvTarget>(target);
+        TextureEnvParameter pnamePacked = FromGLenum<TextureEnvParameter>(pname);
+        context->gatherParams<EntryPoint::TexEnvxv>(targetPacked, pnamePacked, params);
 
-        if (context->skipValidation() || ValidateTexEnvxv(context, target, pname, params))
+        if (context->skipValidation() ||
+            ValidateTexEnvxv(context, targetPacked, pnamePacked, params))
         {
-            context->texEnvxv(target, pname, params);
+            context->texEnvxv(targetPacked, pnamePacked, params);
         }
     }
 }