[Mesa-dev] [PATCH 09/13] mesa: Minor clean ups in set_combiner_operand

Ian Romanick idr at freedesktop.org
Wed Aug 24 18:46:17 UTC 2016


From: Ian Romanick <ian.d.romanick at intel.com>

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 src/mesa/main/texenv.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/src/mesa/main/texenv.c b/src/mesa/main/texenv.c
index 3d6a219..3f3adba 100644
--- a/src/mesa/main/texenv.c
+++ b/src/mesa/main/texenv.c
@@ -249,7 +249,8 @@ set_combiner_operand(struct gl_context *ctx,
                      GLenum pname, GLenum param)
 {
    GLuint term;
-   GLboolean alpha, legal;
+   bool alpha;
+   bool legal;
 
    /* The enums were given sequential values for a reason.
     */
@@ -259,22 +260,20 @@ set_combiner_operand(struct gl_context *ctx,
    case GL_OPERAND2_RGB:
    case GL_OPERAND3_RGB_NV:
       term = pname - GL_OPERAND0_RGB;
-      alpha = GL_FALSE;
+      alpha = false;
       break;
    case GL_OPERAND0_ALPHA:
    case GL_OPERAND1_ALPHA:
    case GL_OPERAND2_ALPHA:
    case GL_OPERAND3_ALPHA_NV:
       term = pname - GL_OPERAND0_ALPHA;
-      alpha = GL_TRUE;
+      alpha = true;
       break;
    default:
-      TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
-      return;
+      unreachable("invalid pname");
    }
 
-   if ((term == 3) && (ctx->API != API_OPENGL_COMPAT
-                       || !ctx->Extensions.NV_texture_env_combine4)) {
+   if (term == 3 && !_mesa_has_NV_texture_env_combine4(ctx)) {
       TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
       return;
    }
@@ -304,10 +303,10 @@ set_combiner_operand(struct gl_context *ctx,
 	 || ctx->Extensions.NV_texture_env_combine4;
       break;
    case GL_SRC_ALPHA:
-      legal = GL_TRUE;
+      legal = true;
       break;
    default:
-      legal = GL_FALSE;
+      legal = false;
    }
 
    if (!legal) {
-- 
2.5.5



More information about the mesa-dev mailing list