mesa/st: Deduplicate the NIR uniform lowering code.
[mesa.git] / src / mesa / state_tracker / st_nir_builtins.c
index aa26c6548c25cab2d326fea777a8668950458d21..de518098024353e54e7ba51be9a7d54e6d738135 100644 (file)
@@ -58,15 +58,7 @@ st_nir_finish_builtin_shader(struct st_context *st,
    st_nir_assign_varying_locations(st, nir);
 
    st_nir_lower_samplers(screen, nir, NULL, NULL);
-
-   if (st->ctx->Const.PackedDriverUniformStorage) {
-      NIR_PASS_V(nir, nir_lower_io, nir_var_uniform, st_glsl_type_dword_size,
-                 (nir_lower_io_options)0);
-      NIR_PASS_V(nir, nir_lower_uniforms_to_ubo, 4);
-   } else {
-      NIR_PASS_V(nir, nir_lower_io, nir_var_uniform, st_glsl_uniforms_type_size,
-                 (nir_lower_io_options)0);
-   }
+   st_nir_lower_uniforms(st, nir);
 
    if (screen->finalize_nir)
       screen->finalize_nir(screen, nir, true);