nir/lower_uniforms_to_ubo: Use nir_foreach_variable_with_modes
authorJason Ekstrand <jason@jlekstrand.net>
Tue, 21 Jul 2020 16:22:23 +0000 (11:22 -0500)
committerMarge Bot <eric+marge@anholt.net>
Wed, 29 Jul 2020 17:38:58 +0000 (17:38 +0000)
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>

src/compiler/nir/nir_lower_uniforms_to_ubo.c

index eef0d41440fb6d74dd00dc5b84a55d83d0a0bb0d..bdee9e927cbf11f4e2cbd04033096c8d2ff6ecb8 100644 (file)
@@ -105,10 +105,8 @@ nir_lower_uniforms_to_ubo(nir_shader *shader, int multiplier)
 
    if (progress) {
       if (!shader->info.first_ubo_is_default_ubo) {
-         nir_foreach_variable(var, &shader->uniforms) {
-            if (var->data.mode == nir_var_mem_ubo)
-               var->data.binding++;
-         }
+         nir_foreach_variable_with_modes(var, shader, nir_var_mem_ubo)
+            var->data.binding++;
       }
       shader->info.num_ubos++;