nir: drop support for using load_alpha_ref_float
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 7 Oct 2019 10:08:55 +0000 (12:08 +0200)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Thu, 17 Oct 2019 08:41:36 +0000 (10:41 +0200)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/compiler/nir/nir_lower_alpha_test.c

index b652fb796be71cc427c6c1dca30a019d92dcb4ae..a13de554445f36bce797e0718f1931443de8202d 100644 (file)
@@ -40,6 +40,7 @@ nir_lower_alpha_test(nir_shader *shader, enum compare_func func,
                      bool alpha_to_one,
                      const gl_state_index16 *alpha_ref_state_tokens)
 {
+   assert(alpha_ref_state_tokens);
    assert(shader->info.stage == MESA_SHADER_FRAGMENT);
 
    nir_foreach_function(function, shader) {
@@ -94,20 +95,16 @@ nir_lower_alpha_test(nir_shader *shader, enum compare_func func,
                                       3);
                }
 
-               nir_ssa_def *alpha_ref;
-               if (alpha_ref_state_tokens) {
-                  nir_variable *var = nir_variable_create(shader,
-                                                          nir_var_uniform,
-                                                          glsl_float_type(),
-                                                          "gl_AlphaRefMESA");
-                  var->num_state_slots = 1;
-                  var->state_slots = ralloc_array(var, nir_state_slot, 1);
-                  memcpy(var->state_slots[0].tokens,
-                         alpha_ref_state_tokens,
-                         sizeof(var->state_slots[0].tokens));
-                  alpha_ref = nir_load_var(&b, var);
-               } else
-                  alpha_ref = nir_load_alpha_ref_float(&b);
+               nir_variable *var = nir_variable_create(shader,
+                                                       nir_var_uniform,
+                                                       glsl_float_type(),
+                                                       "gl_AlphaRefMESA");
+               var->num_state_slots = 1;
+               var->state_slots = ralloc_array(var, nir_state_slot, 1);
+               memcpy(var->state_slots[0].tokens,
+                      alpha_ref_state_tokens,
+                      sizeof(var->state_slots[0].tokens));
+               nir_ssa_def *alpha_ref = nir_load_var(&b, var);
 
                nir_ssa_def *condition =
                   nir_compare_func(&b, func, alpha, alpha_ref);