Mesa (master): glsl: Minor clean-up in validate_assignment

Ian Romanick idr at kemper.freedesktop.org
Sat Dec 11 04:41:15 UTC 2010


Module: Mesa
Branch: master
Commit: ec53010c4d02e11171d3c782a41b70cad76788e8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ec53010c4d02e11171d3c782a41b70cad76788e8

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Fri Dec 10 15:47:11 2010 -0800

glsl: Minor clean-up in validate_assignment

This code has been changed around a lot, and there were some temporary
variables left around from previous versions.

---

 src/glsl/ast_to_hir.cpp |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 1f4972c..75ba3a9 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -598,17 +598,15 @@ ir_rvalue *
 validate_assignment(struct _mesa_glsl_parse_state *state,
 		    const glsl_type *lhs_type, ir_rvalue *rhs)
 {
-   const glsl_type *rhs_type = rhs->type;
-
    /* If there is already some error in the RHS, just return it.  Anything
     * else will lead to an avalanche of error message back to the user.
     */
-   if (rhs_type->is_error())
+   if (rhs->type->is_error())
       return rhs;
 
    /* If the types are identical, the assignment can trivially proceed.
     */
-   if (rhs_type == lhs_type)
+   if (rhs->type == lhs_type)
       return rhs;
 
    /* If the array element types are the same and the size of the LHS is zero,
@@ -625,8 +623,7 @@ validate_assignment(struct _mesa_glsl_parse_state *state,
 
    /* Check for implicit conversion in GLSL 1.20 */
    if (apply_implicit_conversion(lhs_type, rhs, state)) {
-      rhs_type = rhs->type;
-      if (rhs_type == lhs_type)
+      if (rhs->type == lhs_type)
 	 return rhs;
    }
 




More information about the mesa-commit mailing list