glsl: simplify loop in varying_matches::assign_locations()
authorBrian Paul <brianp@vmware.com>
Fri, 15 Dec 2017 21:27:55 +0000 (14:27 -0700)
committerBrian Paul <brianp@vmware.com>
Wed, 20 Dec 2017 18:23:16 +0000 (11:23 -0700)
The use of break/continue was kind of weird/confusing.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/compiler/glsl/link_varyings.cpp

index 6d74f9a4637c39dd212d411be6acd49a529b6160..7821b1ec8162c8725b9f263d0356ca5adc2ce33b 100644 (file)
@@ -1834,13 +1834,13 @@ varying_matches::assign_locations(struct gl_shader_program *prog,
          const uint64_t slot_mask = ((1ull << slots) - 1) << (*location / 4u);
 
          assert(slots > 0);
-         if (reserved_slots & slot_mask) {
-            *location = ALIGN(*location + 1, 4);
-            slot_end = *location + num_components - 1;
-            continue;
+
+         if ((reserved_slots & slot_mask) == 0) {
+            break;
          }
 
-         break;
+         *location = ALIGN(*location + 1, 4);
+         slot_end = *location + num_components - 1;
       }
 
       if (!var->data.patch && slot_end >= MAX_VARYING * 4u) {