From 00af463e03efd3bf4449420889a892632915fee4 Mon Sep 17 00:00:00 2001 From: Lingfeng Yang Date: Mon, 2 Apr 2018 12:42:24 -0700 Subject: [PATCH] GLES1: Add MatrixType packed enum to entry points (It's not called MatrixMode because that collides with the MatrixMode entry point name) BUG=angleproject:2306 Change-Id: I9a192701f6248f1e7d4f202c7d1ddfcdbe1b0089 Reviewed-on: https://chromium-review.googlesource.com/990585 Commit-Queue: Lingfeng Yang Reviewed-by: Jamie Madill Reviewed-by: Corentin Wallez --- scripts/entry_point_packed_gl_enums.json | 3 +++ src/libANGLE/Context_gles_1_0.cpp | 2 +- src/libANGLE/Context_gles_1_0_autogen.h | 2 +- src/libANGLE/validationES1.cpp | 2 +- src/libANGLE/validationES1.h | 2 +- src/libGLESv2/entry_points_gles_1_0_autogen.cpp | 7 ++++--- 6 files changed, 11 insertions(+), 7 deletions(-) diff --git a/scripts/entry_point_packed_gl_enums.json b/scripts/entry_point_packed_gl_enums.json index 12444a042..9df1fbf98 100644 --- a/scripts/entry_point_packed_gl_enums.json +++ b/scripts/entry_point_packed_gl_enums.json @@ -163,6 +163,9 @@ "glMapBufferRangeEXT": { "target": "BufferBinding" }, + "glMatrixMode": { + "mode": "MatrixType" + }, "glTexImage2D": { "target": "TextureTarget" }, diff --git a/src/libANGLE/Context_gles_1_0.cpp b/src/libANGLE/Context_gles_1_0.cpp index af9bb4472..d0a292b93 100644 --- a/src/libANGLE/Context_gles_1_0.cpp +++ b/src/libANGLE/Context_gles_1_0.cpp @@ -262,7 +262,7 @@ void Context::materialxv(GLenum face, GLenum pname, const GLfixed *param) UNIMPLEMENTED(); } -void Context::matrixMode(GLenum mode) +void Context::matrixMode(MatrixType mode) { UNIMPLEMENTED(); } diff --git a/src/libANGLE/Context_gles_1_0_autogen.h b/src/libANGLE/Context_gles_1_0_autogen.h index 6cd65f523..8dd4ab4b8 100644 --- a/src/libANGLE/Context_gles_1_0_autogen.h +++ b/src/libANGLE/Context_gles_1_0_autogen.h @@ -59,7 +59,7 @@ void materialfv(GLenum face, GLenum pname, const GLfloat *params); \ void materialx(GLenum face, GLenum pname, GLfixed param); \ void materialxv(GLenum face, GLenum pname, const GLfixed *param); \ - void matrixMode(GLenum mode); \ + 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); \ diff --git a/src/libANGLE/validationES1.cpp b/src/libANGLE/validationES1.cpp index f5457b4f5..4a9d708e6 100644 --- a/src/libANGLE/validationES1.cpp +++ b/src/libANGLE/validationES1.cpp @@ -369,7 +369,7 @@ bool ValidateMaterialxv(Context *context, GLenum face, GLenum pname, const GLfix return true; } -bool ValidateMatrixMode(Context *context, GLenum mode) +bool ValidateMatrixMode(Context *context, MatrixType mode) { UNIMPLEMENTED(); return true; diff --git a/src/libANGLE/validationES1.h b/src/libANGLE/validationES1.h index 3f1b72ca4..be871e7f0 100644 --- a/src/libANGLE/validationES1.h +++ b/src/libANGLE/validationES1.h @@ -85,7 +85,7 @@ bool ValidateMaterialf(Context *context, GLenum face, GLenum pname, GLfloat para bool ValidateMaterialfv(Context *context, GLenum face, GLenum pname, const GLfloat *params); bool ValidateMaterialx(Context *context, GLenum face, GLenum pname, GLfixed param); bool ValidateMaterialxv(Context *context, GLenum face, GLenum pname, const GLfixed *param); -bool ValidateMatrixMode(Context *context, GLenum mode); +bool ValidateMatrixMode(Context *context, MatrixType mode); bool ValidateMultMatrixf(Context *context, const GLfloat *m); bool ValidateMultMatrixx(Context *context, const GLfixed *m); bool ValidateMultiTexCoord4f(Context *context, diff --git a/src/libGLESv2/entry_points_gles_1_0_autogen.cpp b/src/libGLESv2/entry_points_gles_1_0_autogen.cpp index 758506fa9..beada99b9 100644 --- a/src/libGLESv2/entry_points_gles_1_0_autogen.cpp +++ b/src/libGLESv2/entry_points_gles_1_0_autogen.cpp @@ -835,11 +835,12 @@ void GL_APIENTRY MatrixMode(GLenum mode) Context *context = GetValidGlobalContext(); if (context) { - context->gatherParams(mode); + MatrixType modePacked = FromGLenum(mode); + context->gatherParams(modePacked); - if (context->skipValidation() || ValidateMatrixMode(context, mode)) + if (context->skipValidation() || ValidateMatrixMode(context, modePacked)) { - context->matrixMode(mode); + context->matrixMode(modePacked); } } }