Mesa (master): mesa: remove redundant modulus operation

Timothy Arceri tarceri at kemper.freedesktop.org
Thu May 25 02:21:07 UTC 2017


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

Author: Timothy Arceri <tarceri at itsqueeze.com>
Date:   Tue May 23 22:01:52 2017 +1000

mesa: remove redundant modulus operation

The if check above means we can only get here if size is less than 4.

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>

---

 src/mesa/program/prog_parameter.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/mesa/program/prog_parameter.c b/src/mesa/program/prog_parameter.c
index 44e680c048..40bc47de35 100644
--- a/src/mesa/program/prog_parameter.c
+++ b/src/mesa/program/prog_parameter.c
@@ -267,9 +267,8 @@ _mesa_add_parameter(struct gl_program_parameter_list *paramList,
             COPY_4V(paramList->ParameterValues[oldNum + i], values);
          } else {
             /* copy 1, 2 or 3 values */
-            GLuint remaining = size % 4;
-            assert(remaining < 4);
-            for (j = 0; j < remaining; j++) {
+            assert(size < 4);
+            for (j = 0; j < size; j++) {
                paramList->ParameterValues[oldNum + i][j].f = values[j].f;
             }
             /* fill in remaining positions with zeros */




More information about the mesa-commit mailing list